diff --git a/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/DeletedAppRestoreRequest.java b/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/DeletedAppRestoreRequest.java index 5907be148642..f64f8735eab5 100644 --- a/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/DeletedAppRestoreRequest.java +++ b/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/DeletedAppRestoreRequest.java @@ -38,6 +38,12 @@ public class DeletedAppRestoreRequest extends ProxyOnlyResource { @JsonProperty(value = "properties.snapshotTime") private String snapshotTime; + /** + * If true, the snapshot is retrieved from DRSecondary endpoint. + */ + @JsonProperty(value = "properties.useDRSecondary") + private Boolean useDRSecondary; + /** * Get aRM resource ID of the deleted app. Example: /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}. @@ -102,4 +108,24 @@ public DeletedAppRestoreRequest withSnapshotTime(String snapshotTime) { return this; } + /** + * Get if true, the snapshot is retrieved from DRSecondary endpoint. + * + * @return the useDRSecondary value + */ + public Boolean useDRSecondary() { + return this.useDRSecondary; + } + + /** + * Set if true, the snapshot is retrieved from DRSecondary endpoint. + * + * @param useDRSecondary the useDRSecondary value to set + * @return the DeletedAppRestoreRequest object itself. + */ + public DeletedAppRestoreRequest withUseDRSecondary(Boolean useDRSecondary) { + this.useDRSecondary = useDRSecondary; + return this; + } + } diff --git a/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/SnapshotRestoreRequest.java b/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/SnapshotRestoreRequest.java index a6bdda909ef2..f8a00cf4f4a6 100644 --- a/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/SnapshotRestoreRequest.java +++ b/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/SnapshotRestoreRequest.java @@ -52,6 +52,12 @@ public class SnapshotRestoreRequest extends ProxyOnlyResource { @JsonProperty(value = "properties.ignoreConflictingHostNames") private Boolean ignoreConflictingHostNames; + /** + * If true, the snapshot is retrieved from DRSecondary endpoint. + */ + @JsonProperty(value = "properties.useDRSecondary") + private Boolean useDRSecondary; + /** * Get point in time in which the app restore should be done, formatted as a DateTime string. * @@ -156,4 +162,24 @@ public SnapshotRestoreRequest withIgnoreConflictingHostNames(Boolean ignoreConfl return this; } + /** + * Get if true, the snapshot is retrieved from DRSecondary endpoint. + * + * @return the useDRSecondary value + */ + public Boolean useDRSecondary() { + return this.useDRSecondary; + } + + /** + * Set if true, the snapshot is retrieved from DRSecondary endpoint. + * + * @param useDRSecondary the useDRSecondary value to set + * @return the SnapshotRestoreRequest object itself. + */ + public SnapshotRestoreRequest withUseDRSecondary(Boolean useDRSecondary) { + this.useDRSecondary = useDRSecondary; + return this; + } + } diff --git a/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/WebApps.java b/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/WebApps.java index 527b0a5a7de3..4982bec5d3f3 100644 --- a/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/WebApps.java +++ b/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/WebApps.java @@ -688,6 +688,17 @@ public interface WebApps { */ Completable swapSlotWithProductionAsync(String resourceGroupName, String name, CsmSlotEntity slotSwapEntity); + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSnapshotsFromDRSecondaryAsync(final String resourceGroupName, final String name); + /** * Starts an app (or deployment slot, if specified). * Starts an app (or deployment slot, if specified). @@ -3637,6 +3648,18 @@ public interface WebApps { */ Completable swapSlotSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntity slotSwapEntity); + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param slot Website Slot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listSnapshotsFromDRSecondarySlotAsync(final String resourceGroupName, final String name, final String slot); + /** * Starts an app (or deployment slot, if specified). * Starts an app (or deployment slot, if specified). diff --git a/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebAppsImpl.java b/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebAppsImpl.java index cdbd26aadcd5..cf128aa31509 100644 --- a/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebAppsImpl.java +++ b/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebAppsImpl.java @@ -32,6 +32,7 @@ import com.microsoft.azure.management.appservice.v2018_02_01.NetworkTrace; import com.microsoft.azure.management.appservice.v2018_02_01.SitePhpErrorLogFlag; import com.microsoft.azure.management.appservice.v2018_02_01.SlotDifference; +import com.microsoft.azure.management.appservice.v2018_02_01.Snapshot; import com.microsoft.azure.management.appservice.v2018_02_01.CsmSlotEntity; import com.microsoft.azure.management.appservice.v2018_02_01.StorageMigrationOptions; import com.microsoft.azure.management.appservice.v2018_02_01.MigrateMySqlRequest; @@ -45,7 +46,6 @@ import com.microsoft.azure.management.appservice.v2018_02_01.User; import com.microsoft.azure.management.appservice.v2018_02_01.PushSettings; import com.microsoft.azure.management.appservice.v2018_02_01.SlotConfigNamesResource; -import com.microsoft.azure.management.appservice.v2018_02_01.Snapshot; import com.microsoft.azure.management.appservice.v2018_02_01.SiteConfigurationSnapshotInfo; import com.microsoft.azure.management.appservice.v2018_02_01.ContinuousWebJob; import com.microsoft.azure.management.appservice.v2018_02_01.Deployment; @@ -961,6 +961,24 @@ public Completable swapSlotWithProductionAsync(String resourceGroupName, String return client.swapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity).toCompletable(); } + @Override + public Observable listSnapshotsFromDRSecondaryAsync(final String resourceGroupName, final String name) { + WebAppsInner client = this.inner(); + return client.listSnapshotsFromDRSecondaryAsync(resourceGroupName, name) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Snapshot call(SnapshotInner inner) { + return new SnapshotImpl(inner, manager()); + } + }); + } + @Override public Completable startAsync(String resourceGroupName, String name) { WebAppsInner client = this.inner(); @@ -3763,6 +3781,24 @@ public Completable swapSlotSlotAsync(String resourceGroupName, String name, Stri return client.swapSlotSlotAsync(resourceGroupName, name, slot, slotSwapEntity).toCompletable(); } + @Override + public Observable listSnapshotsFromDRSecondarySlotAsync(final String resourceGroupName, final String name, final String slot) { + WebAppsInner client = this.inner(); + return client.listSnapshotsFromDRSecondarySlotAsync(resourceGroupName, name, slot) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Snapshot call(SnapshotInner inner) { + return new SnapshotImpl(inner, manager()); + } + }); + } + @Override public Completable startSlotAsync(String resourceGroupName, String name, String slot) { WebAppsInner client = this.inner(); diff --git a/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebAppsInner.java b/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebAppsInner.java index bfe4168935c2..4abdfcb0c4a0 100644 --- a/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebAppsInner.java +++ b/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/WebAppsInner.java @@ -1348,6 +1348,10 @@ interface WebAppsService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots") Observable> listSnapshotsSlot(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("slot") String slot, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.v2018_02_01.WebApps listSnapshotsFromDRSecondarySlot" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr") + Observable> listSnapshotsFromDRSecondarySlot(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("slot") String slot, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.v2018_02_01.WebApps getSourceControlSlot" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web") Observable> getSourceControlSlot(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("slot") String slot, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1480,6 +1484,10 @@ interface WebAppsService { @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots") Observable> listSnapshots(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.v2018_02_01.WebApps listSnapshotsFromDRSecondary" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr") + Observable> listSnapshotsFromDRSecondary(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.v2018_02_01.WebApps getSourceControl" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web") Observable> getSourceControl(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1776,6 +1784,10 @@ interface WebAppsService { @GET Observable> listSnapshotsSlotNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.v2018_02_01.WebApps listSnapshotsFromDRSecondarySlotNext" }) + @GET + Observable> listSnapshotsFromDRSecondarySlotNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.v2018_02_01.WebApps listTriggeredWebJobsSlotNext" }) @GET Observable> listTriggeredWebJobsSlotNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -1800,6 +1812,10 @@ interface WebAppsService { @GET Observable> listSnapshotsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.v2018_02_01.WebApps listSnapshotsFromDRSecondaryNext" }) + @GET + Observable> listSnapshotsFromDRSecondaryNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.v2018_02_01.WebApps listTriggeredWebJobsNext" }) @GET Observable> listTriggeredWebJobsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -36471,6 +36487,142 @@ private ServiceResponse> listSnapshotsSlotDelegate(Respo .build(response); } + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param slot Website Slot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SnapshotInner> object if successful. + */ + public PagedList listSnapshotsFromDRSecondarySlot(final String resourceGroupName, final String name, final String slot) { + ServiceResponse> response = listSnapshotsFromDRSecondarySlotSinglePageAsync(resourceGroupName, name, slot).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSnapshotsFromDRSecondarySlotNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param slot Website Slot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSnapshotsFromDRSecondarySlotAsync(final String resourceGroupName, final String name, final String slot, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSnapshotsFromDRSecondarySlotSinglePageAsync(resourceGroupName, name, slot), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSnapshotsFromDRSecondarySlotNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param slot Website Slot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SnapshotInner> object + */ + public Observable> listSnapshotsFromDRSecondarySlotAsync(final String resourceGroupName, final String name, final String slot) { + return listSnapshotsFromDRSecondarySlotWithServiceResponseAsync(resourceGroupName, name, slot) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param slot Website Slot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SnapshotInner> object + */ + public Observable>> listSnapshotsFromDRSecondarySlotWithServiceResponseAsync(final String resourceGroupName, final String name, final String slot) { + return listSnapshotsFromDRSecondarySlotSinglePageAsync(resourceGroupName, name, slot) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSnapshotsFromDRSecondarySlotNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. + ServiceResponse> * @param name Website Name. + ServiceResponse> * @param slot Website Slot. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SnapshotInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSnapshotsFromDRSecondarySlotSinglePageAsync(final String resourceGroupName, final String name, final String slot) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSnapshotsFromDRSecondarySlot(resourceGroupName, name, slot, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSnapshotsFromDRSecondarySlotDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSnapshotsFromDRSecondarySlotDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(DefaultErrorResponseException.class) + .build(response); + } + /** * Gets the source control configuration of an app. * Gets the source control configuration of an app. @@ -40367,6 +40519,134 @@ private ServiceResponse> listSnapshotsDelegate(Response< .build(response); } + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SnapshotInner> object if successful. + */ + public PagedList listSnapshotsFromDRSecondary(final String resourceGroupName, final String name) { + ServiceResponse> response = listSnapshotsFromDRSecondarySinglePageAsync(resourceGroupName, name).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSnapshotsFromDRSecondaryNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSnapshotsFromDRSecondaryAsync(final String resourceGroupName, final String name, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSnapshotsFromDRSecondarySinglePageAsync(resourceGroupName, name), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSnapshotsFromDRSecondaryNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SnapshotInner> object + */ + public Observable> listSnapshotsFromDRSecondaryAsync(final String resourceGroupName, final String name) { + return listSnapshotsFromDRSecondaryWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name Website Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SnapshotInner> object + */ + public Observable>> listSnapshotsFromDRSecondaryWithServiceResponseAsync(final String resourceGroupName, final String name) { + return listSnapshotsFromDRSecondarySinglePageAsync(resourceGroupName, name) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSnapshotsFromDRSecondaryNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. + ServiceResponse> * @param name Website Name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SnapshotInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSnapshotsFromDRSecondarySinglePageAsync(final String resourceGroupName, final String name) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listSnapshotsFromDRSecondary(resourceGroupName, name, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSnapshotsFromDRSecondaryDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSnapshotsFromDRSecondaryDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(DefaultErrorResponseException.class) + .build(response); + } + /** * Gets the source control configuration of an app. * Gets the source control configuration of an app. @@ -48827,6 +49107,122 @@ private ServiceResponse> listSnapshotsSlotNextDelegate(R .build(response); } + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SnapshotInner> object if successful. + */ + public PagedList listSnapshotsFromDRSecondarySlotNext(final String nextPageLink) { + ServiceResponse> response = listSnapshotsFromDRSecondarySlotNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSnapshotsFromDRSecondarySlotNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSnapshotsFromDRSecondarySlotNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSnapshotsFromDRSecondarySlotNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSnapshotsFromDRSecondarySlotNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SnapshotInner> object + */ + public Observable> listSnapshotsFromDRSecondarySlotNextAsync(final String nextPageLink) { + return listSnapshotsFromDRSecondarySlotNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SnapshotInner> object + */ + public Observable>> listSnapshotsFromDRSecondarySlotNextWithServiceResponseAsync(final String nextPageLink) { + return listSnapshotsFromDRSecondarySlotNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSnapshotsFromDRSecondarySlotNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SnapshotInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSnapshotsFromDRSecondarySlotNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listSnapshotsFromDRSecondarySlotNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSnapshotsFromDRSecondarySlotNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSnapshotsFromDRSecondarySlotNextDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(DefaultErrorResponseException.class) + .build(response); + } + /** * List triggered web jobs for an app, or a deployment slot. * List triggered web jobs for an app, or a deployment slot. @@ -49524,6 +49920,122 @@ private ServiceResponse> listSnapshotsNextDelegate(Respo .build(response); } + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DefaultErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SnapshotInner> object if successful. + */ + public PagedList listSnapshotsFromDRSecondaryNext(final String nextPageLink) { + ServiceResponse> response = listSnapshotsFromDRSecondaryNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSnapshotsFromDRSecondaryNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listSnapshotsFromDRSecondaryNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSnapshotsFromDRSecondaryNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSnapshotsFromDRSecondaryNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SnapshotInner> object + */ + public Observable> listSnapshotsFromDRSecondaryNextAsync(final String nextPageLink) { + return listSnapshotsFromDRSecondaryNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SnapshotInner> object + */ + public Observable>> listSnapshotsFromDRSecondaryNextWithServiceResponseAsync(final String nextPageLink) { + return listSnapshotsFromDRSecondaryNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSnapshotsFromDRSecondaryNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Returns all Snapshots to the user from DRSecondary endpoint. + * Returns all Snapshots to the user from DRSecondary endpoint. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SnapshotInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSnapshotsFromDRSecondaryNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listSnapshotsFromDRSecondaryNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSnapshotsFromDRSecondaryNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSnapshotsFromDRSecondaryNextDelegate(Response response) throws DefaultErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., DefaultErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(DefaultErrorResponseException.class) + .build(response); + } + /** * List triggered web jobs for an app, or a deployment slot. * List triggered web jobs for an app, or a deployment slot.