diff --git a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml index f536c098907f..ffa56e0ca5e0 100755 --- a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml +++ b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml @@ -1982,7 +1982,7 @@ - + diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/WebSiteManagementClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/WebSiteManagementClient.java index 0381c1d7c68c..acd20cfc1cb4 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/WebSiteManagementClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/WebSiteManagementClient.java @@ -8,7 +8,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.appservice.fluent.AppServiceCertificateOrdersClient; import com.azure.resourcemanager.appservice.fluent.AppServiceEnvironmentsClient; import com.azure.resourcemanager.appservice.fluent.AppServicePlansClient; @@ -25,6 +24,7 @@ import com.azure.resourcemanager.appservice.fluent.StaticSitesClient; import com.azure.resourcemanager.appservice.fluent.TopLevelDomainsClient; import com.azure.resourcemanager.appservice.fluent.WebAppsClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; /** Initializes a new instance of the WebSiteManagementClient type. */ @ServiceClient(builder = WebSiteManagementClientBuilder.class) diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceCertificateOrdersClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceCertificateOrdersClient.java index 04a53826f5ce..dc4b30792bf1 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceCertificateOrdersClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceCertificateOrdersClient.java @@ -31,6 +31,7 @@ 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.appservice.WebSiteManagementClient; import com.azure.resourcemanager.appservice.fluent.inner.AppServiceCertificateCollectionInner; import com.azure.resourcemanager.appservice.fluent.inner.AppServiceCertificateOrderCollectionInner; @@ -373,37 +374,6 @@ Mono>> retrieveCertificateEmailHistory( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServiceCertificateOrderInner certificateDistinguishedName, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers" - + "/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateCertificateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("certificateOrderName") String certificateOrderName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServiceCertificateResourceInner keyVaultCertificate, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -491,6 +461,7 @@ public Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -634,6 +605,7 @@ public Mono> validatePurchaseInformationWithResponseAsync( } else { appServiceCertificateOrder.validate(); } + context = this.client.mergeContext(context); return service .validatePurchaseInformation( this.client.getEndpoint(), @@ -782,6 +754,7 @@ public Mono> listByResourceGroupS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -945,6 +918,7 @@ public Mono> getByResourceGroupWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1141,6 +1115,7 @@ public Mono>> createOrUpdateWithResponseAsync( } else { certificateDistinguishedName.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -1164,10 +1139,11 @@ public Mono>> createOrUpdateWithResponseAsync( * @return sSL certificate purchase order. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AppServiceCertificateOrderInner> beginCreateOrUpdate( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName) { + public PollerFlux, AppServiceCertificateOrderInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String certificateOrderName, + AppServiceCertificateOrderInner certificateDistinguishedName) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName); return this @@ -1192,11 +1168,12 @@ public PollerFlux, AppServiceCertifi * @return sSL certificate purchase order. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AppServiceCertificateOrderInner> beginCreateOrUpdate( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context) { + public PollerFlux, AppServiceCertificateOrderInner> + beginCreateOrUpdateAsync( + String resourceGroupName, + String certificateOrderName, + AppServiceCertificateOrderInner certificateDistinguishedName, + Context context) { Mono>> mono = createOrUpdateWithResponseAsync( resourceGroupName, certificateOrderName, certificateDistinguishedName, context); @@ -1209,6 +1186,48 @@ public PollerFlux, AppServiceCertifi AppServiceCertificateOrderInner.class); } + /** + * Description for Create or update a certificate purchase order. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param certificateOrderName Name of the certificate order. + * @param certificateDistinguishedName SSL certificate purchase order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sSL certificate purchase order. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServiceCertificateOrderInner> beginCreateOrUpdate( + String resourceGroupName, + String certificateOrderName, + AppServiceCertificateOrderInner certificateDistinguishedName) { + return beginCreateOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName) + .getSyncPoller(); + } + + /** + * Description for Create or update a certificate purchase order. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param certificateOrderName Name of the certificate order. + * @param certificateDistinguishedName SSL certificate purchase order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sSL certificate purchase order. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServiceCertificateOrderInner> beginCreateOrUpdate( + String resourceGroupName, + String certificateOrderName, + AppServiceCertificateOrderInner certificateDistinguishedName, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName, context) + .getSyncPoller(); + } + /** * Description for Create or update a certificate purchase order. * @@ -1225,17 +1244,9 @@ public Mono createOrUpdateAsync( String resourceGroupName, String certificateOrderName, AppServiceCertificateOrderInner certificateDistinguishedName) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - AppServiceCertificateOrderInner.class, - AppServiceCertificateOrderInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1256,18 +1267,9 @@ public Mono createOrUpdateAsync( String certificateOrderName, AppServiceCertificateOrderInner certificateDistinguishedName, Context context) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, certificateOrderName, certificateDistinguishedName, context); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - AppServiceCertificateOrderInner.class, - AppServiceCertificateOrderInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, certificateOrderName, certificateDistinguishedName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1391,6 +1393,7 @@ public Mono> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1568,6 +1571,7 @@ public Mono> updateWithResponseAsync( } else { certificateDistinguishedName.validate(); } + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1765,6 +1769,7 @@ public Mono> listCertificatesS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listCertificates( this.client.getEndpoint(), @@ -1944,6 +1949,7 @@ public Mono> getCertificateWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getCertificate( this.client.getEndpoint(), @@ -2153,6 +2159,7 @@ public Mono>> createOrUpdateCertificateWithResponseAsy } else { keyVaultCertificate.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateCertificate( this.client.getEndpoint(), @@ -2179,7 +2186,7 @@ public Mono>> createOrUpdateCertificateWithResponseAsy */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, AppServiceCertificateResourceInner> - beginCreateOrUpdateCertificate( + beginCreateOrUpdateCertificateAsync( String resourceGroupName, String certificateOrderName, String name, @@ -2211,7 +2218,7 @@ public Mono>> createOrUpdateCertificateWithResponseAsy */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, AppServiceCertificateResourceInner> - beginCreateOrUpdateCertificate( + beginCreateOrUpdateCertificateAsync( String resourceGroupName, String certificateOrderName, String name, @@ -2229,6 +2236,55 @@ public Mono>> createOrUpdateCertificateWithResponseAsy AppServiceCertificateResourceInner.class); } + /** + * Description for Creates or updates a certificate and associates with key vault secret. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param certificateOrderName Name of the certificate order. + * @param name Name of the certificate. + * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return key Vault container ARM resource for a certificate that is purchased through Azure. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServiceCertificateResourceInner> + beginCreateOrUpdateCertificate( + String resourceGroupName, + String certificateOrderName, + String name, + AppServiceCertificateResourceInner keyVaultCertificate) { + return beginCreateOrUpdateCertificateAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate) + .getSyncPoller(); + } + + /** + * Description for Creates or updates a certificate and associates with key vault secret. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param certificateOrderName Name of the certificate order. + * @param name Name of the certificate. + * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return key Vault container ARM resource for a certificate that is purchased through Azure. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServiceCertificateResourceInner> + beginCreateOrUpdateCertificate( + String resourceGroupName, + String certificateOrderName, + String name, + AppServiceCertificateResourceInner keyVaultCertificate, + Context context) { + return beginCreateOrUpdateCertificateAsync( + resourceGroupName, certificateOrderName, name, keyVaultCertificate, context) + .getSyncPoller(); + } + /** * Description for Creates or updates a certificate and associates with key vault secret. * @@ -2247,18 +2303,9 @@ public Mono createOrUpdateCertificateAsync( String certificateOrderName, String name, AppServiceCertificateResourceInner keyVaultCertificate) { - Mono>> mono = - createOrUpdateCertificateWithResponseAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - AppServiceCertificateResourceInner.class, - AppServiceCertificateResourceInner.class) + return beginCreateOrUpdateCertificateAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2281,18 +2328,10 @@ public Mono createOrUpdateCertificateAsync( String name, AppServiceCertificateResourceInner keyVaultCertificate, Context context) { - Mono>> mono = - createOrUpdateCertificateWithResponseAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate, context); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - AppServiceCertificateResourceInner.class, - AppServiceCertificateResourceInner.class) + return beginCreateOrUpdateCertificateAsync( + resourceGroupName, certificateOrderName, name, keyVaultCertificate, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2432,6 +2471,7 @@ public Mono> deleteCertificateWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteCertificate( this.client.getEndpoint(), @@ -2622,6 +2662,7 @@ public Mono> updateCertificateWithR } else { keyVaultCertificate.validate(); } + context = this.client.mergeContext(context); return service .updateCertificate( this.client.getEndpoint(), @@ -2845,6 +2886,7 @@ public Mono> reissueWithResponseAsync( } else { reissueCertificateOrderRequest.validate(); } + context = this.client.mergeContext(context); return service .reissue( this.client.getEndpoint(), @@ -3042,6 +3084,7 @@ public Mono> renewWithResponseAsync( } else { renewCertificateOrderRequest.validate(); } + context = this.client.mergeContext(context); return service .renew( this.client.getEndpoint(), @@ -3213,6 +3256,7 @@ public Mono> resendEmailWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .resendEmail( this.client.getEndpoint(), @@ -3373,6 +3417,7 @@ public Mono> resendRequestEmailsWithResponseAsync( } NameIdentifierInner nameIdentifier = new NameIdentifierInner(); nameIdentifier.withName(name); + context = this.client.mergeContext(context); return service .resendRequestEmails( this.client.getEndpoint(), @@ -3548,6 +3593,7 @@ public Mono> retrieveSiteSealWithResponseAsync( } else { siteSealRequest.validate(); } + context = this.client.mergeContext(context); return service .retrieveSiteSeal( this.client.getEndpoint(), @@ -3726,6 +3772,7 @@ public Mono> verifyDomainOwnershipWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .verifyDomainOwnership( this.client.getEndpoint(), @@ -3878,6 +3925,7 @@ public Mono>> retrieveCertificateActi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .retrieveCertificateActions( this.client.getEndpoint(), @@ -4048,6 +4096,7 @@ public Mono>> retrieveCertificateEmailHisto new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .retrieveCertificateEmailHistory( this.client.getEndpoint(), @@ -4139,460 +4188,6 @@ public List retrieveCertificateEmailHistory( return retrieveCertificateEmailHistoryAsync(resourceGroupName, name, context).block(); } - /** - * Description for Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName SSL certificate purchase order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName) { - 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 (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName 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 (certificateDistinguishedName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter certificateDistinguishedName is required and cannot be null.")); - } else { - certificateDistinguishedName.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - certificateDistinguishedName, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName SSL certificate purchase order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - 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 (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName 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 (certificateDistinguishedName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter certificateDistinguishedName is required and cannot be null.")); - } else { - certificateDistinguishedName.validate(); - } - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - certificateDistinguishedName, - context); - } - - /** - * Description for Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName SSL certificate purchase order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, certificateOrderName, certificateDistinguishedName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName SSL certificate purchase order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, certificateOrderName, certificateDistinguishedName, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName SSL certificate purchase order. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateOrderInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, certificateOrderName, certificateDistinguishedName) - .block(); - } - - /** - * Description for Create or update a certificate purchase order. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param certificateDistinguishedName SSL certificate purchase order. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return sSL certificate purchase order. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateOrderInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String certificateOrderName, - AppServiceCertificateOrderInner certificateDistinguishedName, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, certificateOrderName, certificateDistinguishedName, context) - .block(); - } - - /** - * Description for Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - beginCreateOrUpdateCertificateWithoutPollingWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate) { - 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 (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (keyVaultCertificate == null) { - return Mono - .error(new IllegalArgumentException("Parameter keyVaultCertificate is required and cannot be null.")); - } else { - keyVaultCertificate.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateCertificateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - keyVaultCertificate, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - beginCreateOrUpdateCertificateWithoutPollingWithResponseAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate, - 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 (certificateOrderName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (keyVaultCertificate == null) { - return Mono - .error(new IllegalArgumentException("Parameter keyVaultCertificate is required and cannot be null.")); - } else { - keyVaultCertificate.validate(); - } - return service - .beginCreateOrUpdateCertificateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - certificateOrderName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - keyVaultCertificate, - context); - } - - /** - * Description for Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateCertificateWithoutPollingAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate) { - return beginCreateOrUpdateCertificateWithoutPollingWithResponseAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateCertificateWithoutPollingAsync( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate, - Context context) { - return beginCreateOrUpdateCertificateWithoutPollingWithResponseAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateResourceInner beginCreateOrUpdateCertificateWithoutPolling( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate) { - return beginCreateOrUpdateCertificateWithoutPollingAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate) - .block(); - } - - /** - * Description for Creates or updates a certificate and associates with key vault secret. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param certificateOrderName Name of the certificate order. - * @param name Name of the certificate. - * @param keyVaultCertificate Key Vault container ARM resource for a certificate that is purchased through Azure. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return key Vault container ARM resource for a certificate that is purchased through Azure. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceCertificateResourceInner beginCreateOrUpdateCertificateWithoutPolling( - String resourceGroupName, - String certificateOrderName, - String name, - AppServiceCertificateResourceInner keyVaultCertificate, - Context context) { - return beginCreateOrUpdateCertificateWithoutPollingAsync( - resourceGroupName, certificateOrderName, name, keyVaultCertificate, context) - .block(); - } - /** * Get the next page of items. * @@ -4637,6 +4232,7 @@ public Mono> listNextSinglePageAs if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -4695,6 +4291,7 @@ public Mono> listByResourceGroupN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -4753,6 +4350,7 @@ public Mono> listCertificatesN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listCertificatesNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceEnvironmentsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceEnvironmentsClient.java index 7550af44f578..0d53862c1ab5 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceEnvironmentsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServiceEnvironmentsClient.java @@ -31,6 +31,7 @@ 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.appservice.WebSiteManagementClient; import com.azure.resourcemanager.appservice.fluent.inner.AddressResponseInner; import com.azure.resourcemanager.appservice.fluent.inner.AppServiceEnvironmentCollectionInner; @@ -619,110 +620,6 @@ Mono> listWebWorkerUsages( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("forceDelete") Boolean forceDelete, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/changeVirtualNetwork") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginChangeVnetWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") VirtualNetworkProfile vnetInfo, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/multiRolePools/default") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateMultiRolePoolWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") WorkerPoolResourceInner multiRolePoolEnvelope, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/resume") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginResumeWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/suspend") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginSuspendWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web" - + "/hostingEnvironments/{name}/workerPools/{workerPoolName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateWorkerPoolWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("workerPoolName") String workerPoolName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") WorkerPoolResourceInner workerPoolEnvelope, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -744,6 +641,13 @@ Mono> listByResourceGroupNext( Mono> listCapacitiesNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> changeVnetNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -793,6 +697,13 @@ Mono> listMultiRoleUsagesNext( Mono> getOutboundNetworkDependenciesEndpointsNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> resumeNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -807,6 +718,13 @@ Mono> listAppServicePlansNext( Mono> listWebAppsNext( @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @Headers({"Accept: application/json", "Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> suspendNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, Context context); + @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -915,6 +833,7 @@ public Mono> listSinglePageAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -1059,6 +978,7 @@ public Mono> listByResourceGro new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -1220,6 +1140,7 @@ public Mono> getByResourceGroupWith new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1411,6 +1332,7 @@ public Mono>> createOrUpdateWithResponseAsync( } else { hostingEnvironmentEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -1435,7 +1357,7 @@ public Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, AppServiceEnvironmentResourceInner> - beginCreateOrUpdate( + beginCreateOrUpdateAsync( String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope); @@ -1462,7 +1384,7 @@ public Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, AppServiceEnvironmentResourceInner> - beginCreateOrUpdate( + beginCreateOrUpdateAsync( String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, @@ -1478,6 +1400,46 @@ public Mono>> createOrUpdateWithResponseAsync( AppServiceEnvironmentResourceInner.class); } + /** + * Description for Create or update an App Service Environment. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app Service Environment ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServiceEnvironmentResourceInner> + beginCreateOrUpdate( + String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope).getSyncPoller(); + } + + /** + * Description for Create or update an App Service Environment. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app Service Environment ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServiceEnvironmentResourceInner> + beginCreateOrUpdate( + String resourceGroupName, + String name, + AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope, context).getSyncPoller(); + } + /** * Description for Create or update an App Service Environment. * @@ -1492,17 +1454,9 @@ public Mono>> createOrUpdateWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - AppServiceEnvironmentResourceInner.class, - AppServiceEnvironmentResourceInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1523,17 +1477,9 @@ public Mono createOrUpdateAsync( String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, Context context) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope, context); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - AppServiceEnvironmentResourceInner.class, - AppServiceEnvironmentResourceInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, name, hostingEnvironmentEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1658,6 +1604,7 @@ public Mono>> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1682,7 +1629,8 @@ public Mono>> deleteWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDelete(String resourceGroupName, String name, Boolean forceDelete) { + public PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String name, Boolean forceDelete) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, forceDelete); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } @@ -1701,12 +1649,48 @@ public PollerFlux, Void> beginDelete(String resourceGroupName, * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginDelete( + public PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String name, Boolean forceDelete, Context context) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, forceDelete, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Delete an App Service Environment. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service + * Environment contains resources. The default is <code>false</code>. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 name, Boolean forceDelete) { + return beginDeleteAsync(resourceGroupName, name, forceDelete).getSyncPoller(); + } + + /** + * Description for Delete an App Service Environment. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service + * Environment contains resources. The default is <code>false</code>. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 name, Boolean forceDelete, Context context) { + return beginDeleteAsync(resourceGroupName, name, forceDelete, context).getSyncPoller(); + } + /** * Description for Delete an App Service Environment. * @@ -1721,12 +1705,9 @@ public PollerFlux, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String name, Boolean forceDelete) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, forceDelete); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginDeleteAsync(resourceGroupName, name, forceDelete) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1744,12 +1725,9 @@ public Mono deleteAsync(String resourceGroupName, String name, Boolean for */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String name, Boolean forceDelete, Context context) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, forceDelete, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginDeleteAsync(resourceGroupName, name, forceDelete, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1766,12 +1744,9 @@ public Mono deleteAsync(String resourceGroupName, String name, Boolean for public Mono deleteAsync(String resourceGroupName, String name) { final Boolean forceDelete = null; final Context context = null; - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, forceDelete); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginDeleteAsync(resourceGroupName, name, forceDelete) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1924,6 +1899,7 @@ public Mono> updateWithResponseAsyn } else { hostingEnvironmentEnvelope.validate(); } + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -2115,6 +2091,7 @@ public Mono> listCapacitiesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listCapacities( this.client.getEndpoint(), @@ -2278,6 +2255,7 @@ public Mono> getVipInfoWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVipInfo( this.client.getEndpoint(), @@ -2378,7 +2356,7 @@ public AddressResponseInner getVipInfo(String resourceGroupName, String name, Co * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> changeVnetWithResponseAsync( + public Mono> changeVnetSinglePageAsync( String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { if (this.client.getEndpoint() == null) { return Mono @@ -2406,16 +2384,40 @@ public Mono>> changeVnetWithResponseAsync( } return FluxUtil .withContext( - context -> - service - .changeVnet( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - vnetInfo, - context)) + context -> { + Mono>> mono = + service + .changeVnet( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + vnetInfo, + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + WebAppCollectionInner.class, + WebAppCollectionInner.class) + .last() + .flatMap(this.client::getLroFinalResultOrError)); + }) + .>map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } @@ -2432,7 +2434,7 @@ public Mono>> changeVnetWithResponseAsync( * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> changeVnetWithResponseAsync( + public Mono> changeVnetSinglePageAsync( String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -2458,15 +2460,36 @@ public Mono>> changeVnetWithResponseAsync( } else { vnetInfo.validate(); } - return service - .changeVnet( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - vnetInfo, - context); + context = this.client.mergeContext(context); + Mono>> mono = + service + .changeVnet( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + vnetInfo, + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) + .last() + .flatMap(this.client::getLroFinalResultOrError)) + .map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)); } /** @@ -2480,14 +2503,11 @@ public Mono>> changeVnetWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WebAppCollectionInner> beginChangeVnet( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - Mono>> mono = changeVnetWithResponseAsync(resourceGroupName, name, vnetInfo); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux changeVnetAsync(String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { + return new PagedFlux<>( + () -> changeVnetSinglePageAsync(resourceGroupName, name, vnetInfo), + nextLink -> changeVnetNextSinglePageAsync(nextLink)); } /** @@ -2502,14 +2522,12 @@ public PollerFlux, WebAppCollectionInner> begi * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WebAppCollectionInner> beginChangeVnet( + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux changeVnetAsync( String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - Mono>> mono = changeVnetWithResponseAsync(resourceGroupName, name, vnetInfo, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class); + return new PagedFlux<>( + () -> changeVnetSinglePageAsync(resourceGroupName, name, vnetInfo, context), + nextLink -> changeVnetNextSinglePageAsync(nextLink)); } /** @@ -2523,16 +2541,9 @@ public PollerFlux, WebAppCollectionInner> begi * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono changeVnetAsync( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - Mono>> mono = changeVnetWithResponseAsync(resourceGroupName, name, vnetInfo); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable changeVnet(String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { + return new PagedIterable<>(changeVnetAsync(resourceGroupName, name, vnetInfo)); } /** @@ -2547,50 +2558,10 @@ public Mono changeVnetAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono changeVnetAsync( + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable changeVnet( String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - Mono>> mono = changeVnetWithResponseAsync(resourceGroupName, name, vnetInfo, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner changeVnet(String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - return changeVnetAsync(resourceGroupName, name, vnetInfo).block(); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner changeVnet( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - return changeVnetAsync(resourceGroupName, name, vnetInfo, context).block(); + return new PagedIterable<>(changeVnetAsync(resourceGroupName, name, vnetInfo, context)); } /** @@ -2672,6 +2643,7 @@ public Mono>> listDiagnosticsW new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDiagnostics( this.client.getEndpoint(), @@ -2852,6 +2824,7 @@ public Mono> getDiagnosticsItemWith new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDiagnosticsItem( this.client.getEndpoint(), @@ -3037,6 +3010,7 @@ public Mono> getInboundNetworkDep new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInboundNetworkDependenciesEndpoints( this.client.getEndpoint(), @@ -3214,6 +3188,7 @@ public Mono> listMultiRolePoolsSinglePage new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRolePools( this.client.getEndpoint(), @@ -3380,6 +3355,7 @@ public Mono> getMultiRolePoolWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getMultiRolePool( this.client.getEndpoint(), @@ -3562,6 +3538,7 @@ public Mono>> createOrUpdateMultiRolePoolWithResponseA } else { multiRolePoolEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateMultiRolePool( this.client.getEndpoint(), @@ -3585,8 +3562,9 @@ public Mono>> createOrUpdateMultiRolePoolWithResponseA * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { + public PollerFlux, WorkerPoolResourceInner> + beginCreateOrUpdateMultiRolePoolAsync( + String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { Mono>> mono = createOrUpdateMultiRolePoolWithResponseAsync(resourceGroupName, name, multiRolePoolEnvelope); return this @@ -3608,8 +3586,9 @@ public PollerFlux, WorkerPoolResourceInner> * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePool( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { + public PollerFlux, WorkerPoolResourceInner> + beginCreateOrUpdateMultiRolePoolAsync( + String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { Mono>> mono = createOrUpdateMultiRolePoolWithResponseAsync(resourceGroupName, name, multiRolePoolEnvelope, context); return this @@ -3618,6 +3597,42 @@ public PollerFlux, WorkerPoolResourceInner> mono, this.client.getHttpPipeline(), WorkerPoolResourceInner.class, WorkerPoolResourceInner.class); } + /** + * Description for Create or update a multi-role pool. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return worker pool of an App Service Environment ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePool( + String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { + return beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope).getSyncPoller(); + } + + /** + * Description for Create or update a multi-role pool. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return worker pool of an App Service Environment ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateMultiRolePool( + String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { + return beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope, context) + .getSyncPoller(); + } + /** * Description for Create or update a multi-role pool. * @@ -3632,14 +3647,9 @@ public PollerFlux, WorkerPoolResourceInner> @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateMultiRolePoolAsync( String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - Mono>> mono = - createOrUpdateMultiRolePoolWithResponseAsync(resourceGroupName, name, multiRolePoolEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WorkerPoolResourceInner.class, WorkerPoolResourceInner.class) + return beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3657,14 +3667,9 @@ public Mono createOrUpdateMultiRolePoolAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateMultiRolePoolAsync( String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - Mono>> mono = - createOrUpdateMultiRolePoolWithResponseAsync(resourceGroupName, name, multiRolePoolEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WorkerPoolResourceInner.class, WorkerPoolResourceInner.class) + return beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3796,6 +3801,7 @@ public Mono> updateMultiRolePoolWithResponseAs } else { multiRolePoolEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateMultiRolePool( this.client.getEndpoint(), @@ -3992,6 +3998,7 @@ public Mono> listMultiRolePoolInsta new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRolePoolInstanceMetricDefinitions( this.client.getEndpoint(), @@ -4179,6 +4186,7 @@ public Mono> listMultiRoleMetricDef new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRoleMetricDefinitions( this.client.getEndpoint(), @@ -4356,6 +4364,7 @@ public Mono> listMultiRolePoolSkusSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRolePoolSkus( this.client.getEndpoint(), @@ -4528,6 +4537,7 @@ public Mono> listMultiRoleUsagesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRoleUsages( this.client.getEndpoint(), @@ -4691,6 +4701,7 @@ public Mono>> listOperationsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperations( this.client.getEndpoint(), @@ -4867,6 +4878,7 @@ public Mono> getOutboundNetworkD new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getOutboundNetworkDependenciesEndpoints( this.client.getEndpoint(), @@ -5033,6 +5045,7 @@ public Mono> rebootWithResponseAsync(String resourceGroupName, St new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .reboot( this.client.getEndpoint(), @@ -5114,7 +5127,7 @@ public void reboot(String resourceGroupName, String name, Context context) { * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> resumeWithResponseAsync(String resourceGroupName, String name) { + public Mono> resumeSinglePageAsync(String resourceGroupName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -5136,15 +5149,39 @@ public Mono>> resumeWithResponseAsync(String resourceG } return FluxUtil .withContext( - context -> - service - .resume( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) + context -> { + Mono>> mono = + service + .resume( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + WebAppCollectionInner.class, + WebAppCollectionInner.class) + .last() + .flatMap(this.client::getLroFinalResultOrError)); + }) + .>map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } @@ -5160,7 +5197,7 @@ public Mono>> resumeWithResponseAsync(String resourceG * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> resumeWithResponseAsync( + public Mono> resumeSinglePageAsync( String resourceGroupName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -5181,55 +5218,35 @@ public Mono>> resumeWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - return service - .resume( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WebAppCollectionInner> beginResume( - String resourceGroupName, String name) { - Mono>> mono = resumeWithResponseAsync(resourceGroupName, name); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WebAppCollectionInner> beginResume( - String resourceGroupName, String name, Context context) { - Mono>> mono = resumeWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class); + context = this.client.mergeContext(context); + Mono>> mono = + service + .resume( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) + .last() + .flatMap(this.client::getLroFinalResultOrError)) + .map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)); } /** @@ -5242,15 +5259,10 @@ public PollerFlux, WebAppCollectionInner> begi * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resumeAsync(String resourceGroupName, String name) { - Mono>> mono = resumeWithResponseAsync(resourceGroupName, name); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux resumeAsync(String resourceGroupName, String name) { + return new PagedFlux<>( + () -> resumeSinglePageAsync(resourceGroupName, name), nextLink -> resumeNextSinglePageAsync(nextLink)); } /** @@ -5264,15 +5276,11 @@ public Mono resumeAsync(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono resumeAsync(String resourceGroupName, String name, Context context) { - Mono>> mono = resumeWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux resumeAsync(String resourceGroupName, String name, Context context) { + return new PagedFlux<>( + () -> resumeSinglePageAsync(resourceGroupName, name, context), + nextLink -> resumeNextSinglePageAsync(nextLink)); } /** @@ -5285,9 +5293,9 @@ public Mono resumeAsync(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner resume(String resourceGroupName, String name) { - return resumeAsync(resourceGroupName, name).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable resume(String resourceGroupName, String name) { + return new PagedIterable<>(resumeAsync(resourceGroupName, name)); } /** @@ -5301,9 +5309,9 @@ public WebAppCollectionInner resume(String resourceGroupName, String name) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner resume(String resourceGroupName, String name, Context context) { - return resumeAsync(resourceGroupName, name, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable resume(String resourceGroupName, String name, Context context) { + return new PagedIterable<>(resumeAsync(resourceGroupName, name, context)); } /** @@ -5394,6 +5402,7 @@ public Mono> listAppServicePlansSinglePageAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAppServicePlans( this.client.getEndpoint(), @@ -5572,6 +5581,7 @@ public Mono> listWebAppsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebApps( this.client.getEndpoint(), @@ -5711,7 +5721,7 @@ public PagedIterable listWebApps(String resourceGroupName, String nam * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> suspendWithResponseAsync(String resourceGroupName, String name) { + public Mono> suspendSinglePageAsync(String resourceGroupName, String name) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -5733,15 +5743,39 @@ public Mono>> suspendWithResponseAsync(String resource } return FluxUtil .withContext( - context -> - service - .suspend( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) + context -> { + Mono>> mono = + service + .suspend( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResultAsync( + mono, + this.client.getHttpPipeline(), + WebAppCollectionInner.class, + WebAppCollectionInner.class) + .last() + .flatMap(this.client::getLroFinalResultOrError)); + }) + .>map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } @@ -5757,7 +5791,7 @@ public Mono>> suspendWithResponseAsync(String resource * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> suspendWithResponseAsync( + public Mono> suspendSinglePageAsync( String resourceGroupName, String name, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -5778,55 +5812,35 @@ public Mono>> suspendWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - return service - .suspend( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WebAppCollectionInner> beginSuspend( - String resourceGroupName, String name) { - Mono>> mono = suspendWithResponseAsync(resourceGroupName, name); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WebAppCollectionInner> beginSuspend( - String resourceGroupName, String name, Context context) { - Mono>> mono = suspendWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class); + context = this.client.mergeContext(context); + Mono>> mono = + service + .suspend( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context) + .cache(); + return Mono + .zip( + mono, + this + .client + .getLroResultAsync( + mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) + .last() + .flatMap(this.client::getLroFinalResultOrError)) + .map( + res -> + new PagedResponseBase<>( + res.getT1().getRequest(), + res.getT1().getStatusCode(), + res.getT1().getHeaders(), + res.getT2().value(), + res.getT2().nextLink(), + null)); } /** @@ -5839,15 +5853,10 @@ public PollerFlux, WebAppCollectionInner> begi * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono suspendAsync(String resourceGroupName, String name) { - Mono>> mono = suspendWithResponseAsync(resourceGroupName, name); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux suspendAsync(String resourceGroupName, String name) { + return new PagedFlux<>( + () -> suspendSinglePageAsync(resourceGroupName, name), nextLink -> suspendNextSinglePageAsync(nextLink)); } /** @@ -5861,15 +5870,11 @@ public Mono suspendAsync(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono suspendAsync(String resourceGroupName, String name, Context context) { - Mono>> mono = suspendWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WebAppCollectionInner.class, WebAppCollectionInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux suspendAsync(String resourceGroupName, String name, Context context) { + return new PagedFlux<>( + () -> suspendSinglePageAsync(resourceGroupName, name, context), + nextLink -> suspendNextSinglePageAsync(nextLink)); } /** @@ -5882,9 +5887,9 @@ public Mono suspendAsync(String resourceGroupName, String * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner suspend(String resourceGroupName, String name) { - return suspendAsync(resourceGroupName, name).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable suspend(String resourceGroupName, String name) { + return new PagedIterable<>(suspendAsync(resourceGroupName, name)); } /** @@ -5898,9 +5903,9 @@ public WebAppCollectionInner suspend(String resourceGroupName, String name) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return collection of App Service apps. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner suspend(String resourceGroupName, String name, Context context) { - return suspendAsync(resourceGroupName, name, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable suspend(String resourceGroupName, String name, Context context) { + return new PagedIterable<>(suspendAsync(resourceGroupName, name, context)); } /** @@ -5998,6 +6003,7 @@ public Mono> listUsagesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsages( this.client.getEndpoint(), @@ -6222,6 +6228,7 @@ public Mono> listWorkerPoolsSinglePageAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWorkerPools( this.client.getEndpoint(), @@ -6397,6 +6404,7 @@ public Mono> getWorkerPoolWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getWorkerPool( this.client.getEndpoint(), @@ -6600,6 +6608,7 @@ public Mono>> createOrUpdateWorkerPoolWithResponseAsyn } else { workerPoolEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateWorkerPool( this.client.getEndpoint(), @@ -6625,7 +6634,7 @@ public Mono>> createOrUpdateWorkerPoolWithResponseAsyn * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPool( + public PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPoolAsync( String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { Mono>> mono = createOrUpdateWorkerPoolWithResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope); @@ -6649,7 +6658,7 @@ public PollerFlux, WorkerPoolResourceInner> * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPool( + public PollerFlux, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPoolAsync( String resourceGroupName, String name, String workerPoolName, @@ -6677,16 +6686,10 @@ public PollerFlux, WorkerPoolResourceInner> * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateWorkerPoolAsync( + public SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPool( String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - Mono>> mono = - createOrUpdateWorkerPoolWithResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WorkerPoolResourceInner.class, WorkerPoolResourceInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + return beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope) + .getSyncPoller(); } /** @@ -6703,21 +6706,14 @@ public Mono createOrUpdateWorkerPoolAsync( * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateWorkerPoolAsync( + public SyncPoller, WorkerPoolResourceInner> beginCreateOrUpdateWorkerPool( String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope, Context context) { - Mono>> mono = - createOrUpdateWorkerPoolWithResponseAsync( - resourceGroupName, name, workerPoolName, workerPoolEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), WorkerPoolResourceInner.class, WorkerPoolResourceInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + return beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) + .getSyncPoller(); } /** @@ -6733,9 +6729,11 @@ public Mono createOrUpdateWorkerPoolAsync( * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner createOrUpdateWorkerPool( + public Mono createOrUpdateWorkerPoolAsync( String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - return createOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).block(); + return beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -6752,14 +6750,15 @@ public WorkerPoolResourceInner createOrUpdateWorkerPool( * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner createOrUpdateWorkerPool( + public Mono createOrUpdateWorkerPoolAsync( String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope, Context context) { - return createOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) - .block(); + return beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -6775,15 +6774,57 @@ public WorkerPoolResourceInner createOrUpdateWorkerPool( * @return worker pool of an App Service Environment ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateWorkerPoolWithResponseAsync( + public WorkerPoolResourceInner createOrUpdateWorkerPool( String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { + return createOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).block(); + } + + /** + * Description for Create or update a worker pool. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param workerPoolName Name of the worker pool. + * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return worker pool of an App Service Environment ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public WorkerPoolResourceInner createOrUpdateWorkerPool( + String resourceGroupName, + String name, + String workerPoolName, + WorkerPoolResourceInner workerPoolEnvelope, + Context context) { + return createOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) + .block(); + } + + /** + * Description for Create or update a worker pool. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service Environment. + * @param workerPoolName Name of the worker pool. + * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return worker pool of an App Service Environment ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateWorkerPoolWithResponseAsync( + String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { + 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.")); } @@ -6869,6 +6910,7 @@ public Mono> updateWorkerPoolWithResponseAsync } else { workerPoolEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateWorkerPool( this.client.getEndpoint(), @@ -7085,6 +7127,7 @@ public Mono> listWorkerPoolInstance new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWorkerPoolInstanceMetricDefinitions( this.client.getEndpoint(), @@ -7287,6 +7330,7 @@ public Mono> listWebWorkerMetricDef new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebWorkerMetricDefinitions( this.client.getEndpoint(), @@ -7479,6 +7523,7 @@ public Mono> listWorkerPoolSkusSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWorkerPoolSkus( this.client.getEndpoint(), @@ -7670,6 +7715,7 @@ public Mono> listWebWorkerUsagesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebWorkerUsages( this.client.getEndpoint(), @@ -7764,1430 +7810,139 @@ public PagedIterable listWebWorkerUsages( } /** - * Description for Create or update an App Service Environment. + * Get the next page of items. * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @param nextLink The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. + * @return collection of App Service Environments. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (hostingEnvironmentEnvelope == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter hostingEnvironmentEnvelope is required and cannot be null.")); - } else { - hostingEnvironmentEnvelope.validate(); + public Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - hostingEnvironmentEnvelope, - context)) + .withContext(context -> service.listNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Description for Create or update an App Service Environment. + * Get the next page of items. * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @param nextLink The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. + * @return collection of App Service Environments. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (hostingEnvironmentEnvelope == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter hostingEnvironmentEnvelope is required and cannot be null.")); - } else { - hostingEnvironmentEnvelope.validate(); + public Mono> listNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - hostingEnvironmentEnvelope, - context); + .listNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Description for Create or update an App Service Environment. + * Get the next page of items. * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @param nextLink The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. + * @return collection of App Service Environments. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public Mono> listByResourceGroupNextSinglePageAsync( + String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.listByResourceGroupNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Description for Create or update an App Service Environment. + * Get the next page of items. * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @param nextLink The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. + * @return collection of App Service Environments. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String name, - AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, name, hostingEnvironmentEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); } /** - * Description for Create or update an App Service Environment. + * Get the next page of items. * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope App Service Environment ARM resource. + * @param nextLink The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. + * @return collection of stamp capacities. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceEnvironmentResourceInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String name, AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, name, hostingEnvironmentEnvelope).block(); - } - - /** - * Description for Create or update an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param hostingEnvironmentEnvelope App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServiceEnvironmentResourceInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String name, - AppServiceEnvironmentResourceInner hostingEnvironmentEnvelope, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, name, hostingEnvironmentEnvelope, context) - .block(); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String name, Boolean forceDelete) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - forceDelete, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String name, Boolean forceDelete, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - forceDelete, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginDeleteWithoutPollingAsync(String resourceGroupName, String name, Boolean forceDelete) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, name, forceDelete) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, String name, Boolean forceDelete, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, name, forceDelete, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginDeleteWithoutPollingAsync(String resourceGroupName, String name) { - final Boolean forceDelete = null; - final Context context = null; - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, name, forceDelete) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginDeleteWithoutPolling(String resourceGroupName, String name, Boolean forceDelete) { - beginDeleteWithoutPollingAsync(resourceGroupName, name, forceDelete).block(); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param forceDelete Specify <code>true</code> to force the deletion even if the App Service - * Environment contains resources. The default is <code>false</code>. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginDeleteWithoutPolling(String resourceGroupName, String name, Boolean forceDelete, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, name, forceDelete, context).block(); - } - - /** - * Description for Delete an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginDeleteWithoutPolling(String resourceGroupName, String name) { - final Boolean forceDelete = null; - final Context context = null; - beginDeleteWithoutPollingAsync(resourceGroupName, name, forceDelete).block(); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginChangeVnetWithoutPollingWithResponseAsync( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (vnetInfo == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetInfo is required and cannot be null.")); - } else { - vnetInfo.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginChangeVnetWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - vnetInfo, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginChangeVnetWithoutPollingWithResponseAsync( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (vnetInfo == null) { - return Mono.error(new IllegalArgumentException("Parameter vnetInfo is required and cannot be null.")); - } else { - vnetInfo.validate(); - } - return service - .beginChangeVnetWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - vnetInfo, - context); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginChangeVnetWithoutPollingAsync( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - return beginChangeVnetWithoutPollingWithResponseAsync(resourceGroupName, name, vnetInfo) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginChangeVnetWithoutPollingAsync( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - return beginChangeVnetWithoutPollingWithResponseAsync(resourceGroupName, name, vnetInfo, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner beginChangeVnetWithoutPolling( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo) { - return beginChangeVnetWithoutPollingAsync(resourceGroupName, name, vnetInfo).block(); - } - - /** - * Description for Move an App Service Environment to a different VNET. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param vnetInfo Specification for using a Virtual Network. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner beginChangeVnetWithoutPolling( - String resourceGroupName, String name, VirtualNetworkProfile vnetInfo, Context context) { - return beginChangeVnetWithoutPollingAsync(resourceGroupName, name, vnetInfo, context).block(); - } - - /** - * Description for Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateMultiRolePoolWithoutPollingWithResponseAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (multiRolePoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter multiRolePoolEnvelope is required and cannot be null.")); - } else { - multiRolePoolEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateMultiRolePoolWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - multiRolePoolEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateMultiRolePoolWithoutPollingWithResponseAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (multiRolePoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter multiRolePoolEnvelope is required and cannot be null.")); - } else { - multiRolePoolEnvelope.validate(); - } - return service - .beginCreateOrUpdateMultiRolePoolWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - multiRolePoolEnvelope, - context); - } - - /** - * Description for Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateMultiRolePoolWithoutPollingAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - return beginCreateOrUpdateMultiRolePoolWithoutPollingWithResponseAsync( - resourceGroupName, name, multiRolePoolEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateMultiRolePoolWithoutPollingAsync( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - return beginCreateOrUpdateMultiRolePoolWithoutPollingWithResponseAsync( - resourceGroupName, name, multiRolePoolEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner beginCreateOrUpdateMultiRolePoolWithoutPolling( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) { - return beginCreateOrUpdateMultiRolePoolWithoutPollingAsync(resourceGroupName, name, multiRolePoolEnvelope) - .block(); - } - - /** - * Description for Create or update a multi-role pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param multiRolePoolEnvelope Worker pool of an App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner beginCreateOrUpdateMultiRolePoolWithoutPolling( - String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope, Context context) { - return beginCreateOrUpdateMultiRolePoolWithoutPollingAsync( - resourceGroupName, name, multiRolePoolEnvelope, context) - .block(); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginResumeWithoutPollingWithResponseAsync( - String resourceGroupName, String name) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - return FluxUtil - .withContext( - context -> - service - .beginResumeWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginResumeWithoutPollingWithResponseAsync( - String resourceGroupName, 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - return service - .beginResumeWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginResumeWithoutPollingAsync(String resourceGroupName, String name) { - return beginResumeWithoutPollingWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginResumeWithoutPollingAsync( - String resourceGroupName, String name, Context context) { - return beginResumeWithoutPollingWithResponseAsync(resourceGroupName, name, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner beginResumeWithoutPolling(String resourceGroupName, String name) { - return beginResumeWithoutPollingAsync(resourceGroupName, name).block(); - } - - /** - * Description for Resume an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner beginResumeWithoutPolling(String resourceGroupName, String name, Context context) { - return beginResumeWithoutPollingAsync(resourceGroupName, name, context).block(); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginSuspendWithoutPollingWithResponseAsync( - String resourceGroupName, String name) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - return FluxUtil - .withContext( - context -> - service - .beginSuspendWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginSuspendWithoutPollingWithResponseAsync( - String resourceGroupName, 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - return service - .beginSuspendWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginSuspendWithoutPollingAsync(String resourceGroupName, String name) { - return beginSuspendWithoutPollingWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginSuspendWithoutPollingAsync( - String resourceGroupName, String name, Context context) { - return beginSuspendWithoutPollingWithResponseAsync(resourceGroupName, name, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner beginSuspendWithoutPolling(String resourceGroupName, String name) { - return beginSuspendWithoutPollingAsync(resourceGroupName, name).block(); - } - - /** - * Description for Suspend an App Service Environment. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service apps. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WebAppCollectionInner beginSuspendWithoutPolling(String resourceGroupName, String name, Context context) { - return beginSuspendWithoutPollingAsync(resourceGroupName, name, context).block(); - } - - /** - * Description for Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWorkerPoolWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName 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 (workerPoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter workerPoolEnvelope is required and cannot be null.")); - } else { - workerPoolEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWorkerPoolWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - workerPoolEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWorkerPoolWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (workerPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter workerPoolName 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 (workerPoolEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter workerPoolEnvelope is required and cannot be null.")); - } else { - workerPoolEnvelope.validate(); - } - return service - .beginCreateOrUpdateWorkerPoolWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - workerPoolName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - workerPoolEnvelope, - context); - } - - /** - * Description for Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWorkerPoolWithoutPollingAsync( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - return beginCreateOrUpdateWorkerPoolWithoutPollingWithResponseAsync( - resourceGroupName, name, workerPoolName, workerPoolEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWorkerPoolWithoutPollingAsync( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context) { - return beginCreateOrUpdateWorkerPoolWithoutPollingWithResponseAsync( - resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner beginCreateOrUpdateWorkerPoolWithoutPolling( - String resourceGroupName, String name, String workerPoolName, WorkerPoolResourceInner workerPoolEnvelope) { - return beginCreateOrUpdateWorkerPoolWithoutPollingAsync( - resourceGroupName, name, workerPoolName, workerPoolEnvelope) - .block(); - } - - /** - * Description for Create or update a worker pool. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service Environment. - * @param workerPoolName Name of the worker pool. - * @param workerPoolEnvelope Worker pool of an App Service Environment ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return worker pool of an App Service Environment ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkerPoolResourceInner beginCreateOrUpdateWorkerPoolWithoutPolling( - String resourceGroupName, - String name, - String workerPoolName, - WorkerPoolResourceInner workerPoolEnvelope, - Context context) { - return beginCreateOrUpdateWorkerPoolWithoutPollingAsync( - resourceGroupName, name, workerPoolName, workerPoolEnvelope, context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service Environments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - return FluxUtil - .withContext(context -> service.listNext(nextLink, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * 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 DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service Environments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - return service - .listNext(nextLink, 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 DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service Environments. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByResourceGroupNextSinglePageAsync( - String nextLink) { + public Mono> listCapacitiesNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } return FluxUtil - .withContext(context -> service.listByResourceGroupNext(nextLink, context)) - .>map( + .withContext(context -> service.listCapacitiesNext(nextLink, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -9207,16 +7962,16 @@ public Mono> listByResourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of App Service Environments. + * @return collection of stamp capacities. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { + public Mono> listCapacitiesNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service - .listByResourceGroupNext(nextLink, context) + .listCapacitiesNext(nextLink, context) .map( res -> new PagedResponseBase<>( @@ -9235,16 +7990,16 @@ public Mono> listByResourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of stamp capacities. + * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listCapacitiesNextSinglePageAsync(String nextLink) { + public Mono> changeVnetNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } return FluxUtil - .withContext(context -> service.listCapacitiesNext(nextLink, context)) - .>map( + .withContext(context -> service.changeVnetNext(nextLink, context)) + .>map( res -> new PagedResponseBase<>( res.getRequest(), @@ -9264,15 +8019,16 @@ public Mono> listCapacitiesNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of stamp capacities. + * @return collection of App Service apps. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listCapacitiesNextSinglePageAsync(String nextLink, Context context) { + public Mono> changeVnetNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service - .listCapacitiesNext(nextLink, context) + .changeVnetNext(nextLink, context) .map( res -> new PagedResponseBase<>( @@ -9329,6 +8085,7 @@ public Mono> listCapacitiesNextSinglePageAsync if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInboundNetworkDependenciesEndpointsNext(nextLink, context) .map( @@ -9386,6 +8143,7 @@ public Mono> listMultiRolePoolsNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRolePoolsNext(nextLink, context) .map( @@ -9444,6 +8202,7 @@ public Mono> listMultiRolePoolsNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRolePoolInstanceMetricDefinitionsNext(nextLink, context) .map( @@ -9502,6 +8261,7 @@ public Mono> listMultiRoleMetricDef if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRoleMetricDefinitionsNext(nextLink, context) .map( @@ -9559,6 +8319,7 @@ public Mono> listMultiRolePoolSkusNextSinglePageAsyn if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRolePoolSkusNext(nextLink, context) .map( @@ -9615,6 +8376,7 @@ public Mono> listMultiRoleUsagesNextSinglePageAsync(St if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMultiRoleUsagesNext(nextLink, context) .map( @@ -9673,6 +8435,7 @@ public Mono> listMultiRoleUsagesNextSinglePageAsync(St if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getOutboundNetworkDependenciesEndpointsNext(nextLink, context) .map( @@ -9686,6 +8449,63 @@ public Mono> listMultiRoleUsagesNextSinglePageAsync(St null)); } + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of App Service apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> resumeNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.resumeNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of App Service apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> resumeNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .resumeNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + /** * Get the next page of items. * @@ -9730,6 +8550,7 @@ public Mono> listAppServicePlansNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAppServicePlansNext(nextLink, context) .map( @@ -9786,6 +8607,7 @@ public Mono> listWebAppsNextSinglePageAsync(String next if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebAppsNext(nextLink, context) .map( @@ -9799,6 +8621,63 @@ public Mono> listWebAppsNextSinglePageAsync(String next null)); } + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of App Service apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> suspendNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.suspendNext(nextLink, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * 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 DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of App Service apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> suspendNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service + .suspendNext(nextLink, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + /** * Get the next page of items. * @@ -9842,6 +8721,7 @@ public Mono> listUsagesNextSinglePageAsync(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsagesNext(nextLink, context) .map( @@ -9899,6 +8779,7 @@ public Mono> listWorkerPoolsNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWorkerPoolsNext(nextLink, context) .map( @@ -9957,6 +8838,7 @@ public Mono> listWorkerPoolsNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWorkerPoolInstanceMetricDefinitionsNext(nextLink, context) .map( @@ -10015,6 +8897,7 @@ public Mono> listWebWorkerMetricDef if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebWorkerMetricDefinitionsNext(nextLink, context) .map( @@ -10071,6 +8954,7 @@ public Mono> listWorkerPoolSkusNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWorkerPoolSkusNext(nextLink, context) .map( @@ -10127,6 +9011,7 @@ public Mono> listWebWorkerUsagesNextSinglePageAsync(St if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebWorkerUsagesNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServicePlansClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServicePlansClient.java index 0b8a3421c074..87b88c80140a 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServicePlansClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/AppServicePlansClient.java @@ -31,6 +31,7 @@ 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.appservice.WebSiteManagementClient; import com.azure.resourcemanager.appservice.fluent.inner.AppServicePlanCollectionInner; import com.azure.resourcemanager.appservice.fluent.inner.AppServicePlanInner; @@ -493,21 +494,6 @@ Mono> rebootWorker( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms" - + "/{name}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AppServicePlanInner appServicePlan, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -624,6 +610,7 @@ public Mono> listSinglePageAsync(Boolean deta new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -815,6 +802,7 @@ public Mono> listByResourceGroupSinglePageAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -974,6 +962,7 @@ public Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1154,6 +1143,7 @@ public Mono>> createOrUpdateWithResponseAsync( } else { appServicePlan.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -1177,7 +1167,7 @@ public Mono>> createOrUpdateWithResponseAsync( * @return app Service plan. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AppServicePlanInner> beginCreateOrUpdate( + public PollerFlux, AppServicePlanInner> beginCreateOrUpdateAsync( String resourceGroupName, String name, AppServicePlanInner appServicePlan) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, appServicePlan); @@ -1200,7 +1190,7 @@ public PollerFlux, AppServicePlanInner> beginCre * @return app Service plan. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, AppServicePlanInner> beginCreateOrUpdate( + public PollerFlux, AppServicePlanInner> beginCreateOrUpdateAsync( String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, appServicePlan, context); @@ -1210,6 +1200,41 @@ public PollerFlux, AppServicePlanInner> beginCre mono, this.client.getHttpPipeline(), AppServicePlanInner.class, AppServicePlanInner.class); } + /** + * Description for Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param appServicePlan App Service plan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app Service plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServicePlanInner> beginCreateOrUpdate( + String resourceGroupName, String name, AppServicePlanInner appServicePlan) { + return beginCreateOrUpdateAsync(resourceGroupName, name, appServicePlan).getSyncPoller(); + } + + /** + * Description for Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the App Service plan. + * @param appServicePlan App Service plan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return app Service plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, AppServicePlanInner> beginCreateOrUpdate( + String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, appServicePlan, context).getSyncPoller(); + } + /** * Description for Creates or updates an App Service Plan. * @@ -1224,14 +1249,9 @@ public PollerFlux, AppServicePlanInner> beginCre @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String name, AppServicePlanInner appServicePlan) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, appServicePlan); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), AppServicePlanInner.class, AppServicePlanInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, name, appServicePlan) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1249,14 +1269,9 @@ public Mono createOrUpdateAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, appServicePlan, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), AppServicePlanInner.class, AppServicePlanInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, name, appServicePlan, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1371,6 +1386,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1533,6 +1549,7 @@ public Mono> updateWithResponseAsync( } else { appServicePlan.validate(); } + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1709,6 +1726,7 @@ public Mono>> listCapabilitiesWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listCapabilities( this.client.getEndpoint(), @@ -1894,6 +1912,7 @@ public Mono> getHybridConnectionWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHybridConnection( this.client.getEndpoint(), @@ -2093,6 +2112,7 @@ public Mono> deleteHybridConnectionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHybridConnection( this.client.getEndpoint(), @@ -2275,6 +2295,7 @@ public Mono> listHybridConnectionKeysWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHybridConnectionKeys( this.client.getEndpoint(), @@ -2483,6 +2504,7 @@ public Mono> listWebAppsByHybridConnectionSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebAppsByHybridConnection( this.client.getEndpoint(), @@ -2665,6 +2687,7 @@ public Mono> getHybridConnectionPlanLimitW new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHybridConnectionPlanLimit( this.client.getEndpoint(), @@ -2843,6 +2866,7 @@ public Mono> listHybridConnectionsSinglePag new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHybridConnections( this.client.getEndpoint(), @@ -3016,6 +3040,7 @@ public Mono> restartWebAppsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .restartWebApps( this.client.getEndpoint(), @@ -3236,6 +3261,7 @@ public Mono> listWebAppsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebApps( this.client.getEndpoint(), @@ -3466,6 +3492,7 @@ public Mono> getServerFarmSkusWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getServerFarmSkus( this.client.getEndpoint(), @@ -3647,6 +3674,7 @@ public Mono> listUsagesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsages( this.client.getEndpoint(), @@ -3857,6 +3885,7 @@ public Mono>> listVnetsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listVnets( this.client.getEndpoint(), @@ -4033,6 +4062,7 @@ public Mono> getVnetFromServerFarmWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVnetFromServerFarm( this.client.getEndpoint(), @@ -4225,6 +4255,7 @@ public Mono> getVnetGatewayWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVnetGateway( this.client.getEndpoint(), @@ -4449,6 +4480,7 @@ public Mono> updateVnetGatewayWithResponseAsync( } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateVnetGateway( this.client.getEndpoint(), @@ -4668,6 +4700,7 @@ public Mono>> listRoutesForVnetWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRoutesForVnet( this.client.getEndpoint(), @@ -4860,6 +4893,7 @@ public Mono>> getRouteForVnetWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getRouteForVnet( this.client.getEndpoint(), @@ -5077,6 +5111,7 @@ public Mono> createOrUpdateVnetRouteWithResponseAsync( } else { route.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateVnetRoute( this.client.getEndpoint(), @@ -5291,6 +5326,7 @@ public Mono> deleteVnetRouteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteVnetRoute( this.client.getEndpoint(), @@ -5490,6 +5526,7 @@ public Mono> updateVnetRouteWithResponseAsync( } else { route.validate(); } + context = this.client.mergeContext(context); return service .updateVnetRoute( this.client.getEndpoint(), @@ -5695,6 +5732,7 @@ public Mono> rebootWorkerWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .rebootWorker( this.client.getEndpoint(), @@ -5772,195 +5810,6 @@ public void rebootWorker(String resourceGroupName, String name, String workerNam rebootWorkerAsync(resourceGroupName, name, workerName, context).block(); } - /** - * Description for Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (appServicePlan == null) { - return Mono.error(new IllegalArgumentException("Parameter appServicePlan is required and cannot be null.")); - } else { - appServicePlan.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appServicePlan, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (appServicePlan == null) { - return Mono.error(new IllegalArgumentException("Parameter appServicePlan is required and cannot be null.")); - } else { - appServicePlan.validate(); - } - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - appServicePlan, - context); - } - - /** - * Description for Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, name, appServicePlan) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, name, appServicePlan, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan App Service plan. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServicePlanInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String name, AppServicePlanInner appServicePlan) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, name, appServicePlan).block(); - } - - /** - * Description for Creates or updates an App Service Plan. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the App Service plan. - * @param appServicePlan App Service plan. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return app Service plan. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AppServicePlanInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String name, AppServicePlanInner appServicePlan, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, name, appServicePlan, context).block(); - } - /** * Get the next page of items. * @@ -6004,6 +5853,7 @@ public Mono> listNextSinglePageAsync(String n if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -6061,6 +5911,7 @@ public Mono> listByResourceGroupNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -6118,6 +5969,7 @@ public Mono> listWebAppsByHybridConnectionNextSinglePageAs if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebAppsByHybridConnectionNext(nextLink, context) .map( @@ -6175,6 +6027,7 @@ public Mono> listHybridConnectionsNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHybridConnectionsNext(nextLink, context) .map( @@ -6231,6 +6084,7 @@ public Mono> listWebAppsNextSinglePageAsync(String next if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebAppsNext(nextLink, context) .map( @@ -6287,6 +6141,7 @@ public Mono> listUsagesNextSinglePageAsync(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsagesNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificateRegistrationProvidersClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificateRegistrationProvidersClient.java index d9a4bc50e874..6f119194d036 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificateRegistrationProvidersClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificateRegistrationProvidersClient.java @@ -126,6 +126,7 @@ public Mono> listOperationsSinglePag new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperations(this.client.getEndpoint(), this.client.getApiVersion(), context) .map( @@ -241,6 +242,7 @@ public Mono> listOperationsNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperationsNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificatesClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificatesClient.java index bdb48e2f64ba..948e95fe9f06 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificatesClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/CertificatesClient.java @@ -226,6 +226,7 @@ public Mono> listSinglePageAsync(Context context new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -369,6 +370,7 @@ public Mono> listByResourceGroupSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -527,6 +529,7 @@ public Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -709,6 +712,7 @@ public Mono> createOrUpdateWithResponseAsync( } else { certificateEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -883,6 +887,7 @@ public Mono> deleteWithResponseAsync(String resourceGroupName, St new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1047,6 +1052,7 @@ public Mono> updateWithResponseAsync( } else { certificateEnvelope.validate(); } + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1187,6 +1193,7 @@ public Mono> listNextSinglePageAsync(String next if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -1244,6 +1251,7 @@ public Mono> listByResourceGroupNextSinglePageAs if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DeletedWebAppsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DeletedWebAppsClient.java index 15b135befa77..7583e86abf31 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DeletedWebAppsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DeletedWebAppsClient.java @@ -172,6 +172,7 @@ public Mono> listSinglePageAsync(Context context new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -312,6 +313,7 @@ public Mono> listByLocationSinglePageAsync(Strin new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByLocation( this.client.getEndpoint(), @@ -468,6 +470,7 @@ public Mono> getDeletedWebAppByLocationWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDeletedWebAppByLocation( this.client.getEndpoint(), @@ -600,6 +603,7 @@ public Mono> listNextSinglePageAsync(String next if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -656,6 +660,7 @@ public Mono> listByLocationNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByLocationNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DiagnosticsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DiagnosticsClient.java index 5f300f8935d7..d2119d09811f 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DiagnosticsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DiagnosticsClient.java @@ -584,6 +584,7 @@ public Mono> listHostingEnvironmentDetector new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostingEnvironmentDetectorResponses( this.client.getEndpoint(), @@ -781,6 +782,7 @@ public Mono> getHostingEnvironmentDetectorRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHostingEnvironmentDetectorResponse( this.client.getEndpoint(), @@ -1062,6 +1064,7 @@ public Mono> listSiteDetectorResponsesSingl new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorResponses( this.client.getEndpoint(), @@ -1257,6 +1260,7 @@ public Mono> getSiteDetectorResponseWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteDetectorResponse( this.client.getEndpoint(), @@ -1536,6 +1540,7 @@ public Mono> listSiteDiagnosticCategories new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDiagnosticCategories( this.client.getEndpoint(), @@ -1715,6 +1720,7 @@ public Mono> getSiteDiagnosticCategoryWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteDiagnosticCategory( this.client.getEndpoint(), @@ -1911,6 +1917,7 @@ public Mono> listSiteAnalysesSinglePageAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteAnalyses( this.client.getEndpoint(), @@ -2104,6 +2111,7 @@ public Mono> getSiteAnalysisWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteAnalysis( this.client.getEndpoint(), @@ -2327,6 +2335,7 @@ public Mono> executeSiteAnalysisWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .executeSiteAnalysis( this.client.getEndpoint(), @@ -2630,6 +2639,7 @@ public Mono> listSiteDetectorsSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectors( this.client.getEndpoint(), @@ -2823,6 +2833,7 @@ public Mono> getSiteDetectorWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteDetector( this.client.getEndpoint(), @@ -3046,6 +3057,7 @@ public Mono> executeSiteDetectorWithRe new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .executeSiteDetector( this.client.getEndpoint(), @@ -3347,6 +3359,7 @@ public Mono> listSiteDetectorResponsesSlotS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorResponsesSlot( this.client.getEndpoint(), @@ -3560,6 +3573,7 @@ public Mono> getSiteDetectorResponseSlotWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteDetectorResponseSlot( this.client.getEndpoint(), @@ -3861,6 +3875,7 @@ public Mono> listSiteDiagnosticCategories new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDiagnosticCategoriesSlot( this.client.getEndpoint(), @@ -4054,6 +4069,7 @@ public Mono> getSiteDiagnosticCategorySlotWith new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteDiagnosticCategorySlot( this.client.getEndpoint(), @@ -4266,6 +4282,7 @@ public Mono> listSiteAnalysesSlotSinglePa new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteAnalysesSlot( this.client.getEndpoint(), @@ -4479,6 +4496,7 @@ public Mono> getSiteAnalysisSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteAnalysisSlot( this.client.getEndpoint(), @@ -4730,6 +4748,7 @@ public Mono> executeSiteAnalysisSlotWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .executeSiteAnalysisSlot( this.client.getEndpoint(), @@ -5069,6 +5088,7 @@ public Mono> listSiteDetectorsSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorsSlot( this.client.getEndpoint(), @@ -5282,6 +5302,7 @@ public Mono> getSiteDetectorSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteDetectorSlot( this.client.getEndpoint(), @@ -5533,6 +5554,7 @@ public Mono> executeSiteDetectorSlotWi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .executeSiteDetectorSlot( this.client.getEndpoint(), @@ -5809,6 +5831,7 @@ public Mono> listHostingEnvironmentDetector if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostingEnvironmentDetectorResponsesNext(nextLink, context) .map( @@ -5866,6 +5889,7 @@ public Mono> listSiteDetectorResponsesNextS if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorResponsesNext(nextLink, context) .map( @@ -5924,6 +5948,7 @@ public Mono> listSiteDiagnosticCategories if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDiagnosticCategoriesNext(nextLink, context) .map( @@ -5981,6 +6006,7 @@ public Mono> listSiteAnalysesNextSinglePa if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteAnalysesNext(nextLink, context) .map( @@ -6038,6 +6064,7 @@ public Mono> listSiteDetectorsNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorsNext(nextLink, context) .map( @@ -6096,6 +6123,7 @@ public Mono> listSiteDetectorResponsesSlotN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorResponsesSlotNext(nextLink, context) .map( @@ -6154,6 +6182,7 @@ public Mono> listSiteDiagnosticCategories if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDiagnosticCategoriesSlotNext(nextLink, context) .map( @@ -6211,6 +6240,7 @@ public Mono> listSiteAnalysesSlotNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteAnalysesSlotNext(nextLink, context) .map( @@ -6268,6 +6298,7 @@ public Mono> listSiteDetectorsSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteDetectorsSlotNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainRegistrationProvidersClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainRegistrationProvidersClient.java index 7eed1cecc2b6..f8c2dd735509 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainRegistrationProvidersClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainRegistrationProvidersClient.java @@ -124,6 +124,7 @@ public Mono> listOperationsSinglePag new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperations(this.client.getEndpoint(), this.client.getApiVersion(), context) .map( @@ -239,6 +240,7 @@ public Mono> listOperationsNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperationsNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainsClient.java index 3e7157c3002c..8f0670685147 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/DomainsClient.java @@ -31,6 +31,7 @@ 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.appservice.WebSiteManagementClient; import com.azure.resourcemanager.appservice.fluent.inner.DomainAvailabilityCheckResultInner; import com.azure.resourcemanager.appservice.fluent.inner.DomainCollectionInner; @@ -282,21 +283,6 @@ Mono> renew( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration" - + "/domains/{domainName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("domainName") String domainName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DomainInner domain, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -391,6 +377,7 @@ public Mono> checkAvailabilityWithR } NameIdentifierInner identifier = new NameIdentifierInner(); identifier.withName(name); + context = this.client.mergeContext(context); return service .checkAvailability( this.client.getEndpoint(), @@ -539,6 +526,7 @@ public Mono> listSinglePageAsync(Context context) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -661,6 +649,7 @@ public Mono> getControlCenterSsoReq new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getControlCenterSsoRequest( this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context); @@ -815,6 +804,7 @@ public Mono> listRecommendationsSinglePageAsy } else { parameters.validate(); } + context = this.client.mergeContext(context); return service .listRecommendations( this.client.getEndpoint(), @@ -975,6 +965,7 @@ public Mono> listByResourceGroupSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -1134,6 +1125,7 @@ public Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1314,6 +1306,7 @@ public Mono>> createOrUpdateWithResponseAsync( } else { domain.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -1337,7 +1330,7 @@ public Mono>> createOrUpdateWithResponseAsync( * @return information about a domain. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DomainInner> beginCreateOrUpdate( + public PollerFlux, DomainInner> beginCreateOrUpdateAsync( String resourceGroupName, String domainName, DomainInner domain) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, domainName, domain); return this @@ -1359,7 +1352,7 @@ public PollerFlux, DomainInner> beginCreateOrUpdate( * @return information about a domain. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, DomainInner> beginCreateOrUpdate( + public PollerFlux, DomainInner> beginCreateOrUpdateAsync( String resourceGroupName, String domainName, DomainInner domain, Context context) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, domainName, domain, context); @@ -1369,6 +1362,41 @@ public PollerFlux, DomainInner> beginCreateOrUpdate( mono, this.client.getHttpPipeline(), DomainInner.class, DomainInner.class); } + /** + * Description for Creates or updates a domain. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param domainName Name of the domain. + * @param domain Information about a domain. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DomainInner> beginCreateOrUpdate( + String resourceGroupName, String domainName, DomainInner domain) { + return beginCreateOrUpdateAsync(resourceGroupName, domainName, domain).getSyncPoller(); + } + + /** + * Description for Creates or updates a domain. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param domainName Name of the domain. + * @param domain Information about a domain. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return information about a domain. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, DomainInner> beginCreateOrUpdate( + String resourceGroupName, String domainName, DomainInner domain, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, domainName, domain, context).getSyncPoller(); + } + /** * Description for Creates or updates a domain. * @@ -1382,13 +1410,9 @@ public PollerFlux, DomainInner> beginCreateOrUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync(String resourceGroupName, String domainName, DomainInner domain) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, domainName, domain); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), DomainInner.class, DomainInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, domainName, domain) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1406,14 +1430,9 @@ public Mono createOrUpdateAsync(String resourceGroupName, String do @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String domainName, DomainInner domain, Context context) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, domainName, domain, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), DomainInner.class, DomainInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, domainName, domain, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1534,6 +1553,7 @@ public Mono> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1742,6 +1762,7 @@ public Mono> updateWithResponseAsync( } else { domain.validate(); } + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1925,6 +1946,7 @@ public Mono> listOwnershipIdentifi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOwnershipIdentifiers( this.client.getEndpoint(), @@ -2102,6 +2124,7 @@ public Mono> getOwnershipIdentifierWith new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getOwnershipIdentifier( this.client.getEndpoint(), @@ -2315,6 +2338,7 @@ public Mono> createOrUpdateOwnershipIde } else { domainOwnershipIdentifier.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateOwnershipIdentifier( this.client.getEndpoint(), @@ -2528,6 +2552,7 @@ public Mono> deleteOwnershipIdentifierWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteOwnershipIdentifier( this.client.getEndpoint(), @@ -2722,6 +2747,7 @@ public Mono> updateOwnershipIdentifierW } else { domainOwnershipIdentifier.validate(); } + context = this.client.mergeContext(context); return service .updateOwnershipIdentifier( this.client.getEndpoint(), @@ -2922,6 +2948,7 @@ public Mono> renewWithResponseAsync(String resourceGroupName, Str new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .renew( this.client.getEndpoint(), @@ -2993,195 +3020,6 @@ public void renew(String resourceGroupName, String domainName, Context context) renewAsync(resourceGroupName, domainName, context).block(); } - /** - * Description for Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Information about a domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String domainName, DomainInner domain) { - 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 (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName 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 (domain == null) { - return Mono.error(new IllegalArgumentException("Parameter domain is required and cannot be null.")); - } else { - domain.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domain, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Information about a domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String domainName, DomainInner domain, 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 (domainName == null) { - return Mono.error(new IllegalArgumentException("Parameter domainName 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 (domain == null) { - return Mono.error(new IllegalArgumentException("Parameter domain is required and cannot be null.")); - } else { - domain.validate(); - } - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - domainName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - domain, - context); - } - - /** - * Description for Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Information about a domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String domainName, DomainInner domain) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, domainName, domain) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Information about a domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String domainName, DomainInner domain, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, domainName, domain, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Information about a domain. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String domainName, DomainInner domain) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, domainName, domain).block(); - } - - /** - * Description for Creates or updates a domain. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param domainName Name of the domain. - * @param domain Information about a domain. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information about a domain. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DomainInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String domainName, DomainInner domain, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, domainName, domain, context).block(); - } - /** * Get the next page of items. * @@ -3225,6 +3063,7 @@ public Mono> listNextSinglePageAsync(String nextLink, if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -3282,6 +3121,7 @@ public Mono> listRecommendationsNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRecommendationsNext(nextLink, context) .map( @@ -3338,6 +3178,7 @@ public Mono> listByResourceGroupNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -3396,6 +3237,7 @@ public Mono> listOwnershipIdentifi if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOwnershipIdentifiersNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ProvidersClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ProvidersClient.java index 6c201bb0d137..cffc01e192bd 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ProvidersClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ProvidersClient.java @@ -166,6 +166,7 @@ public Mono> getAvailableStacksSing new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAvailableStacks(this.client.getEndpoint(), osTypeSelected, this.client.getApiVersion(), context) .map( @@ -322,6 +323,7 @@ public Mono> listOperationsSinglePag new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperations(this.client.getEndpoint(), this.client.getApiVersion(), context) .map( @@ -464,6 +466,7 @@ public Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -618,6 +621,7 @@ public Mono> getAvailableStacksNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAvailableStacksNext(nextLink, context) .map( @@ -675,6 +679,7 @@ public Mono> listOperationsNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listOperationsNext(nextLink, context) .map( @@ -733,6 +738,7 @@ public Mono> getAvailableStacksOnPr if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAvailableStacksOnPremNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/RecommendationsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/RecommendationsClient.java index a596d839a508..07d5fee61bd7 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/RecommendationsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/RecommendationsClient.java @@ -395,6 +395,7 @@ public Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -577,6 +578,7 @@ public Mono> resetAllFiltersWithResponseAsync(Context context) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .resetAllFilters( this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context); @@ -698,6 +700,7 @@ public Mono> disableRecommendationForSubscriptionWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .disableRecommendationForSubscription( this.client.getEndpoint(), name, this.client.getSubscriptionId(), this.client.getApiVersion(), context); @@ -865,6 +868,7 @@ public Mono> listHistoryForHostingEnvironment new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHistoryForHostingEnvironment( this.client.getEndpoint(), @@ -1128,6 +1132,7 @@ public Mono> listRecommendedRulesForHostingEn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRecommendedRulesForHostingEnvironment( this.client.getEndpoint(), @@ -1381,6 +1386,7 @@ public Mono> disableAllForHostingEnvironmentWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .disableAllForHostingEnvironment( this.client.getEndpoint(), @@ -1559,6 +1565,7 @@ public Mono> resetAllFiltersForHostingEnvironmentWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .resetAllFiltersForHostingEnvironment( this.client.getEndpoint(), @@ -1754,6 +1761,7 @@ public Mono> getRuleDetailsByHostingEnvironmen new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getRuleDetailsByHostingEnvironment( this.client.getEndpoint(), @@ -2047,6 +2055,7 @@ public Mono> disableRecommendationForHostingEnvironmentWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .disableRecommendationForHostingEnvironment( this.client.getEndpoint(), @@ -2239,6 +2248,7 @@ public Mono> listHistoryForWebAppSinglePageAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHistoryForWebApp( this.client.getEndpoint(), @@ -2487,6 +2497,7 @@ public Mono> listRecommendedRulesForWebAppSin new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRecommendedRulesForWebApp( this.client.getEndpoint(), @@ -2712,6 +2723,7 @@ public Mono> disableAllForWebAppWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .disableAllForWebApp( this.client.getEndpoint(), @@ -2862,6 +2874,7 @@ public Mono> resetAllFiltersForWebAppWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .resetAllFiltersForWebApp( this.client.getEndpoint(), @@ -3037,6 +3050,7 @@ public Mono> getRuleDetailsByWebAppWithRespons new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getRuleDetailsByWebApp( this.client.getEndpoint(), @@ -3299,6 +3313,7 @@ public Mono> disableRecommendationForSiteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .disableRecommendationForSite( this.client.getEndpoint(), @@ -3420,6 +3435,7 @@ public Mono> listNextSinglePageAsync(String n if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -3478,6 +3494,7 @@ public Mono> listHistoryForHostingEnvironment if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHistoryForHostingEnvironmentNext(nextLink, context) .map( @@ -3536,6 +3553,7 @@ public Mono> listRecommendedRulesForHostingEn if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRecommendedRulesForHostingEnvironmentNext(nextLink, context) .map( @@ -3593,6 +3611,7 @@ public Mono> listHistoryForWebAppNextSinglePa if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHistoryForWebAppNext(nextLink, context) .map( @@ -3650,6 +3669,7 @@ public Mono> listRecommendedRulesForWebAppNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRecommendedRulesForWebAppNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceHealthMetadatasClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceHealthMetadatasClient.java index 4726bbf10c53..8ca374b254ad 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceHealthMetadatasClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceHealthMetadatasClient.java @@ -235,6 +235,7 @@ public Mono> listSinglePageAsync(Cont new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -379,6 +380,7 @@ public Mono> listByResourceGroupSingl new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -547,6 +549,7 @@ public Mono> listBySiteSinglePageAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySite( this.client.getEndpoint(), @@ -713,6 +716,7 @@ public Mono> getBySiteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBySite( this.client.getEndpoint(), @@ -898,6 +902,7 @@ public Mono> listBySiteSlotSinglePage new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySiteSlot( this.client.getEndpoint(), @@ -1080,6 +1085,7 @@ public Mono> getBySiteSlotWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBySiteSlot( this.client.getEndpoint(), @@ -1218,6 +1224,7 @@ public Mono> listNextSinglePageAsync( if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -1275,6 +1282,7 @@ public Mono> listByResourceGroupNextS if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -1332,6 +1340,7 @@ public Mono> listBySiteNextSinglePage if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySiteNext(nextLink, context) .map( @@ -1389,6 +1398,7 @@ public Mono> listBySiteSlotNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySiteSlotNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceProvidersClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceProvidersClient.java index 09e58a2cc6bb..35d8dd6d0983 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceProvidersClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/ResourceProvidersClient.java @@ -326,6 +326,7 @@ public Mono> getPublishingUserWithResponseAsync(Context cont new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service.getPublishingUser(this.client.getEndpoint(), this.client.getApiVersion(), context); } @@ -451,6 +452,7 @@ public Mono> updatePublishingUserWithResponseAsync(UserInner } else { userDetails.validate(); } + context = this.client.mergeContext(context); return service .updatePublishingUser(this.client.getEndpoint(), this.client.getApiVersion(), userDetails, context); } @@ -576,6 +578,7 @@ public Mono> listSourceControlsSinglePageAsync new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSourceControls(this.client.getEndpoint(), this.client.getApiVersion(), context) .map( @@ -697,6 +700,7 @@ public Mono> getSourceControlWithResponseAsync( return Mono .error(new IllegalArgumentException("Parameter sourceControlType is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSourceControl(this.client.getEndpoint(), sourceControlType, this.client.getApiVersion(), context); } @@ -845,6 +849,7 @@ public Mono> updateSourceControlWithResponseAsync( } else { requestMessage.validate(); } + context = this.client.mergeContext(context); return service .updateSourceControl( this.client.getEndpoint(), sourceControlType, this.client.getApiVersion(), requestMessage, context); @@ -1004,6 +1009,7 @@ public Mono> listSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -1207,6 +1213,7 @@ public Mono> checkNameAvailabilityWithRe request.withName(name); request.withType(type); request.withIsFqdn(isFqdn); + context = this.client.mergeContext(context); return service .checkNameAvailability( this.client.getEndpoint(), @@ -1361,6 +1368,7 @@ public Mono> getSubscriptionDeploymentLocatio new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSubscriptionDeploymentLocations( this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context); @@ -1528,6 +1536,7 @@ public Mono> listGeoRegionsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listGeoRegions( this.client.getEndpoint(), @@ -1766,6 +1775,7 @@ public Mono> listSiteIdentifiersAssignedToHostnam } NameIdentifierInner nameIdentifier = new NameIdentifierInner(); nameIdentifier.withName(name); + context = this.client.mergeContext(context); return service .listSiteIdentifiersAssignedToHostname( this.client.getEndpoint(), @@ -1911,6 +1921,7 @@ public Mono> listPremierAddOnOffersSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPremierAddOnOffers( this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) @@ -2037,6 +2048,7 @@ public Mono> listSkusWithResponseAsync(Context context) new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSkus(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context); } @@ -2183,6 +2195,7 @@ public Mono> verifyHostingEnvironmen } else { parameters.validate(); } + context = this.client.mergeContext(context); return service .verifyHostingEnvironmentVnet( this.client.getEndpoint(), @@ -2358,6 +2371,7 @@ public Mono> moveWithResponseAsync( } else { moveResourceEnvelope.validate(); } + context = this.client.mergeContext(context); return service .move( this.client.getEndpoint(), @@ -2520,6 +2534,7 @@ public Mono> validateWithResponseAsync( } else { validateRequest.validate(); } + context = this.client.mergeContext(context); return service .validate( this.client.getEndpoint(), @@ -2696,6 +2711,7 @@ public Mono> validateMoveWithResponseAsync( } else { moveResourceEnvelope.validate(); } + context = this.client.mergeContext(context); return service .validateMove( this.client.getEndpoint(), @@ -2817,6 +2833,7 @@ public Mono> listSourceControlsNextSinglePageA if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSourceControlsNext(nextLink, context) .map( @@ -2874,6 +2891,7 @@ public Mono> listBillingMetersNextSinglePageAsy if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBillingMetersNext(nextLink, context) .map( @@ -2930,6 +2948,7 @@ public Mono> listGeoRegionsNextSinglePageAsync(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listGeoRegionsNext(nextLink, context) .map( @@ -2988,6 +3007,7 @@ public Mono> listSiteIdentifiersAssignedToHostnam if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteIdentifiersAssignedToHostnameNext(nextLink, context) .map( @@ -3045,6 +3065,7 @@ public Mono> listPremierAddOnOffersNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPremierAddOnOffersNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/StaticSitesClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/StaticSitesClient.java index fac6576dbf67..349cb28c6e69 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/StaticSitesClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/StaticSitesClient.java @@ -572,6 +572,7 @@ public Mono> listSinglePageAsync(Conte new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -716,6 +717,7 @@ public Mono> listByResourceGroupSingle new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -875,6 +877,7 @@ public Mono> getByResourceGroupWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1058,6 +1061,7 @@ public Mono> createOrUpdateStaticSiteWithRe } else { staticSiteEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateStaticSite( this.client.getEndpoint(), @@ -1233,6 +1237,7 @@ public Mono> deleteStaticSiteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteStaticSite( this.client.getEndpoint(), @@ -1398,6 +1403,7 @@ public Mono> updateStaticSiteWithResponseAs } else { staticSiteEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateStaticSite( this.client.getEndpoint(), @@ -1592,6 +1598,7 @@ public Mono> listStaticSiteUsersSi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteUsers( this.client.getEndpoint(), @@ -1783,6 +1790,7 @@ public Mono> deleteStaticSiteUserWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteStaticSiteUser( this.client.getEndpoint(), @@ -1991,6 +1999,7 @@ public Mono> updateStaticSiteUserWithRe } else { staticSiteUserEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateStaticSiteUser( this.client.getEndpoint(), @@ -2207,6 +2216,7 @@ public Mono> getStaticSiteBuildsS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getStaticSiteBuilds( this.client.getEndpoint(), @@ -2382,6 +2392,7 @@ public Mono> getStaticSiteBuildWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getStaticSiteBuild( this.client.getEndpoint(), @@ -2566,6 +2577,7 @@ public Mono> deleteStaticSiteBuildWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteStaticSiteBuild( this.client.getEndpoint(), @@ -2744,6 +2756,7 @@ public Mono> createOrUpdateStaticSiteBuildFuncti } else { appSettings.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateStaticSiteBuildFunctionAppSettings( this.client.getEndpoint(), @@ -2948,6 +2961,7 @@ public Mono> listStati new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteBuildFunctions( this.client.getEndpoint(), @@ -3130,6 +3144,7 @@ public Mono> listStaticSiteBuildFunctionAppSetti new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteBuildFunctionAppSettings( this.client.getEndpoint(), @@ -3319,6 +3334,7 @@ public Mono> createOrUpdateStaticSiteFunctionApp } else { appSettings.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateStaticSiteFunctionAppSettings( this.client.getEndpoint(), @@ -3520,6 +3536,7 @@ public Mono> createUserR } else { staticSiteUserRolesInvitationEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createUserRolesInvitationLink( this.client.getEndpoint(), @@ -3720,6 +3737,7 @@ public StaticSiteUserInvitationResponseResourceInner createUserRolesInvitationLi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteCustomDomains( this.client.getEndpoint(), @@ -3899,6 +3917,7 @@ public PagedIterable listStaticS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .createOrUpdateStaticSiteCustomDomain( this.client.getEndpoint(), @@ -4084,6 +4103,7 @@ public Mono> deleteStaticSiteCustomDomainWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteStaticSiteCustomDomain( this.client.getEndpoint(), @@ -4251,6 +4271,7 @@ public Mono> validateCustomDomainCanBeAddedToStaticSiteWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .validateCustomDomainCanBeAddedToStaticSite( this.client.getEndpoint(), @@ -4409,6 +4430,7 @@ public Mono> detachStaticSiteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .detachStaticSite( this.client.getEndpoint(), @@ -4568,6 +4590,7 @@ public Mono> listStati new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteFunctions( this.client.getEndpoint(), @@ -4736,6 +4759,7 @@ public Mono> listStaticSiteFunctionAppSettingsWi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteFunctionAppSettings( this.client.getEndpoint(), @@ -4905,6 +4929,7 @@ public Mono> listStaticSiteSecretsWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteSecrets( this.client.getEndpoint(), @@ -5093,6 +5118,7 @@ public Mono> resetStaticSiteApiKeyWithResponseAsync( } else { resetPropertiesEnvelope.validate(); } + context = this.client.mergeContext(context); return service .resetStaticSiteApiKey( this.client.getEndpoint(), @@ -5223,6 +5249,7 @@ public Mono> listNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -5281,6 +5308,7 @@ public Mono> getStaticSitesByResourceG if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getStaticSitesByResourceGroupNext(nextLink, context) .map( @@ -5338,6 +5366,7 @@ public Mono> listStaticSiteUsersNe if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteUsersNext(nextLink, context) .map( @@ -5396,6 +5425,7 @@ public Mono> getStaticSiteBuildsN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getStaticSiteBuildsNext(nextLink, context) .map( @@ -5454,6 +5484,7 @@ public Mono> getStaticSiteBuildsN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteBuildFunctionsNext(nextLink, context) .map( @@ -5512,6 +5543,7 @@ public Mono> getStaticSiteBuildsN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteCustomDomainsNext(nextLink, context) .map( @@ -5570,6 +5602,7 @@ public Mono> listStati if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listStaticSiteFunctionsNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/TopLevelDomainsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/TopLevelDomainsClient.java index 35435edb0ffd..d9fbced033e4 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/TopLevelDomainsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/TopLevelDomainsClient.java @@ -178,6 +178,7 @@ public Mono> listSinglePageAsync(Context cont new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -309,6 +310,7 @@ public Mono> getWithResponseAsync(String name, Con new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), name, this.client.getSubscriptionId(), this.client.getApiVersion(), context); @@ -480,6 +482,7 @@ public Mono> listAgreementsSinglePageAsync } else { agreementOption.validate(); } + context = this.client.mergeContext(context); return service .listAgreements( this.client.getEndpoint(), @@ -612,6 +615,7 @@ public Mono> listNextSinglePageAsync(String n if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -669,6 +673,7 @@ public Mono> listAgreementsNextSinglePageA if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAgreementsNext(nextLink, context) .map( diff --git a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/WebAppsClient.java b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/WebAppsClient.java index 97a01737de3c..a3b283d38041 100644 --- a/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/WebAppsClient.java +++ b/sdk/appservice/mgmt/src/main/java/com/azure/resourcemanager/appservice/fluent/WebAppsClient.java @@ -33,6 +33,7 @@ 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.appservice.WebSiteManagementClient; import com.azure.resourcemanager.appservice.fluent.inner.AzureStoragePropertyDictionaryResourceInner; import com.azure.resourcemanager.appservice.fluent.inner.BackupItemCollectionInner; @@ -135,7 +136,8 @@ import java.io.InputStream; import java.io.SequenceInputStream; import java.nio.ByteBuffer; -import java.util.Collections; +import java.util.Enumeration; +import java.util.Iterator; import java.util.List; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -5890,544 +5892,6 @@ Mono> getWebJob( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteInner siteEnvelope, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/backups/{backupId}/restore") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("backupId") String backupId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/config/publishingcredentials/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginListPublishingCredentialsWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/extensions/MSDeploy") - @ExpectedResponses({201, 409}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateMSDeployOperationWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MSDeploy mSDeploy, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/functions/{functionName}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateFunctionWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FunctionEnvelopeInner functionEnvelope, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/instances/{instanceId}/extensions/MSDeploy") - @ExpectedResponses({201, 409}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateInstanceMSDeployOperationWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MSDeploy mSDeploy, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/migrate") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginMigrateStorageWithoutPolling( - @HostParam("$host") String endpoint, - @QueryParam("subscriptionName") String subscriptionName, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") StorageMigrationOptions migrationOptions, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/migratemysql") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginMigrateMySqlWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MigrateMySqlRequest migrationRequestEnvelope, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/networkTrace/startOperation") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginStartWebSiteNetworkTraceOperationWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/restoreFromBackupBlob") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreFromBackupBlobWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/restoreFromDeletedApp") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreFromDeletedAppWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeletedAppRestoreRequest restoreRequest, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/restoreSnapshot") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreSnapshotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SnapshotRestoreRequest restoreRequest, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/siteextensions/{siteExtensionId}") - @ExpectedResponses({200, 201, 429}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginInstallSiteExtensionWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("siteExtensionId") String siteExtensionId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slotcopy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCopyProductionSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmCopySlotEntityInner copySlotEntity, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteInner siteEnvelope, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/backups/{backupId}/restore") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("backupId") String backupId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/config/publishingcredentials/list") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginListPublishingCredentialsSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/extensions/MSDeploy") - @ExpectedResponses({201, 409}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateMSDeployOperationSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MSDeploy mSDeploy, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/functions/{functionName}") - @ExpectedResponses({201}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateInstanceFunctionSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("functionName") String functionName, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FunctionEnvelopeInner functionEnvelope, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/instances/{instanceId}/extensions/MSDeploy") - @ExpectedResponses({201, 409}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateInstanceMSDeployOperationSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("instanceId") String instanceId, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MSDeploy mSDeploy, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/networkTrace/startOperation") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginStartWebSiteNetworkTraceOperationSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @PathParam("slot") String slot, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> - beginApproveOrRejectPrivateEndpointConnectionWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/privateEndpointConnections/{privateEndpointConnectionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginDeletePrivateEndpointConnectionWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/restoreFromBackupBlob") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreFromBackupBlobSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RestoreRequestInner request, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/restoreFromDeletedApp") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreFromDeletedAppSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DeletedAppRestoreRequest restoreRequest, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/restoreSnapshot") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginRestoreSnapshotSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SnapshotRestoreRequest restoreRequest, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/siteextensions/{siteExtensionId}") - @ExpectedResponses({200, 201, 429}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginInstallSiteExtensionSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("siteExtensionId") String siteExtensionId, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/slotcopy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCopySlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmCopySlotEntityInner copySlotEntity, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/slotsswap") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginSwapSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmSlotEntity slotSwapEntity, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/sourcecontrols/web") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateSourceControlSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("slot") String slot, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteSourceControlInner siteSourceControl, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slots/{slot}/startNetworkTrace") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginStartNetworkTraceSlotWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @PathParam("slot") String slot, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/slotsswap") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginSwapSlotWithProductionWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CsmSlotEntity slotSwapEntity, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/sourcecontrols/web") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginCreateOrUpdateSourceControlWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SiteSourceControlInner siteSourceControl, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}" - + "/startNetworkTrace") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) - Mono> beginStartNetworkTraceWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("name") String name, - @QueryParam("durationInSeconds") Integer durationInSeconds, - @QueryParam("maxFrameLength") Integer maxFrameLength, - @QueryParam("sasUrl") String sasUrl, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -6879,6 +6343,7 @@ public Mono> listSinglePageAsync(Context context) { new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), context) .map( @@ -7028,6 +6493,7 @@ public Mono> listByResourceGroupSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), @@ -7231,6 +6697,7 @@ public Mono> getByResourceGroupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -7413,6 +6880,7 @@ public Mono>> createOrUpdateWithResponseAsync( } else { siteEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -7437,7 +6905,7 @@ public Mono>> createOrUpdateWithResponseAsync( * @return a web app, a mobile app backend, or an API app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteInner> beginCreateOrUpdate( + public PollerFlux, SiteInner> beginCreateOrUpdateAsync( String resourceGroupName, String name, SiteInner siteEnvelope) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, siteEnvelope); return this @@ -7460,7 +6928,7 @@ public PollerFlux, SiteInner> beginCreateOrUpdate( * @return a web app, a mobile app backend, or an API app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteInner> beginCreateOrUpdate( + public PollerFlux, SiteInner> beginCreateOrUpdateAsync( String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, siteEnvelope, context); @@ -7470,6 +6938,43 @@ public PollerFlux, SiteInner> beginCreateOrUpdate( mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class); } + /** + * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} + * parameter. + * @param siteEnvelope A web app, a mobile app backend, or an API app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a web app, a mobile app backend, or an API app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteInner> beginCreateOrUpdate( + String resourceGroupName, String name, SiteInner siteEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, name, siteEnvelope).getSyncPoller(); + } + + /** + * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} + * parameter. + * @param siteEnvelope A web app, a mobile app backend, or an API app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a web app, a mobile app backend, or an API app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteInner> beginCreateOrUpdate( + String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, siteEnvelope, context).getSyncPoller(); + } + /** * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. * @@ -7484,13 +6989,9 @@ public PollerFlux, SiteInner> beginCreateOrUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync(String resourceGroupName, String name, SiteInner siteEnvelope) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, siteEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, name, siteEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -7509,14 +7010,9 @@ public Mono createOrUpdateAsync(String resourceGroupName, String name @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateAsync( String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, siteEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class) + return beginCreateOrUpdateAsync(resourceGroupName, name, siteEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -7641,6 +7137,7 @@ public Mono> deleteWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -7860,6 +7357,7 @@ public Mono> updateWithResponseAsync( } else { siteEnvelope.validate(); } + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -8041,6 +7539,7 @@ public Mono> analyzeCustomHostnameWi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .analyzeCustomHostname( this.client.getEndpoint(), @@ -8272,6 +7771,7 @@ public Mono> applySlotConfigToProductionWithResponseAsync( } else { slotSwapEntity.validate(); } + context = this.client.mergeContext(context); return service .applySlotConfigToProduction( this.client.getEndpoint(), @@ -8444,6 +7944,7 @@ public Mono> backupWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .backup( this.client.getEndpoint(), @@ -8625,6 +8126,7 @@ public Mono> listBackupsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBackups( this.client.getEndpoint(), @@ -8798,6 +8300,7 @@ public Mono> getBackupStatusWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBackupStatus( this.client.getEndpoint(), @@ -8979,6 +8482,7 @@ public Mono> deleteBackupWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteBackup( this.client.getEndpoint(), @@ -9161,6 +8665,7 @@ public Mono> listBackupStatusSecretsWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .listBackupStatusSecrets( this.client.getEndpoint(), @@ -9372,6 +8877,7 @@ public Mono>> restoreWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .restore( this.client.getEndpoint(), @@ -9397,7 +8903,7 @@ public Mono>> restoreWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestore( + public PollerFlux, Void> beginRestoreAsync( String resourceGroupName, String name, String backupId, RestoreRequestInner request) { Mono>> mono = restoreWithResponseAsync(resourceGroupName, name, backupId, request); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); @@ -9417,13 +8923,50 @@ public PollerFlux, Void> beginRestore( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestore( + public PollerFlux, Void> beginRestoreAsync( String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { Mono>> mono = restoreWithResponseAsync(resourceGroupName, name, backupId, request, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores a specific backup to another app (or deployment slot, if specified). + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param request Description of a restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestore( + String resourceGroupName, String name, String backupId, RestoreRequestInner request) { + return beginRestoreAsync(resourceGroupName, name, backupId, request).getSyncPoller(); + } + + /** + * Description for Restores a specific backup to another app (or deployment slot, if specified). + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param request Description of a restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestore( + String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { + return beginRestoreAsync(resourceGroupName, name, backupId, request, context).getSyncPoller(); + } + /** * Description for Restores a specific backup to another app (or deployment slot, if specified). * @@ -9439,12 +8982,9 @@ public PollerFlux, Void> beginRestore( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreAsync( String resourceGroupName, String name, String backupId, RestoreRequestInner request) { - Mono>> mono = restoreWithResponseAsync(resourceGroupName, name, backupId, request); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreAsync(resourceGroupName, name, backupId, request) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -9463,13 +9003,9 @@ public Mono restoreAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreAsync( String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { - Mono>> mono = - restoreWithResponseAsync(resourceGroupName, name, backupId, request, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreAsync(resourceGroupName, name, backupId, request, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -9585,6 +9121,7 @@ public void restore( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBasicPublishingCredentialsPolicies( this.client.getEndpoint(), @@ -9756,6 +9293,7 @@ public Mono> getFtpAllowed new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getFtpAllowed( this.client.getEndpoint(), @@ -9949,6 +9487,7 @@ public Mono> updateFtpAllo } else { csmPublishingAccessPoliciesEntity.validate(); } + context = this.client.mergeContext(context); return service .updateFtpAllowed( this.client.getEndpoint(), @@ -10135,6 +9674,7 @@ public Mono> getScmAllowed new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getScmAllowed( this.client.getEndpoint(), @@ -10328,6 +9868,7 @@ public Mono> updateScmAllo } else { csmPublishingAccessPoliciesEntity.validate(); } + context = this.client.mergeContext(context); return service .updateScmAllowed( this.client.getEndpoint(), @@ -10523,6 +10064,7 @@ public Mono> listConfigurationsSinglePage new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurations( this.client.getEndpoint(), @@ -10702,6 +10244,7 @@ public Mono> updateApplicationSettingsWithRespon } else { appSettings.validate(); } + context = this.client.mergeContext(context); return service .updateApplicationSettings( this.client.getEndpoint(), @@ -10878,6 +10421,7 @@ public Mono> listApplicationSettingsWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listApplicationSettings( this.client.getEndpoint(), @@ -11061,6 +10605,7 @@ public Mono> updateAuthSettingsWithResponseAsync } else { siteAuthSettings.validate(); } + context = this.client.mergeContext(context); return service .updateAuthSettings( this.client.getEndpoint(), @@ -11237,6 +10782,7 @@ public Mono> getAuthSettingsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAuthSettings( this.client.getEndpoint(), @@ -11422,6 +10968,7 @@ public Mono> updateAzureSt } else { azureStorageAccounts.validate(); } + context = this.client.mergeContext(context); return service .updateAzureStorageAccounts( this.client.getEndpoint(), @@ -11604,6 +11151,7 @@ public Mono> listAzureStor new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAzureStorageAccounts( this.client.getEndpoint(), @@ -11787,6 +11335,7 @@ public Mono> updateBackupConfigurationWithResponseA } else { request.validate(); } + context = this.client.mergeContext(context); return service .updateBackupConfiguration( this.client.getEndpoint(), @@ -11962,6 +11511,7 @@ public Mono> deleteBackupConfigurationWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteBackupConfiguration( this.client.getEndpoint(), @@ -12113,6 +11663,7 @@ public Mono> getBackupConfigurationWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBackupConfiguration( this.client.getEndpoint(), @@ -12281,6 +11832,7 @@ public Mono> getAppSettingsKeyVaultRe new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAppSettingsKeyVaultReferences( this.client.getEndpoint(), @@ -12460,6 +12012,7 @@ public Mono> getAppSettingKeyVaultRefer new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAppSettingKeyVaultReference( this.client.getEndpoint(), @@ -12651,6 +12204,7 @@ public Mono> updateConnectionStringsWi } else { connectionStrings.validate(); } + context = this.client.mergeContext(context); return service .updateConnectionStrings( this.client.getEndpoint(), @@ -12827,6 +12381,7 @@ public Mono> listConnectionStringsWith new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConnectionStrings( this.client.getEndpoint(), @@ -12996,6 +12551,7 @@ public Mono> getDiagnosticLogsConfigurationWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDiagnosticLogsConfiguration( this.client.getEndpoint(), @@ -13177,6 +12733,7 @@ public Mono> updateDiagnosticLogsConfigWithRespons } else { siteLogsConfig.validate(); } + context = this.client.mergeContext(context); return service .updateDiagnosticLogsConfig( this.client.getEndpoint(), @@ -13366,6 +12923,7 @@ public Mono> updateMetadataWithResponseAsync( } else { metadata.validate(); } + context = this.client.mergeContext(context); return service .updateMetadata( this.client.getEndpoint(), @@ -13540,6 +13098,7 @@ public Mono> listMetadataWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMetadata( this.client.getEndpoint(), @@ -13707,6 +13266,7 @@ public Mono>> listPublishingCredentialsWithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPublishingCredentials( this.client.getEndpoint(), @@ -13728,7 +13288,7 @@ public Mono>> listPublishingCredentialsWithResponseAsy * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, UserInner> beginListPublishingCredentials( + public PollerFlux, UserInner> beginListPublishingCredentialsAsync( String resourceGroupName, String name) { Mono>> mono = listPublishingCredentialsWithResponseAsync(resourceGroupName, name); return this @@ -13749,7 +13309,7 @@ public PollerFlux, UserInner> beginListPublishingCredentia * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, UserInner> beginListPublishingCredentials( + public PollerFlux, UserInner> beginListPublishingCredentialsAsync( String resourceGroupName, String name, Context context) { Mono>> mono = listPublishingCredentialsWithResponseAsync(resourceGroupName, name, context); @@ -13759,6 +13319,39 @@ public PollerFlux, UserInner> beginListPublishingCredentia mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class); } + /** + * Description for Gets the Git/FTP publishing credentials of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user credentials used for publishing activity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, UserInner> beginListPublishingCredentials( + String resourceGroupName, String name) { + return beginListPublishingCredentialsAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Description for Gets the Git/FTP publishing credentials of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return user credentials used for publishing activity. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, UserInner> beginListPublishingCredentials( + String resourceGroupName, String name, Context context) { + return beginListPublishingCredentialsAsync(resourceGroupName, name, context).getSyncPoller(); + } + /** * Description for Gets the Git/FTP publishing credentials of an app. * @@ -13771,13 +13364,9 @@ public PollerFlux, UserInner> beginListPublishingCredentia */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono listPublishingCredentialsAsync(String resourceGroupName, String name) { - Mono>> mono = listPublishingCredentialsWithResponseAsync(resourceGroupName, name); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class) + return beginListPublishingCredentialsAsync(resourceGroupName, name) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -13793,14 +13382,9 @@ public Mono listPublishingCredentialsAsync(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono listPublishingCredentialsAsync(String resourceGroupName, String name, Context context) { - Mono>> mono = - listPublishingCredentialsWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class) + return beginListPublishingCredentialsAsync(resourceGroupName, name, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -13926,6 +13510,7 @@ public Mono> updateSitePushSettingsWithResponseAsync } else { pushSettings.validate(); } + context = this.client.mergeContext(context); return service .updateSitePushSettings( this.client.getEndpoint(), @@ -14102,6 +13687,7 @@ public Mono> listSitePushSettingsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSitePushSettings( this.client.getEndpoint(), @@ -14269,6 +13855,7 @@ public Mono> listSlotConfigurationNamesWi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSlotConfigurationNames( this.client.getEndpoint(), @@ -14455,6 +14042,7 @@ public Mono> updateSlotConfigurationNames } else { slotConfigNames.validate(); } + context = this.client.mergeContext(context); return service .updateSlotConfigurationNames( this.client.getEndpoint(), @@ -14637,6 +14225,7 @@ public Mono> getConfigurationWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getConfiguration( this.client.getEndpoint(), @@ -14821,6 +14410,7 @@ public Mono> createOrUpdateConfigurationWithRe } else { siteConfig.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateConfiguration( this.client.getEndpoint(), @@ -15010,6 +14600,7 @@ public Mono> updateConfigurationWithResponseAs } else { siteConfig.validate(); } + context = this.client.mergeContext(context); return service .updateConfiguration( this.client.getEndpoint(), @@ -15197,6 +14788,7 @@ public Mono> listConfiguration new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationSnapshotInfo( this.client.getEndpoint(), @@ -15378,6 +14970,7 @@ public Mono> getConfigurationSnapshotWithRespo new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getConfigurationSnapshot( this.client.getEndpoint(), @@ -15562,6 +15155,7 @@ public Mono> recoverSiteConfigurationSnapshotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .recoverSiteConfigurationSnapshot( this.client.getEndpoint(), @@ -15719,6 +15313,7 @@ public Mono getWebSiteContainerLogsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getWebSiteContainerLogs( this.client.getEndpoint(), @@ -15773,11 +15368,24 @@ public Flux getWebSiteContainerLogsAsync(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getWebSiteContainerLogs(String resourceGroupName, String name) { - return getWebSiteContainerLogsAsync(resourceGroupName, name) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getWebSiteContainerLogsAsync(resourceGroupName, name) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -15793,11 +15401,24 @@ public InputStream getWebSiteContainerLogs(String resourceGroupName, String name */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getWebSiteContainerLogs(String resourceGroupName, String name, Context context) { - return getWebSiteContainerLogsAsync(resourceGroupName, name, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getWebSiteContainerLogsAsync(resourceGroupName, name, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -15878,6 +15499,7 @@ public Mono getContainerLogsZipWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getContainerLogsZip( this.client.getEndpoint(), @@ -15932,11 +15554,24 @@ public Flux getContainerLogsZipAsync(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getContainerLogsZip(String resourceGroupName, String name) { - return getContainerLogsZipAsync(resourceGroupName, name) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getContainerLogsZipAsync(resourceGroupName, name) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -15952,11 +15587,24 @@ public InputStream getContainerLogsZip(String resourceGroupName, String name) { */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getContainerLogsZip(String resourceGroupName, String name, Context context) { - return getContainerLogsZipAsync(resourceGroupName, name, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getContainerLogsZipAsync(resourceGroupName, name, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -16047,6 +15695,7 @@ public Mono> listContinuousWebJobsSinglePag new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listContinuousWebJobs( this.client.getEndpoint(), @@ -16222,6 +15871,7 @@ public Mono> getContinuousWebJobWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getContinuousWebJob( this.client.getEndpoint(), @@ -16406,6 +16056,7 @@ public Mono> deleteContinuousWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteContinuousWebJob( this.client.getEndpoint(), @@ -16572,6 +16223,7 @@ public Mono> startContinuousWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startContinuousWebJob( this.client.getEndpoint(), @@ -16738,6 +16390,7 @@ public Mono> stopContinuousWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopContinuousWebJob( this.client.getEndpoint(), @@ -16903,6 +16556,7 @@ public Mono> listDeploymentsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDeployments( this.client.getEndpoint(), @@ -17076,6 +16730,7 @@ public Mono> getDeploymentWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDeployment( this.client.getEndpoint(), @@ -17270,6 +16925,7 @@ public Mono> createDeploymentWithResponseAsync( } else { deployment.validate(); } + context = this.client.mergeContext(context); return service .createDeployment( this.client.getEndpoint(), @@ -17459,6 +17115,7 @@ public Mono> deleteDeploymentWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteDeployment( this.client.getEndpoint(), @@ -17626,6 +17283,7 @@ public Mono> listDeploymentLogWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDeploymentLog( this.client.getEndpoint(), @@ -17818,6 +17476,7 @@ public Mono> discoverBackupWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .discoverBackup( this.client.getEndpoint(), @@ -18006,6 +17665,7 @@ public Mono> listDomainOwnershipIdentifiersSingle new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDomainOwnershipIdentifiers( this.client.getEndpoint(), @@ -18187,6 +17847,7 @@ public Mono> getDomainOwnershipIdentifierWithResponseA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDomainOwnershipIdentifier( this.client.getEndpoint(), @@ -18406,6 +18067,7 @@ public Mono> createOrUpdateDomainOwnershipIdentifierWi } else { domainOwnershipIdentifier.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateDomainOwnershipIdentifier( this.client.getEndpoint(), @@ -18622,6 +18284,7 @@ public Mono> deleteDomainOwnershipIdentifierWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteDomainOwnershipIdentifier( this.client.getEndpoint(), @@ -18824,6 +18487,7 @@ public Mono> updateDomainOwnershipIdentifierWithRespon } else { domainOwnershipIdentifier.validate(); } + context = this.client.mergeContext(context); return service .updateDomainOwnershipIdentifier( this.client.getEndpoint(), @@ -19025,6 +18689,7 @@ public Mono> getMSDeployStatusWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getMSDeployStatus( this.client.getEndpoint(), @@ -19205,6 +18870,7 @@ public Mono>> createMSDeployOperationWithResponseAsync } else { mSDeploy.validate(); } + context = this.client.mergeContext(context); return service .createMSDeployOperation( this.client.getEndpoint(), @@ -19228,7 +18894,7 @@ public Mono>> createMSDeployOperationWithResponseAsync * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperation( + public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationAsync( String resourceGroupName, String name, MSDeploy mSDeploy) { Mono>> mono = createMSDeployOperationWithResponseAsync(resourceGroupName, name, mSDeploy); @@ -19251,7 +18917,7 @@ public PollerFlux, MSDeployStatusInner> beginCre * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperation( + public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationAsync( String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { Mono>> mono = createMSDeployOperationWithResponseAsync(resourceGroupName, name, mSDeploy, context); @@ -19261,6 +18927,41 @@ public PollerFlux, MSDeployStatusInner> beginCre mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class); } + /** + * Description for Invoke the MSDeploy web app extension. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param mSDeploy MSDeploy ARM PUT information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperation( + String resourceGroupName, String name, MSDeploy mSDeploy) { + return beginCreateMSDeployOperationAsync(resourceGroupName, name, mSDeploy).getSyncPoller(); + } + + /** + * Description for Invoke the MSDeploy web app extension. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param mSDeploy MSDeploy ARM PUT information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperation( + String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { + return beginCreateMSDeployOperationAsync(resourceGroupName, name, mSDeploy, context).getSyncPoller(); + } + /** * Description for Invoke the MSDeploy web app extension. * @@ -19275,14 +18976,9 @@ public PollerFlux, MSDeployStatusInner> beginCre @ServiceMethod(returns = ReturnType.SINGLE) public Mono createMSDeployOperationAsync( String resourceGroupName, String name, MSDeploy mSDeploy) { - Mono>> mono = - createMSDeployOperationWithResponseAsync(resourceGroupName, name, mSDeploy); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) + return beginCreateMSDeployOperationAsync(resourceGroupName, name, mSDeploy) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -19300,14 +18996,9 @@ public Mono createMSDeployOperationAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createMSDeployOperationAsync( String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { - Mono>> mono = - createMSDeployOperationWithResponseAsync(resourceGroupName, name, mSDeploy, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) + return beginCreateMSDeployOperationAsync(resourceGroupName, name, mSDeploy, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -19422,6 +19113,7 @@ public Mono> getMSDeployLogWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getMSDeployLog( this.client.getEndpoint(), @@ -19598,6 +19290,7 @@ public Mono> listFunctionsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listFunctions( this.client.getEndpoint(), @@ -19761,6 +19454,7 @@ public Mono> getFunctionsAdminTokenWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getFunctionsAdminToken( this.client.getEndpoint(), @@ -19937,6 +19631,7 @@ public Mono> getFunctionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getFunction( this.client.getEndpoint(), @@ -20139,6 +19834,7 @@ public Mono>> createFunctionWithResponseAsync( } else { functionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createFunction( this.client.getEndpoint(), @@ -20164,7 +19860,7 @@ public Mono>> createFunctionWithResponseAsync( * @return function information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, FunctionEnvelopeInner> beginCreateFunction( + public PollerFlux, FunctionEnvelopeInner> beginCreateFunctionAsync( String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { Mono>> mono = createFunctionWithResponseAsync(resourceGroupName, name, functionName, functionEnvelope); @@ -20188,7 +19884,7 @@ public PollerFlux, FunctionEnvelopeInner> begi * @return function information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, FunctionEnvelopeInner> beginCreateFunction( + public PollerFlux, FunctionEnvelopeInner> beginCreateFunctionAsync( String resourceGroupName, String name, String functionName, @@ -20202,6 +19898,48 @@ public PollerFlux, FunctionEnvelopeInner> begi mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class); } + /** + * Description for Create function for web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param functionEnvelope Function information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return function information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FunctionEnvelopeInner> beginCreateFunction( + String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { + return beginCreateFunctionAsync(resourceGroupName, name, functionName, functionEnvelope).getSyncPoller(); + } + + /** + * Description for Create function for web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param functionEnvelope Function information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return function information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FunctionEnvelopeInner> beginCreateFunction( + String resourceGroupName, + String name, + String functionName, + FunctionEnvelopeInner functionEnvelope, + Context context) { + return beginCreateFunctionAsync(resourceGroupName, name, functionName, functionEnvelope, context) + .getSyncPoller(); + } + /** * Description for Create function for web site, or a deployment slot. * @@ -20217,14 +19955,9 @@ public PollerFlux, FunctionEnvelopeInner> begi @ServiceMethod(returns = ReturnType.SINGLE) public Mono createFunctionAsync( String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { - Mono>> mono = - createFunctionWithResponseAsync(resourceGroupName, name, functionName, functionEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class) + return beginCreateFunctionAsync(resourceGroupName, name, functionName, functionEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -20247,14 +19980,9 @@ public Mono createFunctionAsync( String functionName, FunctionEnvelopeInner functionEnvelope, Context context) { - Mono>> mono = - createFunctionWithResponseAsync(resourceGroupName, name, functionName, functionEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class) + return beginCreateFunctionAsync(resourceGroupName, name, functionName, functionEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -20386,6 +20114,7 @@ public Mono> deleteFunctionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteFunction( this.client.getEndpoint(), @@ -20573,6 +20302,7 @@ public Mono> createOrUpdateFunctionSecretWithResponseAsyn } else { key.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateFunctionSecret( this.client.getEndpoint(), @@ -20778,6 +20508,7 @@ public Mono> deleteFunctionSecretWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteFunctionSecret( this.client.getEndpoint(), @@ -20951,6 +20682,7 @@ public Mono> listFunctionKeysWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listFunctionKeys( this.client.getEndpoint(), @@ -21135,6 +20867,7 @@ public Mono> listFunctionSecretsWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listFunctionSecrets( this.client.getEndpoint(), @@ -21309,6 +21042,7 @@ public Mono> listHostKeysWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostKeys( this.client.getEndpoint(), @@ -21475,6 +21209,7 @@ public Mono> listSyncStatusWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSyncStatus( this.client.getEndpoint(), @@ -21623,6 +21358,7 @@ public Mono> syncFunctionsWithResponseAsync(String resourceGroupN new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .syncFunctions( this.client.getEndpoint(), @@ -21804,6 +21540,7 @@ public Mono> createOrUpdateHostSecretWithResponseAsync( } else { key.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateHostSecret( this.client.getEndpoint(), @@ -22008,6 +21745,7 @@ public Mono> deleteHostSecretWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHostSecret( this.client.getEndpoint(), @@ -22180,6 +21918,7 @@ public Mono> listHostnameBindingsSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostnameBindings( this.client.getEndpoint(), @@ -22355,6 +22094,7 @@ public Mono> getHostnameBindingWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHostnameBinding( this.client.getEndpoint(), @@ -22553,6 +22293,7 @@ public Mono> createOrUpdateHostnameBindingWithRes } else { hostnameBinding.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateHostnameBinding( this.client.getEndpoint(), @@ -22744,6 +22485,7 @@ public Mono> deleteHostnameBindingWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHostnameBinding( this.client.getEndpoint(), @@ -22919,6 +22661,7 @@ public Mono> getHybridConnectionWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHybridConnection( this.client.getEndpoint(), @@ -23142,6 +22885,7 @@ public Mono> createOrUpdateHybridConnectionWithR } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateHybridConnection( this.client.getEndpoint(), @@ -23370,6 +23114,7 @@ public Mono> deleteHybridConnectionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHybridConnection( this.client.getEndpoint(), @@ -23576,6 +23321,7 @@ public Mono> updateHybridConnectionWithResponseA } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateHybridConnection( this.client.getEndpoint(), @@ -23785,6 +23531,7 @@ public Mono> listHybridConnectionsWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHybridConnections( this.client.getEndpoint(), @@ -23953,6 +23700,7 @@ public Mono> listRelayServiceConnect new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRelayServiceConnections( this.client.getEndpoint(), @@ -24132,6 +23880,7 @@ public Mono> getRelayServiceConnecti new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getRelayServiceConnection( this.client.getEndpoint(), @@ -24339,6 +24088,7 @@ public Mono> createOrUpdateRelayServ } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateRelayServiceConnection( this.client.getEndpoint(), @@ -24548,6 +24298,7 @@ public Mono> deleteRelayServiceConnectionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteRelayServiceConnection( this.client.getEndpoint(), @@ -24737,6 +24488,7 @@ public Mono> updateRelayServiceConne } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateRelayServiceConnection( this.client.getEndpoint(), @@ -24943,6 +24695,7 @@ public Mono> listInstanceIdentifiersSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceIdentifiers( this.client.getEndpoint(), @@ -25118,6 +24871,7 @@ public Mono> getInstanceInfoWithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceInfo( this.client.getEndpoint(), @@ -25302,6 +25056,7 @@ public Mono> getInstanceMsDeployStatusWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceMsDeployStatus( this.client.getEndpoint(), @@ -25499,6 +25254,7 @@ public Mono>> createInstanceMSDeployOperationWithRespo } else { mSDeploy.validate(); } + context = this.client.mergeContext(context); return service .createInstanceMSDeployOperation( this.client.getEndpoint(), @@ -25524,7 +25280,7 @@ public Mono>> createInstanceMSDeployOperationWithRespo * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperation( + public PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperationAsync( String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { Mono>> mono = createInstanceMSDeployOperationWithResponseAsync(resourceGroupName, name, instanceId, mSDeploy); @@ -25548,7 +25304,7 @@ public PollerFlux, MSDeployStatusInner> beginCre * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperation( + public PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperationAsync( String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { Mono>> mono = createInstanceMSDeployOperationWithResponseAsync(resourceGroupName, name, instanceId, mSDeploy, context); @@ -25558,6 +25314,44 @@ public PollerFlux, MSDeployStatusInner> beginCre mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class); } + /** + * Description for Invoke the MSDeploy web app extension. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param instanceId ID of web app instance. + * @param mSDeploy MSDeploy ARM PUT information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperation( + String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { + return beginCreateInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy).getSyncPoller(); + } + + /** + * Description for Invoke the MSDeploy web app extension. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param instanceId ID of web app instance. + * @param mSDeploy MSDeploy ARM PUT information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperation( + String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { + return beginCreateInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy, context) + .getSyncPoller(); + } + /** * Description for Invoke the MSDeploy web app extension. * @@ -25573,14 +25367,9 @@ public PollerFlux, MSDeployStatusInner> beginCre @ServiceMethod(returns = ReturnType.SINGLE) public Mono createInstanceMSDeployOperationAsync( String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { - Mono>> mono = - createInstanceMSDeployOperationWithResponseAsync(resourceGroupName, name, instanceId, mSDeploy); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) + return beginCreateInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -25599,14 +25388,9 @@ public Mono createInstanceMSDeployOperationAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createInstanceMSDeployOperationAsync( String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { - Mono>> mono = - createInstanceMSDeployOperationWithResponseAsync(resourceGroupName, name, instanceId, mSDeploy, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) + return beginCreateInstanceMSDeployOperationAsync(resourceGroupName, name, instanceId, mSDeploy, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -25734,6 +25518,7 @@ public Mono> getInstanceMSDeployLogWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceMSDeployLog( this.client.getEndpoint(), @@ -25931,6 +25716,7 @@ public Mono> listInstanceProcessesSinglePageAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcesses( this.client.getEndpoint(), @@ -26132,6 +25918,7 @@ public Mono> getInstanceProcessWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceProcess( this.client.getEndpoint(), @@ -26339,6 +26126,7 @@ public Mono> deleteInstanceProcessWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteInstanceProcess( this.client.getEndpoint(), @@ -26531,6 +26319,7 @@ public Mono getInstanceProcessDumpWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceProcessDump( this.client.getEndpoint(), @@ -26600,11 +26389,24 @@ public Flux getInstanceProcessDumpAsync( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getInstanceProcessDump( String resourceGroupName, String name, String processId, String instanceId) { - return getInstanceProcessDumpAsync(resourceGroupName, name, processId, instanceId) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getInstanceProcessDumpAsync(resourceGroupName, name, processId, instanceId) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -26624,11 +26426,24 @@ public InputStream getInstanceProcessDump( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getInstanceProcessDump( String resourceGroupName, String name, String processId, String instanceId, Context context) { - return getInstanceProcessDumpAsync(resourceGroupName, name, processId, instanceId, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getInstanceProcessDumpAsync(resourceGroupName, name, processId, instanceId, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -26739,6 +26554,7 @@ public Mono> listInstanceProcessModulesSin new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessModules( this.client.getEndpoint(), @@ -26956,6 +26772,7 @@ public Mono> getInstanceProcessModuleWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceProcessModule( this.client.getEndpoint(), @@ -27187,6 +27004,7 @@ public Mono> listInstanceProcessThreadsSin new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessThreads( this.client.getEndpoint(), @@ -27369,6 +27187,7 @@ public Mono> isCloneableWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .isCloneable( this.client.getEndpoint(), @@ -27544,6 +27363,7 @@ public Mono> listSiteBackupsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteBackups( this.client.getEndpoint(), @@ -27708,6 +27528,7 @@ public Mono> listSyncFunctionTriggersWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSyncFunctionTriggers( this.client.getEndpoint(), @@ -27906,6 +27727,7 @@ public Mono>> migrateStorageWithResponseAsync( } else { migrationOptions.validate(); } + context = this.client.mergeContext(context); return service .migrateStorage( this.client.getEndpoint(), @@ -27931,8 +27753,9 @@ public Mono>> migrateStorageWithResponseAsync( * @return response for a migration of app content request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, StorageMigrationResponseInner> beginMigrateStorage( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { + public PollerFlux, StorageMigrationResponseInner> + beginMigrateStorageAsync( + String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { Mono>> mono = migrateStorageWithResponseAsync(subscriptionName, resourceGroupName, name, migrationOptions); return this @@ -27958,12 +27781,13 @@ public PollerFlux, StorageMigrationRes * @return response for a migration of app content request. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, StorageMigrationResponseInner> beginMigrateStorage( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context) { + public PollerFlux, StorageMigrationResponseInner> + beginMigrateStorageAsync( + String subscriptionName, + String resourceGroupName, + String name, + StorageMigrationOptions migrationOptions, + Context context) { Mono>> mono = migrateStorageWithResponseAsync(subscriptionName, resourceGroupName, name, migrationOptions, context); return this @@ -27975,6 +27799,48 @@ public PollerFlux, StorageMigrationRes StorageMigrationResponseInner.class); } + /** + * Description for Restores a web app. + * + * @param subscriptionName Azure subscription. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param migrationOptions Options for app content migration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for a migration of app content request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageMigrationResponseInner> beginMigrateStorage( + String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { + return beginMigrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions).getSyncPoller(); + } + + /** + * Description for Restores a web app. + * + * @param subscriptionName Azure subscription. + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param migrationOptions Options for app content migration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for a migration of app content request. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, StorageMigrationResponseInner> beginMigrateStorage( + String subscriptionName, + String resourceGroupName, + String name, + StorageMigrationOptions migrationOptions, + Context context) { + return beginMigrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions, context) + .getSyncPoller(); + } + /** * Description for Restores a web app. * @@ -27990,17 +27856,9 @@ public PollerFlux, StorageMigrationRes @ServiceMethod(returns = ReturnType.SINGLE) public Mono migrateStorageAsync( String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { - Mono>> mono = - migrateStorageWithResponseAsync(subscriptionName, resourceGroupName, name, migrationOptions); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - StorageMigrationResponseInner.class, - StorageMigrationResponseInner.class) + return beginMigrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -28023,17 +27881,9 @@ public Mono migrateStorageAsync( String name, StorageMigrationOptions migrationOptions, Context context) { - Mono>> mono = - migrateStorageWithResponseAsync(subscriptionName, resourceGroupName, name, migrationOptions, context); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - StorageMigrationResponseInner.class, - StorageMigrationResponseInner.class) + return beginMigrateStorageAsync(subscriptionName, resourceGroupName, name, migrationOptions, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -28173,6 +28023,7 @@ public Mono>> migrateMySqlWithResponseAsync( } else { migrationRequestEnvelope.validate(); } + context = this.client.mergeContext(context); return service .migrateMySql( this.client.getEndpoint(), @@ -28196,7 +28047,7 @@ public Mono>> migrateMySqlWithResponseAsync( * @return an operation on a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, OperationInner> beginMigrateMySql( + public PollerFlux, OperationInner> beginMigrateMySqlAsync( String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { Mono>> mono = migrateMySqlWithResponseAsync(resourceGroupName, name, migrationRequestEnvelope); @@ -28219,7 +28070,7 @@ public PollerFlux, OperationInner> beginMigrateMySql( * @return an operation on a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, OperationInner> beginMigrateMySql( + public PollerFlux, OperationInner> beginMigrateMySqlAsync( String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { Mono>> mono = migrateMySqlWithResponseAsync(resourceGroupName, name, migrationRequestEnvelope, context); @@ -28229,6 +28080,41 @@ public PollerFlux, OperationInner> beginMigrateMySql( mono, this.client.getHttpPipeline(), OperationInner.class, OperationInner.class); } + /** + * Description for Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param migrationRequestEnvelope MySQL migration request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an operation on a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationInner> beginMigrateMySql( + String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { + return beginMigrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope).getSyncPoller(); + } + + /** + * Description for Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param migrationRequestEnvelope MySQL migration request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an operation on a resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, OperationInner> beginMigrateMySql( + String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { + return beginMigrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope, context).getSyncPoller(); + } + /** * Description for Migrates a local (in-app) MySql database to a remote MySql database. * @@ -28243,14 +28129,9 @@ public PollerFlux, OperationInner> beginMigrateMySql( @ServiceMethod(returns = ReturnType.SINGLE) public Mono migrateMySqlAsync( String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { - Mono>> mono = - migrateMySqlWithResponseAsync(resourceGroupName, name, migrationRequestEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), OperationInner.class, OperationInner.class) + return beginMigrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -28268,14 +28149,9 @@ public Mono migrateMySqlAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono migrateMySqlAsync( String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { - Mono>> mono = - migrateMySqlWithResponseAsync(resourceGroupName, name, migrationRequestEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), OperationInner.class, OperationInner.class) + return beginMigrateMySqlAsync(resourceGroupName, name, migrationRequestEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -28394,6 +28270,7 @@ public Mono> getMigrateMySqlStatusWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getMigrateMySqlStatus( this.client.getEndpoint(), @@ -28566,6 +28443,7 @@ public Mono> getSwiftVirtualNetworkConnection new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSwiftVirtualNetworkConnection( this.client.getEndpoint(), @@ -28756,6 +28634,7 @@ public Mono> createOrUpdateSwiftVirtualNetwor } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateSwiftVirtualNetworkConnection( this.client.getEndpoint(), @@ -28945,6 +28824,7 @@ public Mono> deleteSwiftVirtualNetworkWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSwiftVirtualNetwork( this.client.getEndpoint(), @@ -29117,6 +28997,7 @@ public Mono> updateSwiftVirtualNetworkConnect } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateSwiftVirtualNetworkConnection( this.client.getEndpoint(), @@ -29315,6 +29196,7 @@ public Mono> listNetworkFeaturesWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNetworkFeatures( this.client.getEndpoint(), @@ -29498,6 +29380,7 @@ public Mono> getNetworkTraceOperationWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTraceOperation( this.client.getEndpoint(), @@ -29685,6 +29568,7 @@ public Mono> startWebSiteNetworkTraceWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startWebSiteNetworkTrace( this.client.getEndpoint(), @@ -29948,6 +29832,7 @@ public Mono>> startWebSiteNetworkTraceOperationWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startWebSiteNetworkTraceOperation( this.client.getEndpoint(), @@ -29975,7 +29860,7 @@ public Mono>> startWebSiteNetworkTraceOperationWithRes * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartWebSiteNetworkTraceOperation( + public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationAsync( String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { Mono>> mono = startWebSiteNetworkTraceOperationWithResponseAsync( @@ -30000,7 +29885,7 @@ public PollerFlux, Object> beginStartWebSiteNetworkTraceOpera * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartWebSiteNetworkTraceOperation( + public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationAsync( String resourceGroupName, String name, Integer durationInSeconds, @@ -30015,6 +29900,54 @@ public PollerFlux, Object> beginStartWebSiteNetworkTraceOpera .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class); } + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartWebSiteNetworkTraceOperation( + String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { + return beginStartWebSiteNetworkTraceOperationAsync( + resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) + .getSyncPoller(); + } + + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartWebSiteNetworkTraceOperation( + String resourceGroupName, + String name, + Integer durationInSeconds, + Integer maxFrameLength, + String sasUrl, + Context context) { + return beginStartWebSiteNetworkTraceOperationAsync( + resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) + .getSyncPoller(); + } + /** * Description for Start capturing network packets for the site. * @@ -30031,14 +29964,10 @@ public PollerFlux, Object> beginStartWebSiteNetworkTraceOpera @ServiceMethod(returns = ReturnType.SINGLE) public Mono startWebSiteNetworkTraceOperationAsync( String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - Mono>> mono = - startWebSiteNetworkTraceOperationWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartWebSiteNetworkTraceOperationAsync( + resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -30063,14 +29992,10 @@ public Mono startWebSiteNetworkTraceOperationAsync( Integer maxFrameLength, String sasUrl, Context context) { - Mono>> mono = - startWebSiteNetworkTraceOperationWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartWebSiteNetworkTraceOperationAsync( + resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -30089,14 +30014,10 @@ public Mono startWebSiteNetworkTraceOperationAsync(String resourceGroupN final Integer maxFrameLength = null; final String sasUrl = null; final Context context = null; - Mono>> mono = - startWebSiteNetworkTraceOperationWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartWebSiteNetworkTraceOperationAsync( + resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -30246,6 +30167,7 @@ public Mono> stopWebSiteNetworkTraceWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopWebSiteNetworkTrace( this.client.getEndpoint(), @@ -30406,6 +30328,7 @@ public Mono>> getNetworkTracesWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTraces( this.client.getEndpoint(), @@ -30590,6 +30513,7 @@ public Mono> getNetworkTraceOperationV2WithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTraceOperationV2( this.client.getEndpoint(), @@ -30773,6 +30697,7 @@ public Mono>> getNetworkTracesV2WithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTracesV2( this.client.getEndpoint(), @@ -30948,6 +30873,7 @@ public Mono> generateNewSitePublishingPasswordWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .generateNewSitePublishingPassword( this.client.getEndpoint(), @@ -31115,6 +31041,7 @@ public Mono> listPerfMonCountersSinglePageAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPerfMonCounters( this.client.getEndpoint(), @@ -31332,6 +31259,7 @@ public Mono> getSitePhpErrorLogFlagWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSitePhpErrorLogFlag( this.client.getEndpoint(), @@ -31499,6 +31427,7 @@ public Mono> listPremierAddOnsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPremierAddOns( this.client.getEndpoint(), @@ -31677,6 +31606,7 @@ public Mono> getPremierAddOnWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPremierAddOn( this.client.getEndpoint(), @@ -31880,6 +31810,7 @@ public Mono> addPremierAddOnWithResponseAsync( } else { premierAddOn.validate(); } + context = this.client.mergeContext(context); return service .addPremierAddOn( this.client.getEndpoint(), @@ -32080,6 +32011,7 @@ public Mono> deletePremierAddOnWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deletePremierAddOn( this.client.getEndpoint(), @@ -32265,6 +32197,7 @@ public Mono> updatePremierAddOnWithResponseAsync( } else { premierAddOn.validate(); } + context = this.client.mergeContext(context); return service .updatePremierAddOn( this.client.getEndpoint(), @@ -32455,6 +32388,7 @@ public Mono> getPrivateAccessWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPrivateAccess( this.client.getEndpoint(), @@ -32641,6 +32575,7 @@ public Mono> putPrivateAccessVnetWithResponseAsync( } else { access.validate(); } + context = this.client.mergeContext(context); return service .putPrivateAccessVnet( this.client.getEndpoint(), @@ -32830,6 +32765,7 @@ public Mono> listProcessesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcesses( this.client.getEndpoint(), @@ -33007,6 +32943,7 @@ public Mono> getProcessWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getProcess( this.client.getEndpoint(), @@ -33191,6 +33128,7 @@ public Mono> deleteProcessWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteProcess( this.client.getEndpoint(), @@ -33360,6 +33298,7 @@ public Mono getProcessDumpWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getProcessDump( this.client.getEndpoint(), @@ -33420,11 +33359,24 @@ public Flux getProcessDumpAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getProcessDump(String resourceGroupName, String name, String processId) { - return getProcessDumpAsync(resourceGroupName, name, processId) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getProcessDumpAsync(resourceGroupName, name, processId) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -33441,11 +33393,24 @@ public InputStream getProcessDump(String resourceGroupName, String name, String */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getProcessDump(String resourceGroupName, String name, String processId, Context context) { - return getProcessDumpAsync(resourceGroupName, name, processId, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getProcessDumpAsync(resourceGroupName, name, processId, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -33545,6 +33510,7 @@ public Mono> listProcessModulesSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessModules( this.client.getEndpoint(), @@ -33736,6 +33702,7 @@ public Mono> getProcessModuleWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getProcessModule( this.client.getEndpoint(), @@ -33935,6 +33902,7 @@ public Mono> listProcessThreadsSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessThreads( this.client.getEndpoint(), @@ -34117,6 +34085,7 @@ public Mono> listPublicCertificatesSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPublicCertificates( this.client.getEndpoint(), @@ -34294,6 +34263,7 @@ public Mono> getPublicCertificateWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPublicCertificate( this.client.getEndpoint(), @@ -34500,6 +34470,7 @@ public Mono> createOrUpdatePublicCertificateWit } else { publicCertificate.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdatePublicCertificate( this.client.getEndpoint(), @@ -34705,6 +34676,7 @@ public Mono> deletePublicCertificateWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deletePublicCertificate( this.client.getEndpoint(), @@ -34881,6 +34853,7 @@ public Mono listPublishingProfileXmlWithSecretsWithResponseAsync } else { publishingProfileOptions.validate(); } + context = this.client.mergeContext(context); return service .listPublishingProfileXmlWithSecrets( this.client.getEndpoint(), @@ -34944,11 +34917,24 @@ public Flux listPublishingProfileXmlWithSecretsAsync( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream listPublishingProfileXmlWithSecrets( String resourceGroupName, String name, CsmPublishingProfileOptions publishingProfileOptions) { - return listPublishingProfileXmlWithSecretsAsync(resourceGroupName, name, publishingProfileOptions) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + listPublishingProfileXmlWithSecretsAsync(resourceGroupName, name, publishingProfileOptions) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -34966,11 +34952,24 @@ public InputStream listPublishingProfileXmlWithSecrets( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream listPublishingProfileXmlWithSecrets( String resourceGroupName, String name, CsmPublishingProfileOptions publishingProfileOptions, Context context) { - return listPublishingProfileXmlWithSecretsAsync(resourceGroupName, name, publishingProfileOptions, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + listPublishingProfileXmlWithSecretsAsync(resourceGroupName, name, publishingProfileOptions, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -35053,6 +35052,7 @@ public Mono> resetProductionSlotConfigWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .resetProductionSlotConfig( this.client.getEndpoint(), @@ -35218,6 +35218,7 @@ public Mono> restartWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .restart( this.client.getEndpoint(), @@ -35438,6 +35439,7 @@ public Mono>> restoreFromBackupBlobWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .restoreFromBackupBlob( this.client.getEndpoint(), @@ -35461,7 +35463,7 @@ public Mono>> restoreFromBackupBlobWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromBackupBlob( + public PollerFlux, Void> beginRestoreFromBackupBlobAsync( String resourceGroupName, String name, RestoreRequestInner request) { Mono>> mono = restoreFromBackupBlobWithResponseAsync(resourceGroupName, name, request); @@ -35481,7 +35483,7 @@ public PollerFlux, Void> beginRestoreFromBackupBlob( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromBackupBlob( + public PollerFlux, Void> beginRestoreFromBackupBlobAsync( String resourceGroupName, String name, RestoreRequestInner request, Context context) { Mono>> mono = restoreFromBackupBlobWithResponseAsync(resourceGroupName, name, request, context); @@ -35500,14 +35502,9 @@ public PollerFlux, Void> beginRestoreFromBackupBlob( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreFromBackupBlobAsync(String resourceGroupName, String name, RestoreRequestInner request) { - Mono>> mono = - restoreFromBackupBlobWithResponseAsync(resourceGroupName, name, request); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(client::getLroFinalResultOrError); + public SyncPoller, Void> beginRestoreFromBackupBlob( + String resourceGroupName, String name, RestoreRequestInner request) { + return beginRestoreFromBackupBlobAsync(resourceGroupName, name, request).getSyncPoller(); } /** @@ -35523,15 +35520,9 @@ public Mono restoreFromBackupBlobAsync(String resourceGroupName, String na * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono restoreFromBackupBlobAsync( + public SyncPoller, Void> beginRestoreFromBackupBlob( String resourceGroupName, String name, RestoreRequestInner request, Context context) { - Mono>> mono = - restoreFromBackupBlobWithResponseAsync(resourceGroupName, name, request, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) - .last() - .flatMap(client::getLroFinalResultOrError); + return beginRestoreFromBackupBlobAsync(resourceGroupName, name, request, context).getSyncPoller(); } /** @@ -35543,10 +35534,13 @@ public Mono restoreFromBackupBlobAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException 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 void restoreFromBackupBlob(String resourceGroupName, String name, RestoreRequestInner request) { - restoreFromBackupBlobAsync(resourceGroupName, name, request).block(); + public Mono restoreFromBackupBlobAsync(String resourceGroupName, String name, RestoreRequestInner request) { + return beginRestoreFromBackupBlobAsync(resourceGroupName, name, request) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -35559,64 +35553,46 @@ public void restoreFromBackupBlob(String resourceGroupName, String name, Restore * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException 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 void restoreFromBackupBlob( + public Mono restoreFromBackupBlobAsync( String resourceGroupName, String name, RestoreRequestInner request, Context context) { - restoreFromBackupBlobAsync(resourceGroupName, name, request, context).block(); + return beginRestoreFromBackupBlobAsync(resourceGroupName, name, request, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Description for Restores a deleted web app to this web app. + * Description for Restores an app from a backup blob in Azure Storage. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. + * @param name Name of the app. + * @param request Description of a restore request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException 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>> restoreFromDeletedAppWithResponseAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .restoreFromDeletedApp( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public void restoreFromBackupBlob(String resourceGroupName, String name, RestoreRequestInner request) { + restoreFromBackupBlobAsync(resourceGroupName, name, request).block(); + } + + /** + * Description for Restores an app from a backup blob in Azure Storage. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param request Description of a restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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 restoreFromBackupBlob( + String resourceGroupName, String name, RestoreRequestInner request, Context context) { + restoreFromBackupBlobAsync(resourceGroupName, name, request, context).block(); } /** @@ -35625,7 +35601,6 @@ public Mono>> restoreFromDeletedAppWithResponseAsync( * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -35633,7 +35608,7 @@ public Mono>> restoreFromDeletedAppWithResponseAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> restoreFromDeletedAppWithResponseAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { + String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -35658,6 +35633,61 @@ public Mono>> restoreFromDeletedAppWithResponseAsync( } else { restoreRequest.validate(); } + return FluxUtil + .withContext( + context -> + service + .restoreFromDeletedApp( + this.client.getEndpoint(), + resourceGroupName, + name, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + restoreRequest, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Description for Restores a deleted web app to this web app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Details about restoring a deleted app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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>> restoreFromDeletedAppWithResponseAsync( + String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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 (restoreRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); + } else { + restoreRequest.validate(); + } + context = this.client.mergeContext(context); return service .restoreFromDeletedApp( this.client.getEndpoint(), @@ -35681,7 +35711,7 @@ public Mono>> restoreFromDeletedAppWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromDeletedApp( + public PollerFlux, Void> beginRestoreFromDeletedAppAsync( String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { Mono>> mono = restoreFromDeletedAppWithResponseAsync(resourceGroupName, name, restoreRequest); @@ -35701,13 +35731,48 @@ public PollerFlux, Void> beginRestoreFromDeletedApp( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromDeletedApp( + public PollerFlux, Void> beginRestoreFromDeletedAppAsync( String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { Mono>> mono = restoreFromDeletedAppWithResponseAsync(resourceGroupName, name, restoreRequest, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores a deleted web app to this web app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Details about restoring a deleted app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestoreFromDeletedApp( + String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { + return beginRestoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest).getSyncPoller(); + } + + /** + * Description for Restores a deleted web app to this web app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Details about restoring a deleted app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestoreFromDeletedApp( + String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { + return beginRestoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest, context).getSyncPoller(); + } + /** * Description for Restores a deleted web app to this web app. * @@ -35722,13 +35787,9 @@ public PollerFlux, Void> beginRestoreFromDeletedApp( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreFromDeletedAppAsync( String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - Mono>> mono = - restoreFromDeletedAppWithResponseAsync(resourceGroupName, name, restoreRequest); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -35746,13 +35807,9 @@ public Mono restoreFromDeletedAppAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreFromDeletedAppAsync( String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { - Mono>> mono = - restoreFromDeletedAppWithResponseAsync(resourceGroupName, name, restoreRequest, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreFromDeletedAppAsync(resourceGroupName, name, restoreRequest, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -35879,6 +35936,7 @@ public Mono>> restoreSnapshotWithResponseAsync( } else { restoreRequest.validate(); } + context = this.client.mergeContext(context); return service .restoreSnapshot( this.client.getEndpoint(), @@ -35902,7 +35960,7 @@ public Mono>> restoreSnapshotWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSnapshot( + public PollerFlux, Void> beginRestoreSnapshotAsync( String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { Mono>> mono = restoreSnapshotWithResponseAsync(resourceGroupName, name, restoreRequest); @@ -35922,13 +35980,48 @@ public PollerFlux, Void> beginRestoreSnapshot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSnapshot( + public PollerFlux, Void> beginRestoreSnapshotAsync( String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { Mono>> mono = restoreSnapshotWithResponseAsync(resourceGroupName, name, restoreRequest, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores a web app from a snapshot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Details about app recovery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestoreSnapshot( + String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { + return beginRestoreSnapshotAsync(resourceGroupName, name, restoreRequest).getSyncPoller(); + } + + /** + * Description for Restores a web app from a snapshot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param restoreRequest Details about app recovery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestoreSnapshot( + String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { + return beginRestoreSnapshotAsync(resourceGroupName, name, restoreRequest, context).getSyncPoller(); + } + /** * Description for Restores a web app from a snapshot. * @@ -35943,13 +36036,9 @@ public PollerFlux, Void> beginRestoreSnapshot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreSnapshotAsync( String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { - Mono>> mono = - restoreSnapshotWithResponseAsync(resourceGroupName, name, restoreRequest); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreSnapshotAsync(resourceGroupName, name, restoreRequest) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -35967,13 +36056,9 @@ public Mono restoreSnapshotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreSnapshotAsync( String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { - Mono>> mono = - restoreSnapshotWithResponseAsync(resourceGroupName, name, restoreRequest, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreSnapshotAsync(resourceGroupName, name, restoreRequest, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -36096,6 +36181,7 @@ public Mono> listSiteExtensionsSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteExtensions( this.client.getEndpoint(), @@ -36273,6 +36359,7 @@ public Mono> getSiteExtensionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteExtension( this.client.getEndpoint(), @@ -36459,6 +36546,7 @@ public Mono>> installSiteExtensionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .installSiteExtension( this.client.getEndpoint(), @@ -36482,7 +36570,7 @@ public Mono>> installSiteExtensionWithResponseAsync( * @return site Extension Information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtension( + public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionAsync( String resourceGroupName, String name, String siteExtensionId) { Mono>> mono = installSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId); @@ -36505,7 +36593,7 @@ public PollerFlux, SiteExtensionInfoInner> be * @return site Extension Information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtension( + public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionAsync( String resourceGroupName, String name, String siteExtensionId, Context context) { Mono>> mono = installSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId, context); @@ -36515,6 +36603,41 @@ public PollerFlux, SiteExtensionInfoInner> be mono, this.client.getHttpPipeline(), SiteExtensionInfoInner.class, SiteExtensionInfoInner.class); } + /** + * Description for Install site extension on a web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site Extension Information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtension( + String resourceGroupName, String name, String siteExtensionId) { + return beginInstallSiteExtensionAsync(resourceGroupName, name, siteExtensionId).getSyncPoller(); + } + + /** + * Description for Install site extension on a web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site Extension Information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtension( + String resourceGroupName, String name, String siteExtensionId, Context context) { + return beginInstallSiteExtensionAsync(resourceGroupName, name, siteExtensionId, context).getSyncPoller(); + } + /** * Description for Install site extension on a web site, or a deployment slot. * @@ -36529,14 +36652,9 @@ public PollerFlux, SiteExtensionInfoInner> be @ServiceMethod(returns = ReturnType.SINGLE) public Mono installSiteExtensionAsync( String resourceGroupName, String name, String siteExtensionId) { - Mono>> mono = - installSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteExtensionInfoInner.class, SiteExtensionInfoInner.class) + return beginInstallSiteExtensionAsync(resourceGroupName, name, siteExtensionId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -36554,14 +36672,9 @@ public Mono installSiteExtensionAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono installSiteExtensionAsync( String resourceGroupName, String name, String siteExtensionId, Context context) { - Mono>> mono = - installSiteExtensionWithResponseAsync(resourceGroupName, name, siteExtensionId, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteExtensionInfoInner.class, SiteExtensionInfoInner.class) + return beginInstallSiteExtensionAsync(resourceGroupName, name, siteExtensionId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -36688,6 +36801,7 @@ public Mono> deleteSiteExtensionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSiteExtension( this.client.getEndpoint(), @@ -36858,6 +36972,7 @@ public Mono>> copyProductionSlotWithResponseAsync( } else { copySlotEntity.validate(); } + context = this.client.mergeContext(context); return service .copyProductionSlot( this.client.getEndpoint(), @@ -36881,7 +36996,7 @@ public Mono>> copyProductionSlotWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginCopyProductionSlot( + public PollerFlux, Void> beginCopyProductionSlotAsync( String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity) { Mono>> mono = copyProductionSlotWithResponseAsync(resourceGroupName, name, copySlotEntity); @@ -36901,13 +37016,48 @@ public PollerFlux, Void> beginCopyProductionSlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginCopyProductionSlot( + public PollerFlux, Void> beginCopyProductionSlotAsync( String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity, Context context) { Mono>> mono = copyProductionSlotWithResponseAsync(resourceGroupName, name, copySlotEntity, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Copies a deployment slot to another deployment slot of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param copySlotEntity Copy deployment slot parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginCopyProductionSlot( + String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity) { + return beginCopyProductionSlotAsync(resourceGroupName, name, copySlotEntity).getSyncPoller(); + } + + /** + * Description for Copies a deployment slot to another deployment slot of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param copySlotEntity Copy deployment slot parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginCopyProductionSlot( + String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity, Context context) { + return beginCopyProductionSlotAsync(resourceGroupName, name, copySlotEntity, context).getSyncPoller(); + } + /** * Description for Copies a deployment slot to another deployment slot of an app. * @@ -36922,13 +37072,9 @@ public PollerFlux, Void> beginCopyProductionSlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono copyProductionSlotAsync( String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity) { - Mono>> mono = - copyProductionSlotWithResponseAsync(resourceGroupName, name, copySlotEntity); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginCopyProductionSlotAsync(resourceGroupName, name, copySlotEntity) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -36946,13 +37092,9 @@ public Mono copyProductionSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono copyProductionSlotAsync( String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity, Context context) { - Mono>> mono = - copyProductionSlotWithResponseAsync(resourceGroupName, name, copySlotEntity, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginCopyProductionSlotAsync(resourceGroupName, name, copySlotEntity, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -37074,6 +37216,7 @@ public Mono> listSlotsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSlots( this.client.getEndpoint(), @@ -37246,6 +37389,7 @@ public Mono> getSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSlot( this.client.getEndpoint(), @@ -37444,6 +37588,7 @@ public Mono>> createOrUpdateSlotWithResponseAsync( } else { siteEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateSlot( this.client.getEndpoint(), @@ -37471,7 +37616,7 @@ public Mono>> createOrUpdateSlotWithResponseAsync( * @return a web app, a mobile app backend, or an API app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteInner> beginCreateOrUpdateSlot( + public PollerFlux, SiteInner> beginCreateOrUpdateSlotAsync( String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { Mono>> mono = createOrUpdateSlotWithResponseAsync(resourceGroupName, name, slot, siteEnvelope); @@ -37497,7 +37642,7 @@ public PollerFlux, SiteInner> beginCreateOrUpdateSlot( * @return a web app, a mobile app backend, or an API app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteInner> beginCreateOrUpdateSlot( + public PollerFlux, SiteInner> beginCreateOrUpdateSlotAsync( String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { Mono>> mono = createOrUpdateSlotWithResponseAsync(resourceGroupName, name, slot, siteEnvelope, context); @@ -37507,6 +37652,47 @@ public PollerFlux, SiteInner> beginCreateOrUpdateSlot( mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class); } + /** + * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} + * parameter. + * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify + * the production slot. + * @param siteEnvelope A web app, a mobile app backend, or an API app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a web app, a mobile app backend, or an API app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteInner> beginCreateOrUpdateSlot( + String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { + return beginCreateOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope).getSyncPoller(); + } + + /** + * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} + * parameter. + * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify + * the production slot. + * @param siteEnvelope A web app, a mobile app backend, or an API app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a web app, a mobile app backend, or an API app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteInner> beginCreateOrUpdateSlot( + String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { + return beginCreateOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope, context).getSyncPoller(); + } + /** * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. * @@ -37524,14 +37710,9 @@ public PollerFlux, SiteInner> beginCreateOrUpdateSlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateSlotAsync( String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { - Mono>> mono = - createOrUpdateSlotWithResponseAsync(resourceGroupName, name, slot, siteEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class) + return beginCreateOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -37552,14 +37733,9 @@ public Mono createOrUpdateSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateSlotAsync( String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { - Mono>> mono = - createOrUpdateSlotWithResponseAsync(resourceGroupName, name, slot, siteEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteInner.class, SiteInner.class) + return beginCreateOrUpdateSlotAsync(resourceGroupName, name, slot, siteEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -37703,6 +37879,7 @@ public Mono> deleteSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSlot( this.client.getEndpoint(), @@ -37951,6 +38128,7 @@ public Mono> updateSlotWithResponseAsync( } else { siteEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateSlot( this.client.getEndpoint(), @@ -38152,6 +38330,7 @@ public Mono> analyzeCustomHostnameSl new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .analyzeCustomHostnameSlot( this.client.getEndpoint(), @@ -38401,6 +38580,7 @@ public Mono> applySlotConfigurationSlotWithResponseAsync( } else { slotSwapEntity.validate(); } + context = this.client.mergeContext(context); return service .applySlotConfigurationSlot( this.client.getEndpoint(), @@ -38590,6 +38770,7 @@ public Mono> backupSlotWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .backupSlot( this.client.getEndpoint(), @@ -38794,6 +38975,7 @@ public Mono> listBackupsSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBackupsSlot( this.client.getEndpoint(), @@ -38989,6 +39171,7 @@ public Mono> getBackupStatusSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBackupStatusSlot( this.client.getEndpoint(), @@ -39193,6 +39376,7 @@ public Mono> deleteBackupSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteBackupSlot( this.client.getEndpoint(), @@ -39399,6 +39583,7 @@ public Mono> listBackupStatusSecretsSlotWithResponseAs } else { request.validate(); } + context = this.client.mergeContext(context); return service .listBackupStatusSecretsSlot( this.client.getEndpoint(), @@ -39641,6 +39826,7 @@ public Mono>> restoreSlotWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .restoreSlot( this.client.getEndpoint(), @@ -39669,7 +39855,7 @@ public Mono>> restoreSlotWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSlot( + public PollerFlux, Void> beginRestoreSlotAsync( String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { Mono>> mono = restoreSlotWithResponseAsync(resourceGroupName, name, backupId, slot, request); @@ -39692,7 +39878,7 @@ public PollerFlux, Void> beginRestoreSlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSlot( + public PollerFlux, Void> beginRestoreSlotAsync( String resourceGroupName, String name, String backupId, @@ -39704,6 +39890,52 @@ public PollerFlux, Void> beginRestoreSlot( return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores a specific backup to another app (or deployment slot, if specified). + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the + * production slot. + * @param request Description of a restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestoreSlot( + String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { + return beginRestoreSlotAsync(resourceGroupName, name, backupId, slot, request).getSyncPoller(); + } + + /** + * Description for Restores a specific backup to another app (or deployment slot, if specified). + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param backupId ID of the backup. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the + * production slot. + * @param request Description of a restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestoreSlot( + String resourceGroupName, + String name, + String backupId, + String slot, + RestoreRequestInner request, + Context context) { + return beginRestoreSlotAsync(resourceGroupName, name, backupId, slot, request, context).getSyncPoller(); + } + /** * Description for Restores a specific backup to another app (or deployment slot, if specified). * @@ -39721,13 +39953,9 @@ public PollerFlux, Void> beginRestoreSlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreSlotAsync( String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { - Mono>> mono = - restoreSlotWithResponseAsync(resourceGroupName, name, backupId, slot, request); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreSlotAsync(resourceGroupName, name, backupId, slot, request) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -39753,13 +39981,9 @@ public Mono restoreSlotAsync( String slot, RestoreRequestInner request, Context context) { - Mono>> mono = - restoreSlotWithResponseAsync(resourceGroupName, name, backupId, slot, request, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreSlotAsync(resourceGroupName, name, backupId, slot, request, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -39905,6 +40129,7 @@ public Mono> listConfigurationsSlotSingle new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationsSlot( this.client.getEndpoint(), @@ -40106,6 +40331,7 @@ public Mono> updateApplicationSettingsSlotWithRe } else { appSettings.validate(); } + context = this.client.mergeContext(context); return service .updateApplicationSettingsSlot( this.client.getEndpoint(), @@ -40302,6 +40528,7 @@ public Mono> listApplicationSettingsSlotWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listApplicationSettingsSlot( this.client.getEndpoint(), @@ -40505,6 +40732,7 @@ public Mono> updateAuthSettingsSlotWithResponseA } else { siteAuthSettings.validate(); } + context = this.client.mergeContext(context); return service .updateAuthSettingsSlot( this.client.getEndpoint(), @@ -40697,6 +40925,7 @@ public Mono> getAuthSettingsSlotWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getAuthSettingsSlot( this.client.getEndpoint(), @@ -40908,6 +41137,7 @@ public Mono> updateAzureSt } else { azureStorageAccounts.validate(); } + context = this.client.mergeContext(context); return service .updateAzureStorageAccountsSlot( this.client.getEndpoint(), @@ -41120,6 +41350,7 @@ public Mono> listAzureStor new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAzureStorageAccountsSlot( this.client.getEndpoint(), @@ -41324,6 +41555,7 @@ public Mono> updateBackupConfigurationSlotWithRespo } else { request.validate(); } + context = this.client.mergeContext(context); return service .updateBackupConfigurationSlot( this.client.getEndpoint(), @@ -41520,6 +41752,7 @@ public Mono> deleteBackupConfigurationSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteBackupConfigurationSlot( this.client.getEndpoint(), @@ -41692,6 +41925,7 @@ public Mono> getBackupConfigurationSlotWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getBackupConfigurationSlot( this.client.getEndpoint(), @@ -41901,6 +42135,7 @@ public Mono> updateConnectionStringsSl } else { connectionStrings.validate(); } + context = this.client.mergeContext(context); return service .updateConnectionStringsSlot( this.client.getEndpoint(), @@ -42105,6 +42340,7 @@ public Mono> listConnectionStringsSlot new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConnectionStringsSlot( this.client.getEndpoint(), @@ -42296,6 +42532,7 @@ public Mono> getDiagnosticLogsConfigurationSlotWit new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDiagnosticLogsConfigurationSlot( this.client.getEndpoint(), @@ -42499,6 +42736,7 @@ public Mono> updateDiagnosticLogsConfigSlotWithRes } else { siteLogsConfig.validate(); } + context = this.client.mergeContext(context); return service .updateDiagnosticLogsConfigSlot( this.client.getEndpoint(), @@ -42708,6 +42946,7 @@ public Mono> updateMetadataSlotWithResponseAsync } else { metadata.validate(); } + context = this.client.mergeContext(context); return service .updateMetadataSlot( this.client.getEndpoint(), @@ -42904,6 +43143,7 @@ public Mono> listMetadataSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listMetadataSlot( this.client.getEndpoint(), @@ -43092,6 +43332,7 @@ public Mono>> listPublishingCredentialsSlotWithRespons new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPublishingCredentialsSlot( this.client.getEndpoint(), @@ -43116,7 +43357,7 @@ public Mono>> listPublishingCredentialsSlotWithRespons * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, UserInner> beginListPublishingCredentialsSlot( + public PollerFlux, UserInner> beginListPublishingCredentialsSlotAsync( String resourceGroupName, String name, String slot) { Mono>> mono = listPublishingCredentialsSlotWithResponseAsync(resourceGroupName, name, slot); @@ -43140,7 +43381,7 @@ public PollerFlux, UserInner> beginListPublishingCredentia * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, UserInner> beginListPublishingCredentialsSlot( + public PollerFlux, UserInner> beginListPublishingCredentialsSlotAsync( String resourceGroupName, String name, String slot, Context context) { Mono>> mono = listPublishingCredentialsSlotWithResponseAsync(resourceGroupName, name, slot, context); @@ -43163,15 +43404,9 @@ public PollerFlux, UserInner> beginListPublishingCredentia * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listPublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot) { - Mono>> mono = - listPublishingCredentialsSlotWithResponseAsync(resourceGroupName, name, slot); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + public SyncPoller, UserInner> beginListPublishingCredentialsSlot( + String resourceGroupName, String name, String slot) { + return beginListPublishingCredentialsSlotAsync(resourceGroupName, name, slot).getSyncPoller(); } /** @@ -43188,16 +43423,9 @@ public Mono listPublishingCredentialsSlotAsync(String resourceGroupNa * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listPublishingCredentialsSlotAsync( + public SyncPoller, UserInner> beginListPublishingCredentialsSlot( String resourceGroupName, String name, String slot, Context context) { - Mono>> mono = - listPublishingCredentialsSlotWithResponseAsync(resourceGroupName, name, slot, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), UserInner.class, UserInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + return beginListPublishingCredentialsSlotAsync(resourceGroupName, name, slot, context).getSyncPoller(); } /** @@ -43213,8 +43441,10 @@ public Mono listPublishingCredentialsSlotAsync( * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner listPublishingCredentialsSlot(String resourceGroupName, String name, String slot) { - return listPublishingCredentialsSlotAsync(resourceGroupName, name, slot).block(); + public Mono listPublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot) { + return beginListPublishingCredentialsSlotAsync(resourceGroupName, name, slot) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -43231,175 +43461,47 @@ public UserInner listPublishingCredentialsSlot(String resourceGroupName, String * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner listPublishingCredentialsSlot( + public Mono listPublishingCredentialsSlotAsync( String resourceGroupName, String name, String slot, Context context) { - return listPublishingCredentialsSlotAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Description for Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings for the App. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (pushSettings == null) { - return Mono.error(new IllegalArgumentException("Parameter pushSettings is required and cannot be null.")); - } else { - pushSettings.validate(); - } - return FluxUtil - .withContext( - context -> - service - .updateSitePushSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - pushSettings, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings for the App. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (pushSettings == null) { - return Mono.error(new IllegalArgumentException("Parameter pushSettings is required and cannot be null.")); - } else { - pushSettings.validate(); - } - return service - .updateSitePushSettingsSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - pushSettings, - context); + return beginListPublishingCredentialsSlotAsync(resourceGroupName, name, slot, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Description for Updates the Push settings associated with web app. + * Description for Gets the Git/FTP publishing credentials of an app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings for the App. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials + * for the production slot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. + * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSitePushSettingsSlotAsync( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings) { - return updateSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, pushSettings) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public UserInner listPublishingCredentialsSlot(String resourceGroupName, String name, String slot) { + return listPublishingCredentialsSlotAsync(resourceGroupName, name, slot).block(); } /** - * Description for Updates the Push settings associated with web app. + * Description for Gets the Git/FTP publishing credentials of an app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings for the App. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials + * for the production slot. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. + * @return user credentials used for publishing activity. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSitePushSettingsSlotAsync( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context) { - return updateSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, pushSettings, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public UserInner listPublishingCredentialsSlot( + String resourceGroupName, String name, String slot, Context context) { + return listPublishingCredentialsSlotAsync(resourceGroupName, name, slot, context).block(); } /** @@ -43415,44 +43517,8 @@ public Mono updateSitePushSettingsSlotAsync( * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PushSettingsInner updateSitePushSettingsSlot( + public Mono> updateSitePushSettingsSlotWithResponseAsync( String resourceGroupName, String name, String slot, PushSettingsInner pushSettings) { - return updateSitePushSettingsSlotAsync(resourceGroupName, name, slot, pushSettings).block(); - } - - /** - * Description for Updates the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param pushSettings Push settings for the App. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PushSettingsInner updateSitePushSettingsSlot( - String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context) { - return updateSitePushSettingsSlotAsync(resourceGroupName, name, slot, pushSettings, context).block(); - } - - /** - * Description for Gets the Push settings associated with web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return push settings for the App. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -43475,27 +43541,34 @@ public Mono> listSitePushSettingsSlotWithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (pushSettings == null) { + return Mono.error(new IllegalArgumentException("Parameter pushSettings is required and cannot be null.")); + } else { + pushSettings.validate(); + } return FluxUtil .withContext( context -> service - .listSitePushSettingsSlot( + .updateSitePushSettingsSlot( this.client.getEndpoint(), resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), + pushSettings, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Description for Gets the Push settings associated with web app. + * Description for Updates the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param pushSettings Push settings for the App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -43503,8 +43576,8 @@ public Mono> listSitePushSettingsSlotWithResponseAsy * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSitePushSettingsSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { + public Mono> updateSitePushSettingsSlotWithResponseAsync( + String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -43527,31 +43600,40 @@ public Mono> listSitePushSettingsSlotWithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (pushSettings == null) { + return Mono.error(new IllegalArgumentException("Parameter pushSettings is required and cannot be null.")); + } else { + pushSettings.validate(); + } + context = this.client.mergeContext(context); return service - .listSitePushSettingsSlot( + .updateSitePushSettingsSlot( this.client.getEndpoint(), resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), + pushSettings, context); } /** - * Description for Gets the Push settings associated with web app. + * Description for Updates the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param pushSettings Push settings for the App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listSitePushSettingsSlotAsync(String resourceGroupName, String name, String slot) { - return listSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot) + public Mono updateSitePushSettingsSlotAsync( + String resourceGroupName, String name, String slot, PushSettingsInner pushSettings) { + return updateSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, pushSettings) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -43563,11 +43645,12 @@ public Mono listSitePushSettingsSlotAsync(String resourceGrou } /** - * Description for Gets the Push settings associated with web app. + * Description for Updates the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param pushSettings Push settings for the App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -43575,9 +43658,9 @@ public Mono listSitePushSettingsSlotAsync(String resourceGrou * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono listSitePushSettingsSlotAsync( - String resourceGroupName, String name, String slot, Context context) { - return listSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, context) + public Mono updateSitePushSettingsSlotAsync( + String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context) { + return updateSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, pushSettings, context) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -43589,27 +43672,30 @@ public Mono listSitePushSettingsSlotAsync( } /** - * Description for Gets the Push settings associated with web app. + * Description for Updates the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param pushSettings Push settings for the App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PushSettingsInner listSitePushSettingsSlot(String resourceGroupName, String name, String slot) { - return listSitePushSettingsSlotAsync(resourceGroupName, name, slot).block(); + public PushSettingsInner updateSitePushSettingsSlot( + String resourceGroupName, String name, String slot, PushSettingsInner pushSettings) { + return updateSitePushSettingsSlotAsync(resourceGroupName, name, slot, pushSettings).block(); } /** - * Description for Gets the Push settings associated with web app. + * Description for Updates the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param pushSettings Push settings for the App. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -43617,26 +43703,24 @@ public PushSettingsInner listSitePushSettingsSlot(String resourceGroupName, Stri * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PushSettingsInner listSitePushSettingsSlot( - String resourceGroupName, String name, String slot, Context context) { - return listSitePushSettingsSlotAsync(resourceGroupName, name, slot, context).block(); + public PushSettingsInner updateSitePushSettingsSlot( + String resourceGroupName, String name, String slot, PushSettingsInner pushSettings, Context context) { + return updateSitePushSettingsSlotAsync(resourceGroupName, name, slot, pushSettings, context).block(); } /** - * Description for Gets the configuration of an app, such as platform version and bitness, default documents, - * virtual applications, Always On, etc. + * Description for Gets the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. + * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getConfigurationSlotWithResponseAsync( + public Mono> listSitePushSettingsSlotWithResponseAsync( String resourceGroupName, String name, String slot) { if (this.client.getEndpoint() == null) { return Mono @@ -43664,7 +43748,7 @@ public Mono> getConfigurationSlotWithResponseA .withContext( context -> service - .getConfigurationSlot( + .listSitePushSettingsSlot( this.client.getEndpoint(), resourceGroupName, name, @@ -43676,21 +43760,19 @@ public Mono> getConfigurationSlotWithResponseA } /** - * Description for Gets the configuration of an app, such as platform version and bitness, default documents, - * virtual applications, Always On, etc. + * Description for Gets the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. + * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getConfigurationSlotWithResponseAsync( + public Mono> listSitePushSettingsSlotWithResponseAsync( String resourceGroupName, String name, String slot, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -43714,8 +43796,9 @@ public Mono> getConfigurationSlotWithResponseA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service - .getConfigurationSlot( + .listSitePushSettingsSlot( this.client.getEndpoint(), resourceGroupName, name, @@ -43726,23 +43809,21 @@ public Mono> getConfigurationSlotWithResponseA } /** - * Description for Gets the configuration of an app, such as platform version and bitness, default documents, - * virtual applications, Always On, etc. + * Description for Gets the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. + * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getConfigurationSlotAsync(String resourceGroupName, String name, String slot) { - return getConfigurationSlotWithResponseAsync(resourceGroupName, name, slot) + public Mono listSitePushSettingsSlotAsync(String resourceGroupName, String name, String slot) { + return listSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -43752,25 +43833,23 @@ public Mono getConfigurationSlotAsync(String resourceGr } /** - * Description for Gets the configuration of an app, such as platform version and bitness, default documents, - * virtual applications, Always On, etc. + * Description for Gets the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. + * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getConfigurationSlotAsync( + public Mono listSitePushSettingsSlotAsync( String resourceGroupName, String name, String slot, Context context) { - return getConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, context) + return listSitePushSettingsSlotWithResponseAsync(resourceGroupName, name, slot, context) .flatMap( - (Response res) -> { + (Response res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { @@ -43780,59 +43859,55 @@ public Mono getConfigurationSlotAsync( } /** - * Description for Gets the configuration of an app, such as platform version and bitness, default documents, - * virtual applications, Always On, etc. + * Description for Gets the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. + * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner getConfigurationSlot(String resourceGroupName, String name, String slot) { - return getConfigurationSlotAsync(resourceGroupName, name, slot).block(); + public PushSettingsInner listSitePushSettingsSlot(String resourceGroupName, String name, String slot) { + return listSitePushSettingsSlotAsync(resourceGroupName, name, slot).block(); } /** - * Description for Gets the configuration of an app, such as platform version and bitness, default documents, - * virtual applications, Always On, etc. + * Description for Gets the Push settings associated with web app. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the - * production slot. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return web app configuration ARM resource. + * @return push settings for the App. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner getConfigurationSlot( + public PushSettingsInner listSitePushSettingsSlot( String resourceGroupName, String name, String slot, Context context) { - return getConfigurationSlotAsync(resourceGroupName, name, slot, context).block(); + return listSitePushSettingsSlotAsync(resourceGroupName, name, slot, context).block(); } /** - * Description for Updates the configuration of an app. + * Description for Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the * production slot. - * @param siteConfig Web app configuration ARM resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { + public Mono> getConfigurationSlotWithResponseAsync( + String resourceGroupName, String name, String slot) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -43855,35 +43930,29 @@ public Mono> createOrUpdateConfigurationSlotWi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (siteConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); - } else { - siteConfig.validate(); - } return FluxUtil .withContext( context -> service - .createOrUpdateConfigurationSlot( + .getConfigurationSlot( this.client.getEndpoint(), resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), - siteConfig, context)) .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); } /** - * Description for Updates the configuration of an app. + * Description for Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the * production slot. - * @param siteConfig Web app configuration ARM resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -43891,8 +43960,8 @@ public Mono> createOrUpdateConfigurationSlotWi * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateConfigurationSlotWithResponseAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { + public Mono> getConfigurationSlotWithResponseAsync( + String resourceGroupName, String name, String slot, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -43915,40 +43984,34 @@ public Mono> createOrUpdateConfigurationSlotWi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (siteConfig == null) { - return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); - } else { - siteConfig.validate(); - } + context = this.client.mergeContext(context); return service - .createOrUpdateConfigurationSlot( + .getConfigurationSlot( this.client.getEndpoint(), resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), - siteConfig, context); } /** - * Description for Updates the configuration of an app. + * Description for Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the * production slot. - * @param siteConfig Web app configuration ARM resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateConfigurationSlotAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - return createOrUpdateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig) + public Mono getConfigurationSlotAsync(String resourceGroupName, String name, String slot) { + return getConfigurationSlotWithResponseAsync(resourceGroupName, name, slot) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -43960,13 +44023,13 @@ public Mono createOrUpdateConfigurationSlotAsync( } /** - * Description for Updates the configuration of an app. + * Description for Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the * production slot. - * @param siteConfig Web app configuration ARM resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -43974,9 +44037,9 @@ public Mono createOrUpdateConfigurationSlotAsync( * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateConfigurationSlotAsync( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { - return createOrUpdateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig, context) + public Mono getConfigurationSlotAsync( + String resourceGroupName, String name, String slot, Context context) { + return getConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, context) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -43988,32 +44051,31 @@ public Mono createOrUpdateConfigurationSlotAsync( } /** - * Description for Updates the configuration of an app. + * Description for Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the * production slot. - * @param siteConfig Web app configuration ARM resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner createOrUpdateConfigurationSlot( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - return createOrUpdateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig).block(); + public SiteConfigResourceInner getConfigurationSlot(String resourceGroupName, String name, String slot) { + return getConfigurationSlotAsync(resourceGroupName, name, slot).block(); } /** - * Description for Updates the configuration of an app. + * Description for Gets the configuration of an app, such as platform version and bitness, default documents, + * virtual applications, Always On, etc. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the * production slot. - * @param siteConfig Web app configuration ARM resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. @@ -44021,9 +44083,9 @@ public SiteConfigResourceInner createOrUpdateConfigurationSlot( * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner createOrUpdateConfigurationSlot( - String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { - return createOrUpdateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig, context).block(); + public SiteConfigResourceInner getConfigurationSlot( + String resourceGroupName, String name, String slot, Context context) { + return getConfigurationSlotAsync(resourceGroupName, name, slot, context).block(); } /** @@ -44040,7 +44102,7 @@ public SiteConfigResourceInner createOrUpdateConfigurationSlot( * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateConfigurationSlotWithResponseAsync( + public Mono> createOrUpdateConfigurationSlotWithResponseAsync( String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { if (this.client.getEndpoint() == null) { return Mono @@ -44073,7 +44135,7 @@ public Mono> updateConfigurationSlotWithRespon .withContext( context -> service - .updateConfigurationSlot( + .createOrUpdateConfigurationSlot( this.client.getEndpoint(), resourceGroupName, name, @@ -44100,7 +44162,7 @@ public Mono> updateConfigurationSlotWithRespon * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateConfigurationSlotWithResponseAsync( + public Mono> createOrUpdateConfigurationSlotWithResponseAsync( String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -44129,8 +44191,9 @@ public Mono> updateConfigurationSlotWithRespon } else { siteConfig.validate(); } + context = this.client.mergeContext(context); return service - .updateConfigurationSlot( + .createOrUpdateConfigurationSlot( this.client.getEndpoint(), resourceGroupName, name, @@ -44155,9 +44218,9 @@ public Mono> updateConfigurationSlotWithRespon * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateConfigurationSlotAsync( + public Mono createOrUpdateConfigurationSlotAsync( String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - return updateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig) + return createOrUpdateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -44183,9 +44246,9 @@ public Mono updateConfigurationSlotAsync( * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateConfigurationSlotAsync( + public Mono createOrUpdateConfigurationSlotAsync( String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { - return updateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig, context) + return createOrUpdateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig, context) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -44210,9 +44273,9 @@ public Mono updateConfigurationSlotAsync( * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner updateConfigurationSlot( + public SiteConfigResourceInner createOrUpdateConfigurationSlot( String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { - return updateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig).block(); + return createOrUpdateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig).block(); } /** @@ -44230,27 +44293,237 @@ public SiteConfigResourceInner updateConfigurationSlot( * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SiteConfigResourceInner updateConfigurationSlot( + public SiteConfigResourceInner createOrUpdateConfigurationSlot( String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { - return updateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig, context).block(); + return createOrUpdateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig, context).block(); } /** - * Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a - * timestamp and the ID of the snapshot. + * Description for Updates the configuration of an app. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the + * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the * production slot. + * @param siteConfig Web app configuration ARM resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of metadata for the app configuration snapshots that can be restored. + * @return web app configuration ARM resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listConfigurationSnapshotInfoSlotSinglePageAsync( - String resourceGroupName, String name, String slot) { + public Mono> updateConfigurationSlotWithResponseAsync( + String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { + 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (slot == null) { + return Mono.error(new IllegalArgumentException("Parameter slot 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 (siteConfig == null) { + return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); + } else { + siteConfig.validate(); + } + return FluxUtil + .withContext( + context -> + service + .updateConfigurationSlot( + this.client.getEndpoint(), + resourceGroupName, + name, + slot, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + siteConfig, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Description for Updates the configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * production slot. + * @param siteConfig Web app configuration ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return web app configuration ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateConfigurationSlotWithResponseAsync( + String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (slot == null) { + return Mono.error(new IllegalArgumentException("Parameter slot 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 (siteConfig == null) { + return Mono.error(new IllegalArgumentException("Parameter siteConfig is required and cannot be null.")); + } else { + siteConfig.validate(); + } + context = this.client.mergeContext(context); + return service + .updateConfigurationSlot( + this.client.getEndpoint(), + resourceGroupName, + name, + slot, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + siteConfig, + context); + } + + /** + * Description for Updates the configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * production slot. + * @param siteConfig Web app configuration ARM resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return web app configuration ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateConfigurationSlotAsync( + String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { + return updateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Description for Updates the configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * production slot. + * @param siteConfig Web app configuration ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return web app configuration ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateConfigurationSlotAsync( + String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { + return updateConfigurationSlotWithResponseAsync(resourceGroupName, name, slot, siteConfig, context) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Description for Updates the configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * production slot. + * @param siteConfig Web app configuration ARM resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return web app configuration ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SiteConfigResourceInner updateConfigurationSlot( + String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig) { + return updateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig).block(); + } + + /** + * Description for Updates the configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update configuration for the + * production slot. + * @param siteConfig Web app configuration ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return web app configuration ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SiteConfigResourceInner updateConfigurationSlot( + String resourceGroupName, String name, String slot, SiteConfigResourceInner siteConfig, Context context) { + return updateConfigurationSlotAsync(resourceGroupName, name, slot, siteConfig, context).block(); + } + + /** + * Description for Gets a list of web app configuration snapshots identifiers. Each element of the list contains a + * timestamp and the ID of the snapshot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will return configuration for the + * production slot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return collection of metadata for the app configuration snapshots that can be restored. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listConfigurationSnapshotInfoSlotSinglePageAsync( + String resourceGroupName, String name, String slot) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -44336,6 +44609,7 @@ public Mono> listConfiguration new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationSnapshotInfoSlot( this.client.getEndpoint(), @@ -44537,6 +44811,7 @@ public Mono> getConfigurationSnapshotSlotWithR new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getConfigurationSnapshotSlot( this.client.getEndpoint(), @@ -44742,6 +45017,7 @@ public Mono> recoverSiteConfigurationSnapshotSlotWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .recoverSiteConfigurationSnapshotSlot( this.client.getEndpoint(), @@ -44920,6 +45196,7 @@ public Mono getWebSiteContainerLogsSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getWebSiteContainerLogsSlot( this.client.getEndpoint(), @@ -44980,11 +45257,24 @@ public Flux getWebSiteContainerLogsSlotAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getWebSiteContainerLogsSlot(String resourceGroupName, String name, String slot) { - return getWebSiteContainerLogsSlotAsync(resourceGroupName, name, slot) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getWebSiteContainerLogsSlotAsync(resourceGroupName, name, slot) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -45002,11 +45292,24 @@ public InputStream getWebSiteContainerLogsSlot(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getWebSiteContainerLogsSlot( String resourceGroupName, String name, String slot, Context context) { - return getWebSiteContainerLogsSlotAsync(resourceGroupName, name, slot, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getWebSiteContainerLogsSlotAsync(resourceGroupName, name, slot, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -45097,6 +45400,7 @@ public Mono getContainerLogsZipSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getContainerLogsZipSlot( this.client.getEndpoint(), @@ -45157,11 +45461,24 @@ public Flux getContainerLogsZipSlotAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getContainerLogsZipSlot(String resourceGroupName, String name, String slot) { - return getContainerLogsZipSlotAsync(resourceGroupName, name, slot) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getContainerLogsZipSlotAsync(resourceGroupName, name, slot) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -45178,11 +45495,24 @@ public InputStream getContainerLogsZipSlot(String resourceGroupName, String name */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getContainerLogsZipSlot(String resourceGroupName, String name, String slot, Context context) { - return getContainerLogsZipSlotAsync(resourceGroupName, name, slot, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getContainerLogsZipSlotAsync(resourceGroupName, name, slot, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -45284,6 +45614,7 @@ public Mono> listContinuousWebJobsSlotSingl new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listContinuousWebJobsSlot( this.client.getEndpoint(), @@ -45481,6 +45812,7 @@ public Mono> getContinuousWebJobSlotWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getContinuousWebJobSlot( this.client.getEndpoint(), @@ -45686,6 +46018,7 @@ public Mono> deleteContinuousWebJobSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteContinuousWebJobSlot( this.client.getEndpoint(), @@ -45874,6 +46207,7 @@ public Mono> startContinuousWebJobSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startContinuousWebJobSlot( this.client.getEndpoint(), @@ -46062,6 +46396,7 @@ public Mono> stopContinuousWebJobSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopContinuousWebJobSlot( this.client.getEndpoint(), @@ -46250,6 +46585,7 @@ public Mono> listDeploymentsSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDeploymentsSlot( this.client.getEndpoint(), @@ -46445,6 +46781,7 @@ public Mono> getDeploymentSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDeploymentSlot( this.client.getEndpoint(), @@ -46661,6 +46998,7 @@ public Mono> createDeploymentSlotWithResponseAsync( } else { deployment.validate(); } + context = this.client.mergeContext(context); return service .createDeploymentSlot( this.client.getEndpoint(), @@ -46871,6 +47209,7 @@ public Mono> deleteDeploymentSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteDeploymentSlot( this.client.getEndpoint(), @@ -47059,6 +47398,7 @@ public Mono> listDeploymentLogSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDeploymentLogSlot( this.client.getEndpoint(), @@ -47273,6 +47613,7 @@ public Mono> discoverBackupSlotWithResponseAsync( } else { request.validate(); } + context = this.client.mergeContext(context); return service .discoverBackupSlot( this.client.getEndpoint(), @@ -47482,6 +47823,7 @@ public Mono> listDomainOwnershipIdentifiersSlotSi new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDomainOwnershipIdentifiersSlot( this.client.getEndpoint(), @@ -47685,6 +48027,7 @@ public Mono> getDomainOwnershipIdentifierSlotWithRespo new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getDomainOwnershipIdentifierSlot( this.client.getEndpoint(), @@ -47929,6 +48272,7 @@ public Mono> createOrUpdateDomainOwnershipIdentifierSl } else { domainOwnershipIdentifier.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateDomainOwnershipIdentifierSlot( this.client.getEndpoint(), @@ -48169,6 +48513,7 @@ public Mono> deleteDomainOwnershipIdentifierSlotWithResponseAsync new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteDomainOwnershipIdentifierSlot( this.client.getEndpoint(), @@ -48395,6 +48740,7 @@ public Mono> updateDomainOwnershipIdentifierSlotWithRe } else { domainOwnershipIdentifier.validate(); } + context = this.client.mergeContext(context); return service .updateDomainOwnershipIdentifierSlot( this.client.getEndpoint(), @@ -48618,6 +48964,7 @@ public Mono> getMSDeployStatusSlotWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getMSDeployStatusSlot( this.client.getEndpoint(), @@ -48814,6 +49161,7 @@ public Mono>> createMSDeployOperationSlotWithResponseA } else { mSDeploy.validate(); } + context = this.client.mergeContext(context); return service .createMSDeployOperationSlot( this.client.getEndpoint(), @@ -48839,7 +49187,7 @@ public Mono>> createMSDeployOperationSlotWithResponseA * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationSlot( + public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationSlotAsync( String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { Mono>> mono = createMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, mSDeploy); @@ -48863,7 +49211,7 @@ public PollerFlux, MSDeployStatusInner> beginCre * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationSlot( + public PollerFlux, MSDeployStatusInner> beginCreateMSDeployOperationSlotAsync( String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { Mono>> mono = createMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, mSDeploy, context); @@ -48886,16 +49234,9 @@ public PollerFlux, MSDeployStatusInner> beginCre * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createMSDeployOperationSlotAsync( + public SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperationSlot( String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - Mono>> mono = - createMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, mSDeploy); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + return beginCreateMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy).getSyncPoller(); } /** @@ -48912,16 +49253,9 @@ public Mono createMSDeployOperationSlotAsync( * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createMSDeployOperationSlotAsync( + public SyncPoller, MSDeployStatusInner> beginCreateMSDeployOperationSlot( String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - Mono>> mono = - createMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, mSDeploy, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) - .last() - .flatMap(client::getLroFinalResultOrError); + return beginCreateMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy, context).getSyncPoller(); } /** @@ -48937,9 +49271,11 @@ public Mono createMSDeployOperationSlotAsync( * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner createMSDeployOperationSlot( + public Mono createMSDeployOperationSlotAsync( String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - return createMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy).block(); + return beginCreateMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -48956,77 +49292,64 @@ public MSDeployStatusInner createMSDeployOperationSlot( * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner createMSDeployOperationSlot( + public Mono createMSDeployOperationSlotAsync( String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - return createMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy, context).block(); + return beginCreateMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Description for Get the MSDeploy Log for the last MSDeploy operation. + * Description for Invoke the MSDeploy web app extension. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param mSDeploy MSDeploy ARM PUT information. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy log. + * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMSDeployLogSlotWithResponseAsync( - String resourceGroupName, String name, String slot) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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.")); - } - return FluxUtil - .withContext( - context -> - service - .getMSDeployLogSlot( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + public MSDeployStatusInner createMSDeployOperationSlot( + String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { + return createMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy).block(); } /** - * Description for Get the MSDeploy Log for the last MSDeploy operation. + * Description for Invoke the MSDeploy web app extension. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param name Name of web app. * @param slot Name of web app slot. If not specified then will default to production slot. + * @param mSDeploy MSDeploy ARM PUT information. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MSDeployStatusInner createMSDeployOperationSlot( + String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { + return createMSDeployOperationSlotAsync(resourceGroupName, name, slot, mSDeploy, context).block(); + } + + /** + * Description for Get the MSDeploy Log for the last MSDeploy operation. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return mSDeploy log. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getMSDeployLogSlotWithResponseAsync( - String resourceGroupName, String name, String slot, Context context) { + String resourceGroupName, String name, String slot) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -49049,6 +49372,59 @@ public Mono> getMSDeployLogSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + return FluxUtil + .withContext( + context -> + service + .getMSDeployLogSlot( + this.client.getEndpoint(), + resourceGroupName, + name, + slot, + this.client.getSubscriptionId(), + this.client.getApiVersion(), + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Description for Get the MSDeploy Log for the last MSDeploy operation. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy log. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMSDeployLogSlotWithResponseAsync( + String resourceGroupName, String name, String slot, 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 (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (slot == null) { + return Mono.error(new IllegalArgumentException("Parameter slot 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.")); + } + context = this.client.mergeContext(context); return service .getMSDeployLogSlot( this.client.getEndpoint(), @@ -49240,6 +49616,7 @@ public Mono> listInstanceFunctionsSlotSingl new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceFunctionsSlot( this.client.getEndpoint(), @@ -49422,6 +49799,7 @@ public Mono> getFunctionsAdminTokenSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getFunctionsAdminTokenSlot( this.client.getEndpoint(), @@ -49613,6 +49991,7 @@ public Mono> getInstanceFunctionSlotWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceFunctionSlot( this.client.getEndpoint(), @@ -49836,6 +50215,7 @@ public Mono>> createInstanceFunctionSlotWithResponseAs } else { functionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createInstanceFunctionSlot( this.client.getEndpoint(), @@ -49863,7 +50243,7 @@ public Mono>> createInstanceFunctionSlotWithResponseAs * @return function information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, FunctionEnvelopeInner> beginCreateInstanceFunctionSlot( + public PollerFlux, FunctionEnvelopeInner> beginCreateInstanceFunctionSlotAsync( String resourceGroupName, String name, String functionName, @@ -49892,7 +50272,7 @@ public PollerFlux, FunctionEnvelopeInner> begi * @return function information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, FunctionEnvelopeInner> beginCreateInstanceFunctionSlot( + public PollerFlux, FunctionEnvelopeInner> beginCreateInstanceFunctionSlotAsync( String resourceGroupName, String name, String functionName, @@ -49908,6 +50288,57 @@ public PollerFlux, FunctionEnvelopeInner> begi mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class); } + /** + * Description for Create function for web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. + * @param functionEnvelope Function information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return function information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FunctionEnvelopeInner> beginCreateInstanceFunctionSlot( + String resourceGroupName, + String name, + String functionName, + String slot, + FunctionEnvelopeInner functionEnvelope) { + return beginCreateInstanceFunctionSlotAsync(resourceGroupName, name, functionName, slot, functionEnvelope) + .getSyncPoller(); + } + + /** + * Description for Create function for web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param functionName Function name. + * @param slot Name of the deployment slot. + * @param functionEnvelope Function information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return function information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, FunctionEnvelopeInner> beginCreateInstanceFunctionSlot( + String resourceGroupName, + String name, + String functionName, + String slot, + FunctionEnvelopeInner functionEnvelope, + Context context) { + return beginCreateInstanceFunctionSlotAsync( + resourceGroupName, name, functionName, slot, functionEnvelope, context) + .getSyncPoller(); + } + /** * Description for Create function for web site, or a deployment slot. * @@ -49928,14 +50359,9 @@ public Mono createInstanceFunctionSlotAsync( String functionName, String slot, FunctionEnvelopeInner functionEnvelope) { - Mono>> mono = - createInstanceFunctionSlotWithResponseAsync(resourceGroupName, name, functionName, slot, functionEnvelope); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class) + return beginCreateInstanceFunctionSlotAsync(resourceGroupName, name, functionName, slot, functionEnvelope) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -49960,15 +50386,10 @@ public Mono createInstanceFunctionSlotAsync( String slot, FunctionEnvelopeInner functionEnvelope, Context context) { - Mono>> mono = - createInstanceFunctionSlotWithResponseAsync( - resourceGroupName, name, functionName, slot, functionEnvelope, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), FunctionEnvelopeInner.class, FunctionEnvelopeInner.class) + return beginCreateInstanceFunctionSlotAsync( + resourceGroupName, name, functionName, slot, functionEnvelope, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -50117,6 +50538,7 @@ public Mono> deleteInstanceFunctionSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteInstanceFunctionSlot( this.client.getEndpoint(), @@ -50327,6 +50749,7 @@ public Mono> createOrUpdateFunctionSecretSlotWithResponse } else { key.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateFunctionSecretSlot( this.client.getEndpoint(), @@ -50560,6 +50983,7 @@ public Mono> deleteFunctionSecretSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteFunctionSecretSlot( this.client.getEndpoint(), @@ -50748,6 +51172,7 @@ public Mono> listFunctionKeysSlotWithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listFunctionKeysSlot( this.client.getEndpoint(), @@ -50947,6 +51372,7 @@ public Mono> listFunctionSecretsSlotWithResponseA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listFunctionSecretsSlot( this.client.getEndpoint(), @@ -51137,6 +51563,7 @@ public Mono> listHostKeysSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostKeysSlot( this.client.getEndpoint(), @@ -51319,6 +51746,7 @@ public Mono> listSyncStatusSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSyncStatusSlot( this.client.getEndpoint(), @@ -51483,6 +51911,7 @@ public Mono> syncFunctionsSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .syncFunctionsSlot( this.client.getEndpoint(), @@ -51685,6 +52114,7 @@ public Mono> createOrUpdateHostSecretSlotWithResponseAsyn } else { key.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateHostSecretSlot( this.client.getEndpoint(), @@ -51916,6 +52346,7 @@ public Mono> deleteHostSecretSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHostSecretSlot( this.client.getEndpoint(), @@ -52106,6 +52537,7 @@ public Mono> listHostnameBindingsSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostnameBindingsSlot( this.client.getEndpoint(), @@ -52303,6 +52735,7 @@ public Mono> getHostnameBindingSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHostnameBindingSlot( this.client.getEndpoint(), @@ -52528,6 +52961,7 @@ public Mono> createOrUpdateHostnameBindingSlotWit } else { hostnameBinding.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateHostnameBindingSlot( this.client.getEndpoint(), @@ -52751,6 +53185,7 @@ public Mono> deleteHostnameBindingSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHostnameBindingSlot( this.client.getEndpoint(), @@ -52946,6 +53381,7 @@ public Mono> getHybridConnectionSlotWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getHybridConnectionSlot( this.client.getEndpoint(), @@ -53186,6 +53622,7 @@ public Mono> createOrUpdateHybridConnectionSlotW } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateHybridConnectionSlot( this.client.getEndpoint(), @@ -53432,6 +53869,7 @@ public Mono> deleteHybridConnectionSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteHybridConnectionSlot( this.client.getEndpoint(), @@ -53656,6 +54094,7 @@ public Mono> updateHybridConnectionSlotWithRespo } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateHybridConnectionSlot( this.client.getEndpoint(), @@ -53884,6 +54323,7 @@ public Mono> listHybridConnectionsSlotWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHybridConnectionsSlot( this.client.getEndpoint(), @@ -54070,6 +54510,7 @@ public Mono> listRelayServiceConnect new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listRelayServiceConnectionsSlot( this.client.getEndpoint(), @@ -54270,6 +54711,7 @@ public Mono> getRelayServiceConnecti new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getRelayServiceConnectionSlot( this.client.getEndpoint(), @@ -54499,6 +54941,7 @@ public Mono> createOrUpdateRelayServ } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateRelayServiceConnectionSlot( this.client.getEndpoint(), @@ -54733,6 +55176,7 @@ public Mono> deleteRelayServiceConnectionSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteRelayServiceConnectionSlot( this.client.getEndpoint(), @@ -54946,6 +55390,7 @@ public Mono> updateRelayServiceConne } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateRelayServiceConnectionSlot( this.client.getEndpoint(), @@ -55177,6 +55622,7 @@ public Mono> listInstanceIdentifiersSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceIdentifiersSlot( this.client.getEndpoint(), @@ -55368,6 +55814,7 @@ public Mono> getInstanceInfoSlotWithRespons new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceInfoSlot( this.client.getEndpoint(), @@ -55567,6 +56014,7 @@ public Mono> getInstanceMsDeployStatusSlotWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceMsDeployStatusSlot( this.client.getEndpoint(), @@ -55779,6 +56227,7 @@ public Mono>> createInstanceMSDeployOperationSlotWithR } else { mSDeploy.validate(); } + context = this.client.mergeContext(context); return service .createInstanceMSDeployOperationSlot( this.client.getEndpoint(), @@ -55806,8 +56255,9 @@ public Mono>> createInstanceMSDeployOperationSlotWithR * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperationSlot( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { + public PollerFlux, MSDeployStatusInner> + beginCreateInstanceMSDeployOperationSlotAsync( + String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { Mono>> mono = createInstanceMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, instanceId, mSDeploy); return this @@ -55831,8 +56281,9 @@ public PollerFlux, MSDeployStatusInner> beginCre * @return mSDeploy ARM response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, MSDeployStatusInner> beginCreateInstanceMSDeployOperationSlot( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { + public PollerFlux, MSDeployStatusInner> + beginCreateInstanceMSDeployOperationSlotAsync( + String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { Mono>> mono = createInstanceMSDeployOperationSlotWithResponseAsync( resourceGroupName, name, slot, instanceId, mSDeploy, context); @@ -55842,6 +56293,48 @@ public PollerFlux, MSDeployStatusInner> beginCre mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class); } + /** + * Description for Invoke the MSDeploy web app extension. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId ID of web app instance. + * @param mSDeploy MSDeploy ARM PUT information. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperationSlot( + String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { + return beginCreateInstanceMSDeployOperationSlotAsync(resourceGroupName, name, slot, instanceId, mSDeploy) + .getSyncPoller(); + } + + /** + * Description for Invoke the MSDeploy web app extension. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId ID of web app instance. + * @param mSDeploy MSDeploy ARM PUT information. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return mSDeploy ARM response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, MSDeployStatusInner> beginCreateInstanceMSDeployOperationSlot( + String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { + return beginCreateInstanceMSDeployOperationSlotAsync( + resourceGroupName, name, slot, instanceId, mSDeploy, context) + .getSyncPoller(); + } + /** * Description for Invoke the MSDeploy web app extension. * @@ -55858,14 +56351,9 @@ public PollerFlux, MSDeployStatusInner> beginCre @ServiceMethod(returns = ReturnType.SINGLE) public Mono createInstanceMSDeployOperationSlotAsync( String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { - Mono>> mono = - createInstanceMSDeployOperationSlotWithResponseAsync(resourceGroupName, name, slot, instanceId, mSDeploy); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) + return beginCreateInstanceMSDeployOperationSlotAsync(resourceGroupName, name, slot, instanceId, mSDeploy) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -55885,15 +56373,10 @@ public Mono createInstanceMSDeployOperationSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createInstanceMSDeployOperationSlotAsync( String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { - Mono>> mono = - createInstanceMSDeployOperationSlotWithResponseAsync( - resourceGroupName, name, slot, instanceId, mSDeploy, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), MSDeployStatusInner.class, MSDeployStatusInner.class) + return beginCreateInstanceMSDeployOperationSlotAsync( + resourceGroupName, name, slot, instanceId, mSDeploy, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -56033,6 +56516,7 @@ public Mono> getInstanceMSDeployLogSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceMSDeployLogSlot( this.client.getEndpoint(), @@ -56247,6 +56731,7 @@ public Mono> listInstanceProcessesSlotSinglePage new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessesSlot( this.client.getEndpoint(), @@ -56468,6 +56953,7 @@ public Mono> getInstanceProcessSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceProcessSlot( this.client.getEndpoint(), @@ -56695,6 +57181,7 @@ public Mono> deleteInstanceProcessSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteInstanceProcessSlot( this.client.getEndpoint(), @@ -56908,6 +57395,7 @@ public Mono getInstanceProcessDumpSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceProcessDumpSlot( this.client.getEndpoint(), @@ -56985,11 +57473,24 @@ public Flux getInstanceProcessDumpSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getInstanceProcessDumpSlot( String resourceGroupName, String name, String processId, String slot, String instanceId) { - return getInstanceProcessDumpSlotAsync(resourceGroupName, name, processId, slot, instanceId) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getInstanceProcessDumpSlotAsync(resourceGroupName, name, processId, slot, instanceId) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -57011,11 +57512,24 @@ public InputStream getInstanceProcessDumpSlot( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getInstanceProcessDumpSlot( String resourceGroupName, String name, String processId, String slot, String instanceId, Context context) { - return getInstanceProcessDumpSlotAsync(resourceGroupName, name, processId, slot, instanceId, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getInstanceProcessDumpSlotAsync(resourceGroupName, name, processId, slot, instanceId, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -57137,6 +57651,7 @@ public Mono> listInstanceProcessModulesSlo new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessModulesSlot( this.client.getEndpoint(), @@ -57378,6 +57893,7 @@ public Mono> getInstanceProcessModuleSlotWithRe new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getInstanceProcessModuleSlot( this.client.getEndpoint(), @@ -57634,6 +58150,7 @@ public Mono> listInstanceProcessThreadsSlo new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessThreadsSlot( this.client.getEndpoint(), @@ -57838,6 +58355,7 @@ public Mono> isCloneableSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .isCloneableSlot( this.client.getEndpoint(), @@ -58031,6 +58549,7 @@ public Mono> listSiteBackupsSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteBackupsSlot( this.client.getEndpoint(), @@ -58215,6 +58734,7 @@ public Mono> listSyncFunctionTriggersSlotWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSyncFunctionTriggersSlot( this.client.getEndpoint(), @@ -58401,6 +58921,7 @@ public Mono> getMigrateMySqlStatusSlotWithResp new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getMigrateMySqlStatusSlot( this.client.getEndpoint(), @@ -58591,6 +59112,7 @@ public Mono> getSwiftVirtualNetworkConnection new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSwiftVirtualNetworkConnectionSlot( this.client.getEndpoint(), @@ -58807,6 +59329,7 @@ public Mono> createOrUpdateSwiftVirtualNetwor } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateSwiftVirtualNetworkConnectionSlot( this.client.getEndpoint(), @@ -59028,6 +59551,7 @@ public Mono> deleteSwiftVirtualNetworkSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSwiftVirtualNetworkSlot( this.client.getEndpoint(), @@ -59225,6 +59749,7 @@ public Mono> updateSwiftVirtualNetworkConnect } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateSwiftVirtualNetworkConnectionSlot( this.client.getEndpoint(), @@ -59453,6 +59978,7 @@ public Mono> listNetworkFeaturesSlotWithResponseA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNetworkFeaturesSlot( this.client.getEndpoint(), @@ -59658,6 +60184,7 @@ public Mono> getNetworkTraceOperationSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTraceOperationSlot( this.client.getEndpoint(), @@ -59871,6 +60398,7 @@ public Mono> startWebSiteNetworkTraceSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startWebSiteNetworkTraceSlot( this.client.getEndpoint(), @@ -60170,6 +60698,7 @@ public Mono>> startWebSiteNetworkTraceOperationSlotWit new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startWebSiteNetworkTraceOperationSlot( this.client.getEndpoint(), @@ -60199,7 +60728,7 @@ public Mono>> startWebSiteNetworkTraceOperationSlotWit * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationSlot( + public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationSlotAsync( String resourceGroupName, String name, String slot, @@ -60230,7 +60759,7 @@ public PollerFlux, Object> beginStartWebSiteNetworkTraceOpera * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationSlot( + public PollerFlux, Object> beginStartWebSiteNetworkTraceOperationSlotAsync( String resourceGroupName, String name, String slot, @@ -60246,6 +60775,62 @@ public PollerFlux, Object> beginStartWebSiteNetworkTraceOpera .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class); } + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartWebSiteNetworkTraceOperationSlot( + String resourceGroupName, + String name, + String slot, + Integer durationInSeconds, + Integer maxFrameLength, + String sasUrl) { + return beginStartWebSiteNetworkTraceOperationSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) + .getSyncPoller(); + } + + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartWebSiteNetworkTraceOperationSlot( + String resourceGroupName, + String name, + String slot, + Integer durationInSeconds, + Integer maxFrameLength, + String sasUrl, + Context context) { + return beginStartWebSiteNetworkTraceOperationSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) + .getSyncPoller(); + } + /** * Description for Start capturing network packets for the site. * @@ -60268,14 +60853,10 @@ public Mono startWebSiteNetworkTraceOperationSlotAsync( Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - Mono>> mono = - startWebSiteNetworkTraceOperationSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartWebSiteNetworkTraceOperationSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -60302,14 +60883,10 @@ public Mono startWebSiteNetworkTraceOperationSlotAsync( Integer maxFrameLength, String sasUrl, Context context) { - Mono>> mono = - startWebSiteNetworkTraceOperationSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartWebSiteNetworkTraceOperationSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -60329,14 +60906,10 @@ public Mono startWebSiteNetworkTraceOperationSlotAsync(String resourceGr final Integer maxFrameLength = null; final String sasUrl = null; final Context context = null; - Mono>> mono = - startWebSiteNetworkTraceOperationSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartWebSiteNetworkTraceOperationSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -60505,6 +61078,7 @@ public Mono> stopWebSiteNetworkTraceSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopWebSiteNetworkTraceSlot( this.client.getEndpoint(), @@ -60682,6 +61256,7 @@ public Mono>> getNetworkTracesSlotWithResponseA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTracesSlot( this.client.getEndpoint(), @@ -60887,6 +61462,7 @@ public Mono> getNetworkTraceOperationSlotV2WithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTraceOperationSlotV2( this.client.getEndpoint(), @@ -61092,6 +61668,7 @@ public Mono>> getNetworkTracesSlotV2WithRespons new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getNetworkTracesSlotV2( this.client.getEndpoint(), @@ -61288,6 +61865,7 @@ public Mono> generateNewSitePublishingPasswordSlotWithResponseAsy new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .generateNewSitePublishingPasswordSlot( this.client.getEndpoint(), @@ -61475,6 +62053,7 @@ public Mono> listPerfMonCountersSlotSinglePa new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPerfMonCountersSlot( this.client.getEndpoint(), @@ -61710,6 +62289,7 @@ public Mono> getSitePhpErrorLogFlagSlotWithRe new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSitePhpErrorLogFlagSlot( this.client.getEndpoint(), @@ -61896,6 +62476,7 @@ public Mono> listPremierAddOnsSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPremierAddOnsSlot( this.client.getEndpoint(), @@ -62096,6 +62677,7 @@ public Mono> getPremierAddOnSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPremierAddOnSlot( this.client.getEndpoint(), @@ -62321,6 +62903,7 @@ public Mono> addPremierAddOnSlotWithResponseAsync( } else { premierAddOn.validate(); } + context = this.client.mergeContext(context); return service .addPremierAddOnSlot( this.client.getEndpoint(), @@ -62544,6 +63127,7 @@ public Mono> deletePremierAddOnSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deletePremierAddOnSlot( this.client.getEndpoint(), @@ -62756,6 +63340,7 @@ public Mono> updatePremierAddOnSlotWithResponseAsync } else { premierAddOn.validate(); } + context = this.client.mergeContext(context); return service .updatePremierAddOnSlot( this.client.getEndpoint(), @@ -62977,6 +63562,7 @@ public Mono> getPrivateAccessSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPrivateAccessSlot( this.client.getEndpoint(), @@ -63179,6 +63765,7 @@ public Mono> putPrivateAccessVnetSlotWithResponseAs } else { access.validate(); } + context = this.client.mergeContext(context); return service .putPrivateAccessVnetSlot( this.client.getEndpoint(), @@ -63379,6 +63966,7 @@ public Mono> getPrivateEndpoint new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPrivateEndpointConnection( this.client.getEndpoint(), @@ -63596,6 +64184,7 @@ public Mono>> approveOrRejectPrivateEndpointConnection } else { privateEndpointWrapper.validate(); } + context = this.client.mergeContext(context); return service .approveOrRejectPrivateEndpointConnection( this.client.getEndpoint(), @@ -63622,7 +64211,7 @@ public Mono>> approveOrRejectPrivateEndpointConnection */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, PrivateEndpointConnectionResourceInner> - beginApproveOrRejectPrivateEndpointConnection( + beginApproveOrRejectPrivateEndpointConnectionAsync( String resourceGroupName, String name, String privateEndpointConnectionName, @@ -63654,7 +64243,7 @@ public Mono>> approveOrRejectPrivateEndpointConnection */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, PrivateEndpointConnectionResourceInner> - beginApproveOrRejectPrivateEndpointConnection( + beginApproveOrRejectPrivateEndpointConnectionAsync( String resourceGroupName, String name, String privateEndpointConnectionName, @@ -63672,6 +64261,56 @@ public Mono>> approveOrRejectPrivateEndpointConnection PrivateEndpointConnectionResourceInner.class); } + /** + * Description for Approves or rejects a private endpoint connection. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the site. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionResourceInner> + beginApproveOrRejectPrivateEndpointConnection( + String resourceGroupName, + String name, + String privateEndpointConnectionName, + PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) { + return beginApproveOrRejectPrivateEndpointConnectionAsync( + resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper) + .getSyncPoller(); + } + + /** + * Description for Approves or rejects a private endpoint connection. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the site. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return private Endpoint Connection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, PrivateEndpointConnectionResourceInner> + beginApproveOrRejectPrivateEndpointConnection( + String resourceGroupName, + String name, + String privateEndpointConnectionName, + PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, + Context context) { + return beginApproveOrRejectPrivateEndpointConnectionAsync( + resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, context) + .getSyncPoller(); + } + /** * Description for Approves or rejects a private endpoint connection. * @@ -63690,18 +64329,10 @@ public Mono approveOrRejectPrivateEndpoi String name, String privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) { - Mono>> mono = - approveOrRejectPrivateEndpointConnectionWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionResourceInner.class, - PrivateEndpointConnectionResourceInner.class) + return beginApproveOrRejectPrivateEndpointConnectionAsync( + resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -63724,18 +64355,10 @@ public Mono approveOrRejectPrivateEndpoi String privateEndpointConnectionName, PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, Context context) { - Mono>> mono = - approveOrRejectPrivateEndpointConnectionWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, context); - return this - .client - .getLroResultAsync( - mono, - this.client.getHttpPipeline(), - PrivateEndpointConnectionResourceInner.class, - PrivateEndpointConnectionResourceInner.class) + return beginApproveOrRejectPrivateEndpointConnectionAsync( + resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -63880,6 +64503,7 @@ public Mono>> deletePrivateEndpointConnectionWithRespo new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deletePrivateEndpointConnection( this.client.getEndpoint(), @@ -63903,7 +64527,7 @@ public Mono>> deletePrivateEndpointConnectionWithRespo * @return any object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginDeletePrivateEndpointConnection( + public PollerFlux, Object> beginDeletePrivateEndpointConnectionAsync( String resourceGroupName, String name, String privateEndpointConnectionName) { Mono>> mono = deletePrivateEndpointConnectionWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName); @@ -63925,7 +64549,7 @@ public PollerFlux, Object> beginDeletePrivateEndpointConnecti * @return any object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginDeletePrivateEndpointConnection( + public PollerFlux, Object> beginDeletePrivateEndpointConnectionAsync( String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { Mono>> mono = deletePrivateEndpointConnectionWithResponseAsync( @@ -63935,6 +64559,44 @@ public PollerFlux, Object> beginDeletePrivateEndpointConnecti .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class); } + /** + * Description for Deletes a private endpoint connection. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the site. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginDeletePrivateEndpointConnection( + String resourceGroupName, String name, String privateEndpointConnectionName) { + return beginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName) + .getSyncPoller(); + } + + /** + * Description for Deletes a private endpoint connection. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the site. + * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return any object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginDeletePrivateEndpointConnection( + String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { + return beginDeletePrivateEndpointConnectionAsync( + resourceGroupName, name, privateEndpointConnectionName, context) + .getSyncPoller(); + } + /** * Description for Deletes a private endpoint connection. * @@ -63949,13 +64611,9 @@ public PollerFlux, Object> beginDeletePrivateEndpointConnecti @ServiceMethod(returns = ReturnType.SINGLE) public Mono deletePrivateEndpointConnectionAsync( String resourceGroupName, String name, String privateEndpointConnectionName) { - Mono>> mono = - deletePrivateEndpointConnectionWithResponseAsync(resourceGroupName, name, privateEndpointConnectionName); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginDeletePrivateEndpointConnectionAsync(resourceGroupName, name, privateEndpointConnectionName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -63973,14 +64631,10 @@ public Mono deletePrivateEndpointConnectionAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono deletePrivateEndpointConnectionAsync( String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { - Mono>> mono = - deletePrivateEndpointConnectionWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginDeletePrivateEndpointConnectionAsync( + resourceGroupName, name, privateEndpointConnectionName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -64098,6 +64752,7 @@ public Mono> getPrivateLinkResourcesW new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPrivateLinkResources( this.client.getEndpoint(), @@ -64289,6 +64944,7 @@ public Mono> listProcessesSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessesSlot( this.client.getEndpoint(), @@ -64488,6 +65144,7 @@ public Mono> getProcessSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getProcessSlot( this.client.getEndpoint(), @@ -64694,6 +65351,7 @@ public Mono> deleteProcessSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteProcessSlot( this.client.getEndpoint(), @@ -64885,6 +65543,7 @@ public Mono getProcessDumpSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getProcessDumpSlot( this.client.getEndpoint(), @@ -64953,11 +65612,24 @@ public Flux getProcessDumpSlotAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getProcessDumpSlot(String resourceGroupName, String name, String processId, String slot) { - return getProcessDumpSlotAsync(resourceGroupName, name, processId, slot) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getProcessDumpSlotAsync(resourceGroupName, name, processId, slot) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -64977,11 +65649,24 @@ public InputStream getProcessDumpSlot(String resourceGroupName, String name, Str @ServiceMethod(returns = ReturnType.SINGLE) public InputStream getProcessDumpSlot( String resourceGroupName, String name, String processId, String slot, Context context) { - return getProcessDumpSlotAsync(resourceGroupName, name, processId, slot, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + getProcessDumpSlotAsync(resourceGroupName, name, processId, slot, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -65092,6 +65777,7 @@ public Mono> listProcessModulesSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessModulesSlot( this.client.getEndpoint(), @@ -65303,6 +65989,7 @@ public Mono> getProcessModuleSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getProcessModuleSlot( this.client.getEndpoint(), @@ -65522,6 +66209,7 @@ public Mono> listProcessThreadsSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessThreadsSlot( this.client.getEndpoint(), @@ -65724,6 +66412,7 @@ public Mono> listPublicCertificatesSlotSin new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPublicCertificatesSlot( this.client.getEndpoint(), @@ -65923,6 +66612,7 @@ public Mono> getPublicCertificateSlotWithRespon new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getPublicCertificateSlot( this.client.getEndpoint(), @@ -66154,6 +66844,7 @@ public Mono> createOrUpdatePublicCertificateSlo } else { publicCertificate.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdatePublicCertificateSlot( this.client.getEndpoint(), @@ -66390,6 +67081,7 @@ public Mono> deletePublicCertificateSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deletePublicCertificateSlot( this.client.getEndpoint(), @@ -66592,6 +67284,7 @@ public Mono listPublishingProfileXmlWithSecretsSlotWithResponseA } else { publishingProfileOptions.validate(); } + context = this.client.mergeContext(context); return service .listPublishingProfileXmlWithSecretsSlot( this.client.getEndpoint(), @@ -66667,11 +67360,24 @@ public Flux listPublishingProfileXmlWithSecretsSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public InputStream listPublishingProfileXmlWithSecretsSlot( String resourceGroupName, String name, String slot, CsmPublishingProfileOptions publishingProfileOptions) { - return listPublishingProfileXmlWithSecretsSlotAsync(resourceGroupName, name, slot, publishingProfileOptions) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + listPublishingProfileXmlWithSecretsSlotAsync(resourceGroupName, name, slot, publishingProfileOptions) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -66695,12 +67401,25 @@ public InputStream listPublishingProfileXmlWithSecretsSlot( String slot, CsmPublishingProfileOptions publishingProfileOptions, Context context) { - return listPublishingProfileXmlWithSecretsSlotAsync( - resourceGroupName, name, slot, publishingProfileOptions, context) - .map(ByteBufferBackedInputStream::new) - .collectList() - .map(list -> new SequenceInputStream(Collections.enumeration(list))) - .block(); + Iterator iterator = + listPublishingProfileXmlWithSecretsSlotAsync( + resourceGroupName, name, slot, publishingProfileOptions, context) + .map(ByteBufferBackedInputStream::new) + .toStream() + .iterator(); + Enumeration enumeration = + new Enumeration() { + @Override + public boolean hasMoreElements() { + return iterator.hasNext(); + } + + @Override + public InputStream nextElement() { + return iterator.next(); + } + }; + return new SequenceInputStream(enumeration); } /** @@ -66795,6 +67514,7 @@ public Mono> resetSlotConfigurationSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .resetSlotConfigurationSlot( this.client.getEndpoint(), @@ -66979,6 +67699,7 @@ public Mono> restartSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .restartSlot( this.client.getEndpoint(), @@ -67219,6 +67940,7 @@ public Mono>> restoreFromBackupBlobSlotWithResponseAsy } else { request.validate(); } + context = this.client.mergeContext(context); return service .restoreFromBackupBlobSlot( this.client.getEndpoint(), @@ -67245,7 +67967,7 @@ public Mono>> restoreFromBackupBlobSlotWithResponseAsy * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromBackupBlobSlot( + public PollerFlux, Void> beginRestoreFromBackupBlobSlotAsync( String resourceGroupName, String name, String slot, RestoreRequestInner request) { Mono>> mono = restoreFromBackupBlobSlotWithResponseAsync(resourceGroupName, name, slot, request); @@ -67267,13 +67989,52 @@ public PollerFlux, Void> beginRestoreFromBackupBlobSlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromBackupBlobSlot( + public PollerFlux, Void> beginRestoreFromBackupBlobSlotAsync( String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { Mono>> mono = restoreFromBackupBlobSlotWithResponseAsync(resourceGroupName, name, slot, request, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores an app from a backup blob in Azure Storage. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the + * production slot. + * @param request Description of a restore request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestoreFromBackupBlobSlot( + String resourceGroupName, String name, String slot, RestoreRequestInner request) { + return beginRestoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request).getSyncPoller(); + } + + /** + * Description for Restores an app from a backup blob in Azure Storage. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the + * production slot. + * @param request Description of a restore request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestoreFromBackupBlobSlot( + String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { + return beginRestoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request, context).getSyncPoller(); + } + /** * Description for Restores an app from a backup blob in Azure Storage. * @@ -67290,13 +68051,9 @@ public PollerFlux, Void> beginRestoreFromBackupBlobSlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreFromBackupBlobSlotAsync( String resourceGroupName, String name, String slot, RestoreRequestInner request) { - Mono>> mono = - restoreFromBackupBlobSlotWithResponseAsync(resourceGroupName, name, slot, request); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -67316,13 +68073,9 @@ public Mono restoreFromBackupBlobSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreFromBackupBlobSlotAsync( String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - Mono>> mono = - restoreFromBackupBlobSlotWithResponseAsync(resourceGroupName, name, slot, request, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreFromBackupBlobSlotAsync(resourceGroupName, name, slot, request, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -67463,6 +68216,7 @@ public Mono>> restoreFromDeletedAppSlotWithResponseAsy } else { restoreRequest.validate(); } + context = this.client.mergeContext(context); return service .restoreFromDeletedAppSlot( this.client.getEndpoint(), @@ -67488,7 +68242,7 @@ public Mono>> restoreFromDeletedAppSlotWithResponseAsy * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromDeletedAppSlot( + public PollerFlux, Void> beginRestoreFromDeletedAppSlotAsync( String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { Mono>> mono = restoreFromDeletedAppSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest); @@ -67509,13 +68263,51 @@ public PollerFlux, Void> beginRestoreFromDeletedAppSlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreFromDeletedAppSlot( + public PollerFlux, Void> beginRestoreFromDeletedAppSlotAsync( String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { Mono>> mono = restoreFromDeletedAppSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores a deleted web app to this web app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param restoreRequest Details about restoring a deleted app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestoreFromDeletedAppSlot( + String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { + return beginRestoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest).getSyncPoller(); + } + + /** + * Description for Restores a deleted web app to this web app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param restoreRequest Details about restoring a deleted app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestoreFromDeletedAppSlot( + String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { + return beginRestoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest, context) + .getSyncPoller(); + } + /** * Description for Restores a deleted web app to this web app. * @@ -67531,13 +68323,9 @@ public PollerFlux, Void> beginRestoreFromDeletedAppSlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreFromDeletedAppSlotAsync( String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { - Mono>> mono = - restoreFromDeletedAppSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -67556,13 +68344,9 @@ public Mono restoreFromDeletedAppSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreFromDeletedAppSlotAsync( String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { - Mono>> mono = - restoreFromDeletedAppSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreFromDeletedAppSlotAsync(resourceGroupName, name, slot, restoreRequest, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -67701,6 +68485,7 @@ public Mono>> restoreSnapshotSlotWithResponseAsync( } else { restoreRequest.validate(); } + context = this.client.mergeContext(context); return service .restoreSnapshotSlot( this.client.getEndpoint(), @@ -67726,7 +68511,7 @@ public Mono>> restoreSnapshotSlotWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSnapshotSlot( + public PollerFlux, Void> beginRestoreSnapshotSlotAsync( String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { Mono>> mono = restoreSnapshotSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest); @@ -67747,13 +68532,50 @@ public PollerFlux, Void> beginRestoreSnapshotSlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginRestoreSnapshotSlot( + public PollerFlux, Void> beginRestoreSnapshotSlotAsync( String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { Mono>> mono = restoreSnapshotSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Restores a web app from a snapshot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param restoreRequest Details about app recovery operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestoreSnapshotSlot( + String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { + return beginRestoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest).getSyncPoller(); + } + + /** + * Description for Restores a web app from a snapshot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of web app. + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param restoreRequest Details about app recovery operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginRestoreSnapshotSlot( + String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { + return beginRestoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest, context).getSyncPoller(); + } + /** * Description for Restores a web app from a snapshot. * @@ -67769,13 +68591,9 @@ public PollerFlux, Void> beginRestoreSnapshotSlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreSnapshotSlotAsync( String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { - Mono>> mono = - restoreSnapshotSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -67794,13 +68612,9 @@ public Mono restoreSnapshotSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono restoreSnapshotSlotAsync( String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { - Mono>> mono = - restoreSnapshotSlotWithResponseAsync(resourceGroupName, name, slot, restoreRequest, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginRestoreSnapshotSlotAsync(resourceGroupName, name, slot, restoreRequest, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -67935,6 +68749,7 @@ public Mono> listSiteExtensionsSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteExtensionsSlot( this.client.getEndpoint(), @@ -68128,6 +68943,7 @@ public Mono> getSiteExtensionSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSiteExtensionSlot( this.client.getEndpoint(), @@ -68329,6 +69145,7 @@ public Mono>> installSiteExtensionSlotWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .installSiteExtensionSlot( this.client.getEndpoint(), @@ -68354,7 +69171,7 @@ public Mono>> installSiteExtensionSlotWithResponseAsyn * @return site Extension Information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionSlot( + public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionSlotAsync( String resourceGroupName, String name, String siteExtensionId, String slot) { Mono>> mono = installSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot); @@ -68378,7 +69195,7 @@ public PollerFlux, SiteExtensionInfoInner> be * @return site Extension Information. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionSlot( + public PollerFlux, SiteExtensionInfoInner> beginInstallSiteExtensionSlotAsync( String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { Mono>> mono = installSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot, context); @@ -68388,6 +69205,44 @@ public PollerFlux, SiteExtensionInfoInner> be mono, this.client.getHttpPipeline(), SiteExtensionInfoInner.class, SiteExtensionInfoInner.class); } + /** + * Description for Install site extension on a web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site Extension Information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtensionSlot( + String resourceGroupName, String name, String siteExtensionId, String slot) { + return beginInstallSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot).getSyncPoller(); + } + + /** + * Description for Install site extension on a web site, or a deployment slot. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Site name. + * @param siteExtensionId Site extension name. + * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return site Extension Information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteExtensionInfoInner> beginInstallSiteExtensionSlot( + String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { + return beginInstallSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot, context) + .getSyncPoller(); + } + /** * Description for Install site extension on a web site, or a deployment slot. * @@ -68403,14 +69258,9 @@ public PollerFlux, SiteExtensionInfoInner> be @ServiceMethod(returns = ReturnType.SINGLE) public Mono installSiteExtensionSlotAsync( String resourceGroupName, String name, String siteExtensionId, String slot) { - Mono>> mono = - installSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteExtensionInfoInner.class, SiteExtensionInfoInner.class) + return beginInstallSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -68429,14 +69279,9 @@ public Mono installSiteExtensionSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono installSiteExtensionSlotAsync( String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - Mono>> mono = - installSiteExtensionSlotWithResponseAsync(resourceGroupName, name, siteExtensionId, slot, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteExtensionInfoInner.class, SiteExtensionInfoInner.class) + return beginInstallSiteExtensionSlotAsync(resourceGroupName, name, siteExtensionId, slot, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -68577,6 +69422,7 @@ public Mono> deleteSiteExtensionSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSiteExtensionSlot( this.client.getEndpoint(), @@ -68767,6 +69613,7 @@ public Mono>> copySlotWithResponseAsync( } else { copySlotEntity.validate(); } + context = this.client.mergeContext(context); return service .copySlot( this.client.getEndpoint(), @@ -68792,7 +69639,7 @@ public Mono>> copySlotWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginCopySlot( + public PollerFlux, Void> beginCopySlotAsync( String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity) { Mono>> mono = copySlotWithResponseAsync(resourceGroupName, name, slot, copySlotEntity); @@ -68813,13 +69660,50 @@ public PollerFlux, Void> beginCopySlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginCopySlot( + public PollerFlux, Void> beginCopySlotAsync( String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity, Context context) { Mono>> mono = copySlotWithResponseAsync(resourceGroupName, name, slot, copySlotEntity, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Copies a deployment slot to another deployment slot of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + * @param copySlotEntity Copy deployment slot parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginCopySlot( + String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity) { + return beginCopySlotAsync(resourceGroupName, name, slot, copySlotEntity).getSyncPoller(); + } + + /** + * Description for Copies a deployment slot to another deployment slot of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + * @param copySlotEntity Copy deployment slot parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginCopySlot( + String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity, Context context) { + return beginCopySlotAsync(resourceGroupName, name, slot, copySlotEntity, context).getSyncPoller(); + } + /** * Description for Copies a deployment slot to another deployment slot of an app. * @@ -68835,13 +69719,9 @@ public PollerFlux, Void> beginCopySlot( @ServiceMethod(returns = ReturnType.SINGLE) public Mono copySlotAsync( String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity) { - Mono>> mono = - copySlotWithResponseAsync(resourceGroupName, name, slot, copySlotEntity); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginCopySlotAsync(resourceGroupName, name, slot, copySlotEntity) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -68860,13 +69740,9 @@ public Mono copySlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono copySlotAsync( String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity, Context context) { - Mono>> mono = - copySlotWithResponseAsync(resourceGroupName, name, slot, copySlotEntity, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginCopySlotAsync(resourceGroupName, name, slot, copySlotEntity, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -69013,6 +69889,7 @@ public Mono> listSlotDifferencesSlotSinglePag } else { slotSwapEntity.validate(); } + context = this.client.mergeContext(context); return service .listSlotDifferencesSlot( this.client.getEndpoint(), @@ -69214,6 +70091,7 @@ public Mono>> swapSlotWithResponseAsync( } else { slotSwapEntity.validate(); } + context = this.client.mergeContext(context); return service .swapSlot( this.client.getEndpoint(), @@ -69239,7 +70117,7 @@ public Mono>> swapSlotWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginSwapSlot( + public PollerFlux, Void> beginSwapSlotAsync( String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { Mono>> mono = swapSlotWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity); @@ -69260,13 +70138,50 @@ public PollerFlux, Void> beginSwapSlot( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginSwapSlot( + public PollerFlux, Void> beginSwapSlotAsync( String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { Mono>> mono = swapSlotWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Swaps two deployment slots of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + * @param slotSwapEntity Deployment slot parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginSwapSlot( + String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { + return beginSwapSlotAsync(resourceGroupName, name, slot, slotSwapEntity).getSyncPoller(); + } + + /** + * Description for Swaps two deployment slots of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. + * @param slotSwapEntity Deployment slot parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginSwapSlot( + String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { + return beginSwapSlotAsync(resourceGroupName, name, slot, slotSwapEntity, context).getSyncPoller(); + } + /** * Description for Swaps two deployment slots of an app. * @@ -69281,13 +70196,9 @@ public PollerFlux, Void> beginSwapSlot( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono swapSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - Mono>> mono = - swapSlotWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginSwapSlotAsync(resourceGroupName, name, slot, slotSwapEntity) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -69306,13 +70217,9 @@ public Mono swapSlotAsync(String resourceGroupName, String name, String sl @ServiceMethod(returns = ReturnType.SINGLE) public Mono swapSlotAsync( String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - Mono>> mono = - swapSlotWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginSwapSlotAsync(resourceGroupName, name, slot, slotSwapEntity, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -69446,6 +70353,7 @@ public Mono> listSnapshotsSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsSlot( this.client.getEndpoint(), @@ -69635,6 +70543,7 @@ public Mono> listSnapshotsFromDRSecondarySlotSingle new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsFromDRSecondarySlot( this.client.getEndpoint(), @@ -69819,6 +70728,7 @@ public Mono> getSourceControlSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSourceControlSlot( this.client.getEndpoint(), @@ -70023,6 +70933,7 @@ public Mono>> createOrUpdateSourceControlSlotWithRespo } else { siteSourceControl.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateSourceControlSlot( this.client.getEndpoint(), @@ -70049,8 +70960,9 @@ public Mono>> createOrUpdateSourceControlSlotWithRespo * @return source control configuration for an app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { + public PollerFlux, SiteSourceControlInner> + beginCreateOrUpdateSourceControlSlotAsync( + String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { Mono>> mono = createOrUpdateSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, siteSourceControl); return this @@ -70074,8 +70986,13 @@ public PollerFlux, SiteSourceControlInner> be * @return source control configuration for an app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControlSlot( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { + public PollerFlux, SiteSourceControlInner> + beginCreateOrUpdateSourceControlSlotAsync( + String resourceGroupName, + String name, + String slot, + SiteSourceControlInner siteSourceControl, + Context context) { Mono>> mono = createOrUpdateSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, siteSourceControl, context); return this @@ -70084,6 +71001,47 @@ public PollerFlux, SiteSourceControlInner> be mono, this.client.getHttpPipeline(), SiteSourceControlInner.class, SiteSourceControlInner.class); } + /** + * Description for Updates the source control configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control + * configuration for the production slot. + * @param siteSourceControl Source control configuration for an app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return source control configuration for an app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControlSlot( + String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { + return beginCreateOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl) + .getSyncPoller(); + } + + /** + * Description for Updates the source control configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control + * configuration for the production slot. + * @param siteSourceControl Source control configuration for an app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return source control configuration for an app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControlSlot( + String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { + return beginCreateOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl, context) + .getSyncPoller(); + } + /** * Description for Updates the source control configuration of an app. * @@ -70100,14 +71058,9 @@ public PollerFlux, SiteSourceControlInner> be @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateSourceControlSlotAsync( String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - Mono>> mono = - createOrUpdateSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, siteSourceControl); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteSourceControlInner.class, SiteSourceControlInner.class) + return beginCreateOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -70127,14 +71080,9 @@ public Mono createOrUpdateSourceControlSlotAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateSourceControlSlotAsync( String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { - Mono>> mono = - createOrUpdateSourceControlSlotWithResponseAsync(resourceGroupName, name, slot, siteSourceControl, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteSourceControlInner.class, SiteSourceControlInner.class) + return beginCreateOrUpdateSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -70266,6 +71214,7 @@ public Mono> deleteSourceControlSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSourceControlSlot( this.client.getEndpoint(), @@ -70453,6 +71402,7 @@ public Mono> updateSourceControlSlotWithRespons } else { siteSourceControl.validate(); } + context = this.client.mergeContext(context); return service .updateSourceControlSlot( this.client.getEndpoint(), @@ -70646,6 +71596,7 @@ public Mono> startSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startSlot( this.client.getEndpoint(), @@ -70830,6 +71781,7 @@ public Mono>> startNetworkTraceSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startNetworkTraceSlot( this.client.getEndpoint(), @@ -70859,7 +71811,7 @@ public Mono>> startNetworkTraceSlotWithResponseAsync( * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartNetworkTraceSlot( + public PollerFlux, Object> beginStartNetworkTraceSlotAsync( String resourceGroupName, String name, String slot, @@ -70890,7 +71842,7 @@ public PollerFlux, Object> beginStartNetworkTraceSlot( * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartNetworkTraceSlot( + public PollerFlux, Object> beginStartNetworkTraceSlotAsync( String resourceGroupName, String name, String slot, @@ -70906,6 +71858,61 @@ public PollerFlux, Object> beginStartNetworkTraceSlot( .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class); } + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartNetworkTraceSlot( + String resourceGroupName, + String name, + String slot, + Integer durationInSeconds, + Integer maxFrameLength, + String sasUrl) { + return beginStartNetworkTraceSlotAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) + .getSyncPoller(); + } + + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param slot The name of the slot for this web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartNetworkTraceSlot( + String resourceGroupName, + String name, + String slot, + Integer durationInSeconds, + Integer maxFrameLength, + String sasUrl, + Context context) { + return beginStartNetworkTraceSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) + .getSyncPoller(); + } + /** * Description for Start capturing network packets for the site. * @@ -70928,14 +71935,9 @@ public Mono startNetworkTraceSlotAsync( Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - Mono>> mono = - startNetworkTraceSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartNetworkTraceSlotAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -70962,14 +71964,10 @@ public Mono startNetworkTraceSlotAsync( Integer maxFrameLength, String sasUrl, Context context) { - Mono>> mono = - startNetworkTraceSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartNetworkTraceSlotAsync( + resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -70989,14 +71987,9 @@ public Mono startNetworkTraceSlotAsync(String resourceGroupName, String final Integer maxFrameLength = null; final String sasUrl = null; final Context context = null; - Mono>> mono = - startNetworkTraceSlotWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartNetworkTraceSlotAsync(resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -71162,6 +72155,7 @@ public Mono> stopSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopSlot( this.client.getEndpoint(), @@ -71326,6 +72320,7 @@ public Mono> stopNetworkTraceSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopNetworkTraceSlot( this.client.getEndpoint(), @@ -71491,6 +72486,7 @@ public Mono> syncRepositorySlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .syncRepositorySlot( this.client.getEndpoint(), @@ -71656,6 +72652,7 @@ public Mono> syncFunctionTriggersSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .syncFunctionTriggersSlot( this.client.getEndpoint(), @@ -71833,6 +72830,7 @@ public Mono> listTriggeredWebJobsSlotSingleP new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobsSlot( this.client.getEndpoint(), @@ -72028,6 +73026,7 @@ public Mono> getTriggeredWebJobSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getTriggeredWebJobSlot( this.client.getEndpoint(), @@ -72229,6 +73228,7 @@ public Mono> deleteTriggeredWebJobSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteTriggeredWebJobSlot( this.client.getEndpoint(), @@ -72424,6 +73424,7 @@ public Mono> listTriggeredWebJobHistoryS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobHistorySlot( this.client.getEndpoint(), @@ -72630,6 +73631,7 @@ public Mono> getTriggeredWebJobHistorySlotWit new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getTriggeredWebJobHistorySlot( this.client.getEndpoint(), @@ -72834,6 +73836,7 @@ public Mono> runTriggeredWebJobSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .runTriggeredWebJobSlot( this.client.getEndpoint(), @@ -73025,6 +74028,7 @@ public Mono> listUsagesSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsagesSlot( this.client.getEndpoint(), @@ -73266,6 +74270,7 @@ public Mono>> listVnetConnectionsSlotWithResponseAs new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listVnetConnectionsSlot( this.client.getEndpoint(), @@ -73464,6 +74469,7 @@ public Mono> getVnetConnectionSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVnetConnectionSlot( this.client.getEndpoint(), @@ -73690,6 +74696,7 @@ public Mono> createOrUpdateVnetConnectionSlotWithRespons } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateVnetConnectionSlot( this.client.getEndpoint(), @@ -73919,6 +74926,7 @@ public Mono> deleteVnetConnectionSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteVnetConnectionSlot( this.client.getEndpoint(), @@ -74129,6 +75137,7 @@ public Mono> updateVnetConnectionSlotWithResponseAsync( } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateVnetConnectionSlot( this.client.getEndpoint(), @@ -74364,6 +75373,7 @@ public Mono> getVnetConnectionGatewaySlotWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVnetConnectionGatewaySlot( this.client.getEndpoint(), @@ -74612,6 +75622,7 @@ public Mono> createOrUpdateVnetConnectionGatewaySlotW } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateVnetConnectionGatewaySlot( this.client.getEndpoint(), @@ -74896,6 +75907,7 @@ public Mono> updateVnetConnectionGatewaySlotWithRespo } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateVnetConnectionGatewaySlot( this.client.getEndpoint(), @@ -75143,6 +76155,7 @@ public Mono> listWebJobsSlotSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebJobsSlot( this.client.getEndpoint(), @@ -75338,6 +76351,7 @@ public Mono> getWebJobSlotWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getWebJobSlot( this.client.getEndpoint(), @@ -75543,6 +76557,7 @@ public Mono> listSlotDifferencesFromProductio } else { slotSwapEntity.validate(); } + context = this.client.mergeContext(context); return service .listSlotDifferencesFromProduction( this.client.getEndpoint(), @@ -75730,6 +76745,7 @@ public Mono>> swapSlotWithProductionWithResponseAsync( } else { slotSwapEntity.validate(); } + context = this.client.mergeContext(context); return service .swapSlotWithProduction( this.client.getEndpoint(), @@ -75753,7 +76769,7 @@ public Mono>> swapSlotWithProductionWithResponseAsync( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginSwapSlotWithProduction( + public PollerFlux, Void> beginSwapSlotWithProductionAsync( String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { Mono>> mono = swapSlotWithProductionWithResponseAsync(resourceGroupName, name, slotSwapEntity); @@ -75773,13 +76789,48 @@ public PollerFlux, Void> beginSwapSlotWithProduction( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Void> beginSwapSlotWithProduction( + public PollerFlux, Void> beginSwapSlotWithProductionAsync( String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { Mono>> mono = swapSlotWithProductionWithResponseAsync(resourceGroupName, name, slotSwapEntity, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } + /** + * Description for Swaps two deployment slots of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity Deployment slot parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginSwapSlotWithProduction( + String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { + return beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity).getSyncPoller(); + } + + /** + * Description for Swaps two deployment slots of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param slotSwapEntity Deployment slot parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException 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> beginSwapSlotWithProduction( + String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { + return beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity, context).getSyncPoller(); + } + /** * Description for Swaps two deployment slots of an app. * @@ -75793,13 +76844,9 @@ public PollerFlux, Void> beginSwapSlotWithProduction( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono swapSlotWithProductionAsync(String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - Mono>> mono = - swapSlotWithProductionWithResponseAsync(resourceGroupName, name, slotSwapEntity); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -75817,13 +76864,9 @@ public Mono swapSlotWithProductionAsync(String resourceGroupName, String n @ServiceMethod(returns = ReturnType.SINGLE) public Mono swapSlotWithProductionAsync( String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - Mono>> mono = - swapSlotWithProductionWithResponseAsync(resourceGroupName, name, slotSwapEntity, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class) + return beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -75945,6 +76988,7 @@ public Mono> listSnapshotsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshots( this.client.getEndpoint(), @@ -76118,6 +77162,7 @@ public Mono> listSnapshotsFromDRSecondarySinglePage new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsFromDRSecondary( this.client.getEndpoint(), @@ -76284,6 +77329,7 @@ public Mono> getSourceControlWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getSourceControl( this.client.getEndpoint(), @@ -76466,6 +77512,7 @@ public Mono>> createOrUpdateSourceControlWithResponseA } else { siteSourceControl.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateSourceControl( this.client.getEndpoint(), @@ -76489,7 +77536,7 @@ public Mono>> createOrUpdateSourceControlWithResponseA * @return source control configuration for an app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControl( + public PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControlAsync( String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { Mono>> mono = createOrUpdateSourceControlWithResponseAsync(resourceGroupName, name, siteSourceControl); @@ -76512,7 +77559,7 @@ public PollerFlux, SiteSourceControlInner> be * @return source control configuration for an app. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControl( + public PollerFlux, SiteSourceControlInner> beginCreateOrUpdateSourceControlAsync( String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { Mono>> mono = createOrUpdateSourceControlWithResponseAsync(resourceGroupName, name, siteSourceControl, context); @@ -76522,6 +77569,42 @@ public PollerFlux, SiteSourceControlInner> be mono, this.client.getHttpPipeline(), SiteSourceControlInner.class, SiteSourceControlInner.class); } + /** + * Description for Updates the source control configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl Source control configuration for an app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return source control configuration for an app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControl( + String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { + return beginCreateOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl).getSyncPoller(); + } + + /** + * Description for Updates the source control configuration of an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Name of the app. + * @param siteSourceControl Source control configuration for an app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return source control configuration for an app. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SiteSourceControlInner> beginCreateOrUpdateSourceControl( + String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { + return beginCreateOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl, context) + .getSyncPoller(); + } + /** * Description for Updates the source control configuration of an app. * @@ -76536,14 +77619,9 @@ public PollerFlux, SiteSourceControlInner> be @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateSourceControlAsync( String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - Mono>> mono = - createOrUpdateSourceControlWithResponseAsync(resourceGroupName, name, siteSourceControl); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteSourceControlInner.class, SiteSourceControlInner.class) + return beginCreateOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -76561,14 +77639,9 @@ public Mono createOrUpdateSourceControlAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Mono createOrUpdateSourceControlAsync( String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - Mono>> mono = - createOrUpdateSourceControlWithResponseAsync(resourceGroupName, name, siteSourceControl, context); - return this - .client - .getLroResultAsync( - mono, this.client.getHttpPipeline(), SiteSourceControlInner.class, SiteSourceControlInner.class) + return beginCreateOrUpdateSourceControlAsync(resourceGroupName, name, siteSourceControl, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -76684,6 +77757,7 @@ public Mono> deleteSourceControlWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteSourceControl( this.client.getEndpoint(), @@ -76850,6 +77924,7 @@ public Mono> updateSourceControlWithResponseAsy } else { siteSourceControl.validate(); } + context = this.client.mergeContext(context); return service .updateSourceControl( this.client.getEndpoint(), @@ -77024,6 +78099,7 @@ public Mono> startWithResponseAsync(String resourceGroupName, Str new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .start( this.client.getEndpoint(), @@ -77187,6 +78263,7 @@ public Mono>> startNetworkTraceWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .startNetworkTrace( this.client.getEndpoint(), @@ -77214,7 +78291,7 @@ public Mono>> startNetworkTraceWithResponseAsync( * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartNetworkTrace( + public PollerFlux, Object> beginStartNetworkTraceAsync( String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { Mono>> mono = startNetworkTraceWithResponseAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); @@ -77238,7 +78315,7 @@ public PollerFlux, Object> beginStartNetworkTrace( * @return array of NetworkTrace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PollerFlux, Object> beginStartNetworkTrace( + public PollerFlux, Object> beginStartNetworkTraceAsync( String resourceGroupName, String name, Integer durationInSeconds, @@ -77253,6 +78330,52 @@ public PollerFlux, Object> beginStartNetworkTrace( .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class); } + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartNetworkTrace( + String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { + return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) + .getSyncPoller(); + } + + /** + * Description for Start capturing network packets for the site. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name The name of the web app. + * @param durationInSeconds The duration to keep capturing in seconds. + * @param maxFrameLength The maximum frame length in bytes (Optional). + * @param sasUrl The Blob URL to store capture file. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return array of NetworkTrace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Object> beginStartNetworkTrace( + String resourceGroupName, + String name, + Integer durationInSeconds, + Integer maxFrameLength, + String sasUrl, + Context context) { + return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) + .getSyncPoller(); + } + /** * Description for Start capturing network packets for the site. * @@ -77269,13 +78392,9 @@ public PollerFlux, Object> beginStartNetworkTrace( @ServiceMethod(returns = ReturnType.SINGLE) public Mono startNetworkTraceAsync( String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - Mono>> mono = - startNetworkTraceWithResponseAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -77300,14 +78419,9 @@ public Mono startNetworkTraceAsync( Integer maxFrameLength, String sasUrl, Context context) { - Mono>> mono = - startNetworkTraceWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -77326,13 +78440,9 @@ public Mono startNetworkTraceAsync(String resourceGroupName, String name final Integer maxFrameLength = null; final String sasUrl = null; final Context context = null; - Mono>> mono = - startNetworkTraceWithResponseAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl); - return this - .client - .getLroResultAsync(mono, this.client.getHttpPipeline(), Object.class, Object.class) + return beginStartNetworkTraceAsync(resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -77476,6 +78586,7 @@ public Mono> stopWithResponseAsync(String resourceGroupName, Stri new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stop( this.client.getEndpoint(), @@ -77624,6 +78735,7 @@ public Mono> stopNetworkTraceWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .stopNetworkTrace( this.client.getEndpoint(), @@ -77773,6 +78885,7 @@ public Mono> syncRepositoryWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .syncRepository( this.client.getEndpoint(), @@ -77922,6 +79035,7 @@ public Mono> syncFunctionTriggersWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .syncFunctionTriggers( this.client.getEndpoint(), @@ -78082,6 +79196,7 @@ public Mono> listTriggeredWebJobsSinglePageA new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobs( this.client.getEndpoint(), @@ -78257,6 +79372,7 @@ public Mono> getTriggeredWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getTriggeredWebJob( this.client.getEndpoint(), @@ -78441,6 +79557,7 @@ public Mono> deleteTriggeredWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteTriggeredWebJob( this.client.getEndpoint(), @@ -78616,6 +79733,7 @@ public Mono> listTriggeredWebJobHistoryS new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobHistory( this.client.getEndpoint(), @@ -78807,6 +79925,7 @@ public Mono> getTriggeredWebJobHistoryWithRes new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getTriggeredWebJobHistory( this.client.getEndpoint(), @@ -78997,6 +80116,7 @@ public Mono> runTriggeredWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .runTriggeredWebJob( this.client.getEndpoint(), @@ -79170,6 +80290,7 @@ public Mono> listUsagesSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsages( this.client.getEndpoint(), @@ -79385,6 +80506,7 @@ public Mono>> listVnetConnectionsWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listVnetConnections( this.client.getEndpoint(), @@ -79561,6 +80683,7 @@ public Mono> getVnetConnectionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVnetConnection( this.client.getEndpoint(), @@ -79760,6 +80883,7 @@ public Mono> createOrUpdateVnetConnectionWithResponseAsy } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateVnetConnection( this.client.getEndpoint(), @@ -79956,6 +81080,7 @@ public Mono> deleteVnetConnectionWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .deleteVnetConnection( this.client.getEndpoint(), @@ -80139,6 +81264,7 @@ public Mono> updateVnetConnectionWithResponseAsync( } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateVnetConnection( this.client.getEndpoint(), @@ -80342,6 +81468,7 @@ public Mono> getVnetConnectionGatewayWithResponseAsyn new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getVnetConnectionGateway( this.client.getEndpoint(), @@ -80567,6 +81694,7 @@ public Mono> createOrUpdateVnetConnectionGatewayWithR } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .createOrUpdateVnetConnectionGateway( this.client.getEndpoint(), @@ -80825,6 +81953,7 @@ public Mono> updateVnetConnectionGatewayWithResponseA } else { connectionEnvelope.validate(); } + context = this.client.mergeContext(context); return service .updateVnetConnectionGateway( this.client.getEndpoint(), @@ -81046,6 +82175,7 @@ public Mono> listWebJobsSinglePageAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebJobs( this.client.getEndpoint(), @@ -81219,6 +82349,7 @@ public Mono> getWebJobWithResponseAsync( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getWebJob( this.client.getEndpoint(), @@ -81312,7089 +82443,6 @@ public WebJobInner getWebJob(String resourceGroupName, String name, String webJo return getWebJobAsync(resourceGroupName, name, webJobName, context).block(); } - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String name, SiteInner siteEnvelope) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String name, SiteInner siteEnvelope, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - context); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String name, SiteInner siteEnvelope) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, name, siteEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, name, siteEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner beginCreateOrUpdateWithoutPolling(String resourceGroupName, String name, SiteInner siteEnvelope) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, name, siteEnvelope).block(); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String name, SiteInner siteEnvelope, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, name, siteEnvelope, context).block(); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId 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 (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId 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 (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return service - .beginRestoreWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreWithoutPollingAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request) { - return beginRestoreWithoutPollingWithResponseAsync(resourceGroupName, name, backupId, request) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreWithoutPollingAsync( - String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { - return beginRestoreWithoutPollingWithResponseAsync(resourceGroupName, name, backupId, request, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreWithoutPolling( - String resourceGroupName, String name, String backupId, RestoreRequestInner request) { - beginRestoreWithoutPollingAsync(resourceGroupName, name, backupId, request).block(); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreWithoutPolling( - String resourceGroupName, String name, String backupId, RestoreRequestInner request, Context context) { - beginRestoreWithoutPollingAsync(resourceGroupName, name, backupId, request, context).block(); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginListPublishingCredentialsWithoutPollingWithResponseAsync( - String resourceGroupName, String name) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - return FluxUtil - .withContext( - context -> - service - .beginListPublishingCredentialsWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginListPublishingCredentialsWithoutPollingWithResponseAsync( - String resourceGroupName, 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - return service - .beginListPublishingCredentialsWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginListPublishingCredentialsWithoutPollingAsync(String resourceGroupName, String name) { - return beginListPublishingCredentialsWithoutPollingWithResponseAsync(resourceGroupName, name) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginListPublishingCredentialsWithoutPollingAsync( - String resourceGroupName, String name, Context context) { - return beginListPublishingCredentialsWithoutPollingWithResponseAsync(resourceGroupName, name, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner beginListPublishingCredentialsWithoutPolling(String resourceGroupName, String name) { - return beginListPublishingCredentialsWithoutPollingAsync(resourceGroupName, name).block(); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner beginListPublishingCredentialsWithoutPolling( - String resourceGroupName, String name, Context context) { - return beginListPublishingCredentialsWithoutPollingAsync(resourceGroupName, name, context).block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateMSDeployOperationWithoutPollingWithResponseAsync( - String resourceGroupName, String name, MSDeploy mSDeploy) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateMSDeployOperationWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateMSDeployOperationWithoutPollingWithResponseAsync( - String resourceGroupName, String name, MSDeploy mSDeploy, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return service - .beginCreateMSDeployOperationWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateMSDeployOperationWithoutPollingAsync( - String resourceGroupName, String name, MSDeploy mSDeploy) { - return beginCreateMSDeployOperationWithoutPollingWithResponseAsync(resourceGroupName, name, mSDeploy) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateMSDeployOperationWithoutPollingAsync( - String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { - return beginCreateMSDeployOperationWithoutPollingWithResponseAsync(resourceGroupName, name, mSDeploy, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateMSDeployOperationWithoutPolling( - String resourceGroupName, String name, MSDeploy mSDeploy) { - return beginCreateMSDeployOperationWithoutPollingAsync(resourceGroupName, name, mSDeploy).block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateMSDeployOperationWithoutPolling( - String resourceGroupName, String name, MSDeploy mSDeploy, Context context) { - return beginCreateMSDeployOperationWithoutPollingAsync(resourceGroupName, name, mSDeploy, context).block(); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateFunctionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName 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 (functionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter functionEnvelope is required and cannot be null.")); - } else { - functionEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateFunctionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - functionEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateFunctionWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String functionName, - FunctionEnvelopeInner functionEnvelope, - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName 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 (functionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter functionEnvelope is required and cannot be null.")); - } else { - functionEnvelope.validate(); - } - return service - .beginCreateFunctionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - functionEnvelope, - context); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateFunctionWithoutPollingAsync( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { - return beginCreateFunctionWithoutPollingWithResponseAsync( - resourceGroupName, name, functionName, functionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateFunctionWithoutPollingAsync( - String resourceGroupName, - String name, - String functionName, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return beginCreateFunctionWithoutPollingWithResponseAsync( - resourceGroupName, name, functionName, functionEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner beginCreateFunctionWithoutPolling( - String resourceGroupName, String name, String functionName, FunctionEnvelopeInner functionEnvelope) { - return beginCreateFunctionWithoutPollingAsync(resourceGroupName, name, functionName, functionEnvelope).block(); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param functionEnvelope Function information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner beginCreateFunctionWithoutPolling( - String resourceGroupName, - String name, - String functionName, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return beginCreateFunctionWithoutPollingAsync(resourceGroupName, name, functionName, functionEnvelope, context) - .block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateInstanceMSDeployOperationWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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 (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateInstanceMSDeployOperationWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateInstanceMSDeployOperationWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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 (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return service - .beginCreateInstanceMSDeployOperationWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateInstanceMSDeployOperationWithoutPollingAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { - return beginCreateInstanceMSDeployOperationWithoutPollingWithResponseAsync( - resourceGroupName, name, instanceId, mSDeploy) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateInstanceMSDeployOperationWithoutPollingAsync( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { - return beginCreateInstanceMSDeployOperationWithoutPollingWithResponseAsync( - resourceGroupName, name, instanceId, mSDeploy, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateInstanceMSDeployOperationWithoutPolling( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy) { - return beginCreateInstanceMSDeployOperationWithoutPollingAsync(resourceGroupName, name, instanceId, mSDeploy) - .block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateInstanceMSDeployOperationWithoutPolling( - String resourceGroupName, String name, String instanceId, MSDeploy mSDeploy, Context context) { - return beginCreateInstanceMSDeployOperationWithoutPollingAsync( - resourceGroupName, name, instanceId, mSDeploy, context) - .block(); - } - - /** - * Description for Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Options for app content migration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginMigrateStorageWithoutPollingWithResponseAsync( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (migrationOptions == null) { - return Mono - .error(new IllegalArgumentException("Parameter migrationOptions is required and cannot be null.")); - } else { - migrationOptions.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginMigrateStorageWithoutPolling( - this.client.getEndpoint(), - subscriptionName, - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - migrationOptions, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Options for app content migration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginMigrateStorageWithoutPollingWithResponseAsync( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter subscriptionName is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (migrationOptions == null) { - return Mono - .error(new IllegalArgumentException("Parameter migrationOptions is required and cannot be null.")); - } else { - migrationOptions.validate(); - } - return service - .beginMigrateStorageWithoutPolling( - this.client.getEndpoint(), - subscriptionName, - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - migrationOptions, - context); - } - - /** - * Description for Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Options for app content migration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginMigrateStorageWithoutPollingAsync( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { - return beginMigrateStorageWithoutPollingWithResponseAsync( - subscriptionName, resourceGroupName, name, migrationOptions) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Options for app content migration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginMigrateStorageWithoutPollingAsync( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context) { - return beginMigrateStorageWithoutPollingWithResponseAsync( - subscriptionName, resourceGroupName, name, migrationOptions, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Options for app content migration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageMigrationResponseInner beginMigrateStorageWithoutPolling( - String subscriptionName, String resourceGroupName, String name, StorageMigrationOptions migrationOptions) { - return beginMigrateStorageWithoutPollingAsync(subscriptionName, resourceGroupName, name, migrationOptions) - .block(); - } - - /** - * Description for Restores a web app. - * - * @param subscriptionName Azure subscription. - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationOptions Options for app content migration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response for a migration of app content request. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageMigrationResponseInner beginMigrateStorageWithoutPolling( - String subscriptionName, - String resourceGroupName, - String name, - StorageMigrationOptions migrationOptions, - Context context) { - return beginMigrateStorageWithoutPollingAsync( - subscriptionName, resourceGroupName, name, migrationOptions, context) - .block(); - } - - /** - * Description for Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySQL migration request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginMigrateMySqlWithoutPollingWithResponseAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (migrationRequestEnvelope == null) { - return Mono - .error( - new IllegalArgumentException("Parameter migrationRequestEnvelope is required and cannot be null.")); - } else { - migrationRequestEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginMigrateMySqlWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - migrationRequestEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySQL migration request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginMigrateMySqlWithoutPollingWithResponseAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (migrationRequestEnvelope == null) { - return Mono - .error( - new IllegalArgumentException("Parameter migrationRequestEnvelope is required and cannot be null.")); - } else { - migrationRequestEnvelope.validate(); - } - return service - .beginMigrateMySqlWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - migrationRequestEnvelope, - context); - } - - /** - * Description for Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySQL migration request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginMigrateMySqlWithoutPollingAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { - return beginMigrateMySqlWithoutPollingWithResponseAsync(resourceGroupName, name, migrationRequestEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySQL migration request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginMigrateMySqlWithoutPollingAsync( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { - return beginMigrateMySqlWithoutPollingWithResponseAsync( - resourceGroupName, name, migrationRequestEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySQL migration request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationInner beginMigrateMySqlWithoutPolling( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope) { - return beginMigrateMySqlWithoutPollingAsync(resourceGroupName, name, migrationRequestEnvelope).block(); - } - - /** - * Description for Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param migrationRequestEnvelope MySQL migration request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an operation on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationInner beginMigrateMySqlWithoutPolling( - String resourceGroupName, String name, MigrateMySqlRequest migrationRequestEnvelope, Context context) { - return beginMigrateMySqlWithoutPollingAsync(resourceGroupName, name, migrationRequestEnvelope, context).block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWebSiteNetworkTraceOperationWithoutPollingWithResponseAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - return FluxUtil - .withContext( - context -> - service - .beginStartWebSiteNetworkTraceOperationWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWebSiteNetworkTraceOperationWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - return service - .beginStartWebSiteNetworkTraceOperationWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWebSiteNetworkTraceOperationWithoutPollingAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return beginStartWebSiteNetworkTraceOperationWithoutPollingWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWebSiteNetworkTraceOperationWithoutPollingAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartWebSiteNetworkTraceOperationWithoutPollingWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWebSiteNetworkTraceOperationWithoutPollingAsync( - String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartWebSiteNetworkTraceOperationWithoutPollingWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartWebSiteNetworkTraceOperationWithoutPolling( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return beginStartWebSiteNetworkTraceOperationWithoutPollingAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartWebSiteNetworkTraceOperationWithoutPolling( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartWebSiteNetworkTraceOperationWithoutPollingAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartWebSiteNetworkTraceOperationWithoutPolling(String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartWebSiteNetworkTraceOperationWithoutPollingAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreFromBackupBlobWithoutPollingWithResponseAsync( - String resourceGroupName, String name, RestoreRequestInner request) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreFromBackupBlobWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreFromBackupBlobWithoutPollingWithResponseAsync( - String resourceGroupName, String name, RestoreRequestInner request, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return service - .beginRestoreFromBackupBlobWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromBackupBlobWithoutPollingAsync( - String resourceGroupName, String name, RestoreRequestInner request) { - return beginRestoreFromBackupBlobWithoutPollingWithResponseAsync(resourceGroupName, name, request) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromBackupBlobWithoutPollingAsync( - String resourceGroupName, String name, RestoreRequestInner request, Context context) { - return beginRestoreFromBackupBlobWithoutPollingWithResponseAsync(resourceGroupName, name, request, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromBackupBlobWithoutPolling( - String resourceGroupName, String name, RestoreRequestInner request) { - beginRestoreFromBackupBlobWithoutPollingAsync(resourceGroupName, name, request).block(); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromBackupBlobWithoutPolling( - String resourceGroupName, String name, RestoreRequestInner request, Context context) { - beginRestoreFromBackupBlobWithoutPollingAsync(resourceGroupName, name, request, context).block(); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreFromDeletedAppWithoutPollingWithResponseAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreFromDeletedAppWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreFromDeletedAppWithoutPollingWithResponseAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return service - .beginRestoreFromDeletedAppWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromDeletedAppWithoutPollingAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - return beginRestoreFromDeletedAppWithoutPollingWithResponseAsync(resourceGroupName, name, restoreRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromDeletedAppWithoutPollingAsync( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { - return beginRestoreFromDeletedAppWithoutPollingWithResponseAsync( - resourceGroupName, name, restoreRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromDeletedAppWithoutPolling( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest) { - beginRestoreFromDeletedAppWithoutPollingAsync(resourceGroupName, name, restoreRequest).block(); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromDeletedAppWithoutPolling( - String resourceGroupName, String name, DeletedAppRestoreRequest restoreRequest, Context context) { - beginRestoreFromDeletedAppWithoutPollingAsync(resourceGroupName, name, restoreRequest, context).block(); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about app recovery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreSnapshotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreSnapshotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about app recovery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreSnapshotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return service - .beginRestoreSnapshotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about app recovery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreSnapshotWithoutPollingAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { - return beginRestoreSnapshotWithoutPollingWithResponseAsync(resourceGroupName, name, restoreRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about app recovery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreSnapshotWithoutPollingAsync( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { - return beginRestoreSnapshotWithoutPollingWithResponseAsync(resourceGroupName, name, restoreRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about app recovery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreSnapshotWithoutPolling( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest) { - beginRestoreSnapshotWithoutPollingAsync(resourceGroupName, name, restoreRequest).block(); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param restoreRequest Details about app recovery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreSnapshotWithoutPolling( - String resourceGroupName, String name, SnapshotRestoreRequest restoreRequest, Context context) { - beginRestoreSnapshotWithoutPollingAsync(resourceGroupName, name, restoreRequest, context).block(); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginInstallSiteExtensionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId 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.")); - } - return FluxUtil - .withContext( - context -> - service - .beginInstallSiteExtensionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginInstallSiteExtensionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId 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.")); - } - return service - .beginInstallSiteExtensionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginInstallSiteExtensionWithoutPollingAsync( - String resourceGroupName, String name, String siteExtensionId) { - return beginInstallSiteExtensionWithoutPollingWithResponseAsync(resourceGroupName, name, siteExtensionId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginInstallSiteExtensionWithoutPollingAsync( - String resourceGroupName, String name, String siteExtensionId, Context context) { - return beginInstallSiteExtensionWithoutPollingWithResponseAsync( - resourceGroupName, name, siteExtensionId, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner beginInstallSiteExtensionWithoutPolling( - String resourceGroupName, String name, String siteExtensionId) { - return beginInstallSiteExtensionWithoutPollingAsync(resourceGroupName, name, siteExtensionId).block(); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner beginInstallSiteExtensionWithoutPolling( - String resourceGroupName, String name, String siteExtensionId, Context context) { - return beginInstallSiteExtensionWithoutPollingAsync(resourceGroupName, name, siteExtensionId, context).block(); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param copySlotEntity Copy deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginCopyProductionSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (copySlotEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter copySlotEntity is required and cannot be null.")); - } else { - copySlotEntity.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCopyProductionSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - copySlotEntity, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param copySlotEntity Copy deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginCopyProductionSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (copySlotEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter copySlotEntity is required and cannot be null.")); - } else { - copySlotEntity.validate(); - } - return service - .beginCopyProductionSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - copySlotEntity, - context); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param copySlotEntity Copy deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginCopyProductionSlotWithoutPollingAsync( - String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity) { - return beginCopyProductionSlotWithoutPollingWithResponseAsync(resourceGroupName, name, copySlotEntity) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param copySlotEntity Copy deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginCopyProductionSlotWithoutPollingAsync( - String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity, Context context) { - return beginCopyProductionSlotWithoutPollingWithResponseAsync(resourceGroupName, name, copySlotEntity, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param copySlotEntity Copy deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginCopyProductionSlotWithoutPolling( - String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity) { - beginCopyProductionSlotWithoutPollingAsync(resourceGroupName, name, copySlotEntity).block(); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param copySlotEntity Copy deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginCopyProductionSlotWithoutPolling( - String resourceGroupName, String name, CsmCopySlotEntityInner copySlotEntity, Context context) { - beginCopyProductionSlotWithoutPollingAsync(resourceGroupName, name, copySlotEntity, context).block(); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (siteEnvelope == null) { - return Mono.error(new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null.")); - } else { - siteEnvelope.validate(); - } - return service - .beginCreateOrUpdateSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteEnvelope, - context); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { - return beginCreateOrUpdateSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, siteEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { - return beginCreateOrUpdateSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, siteEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner beginCreateOrUpdateSlotWithoutPolling( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { - return beginCreateOrUpdateSlotWithoutPollingAsync(resourceGroupName, name, slot, siteEnvelope).block(); - } - - /** - * Description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Unique name of the app to create or update. To create or update a deployment slot, use the {slot} - * parameter. - * @param slot Name of the deployment slot to create or update. By default, this API attempts to create or modify - * the production slot. - * @param siteEnvelope A web app, a mobile app backend, or an API app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a web app, a mobile app backend, or an API app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteInner beginCreateOrUpdateSlotWithoutPolling( - String resourceGroupName, String name, String slot, SiteInner siteEnvelope, Context context) { - return beginCreateOrUpdateSlotWithoutPollingAsync(resourceGroupName, name, slot, siteEnvelope, context).block(); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String backupId, - String slot, - RestoreRequestInner request, - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (backupId == null) { - return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return service - .beginRestoreSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - backupId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreSlotWithoutPollingAsync( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { - return beginRestoreSlotWithoutPollingWithResponseAsync(resourceGroupName, name, backupId, slot, request) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String backupId, - String slot, - RestoreRequestInner request, - Context context) { - return beginRestoreSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, backupId, slot, request, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreSlotWithoutPolling( - String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { - beginRestoreSlotWithoutPollingAsync(resourceGroupName, name, backupId, slot, request).block(); - } - - /** - * Description for Restores a specific backup to another app (or deployment slot, if specified). - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param backupId ID of the backup. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreSlotWithoutPolling( - String resourceGroupName, - String name, - String backupId, - String slot, - RestoreRequestInner request, - Context context) { - beginRestoreSlotWithoutPollingAsync(resourceGroupName, name, backupId, slot, request, context).block(); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginListPublishingCredentialsSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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.")); - } - return FluxUtil - .withContext( - context -> - service - .beginListPublishingCredentialsSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginListPublishingCredentialsSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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.")); - } - return service - .beginListPublishingCredentialsSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginListPublishingCredentialsSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot) { - return beginListPublishingCredentialsSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginListPublishingCredentialsSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, Context context) { - return beginListPublishingCredentialsSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner beginListPublishingCredentialsSlotWithoutPolling( - String resourceGroupName, String name, String slot) { - return beginListPublishingCredentialsSlotWithoutPollingAsync(resourceGroupName, name, slot).block(); - } - - /** - * Description for Gets the Git/FTP publishing credentials of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will get the publishing credentials - * for the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return user credentials used for publishing activity. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public UserInner beginListPublishingCredentialsSlotWithoutPolling( - String resourceGroupName, String name, String slot, Context context) { - return beginListPublishingCredentialsSlotWithoutPollingAsync(resourceGroupName, name, slot, context).block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateMSDeployOperationSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateMSDeployOperationSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateMSDeployOperationSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return service - .beginCreateMSDeployOperationSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateMSDeployOperationSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - return beginCreateMSDeployOperationSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, mSDeploy) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateMSDeployOperationSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - return beginCreateMSDeployOperationSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, mSDeploy, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateMSDeployOperationSlotWithoutPolling( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy) { - return beginCreateMSDeployOperationSlotWithoutPollingAsync(resourceGroupName, name, slot, mSDeploy).block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateMSDeployOperationSlotWithoutPolling( - String resourceGroupName, String name, String slot, MSDeploy mSDeploy, Context context) { - return beginCreateMSDeployOperationSlotWithoutPollingAsync(resourceGroupName, name, slot, mSDeploy, context) - .block(); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateInstanceFunctionSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (functionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter functionEnvelope is required and cannot be null.")); - } else { - functionEnvelope.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateInstanceFunctionSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - functionEnvelope, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateInstanceFunctionSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope, - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (functionName == null) { - return Mono.error(new IllegalArgumentException("Parameter functionName is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (functionEnvelope == null) { - return Mono - .error(new IllegalArgumentException("Parameter functionEnvelope is required and cannot be null.")); - } else { - functionEnvelope.validate(); - } - return service - .beginCreateInstanceFunctionSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - functionName, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - functionEnvelope, - context); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateInstanceFunctionSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope) { - return beginCreateInstanceFunctionSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, functionName, slot, functionEnvelope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateInstanceFunctionSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return beginCreateInstanceFunctionSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, functionName, slot, functionEnvelope, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner beginCreateInstanceFunctionSlotWithoutPolling( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope) { - return beginCreateInstanceFunctionSlotWithoutPollingAsync( - resourceGroupName, name, functionName, slot, functionEnvelope) - .block(); - } - - /** - * Description for Create function for web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param functionName Function name. - * @param slot Name of the deployment slot. - * @param functionEnvelope Function information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return function information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FunctionEnvelopeInner beginCreateInstanceFunctionSlotWithoutPolling( - String resourceGroupName, - String name, - String functionName, - String slot, - FunctionEnvelopeInner functionEnvelope, - Context context) { - return beginCreateInstanceFunctionSlotWithoutPollingAsync( - resourceGroupName, name, functionName, slot, functionEnvelope, context) - .block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateInstanceMSDeployOperationSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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 (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateInstanceMSDeployOperationSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateInstanceMSDeployOperationSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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 (mSDeploy == null) { - return Mono.error(new IllegalArgumentException("Parameter mSDeploy is required and cannot be null.")); - } else { - mSDeploy.validate(); - } - return service - .beginCreateInstanceMSDeployOperationSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - instanceId, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - mSDeploy, - context); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateInstanceMSDeployOperationSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { - return beginCreateInstanceMSDeployOperationSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, instanceId, mSDeploy) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateInstanceMSDeployOperationSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { - return beginCreateInstanceMSDeployOperationSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, instanceId, mSDeploy, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateInstanceMSDeployOperationSlotWithoutPolling( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy) { - return beginCreateInstanceMSDeployOperationSlotWithoutPollingAsync( - resourceGroupName, name, slot, instanceId, mSDeploy) - .block(); - } - - /** - * Description for Invoke the MSDeploy web app extension. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param instanceId ID of web app instance. - * @param mSDeploy MSDeploy ARM PUT information. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return mSDeploy ARM response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MSDeployStatusInner beginCreateInstanceMSDeployOperationSlotWithoutPolling( - String resourceGroupName, String name, String slot, String instanceId, MSDeploy mSDeploy, Context context) { - return beginCreateInstanceMSDeployOperationSlotWithoutPollingAsync( - resourceGroupName, name, slot, instanceId, mSDeploy, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWebSiteNetworkTraceOperationSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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.")); - } - return FluxUtil - .withContext( - context -> - service - .beginStartWebSiteNetworkTraceOperationSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartWebSiteNetworkTraceOperationSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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.")); - } - return service - .beginStartWebSiteNetworkTraceOperationSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWebSiteNetworkTraceOperationSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return beginStartWebSiteNetworkTraceOperationSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWebSiteNetworkTraceOperationSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartWebSiteNetworkTraceOperationSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartWebSiteNetworkTraceOperationSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartWebSiteNetworkTraceOperationSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartWebSiteNetworkTraceOperationSlotWithoutPolling( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return beginStartWebSiteNetworkTraceOperationSlotWithoutPollingAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartWebSiteNetworkTraceOperationSlotWithoutPolling( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartWebSiteNetworkTraceOperationSlotWithoutPollingAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartWebSiteNetworkTraceOperationSlotWithoutPolling( - String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartWebSiteNetworkTraceOperationSlotWithoutPollingAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Approves or rejects a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - beginApproveOrRejectPrivateEndpointConnectionWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName 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 (privateEndpointWrapper == null) { - return Mono - .error( - new IllegalArgumentException("Parameter privateEndpointWrapper is required and cannot be null.")); - } else { - privateEndpointWrapper.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginApproveOrRejectPrivateEndpointConnectionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - privateEndpointWrapper, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Approves or rejects a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - beginApproveOrRejectPrivateEndpointConnectionWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName 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 (privateEndpointWrapper == null) { - return Mono - .error( - new IllegalArgumentException("Parameter privateEndpointWrapper is required and cannot be null.")); - } else { - privateEndpointWrapper.validate(); - } - return service - .beginApproveOrRejectPrivateEndpointConnectionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - privateEndpointWrapper, - context); - } - - /** - * Description for Approves or rejects a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono - beginApproveOrRejectPrivateEndpointConnectionWithoutPollingAsync( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) { - return beginApproveOrRejectPrivateEndpointConnectionWithoutPollingWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Approves or rejects a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono - beginApproveOrRejectPrivateEndpointConnectionWithoutPollingAsync( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, - Context context) { - return beginApproveOrRejectPrivateEndpointConnectionWithoutPollingWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Approves or rejects a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionResourceInner beginApproveOrRejectPrivateEndpointConnectionWithoutPolling( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper) { - return beginApproveOrRejectPrivateEndpointConnectionWithoutPollingAsync( - resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper) - .block(); - } - - /** - * Description for Approves or rejects a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param privateEndpointWrapper Private Endpoint Connection Approval ARM resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return private Endpoint Connection ARM resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateEndpointConnectionResourceInner beginApproveOrRejectPrivateEndpointConnectionWithoutPolling( - String resourceGroupName, - String name, - String privateEndpointConnectionName, - PrivateLinkConnectionApprovalRequestResource privateEndpointWrapper, - Context context) { - return beginApproveOrRejectPrivateEndpointConnectionWithoutPollingAsync( - resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, context) - .block(); - } - - /** - * Description for Deletes a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeletePrivateEndpointConnectionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String privateEndpointConnectionName) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName 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.")); - } - return FluxUtil - .withContext( - context -> - service - .beginDeletePrivateEndpointConnectionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Deletes a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeletePrivateEndpointConnectionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (privateEndpointConnectionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter privateEndpointConnectionName 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.")); - } - return service - .beginDeletePrivateEndpointConnectionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - privateEndpointConnectionName, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Deletes a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeletePrivateEndpointConnectionWithoutPollingAsync( - String resourceGroupName, String name, String privateEndpointConnectionName) { - return beginDeletePrivateEndpointConnectionWithoutPollingWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Deletes a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeletePrivateEndpointConnectionWithoutPollingAsync( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { - return beginDeletePrivateEndpointConnectionWithoutPollingWithResponseAsync( - resourceGroupName, name, privateEndpointConnectionName, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Deletes a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginDeletePrivateEndpointConnectionWithoutPolling( - String resourceGroupName, String name, String privateEndpointConnectionName) { - return beginDeletePrivateEndpointConnectionWithoutPollingAsync( - resourceGroupName, name, privateEndpointConnectionName) - .block(); - } - - /** - * Description for Deletes a private endpoint connection. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the site. - * @param privateEndpointConnectionName The privateEndpointConnectionName parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return any object. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginDeletePrivateEndpointConnectionWithoutPolling( - String resourceGroupName, String name, String privateEndpointConnectionName, Context context) { - return beginDeletePrivateEndpointConnectionWithoutPollingAsync( - resourceGroupName, name, privateEndpointConnectionName, context) - .block(); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreFromBackupBlobSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreFromBackupBlobSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreFromBackupBlobSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (request == null) { - return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null.")); - } else { - request.validate(); - } - return service - .beginRestoreFromBackupBlobSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - request, - context); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromBackupBlobSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - return beginRestoreFromBackupBlobSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, request) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromBackupBlobSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - return beginRestoreFromBackupBlobSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, request, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromBackupBlobSlotWithoutPolling( - String resourceGroupName, String name, String slot, RestoreRequestInner request) { - beginRestoreFromBackupBlobSlotWithoutPollingAsync(resourceGroupName, name, slot, request).block(); - } - - /** - * Description for Restores an app from a backup blob in Azure Storage. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will restore a backup of the - * production slot. - * @param request Description of a restore request. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromBackupBlobSlotWithoutPolling( - String resourceGroupName, String name, String slot, RestoreRequestInner request, Context context) { - beginRestoreFromBackupBlobSlotWithoutPollingAsync(resourceGroupName, name, slot, request, context).block(); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about restoring a deleted app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreFromDeletedAppSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreFromDeletedAppSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreFromDeletedAppSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return service - .beginRestoreFromDeletedAppSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about restoring a deleted app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromDeletedAppSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { - return beginRestoreFromDeletedAppSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, restoreRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromDeletedAppSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { - return beginRestoreFromDeletedAppSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, restoreRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about restoring a deleted app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromDeletedAppSlotWithoutPolling( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest) { - beginRestoreFromDeletedAppSlotWithoutPollingAsync(resourceGroupName, name, slot, restoreRequest).block(); - } - - /** - * Description for Restores a deleted web app to this web app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about restoring a deleted app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreFromDeletedAppSlotWithoutPolling( - String resourceGroupName, String name, String slot, DeletedAppRestoreRequest restoreRequest, Context context) { - beginRestoreFromDeletedAppSlotWithoutPollingAsync(resourceGroupName, name, slot, restoreRequest, context) - .block(); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about app recovery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreSnapshotSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginRestoreSnapshotSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about app recovery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginRestoreSnapshotSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (restoreRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter restoreRequest is required and cannot be null.")); - } else { - restoreRequest.validate(); - } - return service - .beginRestoreSnapshotSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - restoreRequest, - context); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about app recovery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreSnapshotSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { - return beginRestoreSnapshotSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, restoreRequest) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about app recovery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreSnapshotSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { - return beginRestoreSnapshotSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, restoreRequest, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about app recovery operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreSnapshotSlotWithoutPolling( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest) { - beginRestoreSnapshotSlotWithoutPollingAsync(resourceGroupName, name, slot, restoreRequest).block(); - } - - /** - * Description for Restores a web app from a snapshot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of web app. - * @param slot Name of web app slot. If not specified then will default to production slot. - * @param restoreRequest Details about app recovery operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginRestoreSnapshotSlotWithoutPolling( - String resourceGroupName, String name, String slot, SnapshotRestoreRequest restoreRequest, Context context) { - beginRestoreSnapshotSlotWithoutPollingAsync(resourceGroupName, name, slot, restoreRequest, context).block(); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginInstallSiteExtensionSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, String slot) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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.")); - } - return FluxUtil - .withContext( - context -> - service - .beginInstallSiteExtensionSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginInstallSiteExtensionSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String siteExtensionId, String slot, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (siteExtensionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteExtensionId is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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.")); - } - return service - .beginInstallSiteExtensionSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - siteExtensionId, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginInstallSiteExtensionSlotWithoutPollingAsync( - String resourceGroupName, String name, String siteExtensionId, String slot) { - return beginInstallSiteExtensionSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, siteExtensionId, slot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginInstallSiteExtensionSlotWithoutPollingAsync( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - return beginInstallSiteExtensionSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, siteExtensionId, slot, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner beginInstallSiteExtensionSlotWithoutPolling( - String resourceGroupName, String name, String siteExtensionId, String slot) { - return beginInstallSiteExtensionSlotWithoutPollingAsync(resourceGroupName, name, siteExtensionId, slot).block(); - } - - /** - * Description for Install site extension on a web site, or a deployment slot. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Site name. - * @param siteExtensionId Site extension name. - * @param slot Name of the deployment slot. If a slot is not specified, the API uses the production slot. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return site Extension Information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteExtensionInfoInner beginInstallSiteExtensionSlotWithoutPolling( - String resourceGroupName, String name, String siteExtensionId, String slot, Context context) { - return beginInstallSiteExtensionSlotWithoutPollingAsync(resourceGroupName, name, siteExtensionId, slot, context) - .block(); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param copySlotEntity Copy deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginCopySlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (copySlotEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter copySlotEntity is required and cannot be null.")); - } else { - copySlotEntity.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCopySlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - copySlotEntity, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param copySlotEntity Copy deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginCopySlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (copySlotEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter copySlotEntity is required and cannot be null.")); - } else { - copySlotEntity.validate(); - } - return service - .beginCopySlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - copySlotEntity, - context); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param copySlotEntity Copy deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginCopySlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity) { - return beginCopySlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, copySlotEntity) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param copySlotEntity Copy deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginCopySlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity, Context context) { - return beginCopySlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, copySlotEntity, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param copySlotEntity Copy deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginCopySlotWithoutPolling( - String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity) { - beginCopySlotWithoutPollingAsync(resourceGroupName, name, slot, copySlotEntity).block(); - } - - /** - * Description for Copies a deployment slot to another deployment slot of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param copySlotEntity Copy deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginCopySlotWithoutPolling( - String resourceGroupName, String name, String slot, CsmCopySlotEntityInner copySlotEntity, Context context) { - beginCopySlotWithoutPollingAsync(resourceGroupName, name, slot, copySlotEntity, context).block(); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity Deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginSwapSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginSwapSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity Deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginSwapSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - return service - .beginSwapSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity Deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginSwapSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - return beginSwapSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity Deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginSwapSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - return beginSwapSlotWithoutPollingWithResponseAsync(resourceGroupName, name, slot, slotSwapEntity, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity Deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginSwapSlotWithoutPolling( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity) { - beginSwapSlotWithoutPollingAsync(resourceGroupName, name, slot, slotSwapEntity).block(); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the source slot. If a slot is not specified, the production slot is used as the source slot. - * @param slotSwapEntity Deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginSwapSlotWithoutPolling( - String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity, Context context) { - beginSwapSlotWithoutPollingAsync(resourceGroupName, name, slot, slotSwapEntity, context).block(); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl Source control configuration for an app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateSourceControlSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateSourceControlSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl Source control configuration for an app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateSourceControlSlotWithoutPollingWithResponseAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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 (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - return service - .beginCreateOrUpdateSourceControlSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - slot, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - context); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl Source control configuration for an app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateSourceControlSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - return beginCreateOrUpdateSourceControlSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, siteSourceControl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl Source control configuration for an app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateSourceControlSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { - return beginCreateOrUpdateSourceControlSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, siteSourceControl, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl Source control configuration for an app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner beginCreateOrUpdateSourceControlSlotWithoutPolling( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { - return beginCreateOrUpdateSourceControlSlotWithoutPollingAsync(resourceGroupName, name, slot, siteSourceControl) - .block(); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slot Name of the deployment slot. If a slot is not specified, the API will update the source control - * configuration for the production slot. - * @param siteSourceControl Source control configuration for an app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner beginCreateOrUpdateSourceControlSlotWithoutPolling( - String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, Context context) { - return beginCreateOrUpdateSourceControlSlotWithoutPollingAsync( - resourceGroupName, name, slot, siteSourceControl, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartNetworkTraceSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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.")); - } - return FluxUtil - .withContext( - context -> - service - .beginStartNetworkTraceSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartNetworkTraceSlotWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); - } - if (slot == null) { - return Mono.error(new IllegalArgumentException("Parameter slot 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.")); - } - return service - .beginStartNetworkTraceSlotWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - slot, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartNetworkTraceSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return beginStartNetworkTraceSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartNetworkTraceSlotWithoutPollingAsync( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartNetworkTraceSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartNetworkTraceSlotWithoutPollingAsync( - String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartNetworkTraceSlotWithoutPollingWithResponseAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartNetworkTraceSlotWithoutPolling( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl) { - return beginStartNetworkTraceSlotWithoutPollingAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartNetworkTraceSlotWithoutPolling( - String resourceGroupName, - String name, - String slot, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartNetworkTraceSlotWithoutPollingAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param slot The name of the slot for this web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartNetworkTraceSlotWithoutPolling(String resourceGroupName, String name, String slot) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartNetworkTraceSlotWithoutPollingAsync( - resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity Deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginSwapSlotWithProductionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginSwapSlotWithProductionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity Deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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> beginSwapSlotWithProductionWithoutPollingWithResponseAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (slotSwapEntity == null) { - return Mono.error(new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null.")); - } else { - slotSwapEntity.validate(); - } - return service - .beginSwapSlotWithProductionWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - slotSwapEntity, - context); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity Deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginSwapSlotWithProductionWithoutPollingAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - return beginSwapSlotWithProductionWithoutPollingWithResponseAsync(resourceGroupName, name, slotSwapEntity) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity Deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginSwapSlotWithProductionWithoutPollingAsync( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - return beginSwapSlotWithProductionWithoutPollingWithResponseAsync( - resourceGroupName, name, slotSwapEntity, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity Deployment slot parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginSwapSlotWithProductionWithoutPolling( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity) { - beginSwapSlotWithProductionWithoutPollingAsync(resourceGroupName, name, slotSwapEntity).block(); - } - - /** - * Description for Swaps two deployment slots of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param slotSwapEntity Deployment slot parameters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException 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 beginSwapSlotWithProductionWithoutPolling( - String resourceGroupName, String name, CsmSlotEntity slotSwapEntity, Context context) { - beginSwapSlotWithProductionWithoutPollingAsync(resourceGroupName, name, slotSwapEntity, context).block(); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl Source control configuration for an app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateSourceControlWithoutPollingWithResponseAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateSourceControlWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl Source control configuration for an app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateSourceControlWithoutPollingWithResponseAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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 (siteSourceControl == null) { - return Mono - .error(new IllegalArgumentException("Parameter siteSourceControl is required and cannot be null.")); - } else { - siteSourceControl.validate(); - } - return service - .beginCreateOrUpdateSourceControlWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - siteSourceControl, - context); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl Source control configuration for an app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateSourceControlWithoutPollingAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - return beginCreateOrUpdateSourceControlWithoutPollingWithResponseAsync( - resourceGroupName, name, siteSourceControl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl Source control configuration for an app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateSourceControlWithoutPollingAsync( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - return beginCreateOrUpdateSourceControlWithoutPollingWithResponseAsync( - resourceGroupName, name, siteSourceControl, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl Source control configuration for an app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner beginCreateOrUpdateSourceControlWithoutPolling( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { - return beginCreateOrUpdateSourceControlWithoutPollingAsync(resourceGroupName, name, siteSourceControl).block(); - } - - /** - * Description for Updates the source control configuration of an app. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name Name of the app. - * @param siteSourceControl Source control configuration for an app. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return source control configuration for an app. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SiteSourceControlInner beginCreateOrUpdateSourceControlWithoutPolling( - String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, Context context) { - return beginCreateOrUpdateSourceControlWithoutPollingAsync(resourceGroupName, name, siteSourceControl, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartNetworkTraceWithoutPollingWithResponseAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - return FluxUtil - .withContext( - context -> - service - .beginStartNetworkTraceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginStartNetworkTraceWithoutPollingWithResponseAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - 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 (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name 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.")); - } - return service - .beginStartNetworkTraceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - name, - durationInSeconds, - maxFrameLength, - sasUrl, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - context); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartNetworkTraceWithoutPollingAsync( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return beginStartNetworkTraceWithoutPollingWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartNetworkTraceWithoutPollingAsync( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartNetworkTraceWithoutPollingWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginStartNetworkTraceWithoutPollingAsync(String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartNetworkTraceWithoutPollingWithResponseAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartNetworkTraceWithoutPolling( - String resourceGroupName, String name, Integer durationInSeconds, Integer maxFrameLength, String sasUrl) { - return beginStartNetworkTraceWithoutPollingAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @param durationInSeconds The duration to keep capturing in seconds. - * @param maxFrameLength The maximum frame length in bytes (Optional). - * @param sasUrl The Blob URL to store capture file. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartNetworkTraceWithoutPolling( - String resourceGroupName, - String name, - Integer durationInSeconds, - Integer maxFrameLength, - String sasUrl, - Context context) { - return beginStartNetworkTraceWithoutPollingAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl, context) - .block(); - } - - /** - * Description for Start capturing network packets for the site. - * - * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param name The name of the web app. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return array of NetworkTrace. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Object beginStartNetworkTraceWithoutPolling(String resourceGroupName, String name) { - final Integer durationInSeconds = null; - final Integer maxFrameLength = null; - final String sasUrl = null; - final Context context = null; - return beginStartNetworkTraceWithoutPollingAsync( - resourceGroupName, name, durationInSeconds, maxFrameLength, sasUrl) - .block(); - } - /** * Get the next page of items. * @@ -88438,6 +82486,7 @@ public Mono> listNextSinglePageAsync(String nextLink, C if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -88494,6 +82543,7 @@ public Mono> listByResourceGroupNextSinglePageAsync(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -88550,6 +82600,7 @@ public Mono> listBackupsNextSinglePageAsync(Strin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBackupsNext(nextLink, context) .map( @@ -88607,6 +82658,7 @@ public Mono> listConfigurationsNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationsNext(nextLink, context) .map( @@ -88665,6 +82717,7 @@ public Mono> listConfiguration if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationSnapshotInfoNext(nextLink, context) .map( @@ -88722,6 +82775,7 @@ public Mono> listContinuousWebJobsNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listContinuousWebJobsNext(nextLink, context) .map( @@ -88778,6 +82832,7 @@ public Mono> listDeploymentsNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDeploymentsNext(nextLink, context) .map( @@ -88835,6 +82890,7 @@ public Mono> listDomainOwnershipIdentifiersNextSi if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDomainOwnershipIdentifiersNext(nextLink, context) .map( @@ -88892,6 +82948,7 @@ public Mono> listFunctionsNextSinglePageAsy if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listFunctionsNext(nextLink, context) .map( @@ -88949,6 +83006,7 @@ public Mono> listHostnameBindingsNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostnameBindingsNext(nextLink, context) .map( @@ -89006,6 +83064,7 @@ public Mono> listInstanceIdentifiersNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceIdentifiersNext(nextLink, context) .map( @@ -89063,6 +83122,7 @@ public Mono> listInstanceProcessesNextSinglePage if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessesNext(nextLink, context) .map( @@ -89120,6 +83180,7 @@ public Mono> listInstanceProcessModulesNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessModulesNext(nextLink, context) .map( @@ -89177,6 +83238,7 @@ public Mono> listInstanceProcessThreadsNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessThreadsNext(nextLink, context) .map( @@ -89233,6 +83295,7 @@ public Mono> listSiteBackupsNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteBackupsNext(nextLink, context) .map( @@ -89290,6 +83353,7 @@ public Mono> listPerfMonCountersNextSinglePa if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPerfMonCountersNext(nextLink, context) .map( @@ -89346,6 +83410,7 @@ public Mono> listProcessesNextSinglePageAsync(St if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessesNext(nextLink, context) .map( @@ -89403,6 +83468,7 @@ public Mono> listProcessModulesNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessModulesNext(nextLink, context) .map( @@ -89460,6 +83526,7 @@ public Mono> listProcessThreadsNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessThreadsNext(nextLink, context) .map( @@ -89517,6 +83584,7 @@ public Mono> listPublicCertificatesNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPublicCertificatesNext(nextLink, context) .map( @@ -89574,6 +83642,7 @@ public Mono> listSiteExtensionsNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteExtensionsNext(nextLink, context) .map( @@ -89630,6 +83699,7 @@ public Mono> listSlotsNextSinglePageAsync(String nextLi if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSlotsNext(nextLink, context) .map( @@ -89686,6 +83756,7 @@ public Mono> listBackupsSlotNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBackupsSlotNext(nextLink, context) .map( @@ -89743,6 +83814,7 @@ public Mono> listConfigurationsSlotNextSi if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationsSlotNext(nextLink, context) .map( @@ -89801,6 +83873,7 @@ public Mono> listConfiguration if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listConfigurationSnapshotInfoSlotNext(nextLink, context) .map( @@ -89858,6 +83931,7 @@ public Mono> listContinuousWebJobsSlotNextS if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listContinuousWebJobsSlotNext(nextLink, context) .map( @@ -89915,6 +83989,7 @@ public Mono> listDeploymentsSlotNextSinglePageAsy if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDeploymentsSlotNext(nextLink, context) .map( @@ -89972,6 +84047,7 @@ public Mono> listDomainOwnershipIdentifiersSlotNe if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listDomainOwnershipIdentifiersSlotNext(nextLink, context) .map( @@ -90029,6 +84105,7 @@ public Mono> listInstanceFunctionsSlotNextS if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceFunctionsSlotNext(nextLink, context) .map( @@ -90086,6 +84163,7 @@ public Mono> listHostnameBindingsSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listHostnameBindingsSlotNext(nextLink, context) .map( @@ -90143,6 +84221,7 @@ public Mono> listInstanceIdentifiersSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceIdentifiersSlotNext(nextLink, context) .map( @@ -90200,6 +84279,7 @@ public Mono> listInstanceProcessesSlotNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessesSlotNext(nextLink, context) .map( @@ -90258,6 +84338,7 @@ public Mono> listInstanceProcessModulesSlo if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessModulesSlotNext(nextLink, context) .map( @@ -90316,6 +84397,7 @@ public Mono> listInstanceProcessThreadsSlo if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listInstanceProcessThreadsSlotNext(nextLink, context) .map( @@ -90373,6 +84455,7 @@ public Mono> listSiteBackupsSlotNextSinglePageAsy if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteBackupsSlotNext(nextLink, context) .map( @@ -90430,6 +84513,7 @@ public Mono> listPerfMonCountersSlotNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPerfMonCountersSlotNext(nextLink, context) .map( @@ -90487,6 +84571,7 @@ public Mono> listProcessesSlotNextSinglePageAsyn if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessesSlotNext(nextLink, context) .map( @@ -90544,6 +84629,7 @@ public Mono> listProcessModulesSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessModulesSlotNext(nextLink, context) .map( @@ -90601,6 +84687,7 @@ public Mono> listProcessThreadsSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listProcessThreadsSlotNext(nextLink, context) .map( @@ -90658,6 +84745,7 @@ public Mono> listPublicCertificatesSlotNex if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listPublicCertificatesSlotNext(nextLink, context) .map( @@ -90715,6 +84803,7 @@ public Mono> listSiteExtensionsSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSiteExtensionsSlotNext(nextLink, context) .map( @@ -90772,6 +84861,7 @@ public Mono> listSlotDifferencesSlotNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSlotDifferencesSlotNext(nextLink, context) .map( @@ -90828,6 +84918,7 @@ public Mono> listSnapshotsSlotNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsSlotNext(nextLink, context) .map( @@ -90885,6 +84976,7 @@ public Mono> listSnapshotsFromDRSecondarySlotNextSi if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsFromDRSecondarySlotNext(nextLink, context) .map( @@ -90942,6 +85034,7 @@ public Mono> listTriggeredWebJobsSlotNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobsSlotNext(nextLink, context) .map( @@ -91000,6 +85093,7 @@ public Mono> listTriggeredWebJobHistoryS if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobHistorySlotNext(nextLink, context) .map( @@ -91056,6 +85150,7 @@ public Mono> listUsagesSlotNextSinglePageAsync if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsagesSlotNext(nextLink, context) .map( @@ -91112,6 +85207,7 @@ public Mono> listWebJobsSlotNextSinglePageAsync(Strin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebJobsSlotNext(nextLink, context) .map( @@ -91170,6 +85266,7 @@ public Mono> listSlotDifferencesFromProductio if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSlotDifferencesFromProductionNext(nextLink, context) .map( @@ -91226,6 +85323,7 @@ public Mono> listSnapshotsNextSinglePageAsync(Strin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsNext(nextLink, context) .map( @@ -91283,6 +85381,7 @@ public Mono> listSnapshotsFromDRSecondaryNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSnapshotsFromDRSecondaryNext(nextLink, context) .map( @@ -91340,6 +85439,7 @@ public Mono> listTriggeredWebJobsNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobsNext(nextLink, context) .map( @@ -91398,6 +85498,7 @@ public Mono> listTriggeredWebJobHistoryN if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listTriggeredWebJobHistoryNext(nextLink, context) .map( @@ -91454,6 +85555,7 @@ public Mono> listUsagesNextSinglePageAsync(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listUsagesNext(nextLink, context) .map( @@ -91510,6 +85612,7 @@ public Mono> listWebJobsNextSinglePageAsync(String ne if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listWebJobsNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/ComputeManagementClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/ComputeManagementClient.java index c2c288d7c6fe..129b08aa1103 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/ComputeManagementClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/ComputeManagementClient.java @@ -8,7 +8,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import com.azure.resourcemanager.compute.fluent.AvailabilitySetsClient; import com.azure.resourcemanager.compute.fluent.ContainerServicesClient; import com.azure.resourcemanager.compute.fluent.DedicatedHostGroupsClient; @@ -39,6 +38,7 @@ import com.azure.resourcemanager.compute.fluent.VirtualMachineScaleSetsClient; import com.azure.resourcemanager.compute.fluent.VirtualMachineSizesClient; import com.azure.resourcemanager.compute.fluent.VirtualMachinesClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; /** Initializes a new instance of the ComputeManagementClient type. */ @ServiceClient(builder = ComputeManagementClientBuilder.class) diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/AvailabilitySetsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/AvailabilitySetsClient.java index 97020ea8fd54..19c7bf0fc60c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/AvailabilitySetsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/AvailabilitySetsClient.java @@ -294,6 +294,7 @@ public Mono> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -521,6 +522,7 @@ public Mono> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -704,6 +706,7 @@ public Mono> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -859,6 +862,7 @@ public Mono> getByResourceGroupWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1015,6 +1019,7 @@ public Mono> listSinglePageAsync(String expa "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), expand, context) .map( @@ -1197,6 +1202,7 @@ public Mono> listByResourceGroupSinglePageAs "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -1361,6 +1367,7 @@ public Mono> listAvailableSizesSinglePage "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listAvailableSizes( this.client.getEndpoint(), @@ -1490,6 +1497,7 @@ public Mono> listBySubscriptionNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySubscriptionNext(nextLink, context) .map( @@ -1546,6 +1554,7 @@ public Mono> listNextSinglePageAsync(String if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ContainerServicesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ContainerServicesClient.java index 3c6731cc1039..623a5a520c33 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ContainerServicesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ContainerServicesClient.java @@ -138,35 +138,6 @@ Mono> listByResourceGroup( @PathParam("subscriptionId") String subscriptionId, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/containerServices/{containerServiceName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerServiceName") String containerServiceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ContainerServiceInner parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService" - + "/containerServices/{containerServiceName}") - @ExpectedResponses({202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("containerServiceName") String containerServiceName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -246,6 +217,7 @@ public Mono> listSinglePageAsync(Context co "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2017-01-31"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( @@ -411,6 +383,7 @@ public Mono>> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2017-01-31"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -518,7 +491,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -538,7 +511,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, containerServiceName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -663,6 +636,7 @@ public Mono> getByResourceGroupWithResponseAsync "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2017-01-31"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -850,6 +824,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2017-01-31"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -956,7 +931,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String containerServiceName) { return beginDeleteAsync(resourceGroupName, containerServiceName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -977,7 +952,7 @@ public Mono deleteAsync(String resourceGroupName, String containerServiceN public Mono deleteAsync(String resourceGroupName, String containerServiceName, Context context) { return beginDeleteAsync(resourceGroupName, containerServiceName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1099,6 +1074,7 @@ public Mono> listByResourceGroupSinglePageA "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2017-01-31"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -1183,375 +1159,6 @@ public PagedIterable listByResourceGroup(String resourceG return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Container service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - 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 (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-01-31"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Container service. - * @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 container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, 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 (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2017-01-31"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Container service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, containerServiceName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Container service. - * @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 container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, containerServiceName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Container service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerServiceInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, containerServiceName, parameters).block(); - } - - /** - * Creates or updates a container service with the specified configuration of orchestrator, masters, and agents. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and resource group. - * @param parameters Container service. - * @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 container service. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ContainerServiceInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String containerServiceName, ContainerServiceInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, containerServiceName, parameters, context) - .block(); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String containerServiceName) { - 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 (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName 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 = "2017-01-31"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String containerServiceName, 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 (containerServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter containerServiceName 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 = "2017-01-31"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - containerServiceName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String containerServiceName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, containerServiceName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and 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 the completion. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String containerServiceName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, containerServiceName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String containerServiceName) { - beginDeleteWithoutPollingAsync(resourceGroupName, containerServiceName).block(); - } - - /** - * Deletes the specified container service in the specified subscription and resource group. The operation does not - * delete other resources created as part of creating a container service, including storage accounts, VMs, and - * availability sets. All the other resources created with the container service are part of the same resource group - * and can be deleted individually. - * - * @param resourceGroupName The name of the resource group. - * @param containerServiceName The name of the container service in the specified subscription and 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void beginDeleteWithoutPolling(String resourceGroupName, String containerServiceName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, containerServiceName, context).block(); - } - /** * Get the next page of items. * @@ -1595,6 +1202,7 @@ public Mono> listNextSinglePageAsync(String if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -1652,6 +1260,7 @@ public Mono> listByResourceGroupNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostGroupsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostGroupsClient.java index 724b71cb4cec..3a3f6019aefb 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostGroupsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostGroupsClient.java @@ -264,6 +264,7 @@ public Mono> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -469,6 +470,7 @@ public Mono> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -650,6 +652,7 @@ public Mono> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -802,6 +805,7 @@ public Mono> getByResourceGroupWithResponseAsy "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -973,6 +977,7 @@ public Mono> listByResourceGroupSinglePag "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -1117,6 +1122,7 @@ public Mono> listSinglePageAsync(Context "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( @@ -1232,6 +1238,7 @@ public Mono> listByResourceGroupNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -1289,6 +1296,7 @@ public Mono> listBySubscriptionNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySubscriptionNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostsClient.java index 11b802e7e403..9635c340da21 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DedicatedHostsClient.java @@ -146,53 +146,6 @@ Mono> listByHostGroup( @PathParam("subscriptionId") String subscriptionId, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}/hosts/{hostName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @PathParam("hostName") String hostname, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DedicatedHostInner parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}/hosts/{hostName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @PathParam("hostName") String hostname, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") DedicatedHostUpdate parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups" - + "/{hostGroupName}/hosts/{hostName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("hostGroupName") String hostGroupName, - @PathParam("hostName") String hostname, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -308,6 +261,7 @@ public Mono>> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -430,7 +384,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -455,7 +409,7 @@ public Mono createOrUpdateAsync( Context context) { return beginCreateOrUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -608,6 +562,7 @@ public Mono>> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -734,7 +689,7 @@ public Mono updateAsync( String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { return beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -760,7 +715,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, hostGroupName, hostname, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -896,6 +851,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -995,7 +951,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String hostGroupName, String hostname) { return beginDeleteAsync(resourceGroupName, hostGroupName, hostname) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1014,7 +970,7 @@ public Mono deleteAsync(String resourceGroupName, String hostGroupName, St public Mono deleteAsync(String resourceGroupName, String hostGroupName, String hostname, Context context) { return beginDeleteAsync(resourceGroupName, hostGroupName, hostname, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1141,6 +1097,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1379,6 +1336,7 @@ public Mono> listByHostGroupSinglePageAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByHostGroup( this.client.getEndpoint(), @@ -1470,619 +1428,6 @@ public PagedIterable listByHostGroup( return new PagedIterable<>(listByHostGroupAsync(resourceGroupName, hostGroupName, context)); } - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the Dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - 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 (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the Dedicated host. - * @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 specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostInner parameters, - 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 (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the Dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, hostGroupName, hostname, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the Dedicated host. - * @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 specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostInner parameters, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, hostGroupName, hostname, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the Dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostInner parameters) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); - } - - /** - * Create or update a dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the Dedicated host. - * @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 specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostInner parameters, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, parameters, context) - .block(); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType - * may be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - 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 (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType - * may be updated. - * @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 specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostUpdate parameters, - 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 (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType - * may be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, hostGroupName, hostname, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType - * may be updated. - * @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 specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostUpdate parameters, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, hostGroupName, hostname, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType - * may be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner beginUpdateWithoutPolling( - String resourceGroupName, String hostGroupName, String hostname, DedicatedHostUpdate parameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, parameters).block(); - } - - /** - * Update an dedicated host . - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host . - * @param parameters Specifies information about the dedicated host. Only tags, autoReplaceOnFailure and licenseType - * may be updated. - * @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 specifies information about the Dedicated host. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DedicatedHostInner beginUpdateWithoutPolling( - String resourceGroupName, - String hostGroupName, - String hostname, - DedicatedHostUpdate parameters, - Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, parameters, context).block(); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname) { - 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 (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @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 Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String hostGroupName, String hostname, 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 (hostGroupName == null) { - return Mono.error(new IllegalArgumentException("Parameter hostGroupName is required and cannot be null.")); - } - if (hostname == null) { - return Mono.error(new IllegalArgumentException("Parameter hostname 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-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - hostGroupName, - hostname, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginDeleteWithoutPollingAsync(String resourceGroupName, String hostGroupName, String hostname) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, hostGroupName, hostname) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @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 Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String hostGroupName, String hostname, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, hostGroupName, hostname, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String hostGroupName, String hostname) { - beginDeleteWithoutPollingAsync(resourceGroupName, hostGroupName, hostname).block(); - } - - /** - * Delete a dedicated host. - * - * @param resourceGroupName The name of the resource group. - * @param hostGroupName The name of the dedicated host group. - * @param hostname The name of the dedicated host. - * @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 beginDeleteWithoutPolling( - String resourceGroupName, String hostGroupName, String hostname, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, hostGroupName, hostname, context).block(); - } - /** * Get the next page of items. * @@ -2127,6 +1472,7 @@ public Mono> listByHostGroupNextSinglePageAsyn if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByHostGroupNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DiskEncryptionSetsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DiskEncryptionSetsClient.java index ce206fd2d93a..24e8473f7c32 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DiskEncryptionSetsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DiskEncryptionSetsClient.java @@ -155,50 +155,6 @@ Mono> list( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/diskEncryptionSets/{diskEncryptionSetName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskEncryptionSetName") String diskEncryptionSetName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiskEncryptionSetInner diskEncryptionSet, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/diskEncryptionSets/{diskEncryptionSetName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskEncryptionSetName") String diskEncryptionSetName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiskEncryptionSetUpdate diskEncryptionSet, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/diskEncryptionSets/{diskEncryptionSetName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskEncryptionSetName") String diskEncryptionSetName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -319,6 +275,7 @@ public Mono>> createOrUpdateWithResponseAsync( diskEncryptionSet.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -443,7 +400,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { return beginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -468,7 +425,7 @@ public Mono createOrUpdateAsync( Context context) { return beginCreateOrUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -618,6 +575,7 @@ public Mono>> updateWithResponseAsync( diskEncryptionSet.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -741,7 +699,7 @@ public Mono updateAsync( String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { return beginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -766,7 +724,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -898,6 +856,7 @@ public Mono> getByResourceGroupWithResponseAsyn .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1084,6 +1043,7 @@ public Mono>> deleteWithResponseAsync( .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1185,7 +1145,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String diskEncryptionSetName) { return beginDeleteAsync(resourceGroupName, diskEncryptionSetName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1205,7 +1165,7 @@ public Mono deleteAsync(String resourceGroupName, String diskEncryptionSet public Mono deleteAsync(String resourceGroupName, String diskEncryptionSetName, Context context) { return beginDeleteAsync(resourceGroupName, diskEncryptionSetName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1321,6 +1281,7 @@ public Mono> listByResourceGroupSinglePage .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) @@ -1459,6 +1420,7 @@ public Mono> listSinglePageAsync(Context c "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) .map( @@ -1524,613 +1486,6 @@ public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - 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 (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - if (diskEncryptionSet == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); - } else { - diskEncryptionSet.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - diskEncryptionSet, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetInner diskEncryptionSet, - 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 (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - if (diskEncryptionSet == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); - } else { - diskEncryptionSet.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - diskEncryptionSet, - context); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetInner diskEncryptionSet, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetInner diskEncryptionSet) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - .block(); - } - - /** - * Creates or updates a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetInner diskEncryptionSet, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) - .block(); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set update resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - 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 (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - if (diskEncryptionSet == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); - } else { - diskEncryptionSet.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - diskEncryptionSet, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set update resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetUpdate diskEncryptionSet, - 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 (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - if (diskEncryptionSet == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSet is required and cannot be null.")); - } else { - diskEncryptionSet.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - diskEncryptionSet, - context); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set update resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set update resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetUpdate diskEncryptionSet, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set update resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner beginUpdateWithoutPolling( - String resourceGroupName, String diskEncryptionSetName, DiskEncryptionSetUpdate diskEncryptionSet) { - return beginUpdateWithoutPollingAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet).block(); - } - - /** - * Updates (patches) a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param diskEncryptionSet disk encryption set update resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return disk encryption set resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskEncryptionSetInner beginUpdateWithoutPolling( - String resourceGroupName, - String diskEncryptionSetName, - DiskEncryptionSetUpdate diskEncryptionSet, - Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, diskEncryptionSetName, diskEncryptionSet, context) - .block(); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName) { - 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 (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String diskEncryptionSetName, 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 (diskEncryptionSetName == null) { - return Mono - .error(new IllegalArgumentException("Parameter diskEncryptionSetName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskEncryptionSetName, - apiVersion, - context); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync(String resourceGroupName, String diskEncryptionSetName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, diskEncryptionSetName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, String diskEncryptionSetName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, diskEncryptionSetName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling(String resourceGroupName, String diskEncryptionSetName) { - beginDeleteWithoutPollingAsync(resourceGroupName, diskEncryptionSetName).block(); - } - - /** - * Deletes a disk encryption set. - * - * @param resourceGroupName The name of the resource group. - * @param diskEncryptionSetName The name of the disk encryption set that is being created. The name can't be changed - * after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The - * maximum name length is 80 characters. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling(String resourceGroupName, String diskEncryptionSetName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, diskEncryptionSetName, context).block(); - } - /** * Get the next page of items. * @@ -2175,6 +1530,7 @@ public Mono> listByResourceGroupNextSingle if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -2231,6 +1587,7 @@ public Mono> listNextSinglePageAsync(Strin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DisksClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DisksClient.java index fa403cb03caf..1795861ee990 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DisksClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/DisksClient.java @@ -182,79 +182,6 @@ Mono>> revokeAccess( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiskInner disk, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DiskUpdate disk, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}/beginGetAccess") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginGrantAccessWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GrantAccessData grantAccessData, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks" - + "/{diskName}/endGetAccess") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRevokeAccessWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("diskName") String diskName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -366,6 +293,7 @@ public Mono>> createOrUpdateWithResponseAsync( disk.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -476,7 +404,7 @@ public SyncPoller, DiskInner> beginCreateOrUpdate( public Mono createOrUpdateAsync(String resourceGroupName, String diskName, DiskInner disk) { return beginCreateOrUpdateAsync(resourceGroupName, diskName, disk) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -497,7 +425,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String diskName, DiskInner disk, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, diskName, disk, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -631,6 +559,7 @@ public Mono>> updateWithResponseAsync( disk.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -738,7 +667,9 @@ public SyncPoller, DiskInner> beginUpdate( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateAsync(String resourceGroupName, String diskName, DiskUpdate disk) { - return beginUpdateAsync(resourceGroupName, diskName, disk).last().flatMap(client::getLroFinalResultOrError); + return beginUpdateAsync(resourceGroupName, diskName, disk) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -758,7 +689,7 @@ public Mono updateAsync(String resourceGroupName, String diskName, Di public Mono updateAsync(String resourceGroupName, String diskName, DiskUpdate disk, Context context) { return beginUpdateAsync(resourceGroupName, diskName, disk, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -878,6 +809,7 @@ public Mono> getByResourceGroupWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1052,6 +984,7 @@ public Mono>> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1144,7 +1077,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String diskName) { - return beginDeleteAsync(resourceGroupName, diskName).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, diskName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -1161,7 +1094,9 @@ public Mono deleteAsync(String resourceGroupName, String diskName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String diskName, Context context) { - return beginDeleteAsync(resourceGroupName, diskName, context).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, diskName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1275,6 +1210,7 @@ public Mono> listByResourceGroupSinglePageAsync( .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) @@ -1413,6 +1349,7 @@ public Mono> listSinglePageAsync(Context context) { "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) .map( @@ -1576,6 +1513,7 @@ public Mono>> grantAccessWithResponseAsync( grantAccessData.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .grantAccess( this.client.getEndpoint(), @@ -1688,7 +1626,7 @@ public Mono grantAccessAsync( String resourceGroupName, String diskName, GrantAccessData grantAccessData) { return beginGrantAccessAsync(resourceGroupName, diskName, grantAccessData) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1709,7 +1647,7 @@ public Mono grantAccessAsync( String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { return beginGrantAccessAsync(resourceGroupName, diskName, grantAccessData, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1830,6 +1768,7 @@ public Mono>> revokeAccessWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .revokeAccess( this.client.getEndpoint(), @@ -1923,7 +1862,9 @@ public SyncPoller, Void> beginRevokeAccess( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono revokeAccessAsync(String resourceGroupName, String diskName) { - return beginRevokeAccessAsync(resourceGroupName, diskName).last().flatMap(client::getLroFinalResultOrError); + return beginRevokeAccessAsync(resourceGroupName, diskName) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1942,7 +1883,7 @@ public Mono revokeAccessAsync(String resourceGroupName, String diskName) { public Mono revokeAccessAsync(String resourceGroupName, String diskName, Context context) { return beginRevokeAccessAsync(resourceGroupName, diskName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1976,913 +1917,6 @@ public void revokeAccess(String resourceGroupName, String diskName, Context cont revokeAccessAsync(resourceGroupName, diskName, context).block(); } - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk 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 disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, DiskInner disk) { - 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 (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - disk, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk 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 disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, DiskInner disk, 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 (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - disk, - context); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk 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 disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String diskName, DiskInner disk) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskName, disk) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk 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 disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String diskName, DiskInner disk, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskName, disk, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk 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 disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner beginCreateOrUpdateWithoutPolling(String resourceGroupName, String diskName, DiskInner disk) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, diskName, disk).block(); - } - - /** - * Creates or updates a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk 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 disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String diskName, DiskInner disk, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, diskName, disk, context).block(); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update 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 disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, DiskUpdate disk) { - 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 (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - disk, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update 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 disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, DiskUpdate disk, 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 (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (disk == null) { - return Mono.error(new IllegalArgumentException("Parameter disk is required and cannot be null.")); - } else { - disk.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - disk, - context); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update 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 disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync(String resourceGroupName, String diskName, DiskUpdate disk) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskName, disk) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update 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 disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String diskName, DiskUpdate disk, Context context) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, diskName, disk, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update 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 disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner beginUpdateWithoutPolling(String resourceGroupName, String diskName, DiskUpdate disk) { - return beginUpdateWithoutPollingAsync(resourceGroupName, diskName, disk).block(); - } - - /** - * Updates (patches) a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param disk Disk update 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 disk resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiskInner beginUpdateWithoutPolling( - String resourceGroupName, String diskName, DiskUpdate disk, Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, diskName, disk, context).block(); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginDeleteWithoutPollingWithResponseAsync(String resourceGroupName, String diskName) { - 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 (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @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 Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, 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 (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginDeleteWithoutPollingAsync(String resourceGroupName, String diskName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, diskName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @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 Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String diskName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, diskName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String diskName) { - beginDeleteWithoutPollingAsync(resourceGroupName, diskName).block(); - } - - /** - * Deletes a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String diskName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, diskName, context).block(); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginGrantAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - 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 (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (grantAccessData == null) { - return Mono - .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); - } else { - grantAccessData.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginGrantAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - grantAccessData, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @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 disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginGrantAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData, 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 (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - if (grantAccessData == null) { - return Mono - .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); - } else { - grantAccessData.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginGrantAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - grantAccessData, - context); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginGrantAccessWithoutPollingAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - return beginGrantAccessWithoutPollingWithResponseAsync(resourceGroupName, diskName, grantAccessData) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @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 disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginGrantAccessWithoutPollingAsync( - String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { - return beginGrantAccessWithoutPollingWithResponseAsync(resourceGroupName, diskName, grantAccessData, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner beginGrantAccessWithoutPolling( - String resourceGroupName, String diskName, GrantAccessData grantAccessData) { - return beginGrantAccessWithoutPollingAsync(resourceGroupName, diskName, grantAccessData).block(); - } - - /** - * Grants access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @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 disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner beginGrantAccessWithoutPolling( - String resourceGroupName, String diskName, GrantAccessData grantAccessData, Context context) { - return beginGrantAccessWithoutPollingAsync(resourceGroupName, diskName, grantAccessData, context).block(); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginRevokeAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName) { - 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 (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginRevokeAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @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 Mono> beginRevokeAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String diskName, 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 (diskName == null) { - return Mono.error(new IllegalArgumentException("Parameter diskName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return service - .beginRevokeAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - diskName, - apiVersion, - context); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginRevokeAccessWithoutPollingAsync(String resourceGroupName, String diskName) { - return beginRevokeAccessWithoutPollingWithResponseAsync(resourceGroupName, diskName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @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 Mono beginRevokeAccessWithoutPollingAsync(String resourceGroupName, String diskName, Context context) { - return beginRevokeAccessWithoutPollingWithResponseAsync(resourceGroupName, diskName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginRevokeAccessWithoutPolling(String resourceGroupName, String diskName) { - beginRevokeAccessWithoutPollingAsync(resourceGroupName, diskName).block(); - } - - /** - * Revokes access to a disk. - * - * @param resourceGroupName The name of the resource group. - * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is - * created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. - * @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 beginRevokeAccessWithoutPolling(String resourceGroupName, String diskName, Context context) { - beginRevokeAccessWithoutPollingAsync(resourceGroupName, diskName, context).block(); - } - /** * Get the next page of items. * @@ -2926,6 +1960,7 @@ public Mono> listByResourceGroupNextSinglePageAsync(Str if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -2982,6 +2017,7 @@ public Mono> listNextSinglePageAsync(String nextLink, C if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleriesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleriesClient.java index 98839c6f9ff3..52d07399997a 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleriesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleriesClient.java @@ -151,50 +151,6 @@ Mono> list( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryInner gallery, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryUpdate gallery, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -306,6 +262,7 @@ public Mono>> createOrUpdateWithResponseAsync( gallery.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -417,7 +374,7 @@ public SyncPoller, GalleryInner> beginCreateOrUpdate( public Mono createOrUpdateAsync(String resourceGroupName, String galleryName, GalleryInner gallery) { return beginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -438,7 +395,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, galleryName, gallery, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -573,6 +530,7 @@ public Mono>> updateWithResponseAsync( gallery.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -683,7 +641,7 @@ public SyncPoller, GalleryInner> beginUpdate( public Mono updateAsync(String resourceGroupName, String galleryName, GalleryUpdate gallery) { return beginUpdateAsync(resourceGroupName, galleryName, gallery) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -704,7 +662,7 @@ public Mono updateAsync( String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { return beginUpdateAsync(resourceGroupName, galleryName, gallery, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -823,6 +781,7 @@ public Mono> getByResourceGroupWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -991,6 +950,7 @@ public Mono>> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1079,7 +1039,7 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String galleryName) { - return beginDeleteAsync(resourceGroupName, galleryName).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, galleryName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -1097,7 +1057,7 @@ public Mono deleteAsync(String resourceGroupName, String galleryName) { public Mono deleteAsync(String resourceGroupName, String galleryName, Context context) { return beginDeleteAsync(resourceGroupName, galleryName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1209,6 +1169,7 @@ public Mono> listByResourceGroupSinglePageAsync( .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) @@ -1347,6 +1308,7 @@ public Mono> listSinglePageAsync(Context context) { "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) .map( @@ -1412,552 +1374,6 @@ public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, GalleryInner gallery) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (gallery == null) { - return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); - } else { - gallery.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - gallery, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, GalleryInner gallery, 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (gallery == null) { - return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); - } else { - gallery.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - gallery, - context); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String galleryName, GalleryInner gallery) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, galleryName, gallery) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, galleryName, gallery, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String galleryName, GalleryInner gallery) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, galleryName, gallery).block(); - } - - /** - * Create or update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String galleryName, GalleryInner gallery, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, galleryName, gallery, context).block(); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (gallery == null) { - return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); - } else { - gallery.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - gallery, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery, 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (gallery == null) { - return Mono.error(new IllegalArgumentException("Parameter gallery is required and cannot be null.")); - } else { - gallery.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - gallery, - context); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, galleryName, gallery) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, galleryName, gallery, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner beginUpdateWithoutPolling(String resourceGroupName, String galleryName, GalleryUpdate gallery) { - return beginUpdateWithoutPollingAsync(resourceGroupName, galleryName, gallery).block(); - } - - /** - * Update a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with - * dots and periods allowed in the middle. The maximum length is 80 characters. - * @param gallery Specifies information about the Shared Image Gallery that you want to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the Shared Image Gallery that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryInner beginUpdateWithoutPolling( - String resourceGroupName, String galleryName, GalleryUpdate gallery, Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, galleryName, gallery, context).block(); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - apiVersion, - context); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync(String resourceGroupName, String galleryName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync(String resourceGroupName, String galleryName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling(String resourceGroupName, String galleryName) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName).block(); - } - - /** - * Delete a Shared Image Gallery. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling(String resourceGroupName, String galleryName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, context).block(); - } - /** * Get the next page of items. * @@ -2001,6 +1417,7 @@ public Mono> listByResourceGroupNextSinglePageAsync( if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -2057,6 +1474,7 @@ public Mono> listNextSinglePageAsync(String nextLink if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationVersionsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationVersionsClient.java index 8c338b4d06b2..5db021c4f73c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationVersionsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationVersionsClient.java @@ -153,56 +153,6 @@ Mono> listByGalleryApplication( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryApplicationVersionInner galleryApplicationVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @PathParam("galleryApplicationVersionName") String galleryApplicationVersionName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -356,6 +306,7 @@ public Mono>> createOrUpdateWithResponseAsync( galleryApplicationVersion.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -554,7 +505,7 @@ public Mono createOrUpdateAsync( galleryApplicationVersionName, galleryApplicationVersion) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -591,7 +542,7 @@ public Mono createOrUpdateAsync( galleryApplicationVersion, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -808,6 +759,7 @@ public Mono>> updateWithResponseAsync( galleryApplicationVersion.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1004,7 +956,7 @@ public Mono updateAsync( galleryApplicationVersionName, galleryApplicationVersion) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1041,7 +993,7 @@ public Mono updateAsync( galleryApplicationVersion, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1236,6 +1188,7 @@ public Mono> getWithResponseAsync( "Parameter galleryApplicationVersionName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1546,6 +1499,7 @@ public Mono>> deleteWithResponseAsync( "Parameter galleryApplicationVersionName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1680,7 +1634,7 @@ public Mono deleteAsync( String galleryApplicationVersionName) { return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1707,7 +1661,7 @@ public Mono deleteAsync( return beginDeleteAsync( resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1860,6 +1814,7 @@ public Mono> listByGalleryApplicat new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByGalleryApplication( this.client.getEndpoint(), @@ -1962,854 +1917,6 @@ public PagedIterable listByGalleryApplication( listByGalleryApplicationAsync(resourceGroupName, galleryName, galleryApplicationName, context)); } - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - if (galleryApplicationVersion == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersion is required and cannot be null.")); - } else { - galleryApplicationVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - galleryApplicationVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion, - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - if (galleryApplicationVersion == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersion is required and cannot be null.")); - } else { - galleryApplicationVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - galleryApplicationVersion, - context); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .block(); - } - - /** - * Create or update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be created. - * @param galleryApplicationVersionName The name of the gallery Application Version to be created. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionInner galleryApplicationVersion, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .block(); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - if (galleryApplicationVersion == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersion is required and cannot be null.")); - } else { - galleryApplicationVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - galleryApplicationVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion, - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - if (galleryApplicationVersion == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersion is required and cannot be null.")); - } else { - galleryApplicationVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - galleryApplicationVersion, - context); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion) - .block(); - } - - /** - * Update a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version is - * to be updated. - * @param galleryApplicationVersionName The name of the gallery Application Version to be updated. Needs to follow - * semantic version name pattern: The allowed characters are digit and period. Digits must be within the range - * of a 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryApplicationVersion Specifies information about the gallery Application Version that you want to - * update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationVersionInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - GalleryApplicationVersionUpdate galleryApplicationVersion, - Context context) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - galleryApplicationVersion, - context) - .block(); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplicationVersionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter galleryApplicationVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - galleryApplicationVersionName, - apiVersion, - context); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - Context context) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName) { - beginDeleteWithoutPollingAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) - .block(); - } - - /** - * Delete a gallery Application Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition resides. - * @param galleryApplicationName The name of the gallery Application Definition in which the Application Version - * resides. - * @param galleryApplicationVersionName The name of the gallery Application Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - String galleryApplicationVersionName, - Context context) { - beginDeleteWithoutPollingAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, context) - .block(); - } - /** * Get the next page of items. * @@ -2855,6 +1962,7 @@ public Mono> listByGalleryApplicat if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByGalleryApplicationNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationsClient.java index 7d057a8238e5..1d58caac63b3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryApplicationsClient.java @@ -144,53 +144,6 @@ Mono> listByGallery( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryApplicationInner galleryApplication, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryApplicationUpdate galleryApplication, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/applications/{galleryApplicationName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryApplicationName") String galleryApplicationName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -323,6 +276,7 @@ public Mono>> createOrUpdateWithResponseAsync( galleryApplication.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -477,7 +431,7 @@ public Mono createOrUpdateAsync( GalleryApplicationInner galleryApplication) { return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -507,7 +461,7 @@ public Mono createOrUpdateAsync( return beginCreateOrUpdateAsync( resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -685,6 +639,7 @@ public Mono>> updateWithResponseAsync( galleryApplication.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -833,7 +788,7 @@ public Mono updateAsync( GalleryApplicationUpdate galleryApplication) { return beginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -861,7 +816,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1010,6 +965,7 @@ public Mono> getWithResponseAsync( new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1206,6 +1162,7 @@ public Mono>> deleteWithResponseAsync( new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1311,7 +1268,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String galleryName, String galleryApplicationName) { return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1332,7 +1289,7 @@ public Mono deleteAsync( String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { return beginDeleteAsync(resourceGroupName, galleryName, galleryApplicationName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1460,6 +1417,7 @@ public Mono> listByGallerySinglePageAsync return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByGallery( this.client.getEndpoint(), @@ -1551,705 +1509,6 @@ public PagedIterable listByGallery( return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName, context)); } - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to create - * or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplication == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); - } else { - galleryApplication.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - galleryApplication, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to create - * or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication, - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplication == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); - } else { - galleryApplication.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - galleryApplication, - context); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to create - * or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to create - * or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to create - * or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - .block(); - } - - /** - * Create or update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * created. - * @param galleryApplicationName The name of the gallery Application Definition to be created or updated. The - * allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The - * maximum length is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to create - * or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationInner galleryApplication, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) - .block(); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplication == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); - } else { - galleryApplication.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - galleryApplication, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication, - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - if (galleryApplication == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryApplication is required and cannot be null.")); - } else { - galleryApplication.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - galleryApplication, - context); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - .block(); - } - - /** - * Update a gallery Application Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * updated. - * @param galleryApplicationName The name of the gallery Application Definition to be updated. The allowed - * characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length - * is 80 characters. - * @param galleryApplication Specifies information about the gallery Application Definition that you want to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Application Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryApplicationInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryApplicationName, - GalleryApplicationUpdate galleryApplication, - Context context) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryApplicationName, galleryApplication, context) - .block(); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryApplicationName) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryApplicationName, 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryApplicationName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryApplicationName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryApplicationName, - apiVersion, - context); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryApplicationName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName, galleryApplicationName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryApplicationName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling(String resourceGroupName, String galleryName, String galleryApplicationName) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryApplicationName).block(); - } - - /** - * Delete a gallery Application. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Application Gallery in which the Application Definition is to be - * deleted. - * @param galleryApplicationName The name of the gallery Application Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling( - String resourceGroupName, String galleryName, String galleryApplicationName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryApplicationName, context).block(); - } - /** * Get the next page of items. * @@ -2294,6 +1553,7 @@ public Mono> listByGalleryNextSinglePageA if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByGalleryNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImageVersionsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImageVersionsClient.java index e8ac9eb58037..53d0acbe851c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImageVersionsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImageVersionsClient.java @@ -152,56 +152,6 @@ Mono> listByGalleryImage( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @PathParam("galleryImageVersionName") String galleryImageVersionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageVersionInner galleryImageVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @PathParam("galleryImageVersionName") String galleryImageVersionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageVersionUpdate galleryImageVersion, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @PathParam("galleryImageVersionName") String galleryImageVersionName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -345,6 +295,7 @@ public Mono>> createOrUpdateWithResponseAsync( galleryImageVersion.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -513,7 +464,7 @@ public Mono createOrUpdateAsync( return beginCreateOrUpdateAsync( resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -544,7 +495,7 @@ public Mono createOrUpdateAsync( return beginCreateOrUpdateAsync( resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -738,6 +689,7 @@ public Mono>> updateWithResponseAsync( galleryImageVersion.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -901,7 +853,7 @@ public Mono updateAsync( return beginUpdateAsync( resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -931,7 +883,7 @@ public Mono updateAsync( return beginUpdateAsync( resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1107,6 +1059,7 @@ public Mono> getWithResponseAsync( new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1391,6 +1344,7 @@ public Mono>> deleteWithResponseAsync( new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1508,7 +1462,7 @@ public Mono deleteAsync( String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1533,7 +1487,7 @@ public Mono deleteAsync( Context context) { return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1678,6 +1632,7 @@ public Mono> listByGalleryImageSinglePag .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByGalleryImage( this.client.getEndpoint(), @@ -1776,764 +1731,6 @@ public PagedIterable listByGalleryImage( return new PagedIterable<>(listByGalleryImageAsync(resourceGroupName, galleryName, galleryImageName, context)); } - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or - * update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - if (galleryImageVersion == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); - } else { - galleryImageVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - galleryImageVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or - * update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion, - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - if (galleryImageVersion == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); - } else { - galleryImageVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - galleryImageVersion, - context); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or - * update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or - * update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or - * update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .block(); - } - - /** - * Create or update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be created. - * @param galleryImageVersionName The name of the gallery Image Version to be created. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to create or - * update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionInner galleryImageVersion, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .block(); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - if (galleryImageVersion == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); - } else { - galleryImageVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - galleryImageVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion, - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - if (galleryImageVersion == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageVersion is required and cannot be null.")); - } else { - galleryImageVersion.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - galleryImageVersion, - context); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - .block(); - } - - /** - * Update a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version is to be updated. - * @param galleryImageVersionName The name of the gallery Image Version to be updated. Needs to follow semantic - * version name pattern: The allowed characters are digit and period. Digits must be within the range of a - * 32-bit integer. Format: <MajorVersion>.<MinorVersion>.<Patch>. - * @param galleryImageVersion Specifies information about the gallery Image Version that you want to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Version that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageVersionInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - GalleryImageVersionUpdate galleryImageVersion, - Context context) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, context) - .block(); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImageVersionName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter galleryImageVersionName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - galleryImageVersionName, - apiVersion, - context); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - Context context) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling( - String resourceGroupName, String galleryName, String galleryImageName, String galleryImageVersionName) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) - .block(); - } - - /** - * Delete a gallery Image Version. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition resides. - * @param galleryImageName The name of the gallery Image Definition in which the Image Version resides. - * @param galleryImageVersionName The name of the gallery Image Version to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - String galleryImageVersionName, - Context context) { - beginDeleteWithoutPollingAsync( - resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, context) - .block(); - } - /** * Get the next page of items. * @@ -2578,6 +1775,7 @@ public Mono> listByGalleryImageNextSingl if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByGalleryImageNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImagesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImagesClient.java index 45cf925620a8..5244e8815208 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImagesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/GalleryImagesClient.java @@ -144,53 +144,6 @@ Mono> listByGallery( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}") - @ExpectedResponses({200, 201, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageInner galleryImage, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GalleryImageUpdate galleryImage, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries" - + "/{galleryName}/images/{galleryImageName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("galleryName") String galleryName, - @PathParam("galleryImageName") String galleryImageName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -312,6 +265,7 @@ public Mono>> createOrUpdateWithResponseAsync( galleryImage.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -444,7 +398,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -471,7 +425,7 @@ public Mono createOrUpdateAsync( Context context) { return beginCreateOrUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -632,6 +586,7 @@ public Mono>> updateWithResponseAsync( galleryImage.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -764,7 +719,7 @@ public Mono updateAsync( String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { return beginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -791,7 +746,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -931,6 +886,7 @@ public Mono> getWithResponseAsync( .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1118,6 +1074,7 @@ public Mono>> deleteWithResponseAsync( .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1218,7 +1175,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String galleryName, String galleryImageName) { return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1238,7 +1195,7 @@ public Mono deleteAsync( String resourceGroupName, String galleryName, String galleryImageName, Context context) { return beginDeleteAsync(resourceGroupName, galleryName, galleryImageName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1362,6 +1319,7 @@ public Mono> listByGallerySinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByGallery( this.client.getEndpoint(), @@ -1449,648 +1407,6 @@ public PagedIterable listByGallery( return new PagedIterable<>(listByGalleryAsync(resourceGroupName, galleryName, context)); } - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - galleryImage, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageInner galleryImage, - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - galleryImage, - context); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImage) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImage, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageInner galleryImage) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, galleryImage) - .block(); - } - - /** - * Create or update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be created. - * @param galleryImageName The name of the gallery Image Definition to be created or updated. The allowed characters - * are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to create or update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageInner galleryImage, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, galleryName, galleryImageName, galleryImage, context) - .block(); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - galleryImage, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageUpdate galleryImage, - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - if (galleryImage == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryImage is required and cannot be null.")); - } else { - galleryImage.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - galleryImage, - context); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImage) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageUpdate galleryImage, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, galleryName, galleryImageName, galleryImage, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to update. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner beginUpdateWithoutPolling( - String resourceGroupName, String galleryName, String galleryImageName, GalleryImageUpdate galleryImage) { - return beginUpdateWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, galleryImage).block(); - } - - /** - * Update a gallery Image Definition. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be updated. - * @param galleryImageName The name of the gallery Image Definition to be updated. The allowed characters are - * alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 - * characters. - * @param galleryImage Specifies information about the gallery Image Definition that you want to update. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return specifies information about the gallery Image Definition that you want to create or update. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GalleryImageInner beginUpdateWithoutPolling( - String resourceGroupName, - String galleryName, - String galleryImageName, - GalleryImageUpdate galleryImage, - Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, galleryImage, context) - .block(); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName) { - 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String galleryName, String galleryImageName, 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 (galleryName == null) { - return Mono.error(new IllegalArgumentException("Parameter galleryName is required and cannot be null.")); - } - if (galleryImageName == null) { - return Mono - .error(new IllegalArgumentException("Parameter galleryImageName is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - galleryName, - galleryImageName, - apiVersion, - context); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryImageName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName, galleryImageName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, galleryName, galleryImageName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling(String resourceGroupName, String galleryName, String galleryImageName) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName).block(); - } - - /** - * Delete a gallery image. - * - * @param resourceGroupName The name of the resource group. - * @param galleryName The name of the Shared Image Gallery in which the Image Definition is to be deleted. - * @param galleryImageName The name of the gallery Image Definition to be deleted. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling( - String resourceGroupName, String galleryName, String galleryImageName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, galleryName, galleryImageName, context).block(); - } - /** * Get the next page of items. * @@ -2134,6 +1450,7 @@ public Mono> listByGalleryNextSinglePageAsync(S if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByGalleryNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ImagesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ImagesClient.java index e2a752d015cc..9a06ed1154f8 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ImagesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ImagesClient.java @@ -151,50 +151,6 @@ Mono> list( @PathParam("subscriptionId") String subscriptionId, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" - + "/{imageName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("imageName") String imageName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ImageInner parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" - + "/{imageName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("imageName") String imageName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") ImageUpdate parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images" - + "/{imageName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("imageName") String imageName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -308,6 +264,7 @@ public Mono>> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -424,7 +381,7 @@ public SyncPoller, ImageInner> beginCreateOrUpdate( public Mono createOrUpdateAsync(String resourceGroupName, String imageName, ImageInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, imageName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -446,7 +403,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String imageName, ImageInner parameters, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, imageName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -581,6 +538,7 @@ public Mono>> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -686,7 +644,7 @@ public SyncPoller, ImageInner> beginUpdate( public Mono updateAsync(String resourceGroupName, String imageName, ImageUpdate parameters) { return beginUpdateAsync(resourceGroupName, imageName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -706,7 +664,7 @@ public Mono updateAsync( String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { return beginUpdateAsync(resourceGroupName, imageName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -822,6 +780,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -909,7 +868,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String imageName) { - return beginDeleteAsync(resourceGroupName, imageName).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, imageName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -927,7 +886,7 @@ public Mono deleteAsync(String resourceGroupName, String imageName) { public Mono deleteAsync(String resourceGroupName, String imageName, Context context) { return beginDeleteAsync(resourceGroupName, imageName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1043,6 +1002,7 @@ public Mono> getByResourceGroupWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1259,6 +1219,7 @@ public Mono> listByResourceGroupSinglePageAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -1399,6 +1360,7 @@ public Mono> listSinglePageAsync(Context context) { "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( @@ -1468,551 +1430,6 @@ public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String imageName, ImageInner parameters) { - 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 (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * @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 source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String imageName, ImageInner parameters, 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 (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String imageName, ImageInner parameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, imageName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * @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 source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String imageName, ImageInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, imageName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String imageName, ImageInner parameters) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, imageName, parameters).block(); - } - - /** - * Create or update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. The virtual hard disk will be copied before being - * attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not - * exist. - * @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 source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String imageName, ImageInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, imageName, parameters, context).block(); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. Only tags may be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String imageName, ImageUpdate parameters) { - 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 (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. Only tags may be updated. - * @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 source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String imageName, ImageUpdate parameters, 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 (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. Only tags may be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String imageName, ImageUpdate parameters) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, imageName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. Only tags may be updated. - * @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 source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, imageName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. Only tags may be updated. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner beginUpdateWithoutPolling(String resourceGroupName, String imageName, ImageUpdate parameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, imageName, parameters).block(); - } - - /** - * Update an image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @param parameters The source user image virtual hard disk. Only tags may be updated. - * @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 source user image virtual hard disk. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner beginUpdateWithoutPolling( - String resourceGroupName, String imageName, ImageUpdate parameters, Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, imageName, parameters, context).block(); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginDeleteWithoutPollingWithResponseAsync(String resourceGroupName, String imageName) { - 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 (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @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 Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String imageName, 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 (imageName == null) { - return Mono.error(new IllegalArgumentException("Parameter imageName 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-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - imageName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginDeleteWithoutPollingAsync(String resourceGroupName, String imageName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, imageName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @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 Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String imageName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, imageName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String imageName) { - beginDeleteWithoutPollingAsync(resourceGroupName, imageName).block(); - } - - /** - * Deletes an Image. - * - * @param resourceGroupName The name of the resource group. - * @param imageName The name of the image. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String imageName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, imageName, context).block(); - } - /** * Get the next page of items. * @@ -2056,6 +1473,7 @@ public Mono> listByResourceGroupNextSinglePageAsync(St if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -2112,6 +1530,7 @@ public Mono> listNextSinglePageAsync(String nextLink, if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/LogAnalyticsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/LogAnalyticsClient.java index 3e5652556eba..e028c7cb9ce0 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/LogAnalyticsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/LogAnalyticsClient.java @@ -88,34 +88,6 @@ Mono>> exportThrottledRequests( @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") LogAnalyticsInputBase parameters, Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" - + "/getRequestRateByInterval") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginExportRequestRateByIntervalWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RequestRateByIntervalInput parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess" - + "/getThrottledRequests") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginExportThrottledRequestsWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("location") String location, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") LogAnalyticsInputBase parameters, - Context context); } /** @@ -203,6 +175,7 @@ public Mono>> exportRequestRateByIntervalWithResponseA parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .exportRequestRateByInterval( this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); @@ -309,7 +282,7 @@ public Mono exportRequestRateByIntervalAsync( String location, RequestRateByIntervalInput parameters) { return beginExportRequestRateByIntervalAsync(location, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -329,7 +302,7 @@ public Mono exportRequestRateByIntervalAsync( String location, RequestRateByIntervalInput parameters, Context context) { return beginExportRequestRateByIntervalAsync(location, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -450,6 +423,7 @@ public Mono>> exportThrottledRequestsWithResponseAsync parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .exportThrottledRequests( this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); @@ -550,7 +524,7 @@ public Mono exportThrottledRequestsAsync( String location, LogAnalyticsInputBase parameters) { return beginExportThrottledRequestsAsync(location, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -569,7 +543,7 @@ public Mono exportThrottledRequestsAsync( String location, LogAnalyticsInputBase parameters, Context context) { return beginExportThrottledRequestsAsync(location, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -603,352 +577,4 @@ public LogAnalyticsOperationResultInner exportThrottledRequests( String location, LogAnalyticsInputBase parameters, Context context) { return exportThrottledRequestsAsync(location, parameters, context).block(); } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - beginExportRequestRateByIntervalWithoutPollingWithResponseAsync( - String location, RequestRateByIntervalInput parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginExportRequestRateByIntervalWithoutPolling( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval Api. - * @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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - beginExportRequestRateByIntervalWithoutPollingWithResponseAsync( - String location, RequestRateByIntervalInput parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginExportRequestRateByIntervalWithoutPolling( - this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginExportRequestRateByIntervalWithoutPollingAsync( - String location, RequestRateByIntervalInput parameters) { - return beginExportRequestRateByIntervalWithoutPollingWithResponseAsync(location, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval Api. - * @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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginExportRequestRateByIntervalWithoutPollingAsync( - String location, RequestRateByIntervalInput parameters, Context context) { - return beginExportRequestRateByIntervalWithoutPollingWithResponseAsync(location, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner beginExportRequestRateByIntervalWithoutPolling( - String location, RequestRateByIntervalInput parameters) { - return beginExportRequestRateByIntervalWithoutPollingAsync(location, parameters).block(); - } - - /** - * Export logs that show Api requests made by this subscription in the given time window to show throttling - * activities. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api request input for LogAnalytics getRequestRateByInterval Api. - * @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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner beginExportRequestRateByIntervalWithoutPolling( - String location, RequestRateByIntervalInput parameters, Context context) { - return beginExportRequestRateByIntervalWithoutPollingAsync(location, parameters, context).block(); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginExportThrottledRequestsWithoutPollingWithResponseAsync( - String location, LogAnalyticsInputBase parameters) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginExportThrottledRequestsWithoutPolling( - this.client.getEndpoint(), - location, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics Api. - * @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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginExportThrottledRequestsWithoutPollingWithResponseAsync( - String location, LogAnalyticsInputBase parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginExportThrottledRequestsWithoutPolling( - this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), parameters, context); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginExportThrottledRequestsWithoutPollingAsync( - String location, LogAnalyticsInputBase parameters) { - return beginExportThrottledRequestsWithoutPollingWithResponseAsync(location, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics Api. - * @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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginExportThrottledRequestsWithoutPollingAsync( - String location, LogAnalyticsInputBase parameters, Context context) { - return beginExportThrottledRequestsWithoutPollingWithResponseAsync(location, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics Api. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner beginExportThrottledRequestsWithoutPolling( - String location, LogAnalyticsInputBase parameters) { - return beginExportThrottledRequestsWithoutPollingAsync(location, parameters).block(); - } - - /** - * Export logs that show total throttled Api requests for this subscription in the given time window. - * - * @param location The location upon which virtual-machine-sizes is queried. - * @param parameters Api input base class for LogAnalytics Api. - * @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 logAnalytics operation status response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LogAnalyticsOperationResultInner beginExportThrottledRequestsWithoutPolling( - String location, LogAnalyticsInputBase parameters, Context context) { - return beginExportThrottledRequestsWithoutPollingAsync(location, parameters, context).block(); - } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/OperationsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/OperationsClient.java index acfa82adde4b..8dcd55d1b7e7 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/OperationsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/OperationsClient.java @@ -108,6 +108,7 @@ public Mono> listSinglePageAsync(Conte "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ProximityPlacementGroupsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ProximityPlacementGroupsClient.java index 0e7920237e5e..c0cceda83dc5 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ProximityPlacementGroupsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ProximityPlacementGroupsClient.java @@ -271,6 +271,7 @@ public Mono> createOrUpdateWithResponseAs parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -468,6 +469,7 @@ public Mono> updateWithResponseAsync( final String apiVersion = "2019-12-01"; UpdateResource parameters = new UpdateResource(); parameters.withTags(tags); + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -651,6 +653,7 @@ public Mono> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -815,6 +818,7 @@ public Mono> getByResourceGroupWithRespon "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1026,6 +1030,7 @@ public Mono> listSinglePageAsync(Con "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( @@ -1174,6 +1179,7 @@ public Mono> listByResourceGroupSing "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -1294,6 +1300,7 @@ public Mono> listBySubscriptionNextS if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySubscriptionNext(nextLink, context) .map( @@ -1351,6 +1358,7 @@ public Mono> listByResourceGroupNext if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ResourceSkusClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ResourceSkusClient.java index 26d1bb7b1b31..e1a493a133d3 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ResourceSkusClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/ResourceSkusClient.java @@ -143,6 +143,7 @@ public Mono> listSinglePageAsync(String filter, "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-04-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, context) .map( @@ -286,6 +287,7 @@ public Mono> listNextSinglePageAsync(String next if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SnapshotsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SnapshotsClient.java index 32220bff368b..ccb61f253f38 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SnapshotsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SnapshotsClient.java @@ -183,79 +183,6 @@ Mono>> revokeAccess( @QueryParam("api-version") String apiVersion, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SnapshotInner snapshot, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SnapshotUpdate snapshot, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}/beginGetAccess") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginGrantAccessWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GrantAccessData grantAccessData, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots" - + "/{snapshotName}/endGetAccess") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRevokeAccessWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("snapshotName") String snapshotName, - @QueryParam("api-version") String apiVersion, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -367,6 +294,7 @@ public Mono>> createOrUpdateWithResponseAsync( snapshot.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -479,7 +407,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String snapshotName, SnapshotInner snapshot) { return beginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -500,7 +428,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, snapshotName, snapshot, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -635,6 +563,7 @@ public Mono>> updateWithResponseAsync( snapshot.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -745,7 +674,7 @@ public SyncPoller, SnapshotInner> beginUpdate( public Mono updateAsync(String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { return beginUpdateAsync(resourceGroupName, snapshotName, snapshot) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -766,7 +695,7 @@ public Mono updateAsync( String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { return beginUpdateAsync(resourceGroupName, snapshotName, snapshot, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -888,6 +817,7 @@ public Mono> getByResourceGroupWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1062,6 +992,7 @@ public Mono>> deleteWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1155,7 +1086,7 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String snapshotName) { - return beginDeleteAsync(resourceGroupName, snapshotName).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, snapshotName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -1174,7 +1105,7 @@ public Mono deleteAsync(String resourceGroupName, String snapshotName) { public Mono deleteAsync(String resourceGroupName, String snapshotName, Context context) { return beginDeleteAsync(resourceGroupName, snapshotName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1288,6 +1219,7 @@ public Mono> listByResourceGroupSinglePageAsync( .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, context) @@ -1426,6 +1358,7 @@ public Mono> listSinglePageAsync(Context context) { "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, context) .map( @@ -1589,6 +1522,7 @@ public Mono>> grantAccessWithResponseAsync( grantAccessData.validate(); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .grantAccess( this.client.getEndpoint(), @@ -1701,7 +1635,7 @@ public Mono grantAccessAsync( String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { return beginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1722,7 +1656,7 @@ public Mono grantAccessAsync( String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { return beginGrantAccessAsync(resourceGroupName, snapshotName, grantAccessData, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1844,6 +1778,7 @@ public Mono>> revokeAccessWithResponseAsync( return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); } final String apiVersion = "2019-11-01"; + context = this.client.mergeContext(context); return service .revokeAccess( this.client.getEndpoint(), @@ -1939,7 +1874,7 @@ public SyncPoller, Void> beginRevokeAccess( public Mono revokeAccessAsync(String resourceGroupName, String snapshotName) { return beginRevokeAccessAsync(resourceGroupName, snapshotName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1958,7 +1893,7 @@ public Mono revokeAccessAsync(String resourceGroupName, String snapshotNam public Mono revokeAccessAsync(String resourceGroupName, String snapshotName, Context context) { return beginRevokeAccessAsync(resourceGroupName, snapshotName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1992,919 +1927,6 @@ public void revokeAccess(String resourceGroupName, String snapshotName, Context revokeAccessAsync(resourceGroupName, snapshotName, context).block(); } - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot 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 snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - 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 (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (snapshot == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - } else { - snapshot.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - snapshot, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot 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 snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot, 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 (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (snapshot == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - } else { - snapshot.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - snapshot, - context); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot 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 snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, snapshot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot 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 snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, snapshot, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot 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 snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String snapshotName, SnapshotInner snapshot) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, snapshotName, snapshot).block(); - } - - /** - * Creates or updates a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot 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 snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String snapshotName, SnapshotInner snapshot, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, snapshotName, snapshot, context).block(); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update 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 snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - 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 (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (snapshot == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - } else { - snapshot.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - snapshot, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update 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 snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, 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 (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (snapshot == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshot is required and cannot be null.")); - } else { - snapshot.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - snapshot, - context); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update 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 snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, snapshot) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update 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 snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, snapshot, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update 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 snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner beginUpdateWithoutPolling( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot) { - return beginUpdateWithoutPollingAsync(resourceGroupName, snapshotName, snapshot).block(); - } - - /** - * Updates (patches) a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param snapshot Snapshot update 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 snapshot resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SnapshotInner beginUpdateWithoutPolling( - String resourceGroupName, String snapshotName, SnapshotUpdate snapshot, Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, snapshotName, snapshot, context).block(); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName) { - 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 (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @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 Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, 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 (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginDeleteWithoutPollingAsync(String resourceGroupName, String snapshotName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, snapshotName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @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 Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String snapshotName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String snapshotName) { - beginDeleteWithoutPollingAsync(resourceGroupName, snapshotName).block(); - } - - /** - * Deletes a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String snapshotName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, snapshotName, context).block(); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginGrantAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - 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 (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (grantAccessData == null) { - return Mono - .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); - } else { - grantAccessData.validate(); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginGrantAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - grantAccessData, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @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 disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginGrantAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, 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 (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - if (grantAccessData == null) { - return Mono - .error(new IllegalArgumentException("Parameter grantAccessData is required and cannot be null.")); - } else { - grantAccessData.validate(); - } - final String apiVersion = "2019-11-01"; - return service - .beginGrantAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - grantAccessData, - context); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginGrantAccessWithoutPollingAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - return beginGrantAccessWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, grantAccessData) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @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 disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginGrantAccessWithoutPollingAsync( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { - return beginGrantAccessWithoutPollingWithResponseAsync( - resourceGroupName, snapshotName, grantAccessData, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner beginGrantAccessWithoutPolling( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData) { - return beginGrantAccessWithoutPollingAsync(resourceGroupName, snapshotName, grantAccessData).block(); - } - - /** - * Grants access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @param grantAccessData Data used for requesting a SAS. - * @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 disk access SAS uri. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AccessUriInner beginGrantAccessWithoutPolling( - String resourceGroupName, String snapshotName, GrantAccessData grantAccessData, Context context) { - return beginGrantAccessWithoutPollingAsync(resourceGroupName, snapshotName, grantAccessData, context).block(); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginRevokeAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName) { - 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 (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return FluxUtil - .withContext( - context -> - service - .beginRevokeAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @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 Mono> beginRevokeAccessWithoutPollingWithResponseAsync( - String resourceGroupName, String snapshotName, 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 (snapshotName == null) { - return Mono.error(new IllegalArgumentException("Parameter snapshotName is required and cannot be null.")); - } - final String apiVersion = "2019-11-01"; - return service - .beginRevokeAccessWithoutPolling( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - snapshotName, - apiVersion, - context); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginRevokeAccessWithoutPollingAsync(String resourceGroupName, String snapshotName) { - return beginRevokeAccessWithoutPollingWithResponseAsync(resourceGroupName, snapshotName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @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 Mono beginRevokeAccessWithoutPollingAsync( - String resourceGroupName, String snapshotName, Context context) { - return beginRevokeAccessWithoutPollingWithResponseAsync(resourceGroupName, snapshotName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginRevokeAccessWithoutPolling(String resourceGroupName, String snapshotName) { - beginRevokeAccessWithoutPollingAsync(resourceGroupName, snapshotName).block(); - } - - /** - * Revokes access to a snapshot. - * - * @param resourceGroupName The name of the resource group. - * @param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot - * is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. - * @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 beginRevokeAccessWithoutPolling(String resourceGroupName, String snapshotName, Context context) { - beginRevokeAccessWithoutPollingAsync(resourceGroupName, snapshotName, context).block(); - } - /** * Get the next page of items. * @@ -2948,6 +1970,7 @@ public Mono> listByResourceGroupNextSinglePageAsync if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( @@ -3004,6 +2027,7 @@ public Mono> listNextSinglePageAsync(String nextLin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SshPublicKeysClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SshPublicKeysClient.java index a235536e529f..b03342bad4d4 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SshPublicKeysClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/SshPublicKeysClient.java @@ -245,6 +245,7 @@ public Mono> listSinglePageAsync(Contex "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( @@ -398,6 +399,7 @@ public Mono> listByResourceGroupSingleP "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -574,6 +576,7 @@ public Mono> createWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .create( this.client.getEndpoint(), @@ -767,6 +770,7 @@ public Mono> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -946,6 +950,7 @@ public Mono> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1101,6 +1106,7 @@ public Mono> getByResourceGroupWithResponseA "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1276,6 +1282,7 @@ public Mono> generateKeyPairWit "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .generateKeyPair( this.client.getEndpoint(), @@ -1415,6 +1422,7 @@ public Mono> listBySubscriptionNextSing if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listBySubscriptionNext(nextLink, context) .map( @@ -1472,6 +1480,7 @@ public Mono> listByResourceGroupNextSin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByResourceGroupNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/UsagesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/UsagesClient.java index a4d631bffb95..0b064146aaeb 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/UsagesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/UsagesClient.java @@ -151,6 +151,7 @@ public Mono> listSinglePageAsync(String location, Cont "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context) .map( @@ -270,6 +271,7 @@ public Mono> listNextSinglePageAsync(String nextLink, if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionImagesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionImagesClient.java index bb19231dd7f9..8fca1070ab83 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionImagesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionImagesClient.java @@ -204,6 +204,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -384,6 +385,7 @@ public Mono>> listTypesWithResp "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listTypes( this.client.getEndpoint(), @@ -576,6 +578,7 @@ public Mono>> listVersionsWithR "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listVersions( this.client.getEndpoint(), diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionsClient.java index c913c72feb05..d2e67bc7b23e 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineExtensionsClient.java @@ -142,53 +142,6 @@ Mono> list( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineExtensionInner extensionParameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineExtensionUpdate extensionParameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/extensions/{vmExtensionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); } /** @@ -305,6 +258,7 @@ public Mono>> createOrUpdateWithResponseAsync( extensionParameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -443,7 +397,7 @@ public Mono createOrUpdateAsync( VirtualMachineExtensionInner extensionParameters) { return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -468,7 +422,7 @@ public Mono createOrUpdateAsync( Context context) { return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -629,6 +583,7 @@ public Mono>> updateWithResponseAsync( extensionParameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -766,7 +721,7 @@ public Mono updateAsync( VirtualMachineExtensionUpdate extensionParameters) { return beginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -791,7 +746,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -930,6 +885,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1029,7 +985,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { return beginDeleteAsync(resourceGroupName, vmName, vmExtensionName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1048,7 +1004,7 @@ public Mono deleteAsync(String resourceGroupName, String vmName, String vm public Mono deleteAsync(String resourceGroupName, String vmName, String vmExtensionName, Context context) { return beginDeleteAsync(resourceGroupName, vmName, vmExtensionName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1177,6 +1133,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1408,6 +1365,7 @@ public Mono> listWithResponseA "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -1545,643 +1503,4 @@ public VirtualMachineExtensionsListResultInner list(String resourceGroupName, St final Context context = null; return listAsync(resourceGroupName, vmName, expand).block(); } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @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 a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmName, vmExtensionName, extensionParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @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 a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmName, vmExtensionName, extensionParameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters) - .block(); - } - - /** - * The operation to create or update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be created or updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @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 a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, vmName, vmExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @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 a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmName, vmExtensionName, extensionParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @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 a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmName, vmExtensionName, extensionParameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).block(); - } - - /** - * The operation to update the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be updated. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @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 a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmName, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, String vmExtensionName) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @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 Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, String vmExtensionName, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName 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-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginDeleteWithoutPollingAsync(String resourceGroupName, String vmName, String vmExtensionName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmName, vmExtensionName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @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 Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmName, String vmExtensionName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmName, vmExtensionName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String vmName, String vmExtensionName) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName).block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine where the extension should be deleted. - * @param vmExtensionName The name of the virtual machine extension. - * @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 beginDeleteWithoutPolling( - String resourceGroupName, String vmName, String vmExtensionName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmName, vmExtensionName, context).block(); - } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineImagesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineImagesClient.java index 454896511ae8..c69154278b53 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineImagesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineImagesClient.java @@ -239,6 +239,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -459,6 +460,7 @@ public Mono>> listWithResponseAs "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -721,6 +723,7 @@ public Mono>> listOffersWithResp "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listOffers( this.client.getEndpoint(), @@ -875,6 +878,7 @@ public Mono>> listPublishersWith "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listPublishers(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context); } @@ -1041,6 +1045,7 @@ public Mono>> listSkusWithRespon "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listSkus( this.client.getEndpoint(), diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineRunCommandsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineRunCommandsClient.java index da4489de1202..4bad1232cdbc 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineRunCommandsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineRunCommandsClient.java @@ -165,6 +165,7 @@ public Mono> listSinglePageAsync(Stri "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context) .map( @@ -315,6 +316,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get(this.client.getEndpoint(), location, commandId, apiVersion, this.client.getSubscriptionId(), context); } @@ -440,6 +442,7 @@ public Mono> listNextSinglePageAsync( if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetExtensionsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetExtensionsClient.java index def470e91cc3..ea603ecf3b87 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetExtensionsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetExtensionsClient.java @@ -149,53 +149,6 @@ Mono> list( @PathParam("subscriptionId") String subscriptionId, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("vmssExtensionName") String vmssExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetExtensionInner extensionParameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("vmssExtensionName") String vmssExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("vmssExtensionName") String vmssExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -318,6 +271,7 @@ public Mono>> createOrUpdateWithResponseAsync( extensionParameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -462,7 +416,7 @@ public Mono createOrUpdateAsync( VirtualMachineScaleSetExtensionInner extensionParameters) { return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -488,7 +442,7 @@ public Mono createOrUpdateAsync( return beginCreateOrUpdateAsync( resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -650,6 +604,7 @@ public Mono>> updateWithResponseAsync( extensionParameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -792,7 +747,7 @@ public Mono updateAsync( VirtualMachineScaleSetExtensionUpdate extensionParameters) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -817,7 +772,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -956,6 +911,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1056,7 +1012,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1076,7 +1032,7 @@ public Mono deleteAsync( String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1205,6 +1161,7 @@ public Mono> getWithResponseAsync "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1443,6 +1400,7 @@ public Mono> listSinglePageA "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -1530,649 +1488,6 @@ public PagedIterable list( return new PagedIterable<>(listAsync(resourceGroupName, vmScaleSetName, context)); } - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName 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 (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @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 a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters, - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName 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 (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @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 a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) - .block(); - } - - /** - * The operation to create or update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @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 a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName 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 (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @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 a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters, - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName 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 (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @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 a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters) - .block(); - } - - /** - * The operation to update an extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be updated. - * @param vmssExtensionName The name of the VM scale set extension. - * @param extensionParameters Describes a Virtual Machine Scale Set Extension. - * @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 a Virtual Machine Scale Set Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetExtensionInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String vmssExtensionName, - VirtualMachineScaleSetExtensionUpdate extensionParameters, - Context context) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, vmssExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @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 Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (vmssExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmssExtensionName 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-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - vmssExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @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 Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String vmScaleSetName, String vmssExtensionName) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmssExtensionName).block(); - } - - /** - * The operation to delete the extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be deleted. - * @param vmssExtensionName The name of the VM scale set extension. - * @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 beginDeleteWithoutPolling( - String resourceGroupName, String vmScaleSetName, String vmssExtensionName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmssExtensionName, context).block(); - } - /** * Get the next page of items. * @@ -2217,6 +1532,7 @@ public Mono> listNextSingleP if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java index 9ea4a38e9b07..743aa7e76d12 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetRollingUpgradesClient.java @@ -118,48 +118,6 @@ Mono> getLatest( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCancelWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStartOSUpgradeWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStartExtensionUpgradeWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); } /** @@ -242,6 +200,7 @@ public Mono>> cancelWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .cancel( this.client.getEndpoint(), @@ -330,7 +289,9 @@ public SyncPoller, Void> beginCancel( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono cancelAsync(String resourceGroupName, String vmScaleSetName) { - return beginCancelAsync(resourceGroupName, vmScaleSetName).last().flatMap(client::getLroFinalResultOrError); + return beginCancelAsync(resourceGroupName, vmScaleSetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -348,7 +309,7 @@ public Mono cancelAsync(String resourceGroupName, String vmScaleSetName) { public Mono cancelAsync(String resourceGroupName, String vmScaleSetName, Context context) { return beginCancelAsync(resourceGroupName, vmScaleSetName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -463,6 +424,7 @@ public Mono>> startOSUpgradeWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .startOSUpgrade( this.client.getEndpoint(), @@ -560,7 +522,7 @@ public SyncPoller, Void> beginStartOSUpgrade( public Mono startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName) { return beginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -579,7 +541,7 @@ public Mono startOSUpgradeAsync(String resourceGroupName, String vmScaleSe public Mono startOSUpgradeAsync(String resourceGroupName, String vmScaleSetName, Context context) { return beginStartOSUpgradeAsync(resourceGroupName, vmScaleSetName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -696,6 +658,7 @@ public Mono>> startExtensionUpgradeWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .startExtensionUpgrade( this.client.getEndpoint(), @@ -795,7 +758,7 @@ public SyncPoller, Void> beginStartExtensionUpgrade( public Mono startExtensionUpgradeAsync(String resourceGroupName, String vmScaleSetName) { return beginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -814,7 +777,7 @@ public Mono startExtensionUpgradeAsync(String resourceGroupName, String vm public Mono startExtensionUpgradeAsync(String resourceGroupName, String vmScaleSetName, Context context) { return beginStartExtensionUpgradeAsync(resourceGroupName, vmScaleSetName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -929,6 +892,7 @@ public Mono> getLatestWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getLatest( this.client.getEndpoint(), @@ -1017,478 +981,4 @@ public RollingUpgradeStatusInfoInner getLatest(String resourceGroupName, String public RollingUpgradeStatusInfoInner getLatest(String resourceGroupName, String vmScaleSetName, Context context) { return getLatestAsync(resourceGroupName, vmScaleSetName, context).block(); } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginCancelWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCancelWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @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 Mono> beginCancelWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - return service - .beginCancelWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginCancelWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { - return beginCancelWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @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 Mono beginCancelWithoutPollingAsync(String resourceGroupName, String vmScaleSetName, Context context) { - return beginCancelWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginCancelWithoutPolling(String resourceGroupName, String vmScaleSetName) { - beginCancelWithoutPollingAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Cancels the current virtual machine scale set rolling upgrade. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @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 beginCancelWithoutPolling(String resourceGroupName, String vmScaleSetName, Context context) { - beginCancelWithoutPollingAsync(resourceGroupName, vmScaleSetName, context).block(); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginStartOSUpgradeWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginStartOSUpgradeWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @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 Mono> beginStartOSUpgradeWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - return service - .beginStartOSUpgradeWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginStartOSUpgradeWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { - return beginStartOSUpgradeWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @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 Mono beginStartOSUpgradeWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - return beginStartOSUpgradeWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginStartOSUpgradeWithoutPolling(String resourceGroupName, String vmScaleSetName) { - beginStartOSUpgradeWithoutPollingAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image - * OS version. Instances which are already running the latest available OS version are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @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 beginStartOSUpgradeWithoutPolling(String resourceGroupName, String vmScaleSetName, Context context) { - beginStartOSUpgradeWithoutPollingAsync(resourceGroupName, vmScaleSetName, context).block(); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginStartExtensionUpgradeWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginStartExtensionUpgradeWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @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 Mono> beginStartExtensionUpgradeWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - return service - .beginStartExtensionUpgradeWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginStartExtensionUpgradeWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { - return beginStartExtensionUpgradeWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @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 Mono beginStartExtensionUpgradeWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, Context context) { - return beginStartExtensionUpgradeWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginStartExtensionUpgradeWithoutPolling(String resourceGroupName, String vmScaleSetName) { - beginStartExtensionUpgradeWithoutPollingAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Starts a rolling upgrade to move all extensions for all virtual machine scale set instances to the latest - * available extension version. Instances which are already running the latest extension versions are not affected. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @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 beginStartExtensionUpgradeWithoutPolling( - String resourceGroupName, String vmScaleSetName, Context context) { - beginStartExtensionUpgradeWithoutPollingAsync(resourceGroupName, vmScaleSetName, context).block(); - } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMExtensionsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMExtensionsClient.java index 5525467cc624..79eb0dc75769 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMExtensionsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMExtensionsClient.java @@ -150,56 +150,6 @@ Mono> list( @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineExtensionInner extensionParameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineExtensionUpdate extensionParameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @PathParam("vmExtensionName") String vmExtensionName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); } /** @@ -327,6 +277,7 @@ public Mono>> createOrUpdateWithResponseAsync( extensionParameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -481,7 +432,7 @@ public Mono createOrUpdateAsync( return beginCreateOrUpdateAsync( resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -509,7 +460,7 @@ public Mono createOrUpdateAsync( return beginCreateOrUpdateAsync( resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -688,6 +639,7 @@ public Mono>> updateWithResponseAsync( extensionParameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -840,7 +792,7 @@ public Mono updateAsync( VirtualMachineExtensionUpdate extensionParameters) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -868,7 +820,7 @@ public Mono updateAsync( return beginUpdateAsync( resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1021,6 +973,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1129,7 +1082,7 @@ public Mono deleteAsync( String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1150,7 +1103,7 @@ public Mono deleteAsync( String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1296,6 +1249,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -1554,6 +1508,7 @@ public Mono> listWithResponseA "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -1701,705 +1656,4 @@ public VirtualMachineExtensionsListResultInner list( final Context context = null; return listAsync(resourceGroupName, vmScaleSetName, instanceId, expand).block(); } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) - .block(); - } - - /** - * The operation to create or update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionInner extensionParameters, - Context context) { - return beginCreateOrUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName 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 (extensionParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter extensionParameters is required and cannot be null.")); - } else { - extensionParameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - extensionParameters, - context); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters) - .block(); - } - - /** - * The operation to update the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param extensionParameters Describes a Virtual Machine Extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine Extension. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineExtensionInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - String vmExtensionName, - VirtualMachineExtensionUpdate extensionParameters, - Context context) { - return beginUpdateWithoutPollingAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, extensionParameters, context) - .block(); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } - if (vmExtensionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter vmExtensionName 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-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - vmExtensionName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName).block(); - } - - /** - * The operation to delete the VMSS VM extension. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param vmExtensionName The name of the virtual machine extension. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginDeleteWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, String vmExtensionName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, vmExtensionName, context).block(); - } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMsClient.java index 9e137e3102c1..0ad2aa74e002 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetVMsClient.java @@ -306,175 +306,6 @@ Mono>> runCommand( @BodyParam("application/json") RunCommandInput parameters, Context context); - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimageWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineReimageParameters vmScaleSetVMReimageInput, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimageAllWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeallocateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInner parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPowerOffWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("skipShutdown") Boolean skipShutdown, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRestartWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStartWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRedeployWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPerformMaintenanceWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json,text/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRunCommandWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @PathParam("instanceId") String instanceId, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RunCommandInput parameters, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -590,6 +421,7 @@ public Mono>> reimageWithResponseAsync( vmScaleSetVMReimageInputInternal.withTempDisk(tempDisk); } VirtualMachineReimageParameters vmScaleSetVMReimageInput = vmScaleSetVMReimageInputInternal; + context = this.client.mergeContext(context); return service .reimage( this.client.getEndpoint(), @@ -702,7 +534,7 @@ public Mono reimageAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -724,7 +556,7 @@ public Mono reimageAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -855,6 +687,7 @@ public Mono>> reimageAllWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .reimageAll( this.client.getEndpoint(), @@ -960,7 +793,7 @@ public SyncPoller, Void> beginReimageAll( public Mono reimageAllAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -981,7 +814,7 @@ public Mono reimageAllAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1109,6 +942,7 @@ public Mono>> deallocateWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .deallocate( this.client.getEndpoint(), @@ -1214,7 +1048,7 @@ public SyncPoller, Void> beginDeallocate( public Mono deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1235,7 +1069,7 @@ public Mono deallocateAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1378,6 +1212,7 @@ public Mono>> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1505,7 +1340,7 @@ public Mono updateAsync( String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1530,7 +1365,7 @@ public Mono updateAsync( Context context) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1664,6 +1499,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1763,7 +1599,7 @@ public SyncPoller, Void> beginDelete( public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1782,7 +1618,7 @@ public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, S public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1909,6 +1745,7 @@ public Mono> getWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), @@ -2146,6 +1983,7 @@ public Mono> getInstanceView "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getInstanceView( this.client.getEndpoint(), @@ -2355,6 +2193,7 @@ public Mono> listSinglePageAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), @@ -2615,6 +2454,7 @@ public Mono>> powerOffWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .powerOff( this.client.getEndpoint(), @@ -2737,7 +2577,7 @@ public Mono powerOffAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2761,7 +2601,7 @@ public Mono powerOffAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2782,7 +2622,7 @@ public Mono powerOffAsync(String resourceGroupName, String vmScaleSetName, final Context context = null; return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2933,6 +2773,7 @@ public Mono>> restartWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .restart( this.client.getEndpoint(), @@ -3032,7 +2873,7 @@ public SyncPoller, Void> beginRestart( public Mono restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3052,7 +2893,7 @@ public Mono restartAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3176,6 +3017,7 @@ public Mono>> startWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .start( this.client.getEndpoint(), @@ -3275,7 +3117,7 @@ public SyncPoller, Void> beginStart( public Mono startAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginStartAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3294,7 +3136,7 @@ public Mono startAsync(String resourceGroupName, String vmScaleSetName, St public Mono startAsync(String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginStartAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3418,6 +3260,7 @@ public Mono>> redeployWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .redeploy( this.client.getEndpoint(), @@ -3518,7 +3361,7 @@ public SyncPoller, Void> beginRedeploy( public Mono redeployAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3538,7 +3381,7 @@ public Mono redeployAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3662,6 +3505,7 @@ public Mono>> performMaintenanceWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .performMaintenance( this.client.getEndpoint(), @@ -3762,7 +3606,7 @@ public SyncPoller, Void> beginPerformMaintenance( public Mono performMaintenanceAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3782,7 +3626,7 @@ public Mono performMaintenanceAsync( String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceId, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3909,6 +3753,7 @@ public Mono> simulateEvictionWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .simulateEviction( this.client.getEndpoint(), @@ -4098,6 +3943,7 @@ public Mono>> runCommandWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .runCommand( this.client.getEndpoint(), @@ -4219,7 +4065,7 @@ public Mono runCommandAsync( String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { return beginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4244,7 +4090,7 @@ public Mono runCommandAsync( Context context) { return beginRunCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4288,2083 +4134,6 @@ public RunCommandResultInner runCommand( return runCommandAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context).block(); } - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginReimageWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - VirtualMachineReimageParameters vmScaleSetVMReimageInputInternal = null; - if (tempDisk != null) { - vmScaleSetVMReimageInputInternal = new VirtualMachineReimageParameters(); - vmScaleSetVMReimageInputInternal.withTempDisk(tempDisk); - } - VirtualMachineReimageParameters vmScaleSetVMReimageInput = vmScaleSetVMReimageInputInternal; - return FluxUtil - .withContext( - context -> - service - .beginReimageWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - vmScaleSetVMReimageInput, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @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 Mono> beginReimageWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - VirtualMachineReimageParameters vmScaleSetVMReimageInputInternal = null; - if (tempDisk != null) { - vmScaleSetVMReimageInputInternal = new VirtualMachineReimageParameters(); - vmScaleSetVMReimageInputInternal.withTempDisk(tempDisk); - } - VirtualMachineReimageParameters vmScaleSetVMReimageInput = vmScaleSetVMReimageInputInternal; - return service - .beginReimageWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - vmScaleSetVMReimageInput, - context); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginReimageWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { - return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @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 Mono beginReimageWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { - return beginReimageWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, tempDisk, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginReimageWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk) { - beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk).block(); - } - - /** - * Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @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 beginReimageWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean tempDisk, Context context) { - beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, tempDisk, context).block(); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginReimageAllWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginReimageAllWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono> beginReimageAllWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return service - .beginReimageAllWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginReimageAllWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginReimageAllWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono beginReimageAllWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginReimageAllWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginReimageAllWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginReimageAllWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is - * only supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 beginReimageAllWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginReimageAllWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginDeallocateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeallocateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono> beginDeallocateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return service - .beginDeallocateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginDeallocateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono beginDeallocateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginDeallocateWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginDeallocateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute - * resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 beginDeallocateWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginDeallocateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. - * @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 a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMInner parameters, - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. - * @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 a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMInner parameters, - Context context) { - return beginUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMInner beginUpdateWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, VirtualMachineScaleSetVMInner parameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); - } - - /** - * Updates a virtual machine of a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set where the extension should be create or updated. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Describes a virtual machine scale set virtual machine. - * @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 a virtual machine scale set virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetVMInner beginUpdateWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - VirtualMachineScaleSetVMInner parameters, - Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) - .block(); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono beginDeleteWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Deletes a virtual machine from a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 beginDeleteWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginPowerOffWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginPowerOffWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @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 Mono> beginPowerOffWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return service - .beginPowerOffWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginPowerOffWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @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 Mono beginPowerOffWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { - return beginPowerOffWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginPowerOffWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - final Boolean skipShutdown = null; - final Context context = null; - return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginPowerOffWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown) { - beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @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 beginPowerOffWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, Context context) { - beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown, context).block(); - } - - /** - * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting - * charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginPowerOffWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - final Boolean skipShutdown = null; - final Context context = null; - beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown).block(); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginRestartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginRestartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono> beginRestartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return service - .beginRestartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginRestartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono beginRestartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginRestartWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginRestartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Restarts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 beginRestartWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginRestartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginStartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginStartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono> beginStartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return service - .beginStartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginStartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono beginStartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginStartWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginStartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Starts a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 beginStartWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginStartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginRedeployWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginRedeployWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono> beginRedeployWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return service - .beginRedeployWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginRedeployWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono beginRedeployWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginRedeployWithoutPolling(String resourceGroupName, String vmScaleSetName, String instanceId) { - beginRedeployWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 beginRedeployWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginRedeployWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginPerformMaintenanceWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginPerformMaintenanceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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-12-01"; - return service - .beginPerformMaintenanceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginPerformMaintenanceWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId) { - return beginPerformMaintenanceWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 Mono beginPerformMaintenanceWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - return beginPerformMaintenanceWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginPerformMaintenanceWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId) { - beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId).block(); - } - - /** - * Performs maintenance on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @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 beginPerformMaintenanceWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, Context context) { - beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, context).block(); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Mono> beginRunCommandWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginRunCommandWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @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 Mono> beginRunCommandWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - RunCommandInput parameters, - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginRunCommandWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - instanceId, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Mono beginRunCommandWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - return beginRunCommandWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceId, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @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 Mono beginRunCommandWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - RunCommandInput parameters, - Context context) { - return beginRunCommandWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceId, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 RunCommandResultInner beginRunCommandWithoutPolling( - String resourceGroupName, String vmScaleSetName, String instanceId, RunCommandInput parameters) { - return beginRunCommandWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, parameters).block(); - } - - /** - * Run command on a virtual machine in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceId The instance ID of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @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 RunCommandResultInner beginRunCommandWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - String instanceId, - RunCommandInput parameters, - Context context) { - return beginRunCommandWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceId, parameters, context) - .block(); - } - /** * Get the next page of items. * @@ -6409,6 +4178,7 @@ public Mono> listNextSinglePageAsyn if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetsClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetsClient.java index b07582bf262a..bf1687c26e29 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetsClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetsClient.java @@ -43,7 +43,6 @@ import com.azure.resourcemanager.compute.fluent.inner.VirtualMachineScaleSetListSkusResultInner; import com.azure.resourcemanager.compute.fluent.inner.VirtualMachineScaleSetListWithLinkResultInner; import com.azure.resourcemanager.compute.fluent.inner.VirtualMachineScaleSetSkuInner; -import com.azure.resourcemanager.compute.models.OrchestrationServiceStateAction; import com.azure.resourcemanager.compute.models.OrchestrationServiceStateInput; import com.azure.resourcemanager.compute.models.VMScaleSetConvertToSinglePlacementGroupInput; import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetReimageParameters; @@ -409,216 +408,6 @@ Mono>> setOrchestrationServiceState( @BodyParam("application/json") OrchestrationServiceStateInput parameters, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetInner parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetUpdate parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/deallocate") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeallocateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/delete") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteInstancesWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/poweroff") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPowerOffWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("skipShutdown") Boolean skipShutdown, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRestartWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStartWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/redeploy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRedeployWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPerformMaintenanceWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateInstancesWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/reimage") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimageWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/reimageall") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimageAllWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachineScaleSets/{vmScaleSetName}/setOrchestrationServiceState") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginSetOrchestrationServiceStateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmScaleSetName") String vmScaleSetName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") OrchestrationServiceStateInput parameters, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -742,6 +531,7 @@ public Mono>> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -855,7 +645,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -875,7 +665,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1007,6 +797,7 @@ public Mono>> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1119,7 +910,7 @@ public Mono updateAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1139,7 +930,7 @@ public Mono updateAsync( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { return beginUpdateAsync(resourceGroupName, vmScaleSetName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1257,6 +1048,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1345,7 +1137,9 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String vmScaleSetName) { - return beginDeleteAsync(resourceGroupName, vmScaleSetName).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, vmScaleSetName) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1363,7 +1157,7 @@ public Mono deleteAsync(String resourceGroupName, String vmScaleSetName) { public Mono deleteAsync(String resourceGroupName, String vmScaleSetName, Context context) { return beginDeleteAsync(resourceGroupName, vmScaleSetName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1476,6 +1270,7 @@ public Mono> getByResourceGroupWithRespons "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -1666,6 +1461,7 @@ public Mono>> deallocateWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .deallocate( this.client.getEndpoint(), @@ -1776,7 +1572,7 @@ public SyncPoller, Void> beginDeallocate( public Mono deallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1798,7 +1594,7 @@ public Mono deallocateAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1930,6 +1726,7 @@ public Mono>> deleteInstancesWithResponseAsync( final String apiVersion = "2019-12-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); vmInstanceIDs.withInstanceIds(instanceIds); + context = this.client.mergeContext(context); return service .deleteInstances( this.client.getEndpoint(), @@ -2030,7 +1827,7 @@ public SyncPoller, Void> beginDeleteInstances( public Mono deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2050,7 +1847,7 @@ public Mono deleteInstancesAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2166,6 +1963,7 @@ public Mono> getInstanceViewWi "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getInstanceView( this.client.getEndpoint(), @@ -2338,6 +2136,7 @@ public Mono> listByResourceGroupSingl "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -2479,6 +2278,7 @@ public Mono> listSinglePageAsync(Cont "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), context) .map( @@ -2646,6 +2446,7 @@ public Mono> listSkusSinglePageAsy "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listSkus( this.client.getEndpoint(), @@ -2831,6 +2632,7 @@ public Mono> getOSUpgra "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getOSUpgradeHistory( this.client.getEndpoint(), @@ -3031,6 +2833,7 @@ public Mono>> powerOffWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .powerOff( this.client.getEndpoint(), @@ -3167,7 +2970,7 @@ public Mono powerOffAsync( String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3196,7 +2999,7 @@ public Mono powerOffAsync( Context context) { return beginPowerOffAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3344,6 +3147,7 @@ public Mono>> restartWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .restart( this.client.getEndpoint(), @@ -3449,7 +3253,7 @@ public SyncPoller, Void> beginRestart( public Mono restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3470,7 +3274,7 @@ public Mono restartAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3604,6 +3408,7 @@ public Mono>> startWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .start( this.client.getEndpoint(), @@ -3708,7 +3513,7 @@ public SyncPoller, Void> beginStart( public Mono startAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginStartAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3729,7 +3534,7 @@ public Mono startAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginStartAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3865,6 +3670,7 @@ public Mono>> redeployWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .redeploy( this.client.getEndpoint(), @@ -3975,7 +3781,7 @@ public SyncPoller, Void> beginRedeploy( public Mono redeployAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3997,7 +3803,7 @@ public Mono redeployAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginRedeployAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4137,6 +3943,7 @@ public Mono>> performMaintenanceWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .performMaintenance( this.client.getEndpoint(), @@ -4253,7 +4060,7 @@ public Mono performMaintenanceAsync( String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4276,7 +4083,7 @@ public Mono performMaintenanceAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginPerformMaintenanceAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4411,6 +4218,7 @@ public Mono>> updateInstancesWithResponseAsync( final String apiVersion = "2019-12-01"; VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); vmInstanceIDs.withInstanceIds(instanceIds); + context = this.client.mergeContext(context); return service .updateInstances( this.client.getEndpoint(), @@ -4511,7 +4319,7 @@ public SyncPoller, Void> beginUpdateInstances( public Mono updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4531,7 +4339,7 @@ public Mono updateInstancesAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4665,6 +4473,7 @@ public Mono>> reimageWithResponseAsync( vmScaleSetReimageInput.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .reimage( this.client.getEndpoint(), @@ -4788,7 +4597,7 @@ public Mono reimageAsync( VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4813,7 +4622,7 @@ public Mono reimageAsync( Context context) { return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4834,7 +4643,7 @@ public Mono reimageAsync(String resourceGroupName, String vmScaleSetName) final Context context = null; return beginReimageAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4997,6 +4806,7 @@ public Mono>> reimageAllWithResponseAsync( vmInstanceIDsInternal.withInstanceIds(instanceIds); } VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; + context = this.client.mergeContext(context); return service .reimageAll( this.client.getEndpoint(), @@ -5107,7 +4917,7 @@ public SyncPoller, Void> beginReimageAll( public Mono reimageAllAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceIds) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5129,7 +4939,7 @@ public Mono reimageAllAsync( String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { return beginReimageAllAsync(resourceGroupName, vmScaleSetName, instanceIds, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5253,6 +5063,7 @@ public void reimageAll(String resourceGroupName, String vmScaleSetName, List> convertToSinglePlacementGroupWithResponseAsync( final String apiVersion = "2019-12-01"; VMScaleSetConvertToSinglePlacementGroupInput parameters = new VMScaleSetConvertToSinglePlacementGroupInput(); parameters.withActivePlacementGroupId(activePlacementGroupId); + context = this.client.mergeContext(context); return service .convertToSinglePlacementGroup( this.client.getEndpoint(), @@ -5543,7 +5355,7 @@ public void convertToSinglePlacementGroup( * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -5551,7 +5363,7 @@ public void convertToSinglePlacementGroup( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> setOrchestrationServiceStateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -5571,12 +5383,12 @@ public Mono>> setOrchestrationServiceStateWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (action == null) { - return Mono.error(new IllegalArgumentException("Parameter action 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-12-01"; - OrchestrationServiceStateInput parameters = new OrchestrationServiceStateInput(); - parameters.withAction(action); return FluxUtil .withContext( context -> @@ -5597,7 +5409,7 @@ public Mono>> setOrchestrationServiceStateWithResponse * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @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. @@ -5606,7 +5418,7 @@ public Mono>> setOrchestrationServiceStateWithResponse */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> setOrchestrationServiceStateWithResponseAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -5626,12 +5438,13 @@ public Mono>> setOrchestrationServiceStateWithResponse new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (action == null) { - return Mono.error(new IllegalArgumentException("Parameter action 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-12-01"; - OrchestrationServiceStateInput parameters = new OrchestrationServiceStateInput(); - parameters.withAction(action); + context = this.client.mergeContext(context); return service .setOrchestrationServiceState( this.client.getEndpoint(), @@ -5648,7 +5461,7 @@ public Mono>> setOrchestrationServiceStateWithResponse * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -5656,9 +5469,9 @@ public Mono>> setOrchestrationServiceStateWithResponse */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, Void> beginSetOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { Mono>> mono = - setOrchestrationServiceStateWithResponseAsync(resourceGroupName, vmScaleSetName, action); + setOrchestrationServiceStateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } @@ -5667,7 +5480,7 @@ public PollerFlux, Void> beginSetOrchestrationServiceStateAsync * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @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. @@ -5676,9 +5489,9 @@ public PollerFlux, Void> beginSetOrchestrationServiceStateAsync */ @ServiceMethod(returns = ReturnType.SINGLE) public PollerFlux, Void> beginSetOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { Mono>> mono = - setOrchestrationServiceStateWithResponseAsync(resourceGroupName, vmScaleSetName, action, context); + setOrchestrationServiceStateWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context); return this.client.getLroResultAsync(mono, this.client.getHttpPipeline(), Void.class, Void.class); } @@ -5687,7 +5500,7 @@ public PollerFlux, Void> beginSetOrchestrationServiceStateAsync * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -5695,8 +5508,8 @@ public PollerFlux, Void> beginSetOrchestrationServiceStateAsync */ @ServiceMethod(returns = ReturnType.SINGLE) public SyncPoller, Void> beginSetOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { - return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, action).getSyncPoller(); + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters).getSyncPoller(); } /** @@ -5704,7 +5517,7 @@ public SyncPoller, Void> beginSetOrchestrationServiceState( * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @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. @@ -5713,8 +5526,8 @@ public SyncPoller, Void> beginSetOrchestrationServiceState( */ @ServiceMethod(returns = ReturnType.SINGLE) public SyncPoller, Void> beginSetOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { - return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, action, context) + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters, context) .getSyncPoller(); } @@ -5723,7 +5536,7 @@ public SyncPoller, Void> beginSetOrchestrationServiceState( * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -5731,10 +5544,10 @@ public SyncPoller, Void> beginSetOrchestrationServiceState( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { - return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, action) + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5742,7 +5555,7 @@ public Mono setOrchestrationServiceStateAsync( * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @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. @@ -5751,10 +5564,10 @@ public Mono setOrchestrationServiceStateAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono setOrchestrationServiceStateAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { - return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, action, context) + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + return beginSetOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5762,15 +5575,15 @@ public Mono setOrchestrationServiceStateAsync( * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 setOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { - setOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, action).block(); + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters) { + setOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters).block(); } /** @@ -5778,7 +5591,7 @@ public void setOrchestrationServiceState( * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. + * @param parameters The input for OrchestrationServiceState. * @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. @@ -5786,2660 +5599,8 @@ public void setOrchestrationServiceState( */ @ServiceMethod(returns = ReturnType.SINGLE) public void setOrchestrationServiceState( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { - setOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, action, context).block(); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @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 a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @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 a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, parameters).block(); - } - - /** - * Create or update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @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 a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @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 a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @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 a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner beginUpdateWithoutPolling( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, parameters).block(); - } - - /** - * Update a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set to create or update. - * @param parameters Describes a Virtual Machine Scale Set. - * @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 a Virtual Machine Scale Set. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineScaleSetInner beginUpdateWithoutPolling( - String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetUpdate parameters, Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @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 Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginDeleteWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @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 Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String vmScaleSetName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String vmScaleSetName) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName).block(); - } - - /** - * Deletes a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String vmScaleSetName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmScaleSetName, context).block(); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginDeallocateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginDeallocateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono> beginDeallocateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginDeallocateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginDeallocateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono beginDeallocateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginDeallocateWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginDeallocateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute - * resources. You are not billed for the compute resources that this virtual machine scale set deallocates. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 beginDeallocateWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginDeallocateWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginDeleteInstancesWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (instanceIds == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); - vmInstanceIDs.withInstanceIds(instanceIds); - return FluxUtil - .withContext( - context -> - service - .beginDeleteInstancesWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @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 Mono> beginDeleteInstancesWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (instanceIds == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); - vmInstanceIDs.withInstanceIds(instanceIds); - return service - .beginDeleteInstancesWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginDeleteInstancesWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginDeleteInstancesWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @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 Mono beginDeleteInstancesWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginDeleteInstancesWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginDeleteInstancesWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginDeleteInstancesWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Deletes virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @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 beginDeleteInstancesWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginDeleteInstancesWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginPowerOffWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginPowerOffWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono> beginPowerOffWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - List instanceIds, - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginPowerOffWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginPowerOffWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { - return beginPowerOffWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, skipShutdown, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono beginPowerOffWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - List instanceIds, - Context context) { - return beginPowerOffWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginPowerOffWithoutPolling( - String resourceGroupName, String vmScaleSetName, Boolean skipShutdown, List instanceIds) { - beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds).block(); - } - - /** - * Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and you - * are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 beginPowerOffWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - Boolean skipShutdown, - List instanceIds, - Context context) { - beginPowerOffWithoutPollingAsync(resourceGroupName, vmScaleSetName, skipShutdown, instanceIds, context).block(); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginRestartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginRestartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono> beginRestartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginRestartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginRestartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono beginRestartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginRestartWithoutPolling(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginRestartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Restarts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 beginRestartWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginRestartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginStartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginStartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono> beginStartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginStartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginStartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono beginStartWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginStartWithoutPolling(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginStartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Starts one or more virtual machines in a VM scale set. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 beginStartWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginStartWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginRedeployWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginRedeployWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono> beginRedeployWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginRedeployWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginRedeployWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono beginRedeployWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginRedeployWithoutPolling(String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginRedeployWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them - * back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 beginRedeployWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginRedeployWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginPerformMaintenanceWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginPerformMaintenanceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginPerformMaintenanceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginPerformMaintenanceWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginPerformMaintenanceWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono beginPerformMaintenanceWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginPerformMaintenanceWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginPerformMaintenanceWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not - * eligible for perform maintenance will be failed. Please refer to best practices for more details: - * https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 beginPerformMaintenanceWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginUpdateInstancesWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (instanceIds == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); - vmInstanceIDs.withInstanceIds(instanceIds); - return FluxUtil - .withContext( - context -> - service - .beginUpdateInstancesWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @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 Mono> beginUpdateInstancesWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (instanceIds == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceIds is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - VirtualMachineScaleSetVMInstanceRequiredIDs vmInstanceIDs = new VirtualMachineScaleSetVMInstanceRequiredIDs(); - vmInstanceIDs.withInstanceIds(instanceIds); - return service - .beginUpdateInstancesWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginUpdateInstancesWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginUpdateInstancesWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @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 Mono beginUpdateInstancesWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginUpdateInstancesWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginUpdateInstancesWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginUpdateInstancesWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. - * @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 beginUpdateInstancesWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginUpdateInstancesWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginReimageWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmScaleSetReimageInput != null) { - vmScaleSetReimageInput.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginReimageWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmScaleSetReimageInput, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. - * @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 Mono> beginReimageWithoutPollingWithResponseAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (vmScaleSetReimageInput != null) { - vmScaleSetReimageInput.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginReimageWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmScaleSetReimageInput, - context); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginReimageWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. - * @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 Mono beginReimageWithoutPollingAsync( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context) { - return beginReimageWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginReimageWithoutPollingAsync(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; - final Context context = null; - return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginReimageWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput) { - beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param vmScaleSetReimageInput Describes a Virtual Machine Scale Set VM Reimage Parameters. - * @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 beginReimageWithoutPolling( - String resourceGroupName, - String vmScaleSetName, - VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput, - Context context) { - beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput, context).block(); - } - - /** - * Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a - * ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial - * state. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginReimageWithoutPolling(String resourceGroupName, String vmScaleSetName) { - final VirtualMachineScaleSetReimageParameters vmScaleSetReimageInput = null; - final Context context = null; - beginReimageWithoutPollingAsync(resourceGroupName, vmScaleSetName, vmScaleSetReimageInput).block(); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginReimageAllWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return FluxUtil - .withContext( - context -> - service - .beginReimageAllWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono> beginReimageAllWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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-12-01"; - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDsInternal = null; - if (instanceIds != null) { - vmInstanceIDsInternal = new VirtualMachineScaleSetVMInstanceIDs(); - vmInstanceIDsInternal.withInstanceIds(instanceIds); - } - VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs = vmInstanceIDsInternal; - return service - .beginReimageAllWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - vmInstanceIDs, - context); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginReimageAllWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - return beginReimageAllWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 Mono beginReimageAllWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - return beginReimageAllWithoutPollingWithResponseAsync(resourceGroupName, vmScaleSetName, instanceIds, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginReimageAllWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds) { - beginReimageAllWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds).block(); - } - - /** - * Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only - * supported for managed disks. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the VM scale set. - * @param instanceIds The virtual machine scale set instance ids. Omitting the virtual machine scale set instance - * ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - * @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 beginReimageAllWithoutPolling( - String resourceGroupName, String vmScaleSetName, List instanceIds, Context context) { - beginReimageAllWithoutPollingAsync(resourceGroupName, vmScaleSetName, instanceIds, context).block(); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginSetOrchestrationServiceStateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { - 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (action == null) { - return Mono.error(new IllegalArgumentException("Parameter action is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - OrchestrationServiceStateInput parameters = new OrchestrationServiceStateInput(); - parameters.withAction(action); - return FluxUtil - .withContext( - context -> - service - .beginSetOrchestrationServiceStateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. - * @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 Mono> beginSetOrchestrationServiceStateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, 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 (vmScaleSetName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmScaleSetName 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 (action == null) { - return Mono.error(new IllegalArgumentException("Parameter action is required and cannot be null.")); - } - final String apiVersion = "2019-12-01"; - OrchestrationServiceStateInput parameters = new OrchestrationServiceStateInput(); - parameters.withAction(action); - return service - .beginSetOrchestrationServiceStateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmScaleSetName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginSetOrchestrationServiceStateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { - return beginSetOrchestrationServiceStateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, action) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. - * @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 Mono beginSetOrchestrationServiceStateWithoutPollingAsync( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { - return beginSetOrchestrationServiceStateWithoutPollingWithResponseAsync( - resourceGroupName, vmScaleSetName, action, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginSetOrchestrationServiceStateWithoutPolling( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action) { - beginSetOrchestrationServiceStateWithoutPollingAsync(resourceGroupName, vmScaleSetName, action).block(); - } - - /** - * Changes ServiceState property for a given service. - * - * @param resourceGroupName The name of the resource group. - * @param vmScaleSetName The name of the virtual machine scale set to create or update. - * @param action The action to be performed. - * @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 beginSetOrchestrationServiceStateWithoutPolling( - String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateAction action, Context context) { - beginSetOrchestrationServiceStateWithoutPollingAsync(resourceGroupName, vmScaleSetName, action, context) - .block(); + String resourceGroupName, String vmScaleSetName, OrchestrationServiceStateInput parameters, Context context) { + setOrchestrationServiceStateAsync(resourceGroupName, vmScaleSetName, parameters, context).block(); } /** @@ -8485,6 +5646,7 @@ public Mono> listNextSinglePageAsync( if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -8542,6 +5704,7 @@ public Mono> listAllNextSinglePageAsy if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAllNext(nextLink, context) .map( @@ -8599,6 +5762,7 @@ public Mono> listSkusNextSinglePag if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listSkusNext(nextLink, context) .map( @@ -8657,6 +5821,7 @@ public Mono> getOSUpgra if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .getOSUpgradeHistoryNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineSizesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineSizesClient.java index 22de99921877..97e76a35af88 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineSizesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineSizesClient.java @@ -140,6 +140,7 @@ public Mono> listSinglePageAsync(String l "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java index 1f12644b7d6f..0ae685fea879 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachinesClient.java @@ -393,208 +393,6 @@ Mono>> runCommand( @BodyParam("application/json") RunCommandInput parameters, Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/capture") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCaptureWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineCaptureParameters parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginCreateOrUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineInner parameters, - Context context); - - @Headers({"Accept: application/json", "Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginUpdateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineUpdateInner parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeleteWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/convertToManagedDisks") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginConvertToManagedDisksWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/deallocate") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginDeallocateWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/powerOff") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPowerOffWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("skipShutdown") Boolean skipShutdown, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/reapply") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ApiErrorException.class) - Mono> beginReapplyWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/restart") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRestartWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/start") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginStartWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/redeploy") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRedeployWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/reimage") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginReimageWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") VirtualMachineReimageParameters parameters, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/performMaintenance") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginPerformMaintenanceWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - Context context); - - @Headers({"Accept: application/json,text/json", "Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute" - + "/virtualMachines/{vmName}/runCommand") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> beginRunCommandWithoutPolling( - @HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("vmName") String vmName, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") RunCommandInput parameters, - Context context); - @Headers({"Accept: application/json", "Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -690,6 +488,7 @@ public Mono> listByLocationSinglePageAsync(St "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByLocation(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), context) .map( @@ -860,6 +659,7 @@ public Mono>> captureWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .capture( this.client.getEndpoint(), @@ -977,7 +777,7 @@ public Mono captureAsync( String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { return beginCaptureAsync(resourceGroupName, vmName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -998,7 +798,7 @@ public Mono captureAsync( String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { return beginCaptureAsync(resourceGroupName, vmName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1134,6 +934,7 @@ public Mono>> createOrUpdateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .createOrUpdate( this.client.getEndpoint(), @@ -1245,7 +1046,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String vmName, VirtualMachineInner parameters) { return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1266,7 +1067,7 @@ public Mono createOrUpdateAsync( String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1399,6 +1200,7 @@ public Mono>> updateWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), @@ -1504,7 +1306,7 @@ public Mono updateAsync( String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { return beginUpdateAsync(resourceGroupName, vmName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1524,7 +1326,7 @@ public Mono updateAsync( String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { return beginUpdateAsync(resourceGroupName, vmName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1641,6 +1443,7 @@ public Mono>> deleteWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), @@ -1728,7 +1531,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String vmName) { - return beginDeleteAsync(resourceGroupName, vmName).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -1744,7 +1547,9 @@ public Mono deleteAsync(String resourceGroupName, String vmName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String resourceGroupName, String vmName, Context context) { - return beginDeleteAsync(resourceGroupName, vmName, context).last().flatMap(client::getLroFinalResultOrError); + return beginDeleteAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1860,6 +1665,7 @@ public Mono> getByResourceGroupWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), @@ -2079,6 +1885,7 @@ public Mono> instanceViewWithResponseA "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .instanceView( this.client.getEndpoint(), @@ -2251,6 +2058,7 @@ public Mono>> convertToManagedDisksWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .convertToManagedDisks( this.client.getEndpoint(), @@ -2347,7 +2155,7 @@ public SyncPoller, Void> beginConvertToManagedDisks( public Mono convertToManagedDisksAsync(String resourceGroupName, String vmName) { return beginConvertToManagedDisksAsync(resourceGroupName, vmName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2366,7 +2174,7 @@ public Mono convertToManagedDisksAsync(String resourceGroupName, String vm public Mono convertToManagedDisksAsync(String resourceGroupName, String vmName, Context context) { return beginConvertToManagedDisksAsync(resourceGroupName, vmName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2482,6 +2290,7 @@ public Mono>> deallocateWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .deallocate( this.client.getEndpoint(), @@ -2575,7 +2384,7 @@ public SyncPoller, Void> beginDeallocate( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deallocateAsync(String resourceGroupName, String vmName) { - return beginDeallocateAsync(resourceGroupName, vmName).last().flatMap(client::getLroFinalResultOrError); + return beginDeallocateAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -2594,7 +2403,7 @@ public Mono deallocateAsync(String resourceGroupName, String vmName) { public Mono deallocateAsync(String resourceGroupName, String vmName, Context context) { return beginDeallocateAsync(resourceGroupName, vmName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -2715,6 +2524,7 @@ public Mono> generalizeWithResponseAsync(String resourceGroupName "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .generalize( this.client.getEndpoint(), @@ -2884,6 +2694,7 @@ public Mono> listByResourceGroupSinglePageAsy "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listByResourceGroup( this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), context) @@ -3036,6 +2847,7 @@ public Mono> listSinglePageAsync(String statu "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), statusOnly, context) .map( @@ -3227,6 +3039,7 @@ public Mono> listAvailableSizesSinglePage "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .listAvailableSizes( this.client.getEndpoint(), @@ -3395,6 +3208,7 @@ public Mono>> powerOffWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .powerOff( this.client.getEndpoint(), @@ -3509,7 +3323,7 @@ public SyncPoller, Void> beginPowerOff( public Mono powerOffAsync(String resourceGroupName, String vmName, Boolean skipShutdown) { return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3531,7 +3345,7 @@ public Mono powerOffAsync(String resourceGroupName, String vmName, Boolean public Mono powerOffAsync(String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3551,7 +3365,7 @@ public Mono powerOffAsync(String resourceGroupName, String vmName) { final Context context = null; return beginPowerOffAsync(resourceGroupName, vmName, skipShutdown) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3688,6 +3502,7 @@ public Mono>> reapplyWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .reapply( this.client.getEndpoint(), @@ -3775,7 +3590,7 @@ public SyncPoller, Void> beginReapply(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono reapplyAsync(String resourceGroupName, String vmName) { - return beginReapplyAsync(resourceGroupName, vmName).last().flatMap(client::getLroFinalResultOrError); + return beginReapplyAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -3791,7 +3606,9 @@ public Mono reapplyAsync(String resourceGroupName, String vmName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono reapplyAsync(String resourceGroupName, String vmName, Context context) { - return beginReapplyAsync(resourceGroupName, vmName, context).last().flatMap(client::getLroFinalResultOrError); + return beginReapplyAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -3903,6 +3720,7 @@ public Mono>> restartWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .restart( this.client.getEndpoint(), @@ -3990,7 +3808,7 @@ public SyncPoller, Void> beginRestart(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono restartAsync(String resourceGroupName, String vmName) { - return beginRestartAsync(resourceGroupName, vmName).last().flatMap(client::getLroFinalResultOrError); + return beginRestartAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -4006,7 +3824,9 @@ public Mono restartAsync(String resourceGroupName, String vmName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono restartAsync(String resourceGroupName, String vmName, Context context) { - return beginRestartAsync(resourceGroupName, vmName, context).last().flatMap(client::getLroFinalResultOrError); + return beginRestartAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4118,6 +3938,7 @@ public Mono>> startWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .start( this.client.getEndpoint(), @@ -4205,7 +4026,7 @@ public SyncPoller, Void> beginStart(String resourceGroupName, S */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono startAsync(String resourceGroupName, String vmName) { - return beginStartAsync(resourceGroupName, vmName).last().flatMap(client::getLroFinalResultOrError); + return beginStartAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -4221,7 +4042,9 @@ public Mono startAsync(String resourceGroupName, String vmName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono startAsync(String resourceGroupName, String vmName, Context context) { - return beginStartAsync(resourceGroupName, vmName, context).last().flatMap(client::getLroFinalResultOrError); + return beginStartAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4333,6 +4156,7 @@ public Mono>> redeployWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .redeploy( this.client.getEndpoint(), @@ -4420,7 +4244,7 @@ public SyncPoller, Void> beginRedeploy(String resourceGroupName */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono redeployAsync(String resourceGroupName, String vmName) { - return beginRedeployAsync(resourceGroupName, vmName).last().flatMap(client::getLroFinalResultOrError); + return beginRedeployAsync(resourceGroupName, vmName).last().flatMap(this.client::getLroFinalResultOrError); } /** @@ -4436,7 +4260,9 @@ public Mono redeployAsync(String resourceGroupName, String vmName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono redeployAsync(String resourceGroupName, String vmName, Context context) { - return beginRedeployAsync(resourceGroupName, vmName, context).last().flatMap(client::getLroFinalResultOrError); + return beginRedeployAsync(resourceGroupName, vmName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4566,6 +4392,7 @@ public Mono>> reimageWithResponseAsync( parametersInternal.withTempDisk(tempDisk); } VirtualMachineReimageParameters parameters = parametersInternal; + context = this.client.mergeContext(context); return service .reimage( this.client.getEndpoint(), @@ -4666,7 +4493,9 @@ public SyncPoller, Void> beginReimage( */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono reimageAsync(String resourceGroupName, String vmName, Boolean tempDisk) { - return beginReimageAsync(resourceGroupName, vmName, tempDisk).last().flatMap(client::getLroFinalResultOrError); + return beginReimageAsync(resourceGroupName, vmName, tempDisk) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4686,7 +4515,7 @@ public Mono reimageAsync(String resourceGroupName, String vmName, Boolean public Mono reimageAsync(String resourceGroupName, String vmName, Boolean tempDisk, Context context) { return beginReimageAsync(resourceGroupName, vmName, tempDisk, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4803,6 +4632,7 @@ public Mono>> performMaintenanceWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .performMaintenance( this.client.getEndpoint(), @@ -4893,7 +4723,7 @@ public SyncPoller, Void> beginPerformMaintenance( public Mono performMaintenanceAsync(String resourceGroupName, String vmName) { return beginPerformMaintenanceAsync(resourceGroupName, vmName) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -4911,7 +4741,7 @@ public Mono performMaintenanceAsync(String resourceGroupName, String vmNam public Mono performMaintenanceAsync(String resourceGroupName, String vmName, Context context) { return beginPerformMaintenanceAsync(resourceGroupName, vmName, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5025,6 +4855,7 @@ public Mono> simulateEvictionWithResponseAsync( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .simulateEviction( this.client.getEndpoint(), @@ -5195,6 +5026,7 @@ public Mono>> runCommandWithResponseAsync( parameters.validate(); } final String apiVersion = "2019-12-01"; + context = this.client.mergeContext(context); return service .runCommand( this.client.getEndpoint(), @@ -5301,7 +5133,7 @@ public Mono runCommandAsync( String resourceGroupName, String vmName, RunCommandInput parameters) { return beginRunCommandAsync(resourceGroupName, vmName, parameters) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5321,7 +5153,7 @@ public Mono runCommandAsync( String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { return beginRunCommandAsync(resourceGroupName, vmName, parameters, context) .last() - .flatMap(client::getLroFinalResultOrError); + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -5358,2412 +5190,6 @@ public RunCommandResultInner runCommand( return runCommandAsync(resourceGroupName, vmName, parameters, context).block(); } - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCaptureWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCaptureWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @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 output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCaptureWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCaptureWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCaptureWithoutPollingAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - return beginCaptureWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @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 output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCaptureWithoutPollingAsync( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { - return beginCaptureWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineCaptureResultInner beginCaptureWithoutPolling( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { - return beginCaptureWithoutPollingAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar - * VMs. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @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 output of virtual machine capture operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineCaptureResultInner beginCaptureWithoutPolling( - String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters, Context context) { - return beginCaptureWithoutPollingAsync(resourceGroupName, vmName, parameters, context).block(); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine. - * @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 a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginCreateOrUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginCreateOrUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine. - * @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 a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginCreateOrUpdateWithoutPollingAsync( - String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String vmName, VirtualMachineInner parameters) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * The operation to create or update a virtual machine. Please note some properties can be set only during virtual - * machine creation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine. - * @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 a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner beginCreateOrUpdateWithoutPolling( - String resourceGroupName, String vmName, VirtualMachineInner parameters, Context context) { - return beginCreateOrUpdateWithoutPollingAsync(resourceGroupName, vmName, parameters, context).block(); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine 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. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> beginUpdateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginUpdateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine 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. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono beginUpdateWithoutPollingAsync( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { - return beginUpdateWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine 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. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner beginUpdateWithoutPolling( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * The operation to update a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Describes a Virtual Machine 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes a Virtual Machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public VirtualMachineInner beginUpdateWithoutPolling( - String resourceGroupName, String vmName, VirtualMachineUpdateInner parameters, Context context) { - return beginUpdateWithoutPollingAsync(resourceGroupName, vmName, parameters, context).block(); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginDeleteWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono> beginDeleteWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return service - .beginDeleteWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginDeleteWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono beginDeleteWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { - return beginDeleteWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String vmName) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to delete a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 beginDeleteWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginDeleteWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginConvertToManagedDisksWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginConvertToManagedDisksWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono> beginConvertToManagedDisksWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return service - .beginConvertToManagedDisksWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginConvertToManagedDisksWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginConvertToManagedDisksWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono beginConvertToManagedDisksWithoutPollingAsync( - String resourceGroupName, String vmName, Context context) { - return beginConvertToManagedDisksWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginConvertToManagedDisksWithoutPolling(String resourceGroupName, String vmName) { - beginConvertToManagedDisksWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before - * invoking this operation. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 beginConvertToManagedDisksWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginConvertToManagedDisksWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginDeallocateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginDeallocateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono> beginDeallocateWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return service - .beginDeallocateWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginDeallocateWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono beginDeallocateWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { - return beginDeallocateWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginDeallocateWithoutPolling(String resourceGroupName, String vmName) { - beginDeallocateWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources - * that this virtual machine uses. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 beginDeallocateWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginDeallocateWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginPowerOffWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Boolean skipShutdown) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginPowerOffWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @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 Mono> beginPowerOffWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Boolean skipShutdown, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return service - .beginPowerOffWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - skipShutdown, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginPowerOffWithoutPollingAsync(String resourceGroupName, String vmName, Boolean skipShutdown) { - return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmName, skipShutdown) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @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 Mono beginPowerOffWithoutPollingAsync( - String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { - return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmName, skipShutdown, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginPowerOffWithoutPollingAsync(String resourceGroupName, String vmName) { - final Boolean skipShutdown = null; - final Context context = null; - return beginPowerOffWithoutPollingWithResponseAsync(resourceGroupName, vmName, skipShutdown) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginPowerOffWithoutPolling(String resourceGroupName, String vmName, Boolean skipShutdown) { - beginPowerOffWithoutPollingAsync(resourceGroupName, vmName, skipShutdown).block(); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates - * non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not - * specified. - * @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 beginPowerOffWithoutPolling( - String resourceGroupName, String vmName, Boolean skipShutdown, Context context) { - beginPowerOffWithoutPollingAsync(resourceGroupName, vmName, skipShutdown, context).block(); - } - - /** - * The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same - * provisioned resources. You are still charged for this virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginPowerOffWithoutPolling(String resourceGroupName, String vmName) { - final Boolean skipShutdown = null; - final Context context = null; - beginPowerOffWithoutPollingAsync(resourceGroupName, vmName, skipShutdown).block(); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginReapplyWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginReapplyWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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> beginReapplyWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return service - .beginReapplyWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginReapplyWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginReapplyWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginReapplyWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { - return beginReapplyWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginReapplyWithoutPolling(String resourceGroupName, String vmName) { - beginReapplyWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to reapply a virtual machine's state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ApiErrorException 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 beginReapplyWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginReapplyWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginRestartWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginRestartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono> beginRestartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return service - .beginRestartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginRestartWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono beginRestartWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { - return beginRestartWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginRestartWithoutPolling(String resourceGroupName, String vmName) { - beginRestartWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to restart a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 beginRestartWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginRestartWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginStartWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginStartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono> beginStartWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return service - .beginStartWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginStartWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono beginStartWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { - return beginStartWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginStartWithoutPolling(String resourceGroupName, String vmName) { - beginStartWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to start a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 beginStartWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginStartWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginRedeployWithoutPollingWithResponseAsync(String resourceGroupName, String vmName) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginRedeployWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono> beginRedeployWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return service - .beginRedeployWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginRedeployWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono beginRedeployWithoutPollingAsync(String resourceGroupName, String vmName, Context context) { - return beginRedeployWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginRedeployWithoutPolling(String resourceGroupName, String vmName) { - beginRedeployWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * Shuts down the virtual machine, moves it to a new node, and powers it back on. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 beginRedeployWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginRedeployWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginReimageWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Boolean tempDisk) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - VirtualMachineReimageParameters parametersInternal = null; - if (tempDisk != null) { - parametersInternal = new VirtualMachineReimageParameters(); - parametersInternal.withTempDisk(tempDisk); - } - VirtualMachineReimageParameters parameters = parametersInternal; - return FluxUtil - .withContext( - context -> - service - .beginReimageWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @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 Mono> beginReimageWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, Boolean tempDisk, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - VirtualMachineReimageParameters parametersInternal = null; - if (tempDisk != null) { - parametersInternal = new VirtualMachineReimageParameters(); - parametersInternal.withTempDisk(tempDisk); - } - VirtualMachineReimageParameters parameters = parametersInternal; - return service - .beginReimageWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginReimageWithoutPollingAsync(String resourceGroupName, String vmName, Boolean tempDisk) { - return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmName, tempDisk) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @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 Mono beginReimageWithoutPollingAsync( - String resourceGroupName, String vmName, Boolean tempDisk, Context context) { - return beginReimageWithoutPollingWithResponseAsync(resourceGroupName, vmName, tempDisk, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginReimageWithoutPolling(String resourceGroupName, String vmName, Boolean tempDisk) { - beginReimageWithoutPollingAsync(resourceGroupName, vmName, tempDisk).block(); - } - - /** - * Reimages the virtual machine which has an ephemeral OS disk back to its initial state. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param tempDisk Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage - * parameter is only supported for VM/VMSS with Ephemeral OS disk. - * @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 beginReimageWithoutPolling(String resourceGroupName, String vmName, Boolean tempDisk, Context context) { - beginReimageWithoutPollingAsync(resourceGroupName, vmName, tempDisk, context).block(); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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> beginPerformMaintenanceWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginPerformMaintenanceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono> beginPerformMaintenanceWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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-12-01"; - return service - .beginPerformMaintenanceWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - context); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 beginPerformMaintenanceWithoutPollingAsync(String resourceGroupName, String vmName) { - return beginPerformMaintenanceWithoutPollingWithResponseAsync(resourceGroupName, vmName) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 Mono beginPerformMaintenanceWithoutPollingAsync( - String resourceGroupName, String vmName, Context context) { - return beginPerformMaintenanceWithoutPollingWithResponseAsync(resourceGroupName, vmName, context) - .flatMap((Response res) -> Mono.empty()); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 beginPerformMaintenanceWithoutPolling(String resourceGroupName, String vmName) { - beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmName).block(); - } - - /** - * The operation to perform maintenance on a virtual machine. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @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 beginPerformMaintenanceWithoutPolling(String resourceGroupName, String vmName, Context context) { - beginPerformMaintenanceWithoutPollingAsync(resourceGroupName, vmName, context).block(); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Mono> beginRunCommandWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, RunCommandInput parameters) { - 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return FluxUtil - .withContext( - context -> - service - .beginRunCommandWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @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 Mono> beginRunCommandWithoutPollingWithResponseAsync( - String resourceGroupName, String vmName, RunCommandInput parameters, 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 (vmName == null) { - return Mono.error(new IllegalArgumentException("Parameter vmName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2019-12-01"; - return service - .beginRunCommandWithoutPolling( - this.client.getEndpoint(), - resourceGroupName, - vmName, - apiVersion, - this.client.getSubscriptionId(), - parameters, - context); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Mono beginRunCommandWithoutPollingAsync( - String resourceGroupName, String vmName, RunCommandInput parameters) { - return beginRunCommandWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @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 Mono beginRunCommandWithoutPollingAsync( - String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { - return beginRunCommandWithoutPollingWithResponseAsync(resourceGroupName, vmName, parameters, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 RunCommandResultInner beginRunCommandWithoutPolling( - String resourceGroupName, String vmName, RunCommandInput parameters) { - return beginRunCommandWithoutPollingAsync(resourceGroupName, vmName, parameters).block(); - } - - /** - * Run command on the VM. - * - * @param resourceGroupName The name of the resource group. - * @param vmName The name of the virtual machine. - * @param parameters Capture Virtual Machine parameters. - * @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 RunCommandResultInner beginRunCommandWithoutPolling( - String resourceGroupName, String vmName, RunCommandInput parameters, Context context) { - return beginRunCommandWithoutPollingAsync(resourceGroupName, vmName, parameters, context).block(); - } - /** * Get the next page of items. * @@ -7808,6 +5234,7 @@ public Mono> listByLocationNextSinglePageAsyn if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listByLocationNext(nextLink, context) .map( @@ -7864,6 +5291,7 @@ public Mono> listNextSinglePageAsync(String n if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listNext(nextLink, context) .map( @@ -7920,6 +5348,7 @@ public Mono> listAllNextSinglePageAsync(Strin if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } + context = this.client.mergeContext(context); return service .listAllNext(nextLink, context) .map( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineExtensionInner.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineExtensionInner.java index bf453696b546..cbb3732b6fd0 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineExtensionInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineExtensionInner.java @@ -121,8 +121,8 @@ public VirtualMachineExtensionInner withPublisher(String publisher) { } /** - * Get the virtualMachineExtensionType property: Specifies the type of the extension; an example is - * "CustomScriptExtension". + * Get the virtualMachineExtensionType property: + * Specifies the type of the extension; an example is "CustomScriptExtension". * * @return the virtualMachineExtensionType value. */ @@ -131,8 +131,8 @@ public String virtualMachineExtensionType() { } /** - * Set the virtualMachineExtensionType property: Specifies the type of the extension; an example is - * "CustomScriptExtension". + * Set the virtualMachineExtensionType property: + * Specifies the type of the extension; an example is "CustomScriptExtension". * * @param virtualMachineExtensionType the virtualMachineExtensionType value to set. * @return the VirtualMachineExtensionInner object itself. diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineScaleSetExtensionInner.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineScaleSetExtensionInner.java index 973a0a9948d9..14894df3dc4c 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineScaleSetExtensionInner.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/fluent/inner/VirtualMachineScaleSetExtensionInner.java @@ -24,6 +24,12 @@ public class VirtualMachineScaleSetExtensionInner extends SubResourceReadOnly { @JsonProperty(value = "name") private String name; +// /* +// * Resource type +// */ +// @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) +// private String type; + /* * If a value is provided and is different from the previous value, the * extension handler will be forced to update even if the extension @@ -106,6 +112,15 @@ public VirtualMachineScaleSetExtensionInner withName(String name) { return this; } +// /** +// * Get the type property: Resource type. +// * +// * @return the type value. +// */ +// public String type() { +// return this.type; +// } + /** * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension * handler will be forced to update even if the extension configuration has not changed. diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ApiError.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ApiError.java index c608fd9302f3..0c468859d0f2 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ApiError.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ApiError.java @@ -36,8 +36,5 @@ public InnerError getInnererror() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innererror != null) { - innererror.validate(); - } } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskOptions.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskOptions.java index fb29c6580f57..0548c706432f 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskOptions.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiffDiskOptions.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.compute.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 DiffDiskOptions. */ -public enum DiffDiskOptions { - /** Enum value Local. */ - LOCAL("Local"); - - /** The actual serialized value for a DiffDiskOptions instance. */ - private final String value; - - DiffDiskOptions(String value) { - this.value = value; - } +public final class DiffDiskOptions extends ExpandableStringEnum { + /** Static value Local for DiffDiskOptions. */ + public static final DiffDiskOptions LOCAL = fromString("Local"); /** - * Parses a serialized value to a DiffDiskOptions instance. + * Creates or finds a DiffDiskOptions from its string representation. * - * @param value the serialized value to parse. - * @return the parsed DiffDiskOptions object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding DiffDiskOptions. */ @JsonCreator - public static DiffDiskOptions fromString(String value) { - DiffDiskOptions[] items = DiffDiskOptions.values(); - for (DiffDiskOptions item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static DiffDiskOptions fromString(String name) { + return fromString(name, DiffDiskOptions.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known DiffDiskOptions values. */ + public static Collection values() { + return values(DiffDiskOptions.class); } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetIdentityType.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetIdentityType.java index 76ab87d2b1df..d298d05950cc 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetIdentityType.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/DiskEncryptionSetIdentityType.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.compute.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 DiskEncryptionSetIdentityType. */ -public enum DiskEncryptionSetIdentityType { - /** Enum value SystemAssigned. */ - SYSTEM_ASSIGNED("SystemAssigned"); - - /** The actual serialized value for a DiskEncryptionSetIdentityType instance. */ - private final String value; - - DiskEncryptionSetIdentityType(String value) { - this.value = value; - } +public final class DiskEncryptionSetIdentityType extends ExpandableStringEnum { + /** Static value SystemAssigned for DiskEncryptionSetIdentityType. */ + public static final DiskEncryptionSetIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); /** - * Parses a serialized value to a DiskEncryptionSetIdentityType instance. + * Creates or finds a DiskEncryptionSetIdentityType from its string representation. * - * @param value the serialized value to parse. - * @return the parsed DiskEncryptionSetIdentityType object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding DiskEncryptionSetIdentityType. */ @JsonCreator - public static DiskEncryptionSetIdentityType fromString(String value) { - DiskEncryptionSetIdentityType[] items = DiskEncryptionSetIdentityType.values(); - for (DiskEncryptionSetIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static DiskEncryptionSetIdentityType fromString(String name) { + return fromString(name, DiskEncryptionSetIdentityType.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known DiskEncryptionSetIdentityType values. */ + public static Collection values() { + return values(DiskEncryptionSetIdentityType.class); } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceNames.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceNames.java index 0fc0f8b8babd..c73007451755 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceNames.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceNames.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.compute.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 OrchestrationServiceNames. */ -public enum OrchestrationServiceNames { - /** Enum value AutomaticRepairs. */ - AUTOMATIC_REPAIRS("AutomaticRepairs"); - - /** The actual serialized value for a OrchestrationServiceNames instance. */ - private final String value; - - OrchestrationServiceNames(String value) { - this.value = value; - } +public final class OrchestrationServiceNames extends ExpandableStringEnum { + /** Static value AutomaticRepairs for OrchestrationServiceNames. */ + public static final OrchestrationServiceNames AUTOMATIC_REPAIRS = fromString("AutomaticRepairs"); /** - * Parses a serialized value to a OrchestrationServiceNames instance. + * Creates or finds a OrchestrationServiceNames from its string representation. * - * @param value the serialized value to parse. - * @return the parsed OrchestrationServiceNames object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding OrchestrationServiceNames. */ @JsonCreator - public static OrchestrationServiceNames fromString(String value) { - OrchestrationServiceNames[] items = OrchestrationServiceNames.values(); - for (OrchestrationServiceNames item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static OrchestrationServiceNames fromString(String name) { + return fromString(name, OrchestrationServiceNames.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known OrchestrationServiceNames values. */ + public static Collection values() { + return values(OrchestrationServiceNames.class); } } diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateInput.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateInput.java index 048beb2f72fc..f07747103629 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateInput.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/OrchestrationServiceStateInput.java @@ -18,7 +18,7 @@ public final class OrchestrationServiceStateInput { * The name of the service. */ @JsonProperty(value = "serviceName", required = true) - private String serviceName; + private OrchestrationServiceNames serviceName; /* * The action to be performed. @@ -26,17 +26,12 @@ public final class OrchestrationServiceStateInput { @JsonProperty(value = "action", required = true) private OrchestrationServiceStateAction action; - /** Creates an instance of OrchestrationServiceStateInput class. */ - public OrchestrationServiceStateInput() { - serviceName = "AutomaticRepairs"; - } - /** * Get the serviceName property: The name of the service. * * @return the serviceName value. */ - public String serviceName() { + public OrchestrationServiceNames serviceName() { return this.serviceName; } @@ -46,7 +41,7 @@ public String serviceName() { * @param serviceName the serviceName value to set. * @return the OrchestrationServiceStateInput object itself. */ - public OrchestrationServiceStateInput withServiceName(String serviceName) { + public OrchestrationServiceStateInput withServiceName(OrchestrationServiceNames serviceName) { this.serviceName = serviceName; return this; } @@ -77,6 +72,12 @@ public OrchestrationServiceStateInput withAction(OrchestrationServiceStateAction * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (serviceName() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serviceName in model OrchestrationServiceStateInput")); + } if (action() == null) { throw logger .logExceptionAsError( diff --git a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatusTypes.java b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatusTypes.java index 6adaaf9ea66c..19f17e12b6be 100644 --- a/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatusTypes.java +++ b/sdk/compute/mgmt/src/main/java/com/azure/resourcemanager/compute/models/ReplicationStatusTypes.java @@ -4,41 +4,28 @@ package com.azure.resourcemanager.compute.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 ReplicationStatusTypes. */ -public enum ReplicationStatusTypes { - /** Enum value ReplicationStatus. */ - REPLICATION_STATUS("ReplicationStatus"); - - /** The actual serialized value for a ReplicationStatusTypes instance. */ - private final String value; - - ReplicationStatusTypes(String value) { - this.value = value; - } +public final class ReplicationStatusTypes extends ExpandableStringEnum { + /** Static value ReplicationStatus for ReplicationStatusTypes. */ + public static final ReplicationStatusTypes REPLICATION_STATUS = fromString("ReplicationStatus"); /** - * Parses a serialized value to a ReplicationStatusTypes instance. + * Creates or finds a ReplicationStatusTypes from its string representation. * - * @param value the serialized value to parse. - * @return the parsed ReplicationStatusTypes object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding ReplicationStatusTypes. */ @JsonCreator - public static ReplicationStatusTypes fromString(String value) { - ReplicationStatusTypes[] items = ReplicationStatusTypes.values(); - for (ReplicationStatusTypes item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static ReplicationStatusTypes fromString(String name) { + return fromString(name, ReplicationStatusTypes.class); } - @JsonValue - @Override - public String toString() { - return this.value; + /** @return known ReplicationStatusTypes values. */ + public static Collection values() { + return values(ReplicationStatusTypes.class); } } diff --git a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java index 9ec1a0f8ac03..35c6193d74c4 100644 --- a/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java +++ b/sdk/resources/mgmt/src/main/java/com/azure/resourcemanager/resources/fluentcore/AzureServiceClient.java @@ -37,6 +37,7 @@ import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalQueries; +import java.util.Map; /** * ServiceClient is the abstraction for accessing REST operations and their payload data types. @@ -102,6 +103,19 @@ public Context getContext() { return context; } + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + /** * Gets long running operation result. *