Search in sources :

Example 1 with PublishingProfileFormat

use of com.microsoft.azure.management.appservice.PublishingProfileFormat in project azure-sdk-for-java by Azure.

the class WebAppsInner method listPublishingProfileXmlWithSecretsWithServiceResponseAsync.

/**
     * Gets the publishing profile for an app (or deployment slot, if specified).
     * Gets the publishing profile for an app (or deployment slot, if specified).
     *
     * @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
     * @return the observable to the InputStream object
     */
public Observable<ServiceResponse<InputStream>> listPublishingProfileXmlWithSecretsWithServiceResponseAsync(String resourceGroupName, 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.");
    }
    final String apiVersion = "2016-08-01";
    final PublishingProfileFormat format = null;
    CsmPublishingProfileOptions publishingProfileOptions = new CsmPublishingProfileOptions();
    publishingProfileOptions.withFormat(null);
    return service.listPublishingProfileXmlWithSecrets(resourceGroupName, name, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), publishingProfileOptions, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<InputStream>>>() {

        @Override
        public Observable<ServiceResponse<InputStream>> call(Response<ResponseBody> response) {
            try {
                ServiceResponse<InputStream> clientResponse = listPublishingProfileXmlWithSecretsDelegate(response);
                return Observable.just(clientResponse);
            } catch (Throwable t) {
                return Observable.error(t);
            }
        }
    });
}
Also used : InputStream(java.io.InputStream) Observable(rx.Observable) ResponseBody(okhttp3.ResponseBody) Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) PublishingProfileFormat(com.microsoft.azure.management.appservice.PublishingProfileFormat) ServiceResponse(com.microsoft.rest.ServiceResponse) CsmPublishingProfileOptions(com.microsoft.azure.management.appservice.CsmPublishingProfileOptions)

Example 2 with PublishingProfileFormat

use of com.microsoft.azure.management.appservice.PublishingProfileFormat in project azure-sdk-for-java by Azure.

the class WebAppsInner method listPublishingProfileXmlWithSecretsSlotWithServiceResponseAsync.

/**
     * Gets the publishing profile for an app (or deployment slot, if specified).
     * Gets the publishing profile for an 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 slot Name of the deployment slot. If a slot is not specified, the API will get the publishing profile for the production slot.
     * @throws IllegalArgumentException thrown if parameters fail the validation
     * @return the observable to the InputStream object
     */
public Observable<ServiceResponse<InputStream>> listPublishingProfileXmlWithSecretsSlotWithServiceResponseAsync(String resourceGroupName, String name, 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.");
    }
    final String apiVersion = "2016-08-01";
    final PublishingProfileFormat format = null;
    CsmPublishingProfileOptions publishingProfileOptions = new CsmPublishingProfileOptions();
    publishingProfileOptions.withFormat(null);
    return service.listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), publishingProfileOptions, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<InputStream>>>() {

        @Override
        public Observable<ServiceResponse<InputStream>> call(Response<ResponseBody> response) {
            try {
                ServiceResponse<InputStream> clientResponse = listPublishingProfileXmlWithSecretsSlotDelegate(response);
                return Observable.just(clientResponse);
            } catch (Throwable t) {
                return Observable.error(t);
            }
        }
    });
}
Also used : InputStream(java.io.InputStream) Observable(rx.Observable) ResponseBody(okhttp3.ResponseBody) Response(retrofit2.Response) ServiceResponse(com.microsoft.rest.ServiceResponse) PublishingProfileFormat(com.microsoft.azure.management.appservice.PublishingProfileFormat) ServiceResponse(com.microsoft.rest.ServiceResponse) CsmPublishingProfileOptions(com.microsoft.azure.management.appservice.CsmPublishingProfileOptions)

Aggregations

CsmPublishingProfileOptions (com.microsoft.azure.management.appservice.CsmPublishingProfileOptions)2 PublishingProfileFormat (com.microsoft.azure.management.appservice.PublishingProfileFormat)2 ServiceResponse (com.microsoft.rest.ServiceResponse)2 InputStream (java.io.InputStream)2 ResponseBody (okhttp3.ResponseBody)2 Response (retrofit2.Response)2 Observable (rx.Observable)2