diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/DataTableResponseColumn.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/DataTableResponseColumn.java new file mode 100644 index 00000000000..7345ece1087 --- /dev/null +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/DataTableResponseColumn.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.web; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Column definition. + */ +public class DataTableResponseColumn { + /** + * Name of the column. + */ + @JsonProperty(value = "columnName") + private String columnName; + + /** + * Data type which looks like 'String' or 'Int32'. + */ + @JsonProperty(value = "dataType") + private String dataType; + + /** + * Column Type. + */ + @JsonProperty(value = "columnType") + private String columnType; + + /** + * Get the columnName value. + * + * @return the columnName value + */ + public String columnName() { + return this.columnName; + } + + /** + * Set the columnName value. + * + * @param columnName the columnName value to set + * @return the DataTableResponseColumn object itself. + */ + public DataTableResponseColumn withColumnName(String columnName) { + this.columnName = columnName; + return this; + } + + /** + * Get the dataType value. + * + * @return the dataType value + */ + public String dataType() { + return this.dataType; + } + + /** + * Set the dataType value. + * + * @param dataType the dataType value to set + * @return the DataTableResponseColumn object itself. + */ + public DataTableResponseColumn withDataType(String dataType) { + this.dataType = dataType; + return this; + } + + /** + * Get the columnType value. + * + * @return the columnType value + */ + public String columnType() { + return this.columnType; + } + + /** + * Set the columnType value. + * + * @param columnType the columnType value to set + * @return the DataTableResponseColumn object itself. + */ + public DataTableResponseColumn withColumnType(String columnType) { + this.columnType = columnType; + return this; + } + +} diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/DataTableResponseObject.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/DataTableResponseObject.java new file mode 100644 index 00000000000..8f9eb373305 --- /dev/null +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/DataTableResponseObject.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.web; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Data Table which defines columns and raw row values. + */ +public class DataTableResponseObject { + /** + * Name of the table. + */ + @JsonProperty(value = "tableName") + private String tableName; + + /** + * List of columns with data types. + */ + @JsonProperty(value = "columns") + private List columns; + + /** + * Raw row values. + */ + @JsonProperty(value = "rows") + private List> rows; + + /** + * Get the tableName value. + * + * @return the tableName value + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName value. + * + * @param tableName the tableName value to set + * @return the DataTableResponseObject object itself. + */ + public DataTableResponseObject withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Get the columns value. + * + * @return the columns value + */ + public List columns() { + return this.columns; + } + + /** + * Set the columns value. + * + * @param columns the columns value to set + * @return the DataTableResponseObject object itself. + */ + public DataTableResponseObject withColumns(List columns) { + this.columns = columns; + return this; + } + + /** + * Get the rows value. + * + * @return the rows value + */ + public List> rows() { + return this.rows; + } + + /** + * Set the rows value. + * + * @param rows the rows value to set + * @return the DataTableResponseObject object itself. + */ + public DataTableResponseObject withRows(List> rows) { + this.rows = rows; + return this; + } + +} diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/DetectorInfo.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/DetectorInfo.java new file mode 100644 index 00000000000..1cca0342579 --- /dev/null +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/DetectorInfo.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.web; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Definition of Detector. + */ +public class DetectorInfo { + /** + * Short description of the detector and its purpose. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * Support Category. + */ + @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) + private String category; + + /** + * Support Sub Category. + */ + @JsonProperty(value = "subCategory", access = JsonProperty.Access.WRITE_ONLY) + private String subCategory; + + /** + * Support Topic Id. + */ + @JsonProperty(value = "supportTopicId", access = JsonProperty.Access.WRITE_ONLY) + private String supportTopicId; + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get the category value. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Get the subCategory value. + * + * @return the subCategory value + */ + public String subCategory() { + return this.subCategory; + } + + /** + * Get the supportTopicId value. + * + * @return the supportTopicId value + */ + public String supportTopicId() { + return this.supportTopicId; + } + +} diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/DiagnosticData.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/DiagnosticData.java new file mode 100644 index 00000000000..960df341f97 --- /dev/null +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/DiagnosticData.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.web; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Set of data with rendering instructions. + */ +public class DiagnosticData { + /** + * Data in table form. + */ + @JsonProperty(value = "table") + private DataTableResponseObject table; + + /** + * Properties that describe how the table should be rendered. + */ + @JsonProperty(value = "renderingProperties") + private Rendering renderingProperties; + + /** + * Get the table value. + * + * @return the table value + */ + public DataTableResponseObject table() { + return this.table; + } + + /** + * Set the table value. + * + * @param table the table value to set + * @return the DiagnosticData object itself. + */ + public DiagnosticData withTable(DataTableResponseObject table) { + this.table = table; + return this; + } + + /** + * Get the renderingProperties value. + * + * @return the renderingProperties value + */ + public Rendering renderingProperties() { + return this.renderingProperties; + } + + /** + * Set the renderingProperties value. + * + * @param renderingProperties the renderingProperties value to set + * @return the DiagnosticData object itself. + */ + public DiagnosticData withRenderingProperties(Rendering renderingProperties) { + this.renderingProperties = renderingProperties; + return this; + } + +} diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/ErrorResponseError.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/ErrorResponseError.java new file mode 100644 index 00000000000..c2967bf4bfd --- /dev/null +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/ErrorResponseError.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.web; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error model. + */ +public class ErrorResponseError { + /** + * Standardized string to programmatically identify the error. + */ + @JsonProperty(value = "code", required = true, access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Detailed error description and debugging information. + */ + @JsonProperty(value = "message", required = true, access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Detailed error description and debugging information. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * The details property. + */ + @JsonProperty(value = "details") + private List details; + + /** + * More information to debug error. + */ + @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) + private String innererror; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get the details value. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the details value. + * + * @param details the details value to set + * @return the ErrorResponseError object itself. + */ + public ErrorResponseError withDetails(List details) { + this.details = details; + return this; + } + + /** + * Get the innererror value. + * + * @return the innererror value + */ + public String innererror() { + return this.innererror; + } + +} diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/ErrorResponseErrorDetailsItem.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/ErrorResponseErrorDetailsItem.java new file mode 100644 index 00000000000..e6798570951 --- /dev/null +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/ErrorResponseErrorDetailsItem.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.web; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Detailed errors. + */ +public class ErrorResponseErrorDetailsItem { + /** + * Standardized string to programmatically identify the error. + */ + @JsonProperty(value = "code", required = true, access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * Detailed error description and debugging information. + */ + @JsonProperty(value = "message", required = true, access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Detailed error description and debugging information. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String target() { + return this.target; + } + +} diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/ManagedServiceIdentity.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/ManagedServiceIdentity.java index fbd0ccc6cb4..3210f092a79 100644 --- a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/ManagedServiceIdentity.java +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/ManagedServiceIdentity.java @@ -15,10 +15,11 @@ */ public class ManagedServiceIdentity { /** - * Type of managed service identity. + * Type of managed service identity. Possible values include: + * 'SystemAssigned'. */ @JsonProperty(value = "type") - private Object type; + private ManagedServiceIdentityType type; /** * Tenant of managed service identity. @@ -37,7 +38,7 @@ public class ManagedServiceIdentity { * * @return the type value */ - public Object type() { + public ManagedServiceIdentityType type() { return this.type; } @@ -47,7 +48,7 @@ public Object type() { * @param type the type value to set * @return the ManagedServiceIdentity object itself. */ - public ManagedServiceIdentity withType(Object type) { + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { this.type = type; return this; } diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/Rendering.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/Rendering.java new file mode 100644 index 00000000000..19b81db06b8 --- /dev/null +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/Rendering.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.web; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Instructions for rendering the data. + */ +public class Rendering { + /** + * Rendering Type. Possible values include: 'NoGraph', 'Table', + * 'TimeSeries', 'TimeSeriesPerInstance'. + */ + @JsonProperty(value = "renderingType") + private RenderingType renderingType; + + /** + * Title of data. + */ + @JsonProperty(value = "title") + private String title; + + /** + * Description of the data that will help it be interpreted. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the renderingType value. + * + * @return the renderingType value + */ + public RenderingType renderingType() { + return this.renderingType; + } + + /** + * Set the renderingType value. + * + * @param renderingType the renderingType value to set + * @return the Rendering object itself. + */ + public Rendering withRenderingType(RenderingType renderingType) { + this.renderingType = renderingType; + return this; + } + + /** + * Get the title value. + * + * @return the title value + */ + public String title() { + return this.title; + } + + /** + * Set the title value. + * + * @param title the title value to set + * @return the Rendering object itself. + */ + public Rendering withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the Rendering object itself. + */ + public Rendering withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/RenderingType.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/RenderingType.java new file mode 100644 index 00000000000..05ea22bf76b --- /dev/null +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/RenderingType.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.web; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for RenderingType. + */ +public enum RenderingType { + /** Enum value NoGraph. */ + NO_GRAPH("NoGraph"), + + /** Enum value Table. */ + TABLE("Table"), + + /** Enum value TimeSeries. */ + TIME_SERIES("TimeSeries"), + + /** Enum value TimeSeriesPerInstance. */ + TIME_SERIES_PER_INSTANCE("TimeSeriesPerInstance"); + + /** The actual serialized value for a RenderingType instance. */ + private String value; + + RenderingType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a RenderingType instance. + * + * @param value the serialized value to parse. + * @return the parsed RenderingType object, or null if unable to parse. + */ + @JsonCreator + public static RenderingType fromString(String value) { + RenderingType[] items = RenderingType.values(); + for (RenderingType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/BillingMeterInner.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/BillingMeterInner.java new file mode 100644 index 00000000000..72feb74806e --- /dev/null +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/BillingMeterInner.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.web.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.web.ProxyOnlyResource; + +/** + * App Service billing entity that contains information about meter which the + * Azure billing system utilizes to charge users for services. + */ +@JsonFlatten +public class BillingMeterInner extends ProxyOnlyResource { + /** + * Meter GUID onboarded in Commerce. + */ + @JsonProperty(value = "properties.meterId") + private String meterId; + + /** + * Azure Location of billable resource. + */ + @JsonProperty(value = "properties.billingLocation") + private String billingLocation; + + /** + * Short Name from App Service Azure pricing Page. + */ + @JsonProperty(value = "properties.shortName") + private String shortName; + + /** + * Friendly name of the meter. + */ + @JsonProperty(value = "properties.friendlyName") + private String friendlyName; + + /** + * App Service resource type meter used for. + */ + @JsonProperty(value = "properties.resourceType") + private String resourceType; + + /** + * Get the meterId value. + * + * @return the meterId value + */ + public String meterId() { + return this.meterId; + } + + /** + * Set the meterId value. + * + * @param meterId the meterId value to set + * @return the BillingMeterInner object itself. + */ + public BillingMeterInner withMeterId(String meterId) { + this.meterId = meterId; + return this; + } + + /** + * Get the billingLocation value. + * + * @return the billingLocation value + */ + public String billingLocation() { + return this.billingLocation; + } + + /** + * Set the billingLocation value. + * + * @param billingLocation the billingLocation value to set + * @return the BillingMeterInner object itself. + */ + public BillingMeterInner withBillingLocation(String billingLocation) { + this.billingLocation = billingLocation; + return this; + } + + /** + * Get the shortName value. + * + * @return the shortName value + */ + public String shortName() { + return this.shortName; + } + + /** + * Set the shortName value. + * + * @param shortName the shortName value to set + * @return the BillingMeterInner object itself. + */ + public BillingMeterInner withShortName(String shortName) { + this.shortName = shortName; + return this; + } + + /** + * Get the friendlyName value. + * + * @return the friendlyName value + */ + public String friendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName value. + * + * @param friendlyName the friendlyName value to set + * @return the BillingMeterInner object itself. + */ + public BillingMeterInner withFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the resourceType value. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Set the resourceType value. + * + * @param resourceType the resourceType value to set + * @return the BillingMeterInner object itself. + */ + public BillingMeterInner withResourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + +} diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/BillingMetersInner.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/BillingMetersInner.java new file mode 100644 index 00000000000..dbd6d905b71 --- /dev/null +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/BillingMetersInner.java @@ -0,0 +1,404 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.web.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in BillingMeters. + */ +public class BillingMetersInner { + /** The Retrofit service to perform REST calls. */ + private BillingMetersService service; + /** The service client containing this operation class. */ + private WebSiteManagementClientImpl client; + + /** + * Initializes an instance of BillingMetersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BillingMetersInner(Retrofit retrofit, WebSiteManagementClientImpl client) { + this.service = retrofit.create(BillingMetersService.class); + this.client = client; + } + + /** + * The interface defining all the services for BillingMeters to be + * used by Retrofit to perform actually REST calls. + */ + interface BillingMetersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.web.BillingMeters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("billingLocation") String billingLocation, @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.web.BillingMeters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<BillingMeterInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + * @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> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BillingMeterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BillingMeterInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .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(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BillingMeterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2016-03-01"; + final String billingLocation = null; + return service.list(this.client.subscriptionId(), billingLocation, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + * @param billingLocation Azure Location of billable resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<BillingMeterInner> object if successful. + */ + public PagedList list(final String billingLocation) { + ServiceResponse> response = listSinglePageAsync(billingLocation).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + * @param billingLocation Azure Location of billable resource + * @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> listAsync(final String billingLocation, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(billingLocation), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + * @param billingLocation Azure Location of billable resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BillingMeterInner> object + */ + public Observable> listAsync(final String billingLocation) { + return listWithServiceResponseAsync(billingLocation) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + * @param billingLocation Azure Location of billable resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BillingMeterInner> object + */ + public Observable>> listWithServiceResponseAsync(final String billingLocation) { + return listSinglePageAsync(billingLocation) + .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(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + ServiceResponse> * @param billingLocation Azure Location of billable resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BillingMeterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String billingLocation) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2016-03-01"; + return service.list(this.client.subscriptionId(), billingLocation, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<BillingMeterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + * @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<BillingMeterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + * @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<BillingMeterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(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(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of meters for a given location. + * Gets a list of meters for a given location. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BillingMeterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(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.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/DetectorResponseInner.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/DetectorResponseInner.java new file mode 100644 index 00000000000..3274c2afd2b --- /dev/null +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/DetectorResponseInner.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.web.implementation; + +import com.microsoft.azure.management.web.DetectorInfo; +import java.util.List; +import com.microsoft.azure.management.web.DiagnosticData; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.web.ProxyOnlyResource; + +/** + * Class representing Response from Detector. + */ +@JsonFlatten +public class DetectorResponseInner extends ProxyOnlyResource { + /** + * metadata for the detector. + */ + @JsonProperty(value = "properties.metadata") + private DetectorInfo metadata; + + /** + * Data Set. + */ + @JsonProperty(value = "properties.dataset") + private List dataset; + + /** + * Get the metadata value. + * + * @return the metadata value + */ + public DetectorInfo metadata() { + return this.metadata; + } + + /** + * Set the metadata value. + * + * @param metadata the metadata value to set + * @return the DetectorResponseInner object itself. + */ + public DetectorResponseInner withMetadata(DetectorInfo metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the dataset value. + * + * @return the dataset value + */ + public List dataset() { + return this.dataset; + } + + /** + * Set the dataset value. + * + * @param dataset the dataset value to set + * @return the DetectorResponseInner object itself. + */ + public DetectorResponseInner withDataset(List dataset) { + this.dataset = dataset; + return this; + } + +} diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/DiagnosticsInner.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/DiagnosticsInner.java index e17cf4e8821..f3edda0db98 100644 --- a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/DiagnosticsInner.java +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/DiagnosticsInner.java @@ -59,6 +59,22 @@ public DiagnosticsInner(Retrofit retrofit, WebSiteManagementClientImpl client) { * used by Retrofit to perform actually REST calls. */ interface DiagnosticsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.web.Diagnostics listHostingEnvironmentDetectorResponses" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors") + Observable> listHostingEnvironmentDetectorResponses(@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.web.Diagnostics getHostingEnvironmentDetectorResponse" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors/{detectorName}") + Observable> getHostingEnvironmentDetectorResponse(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("detectorName") String detectorName, @Path("subscriptionId") String subscriptionId, @Query("startTime") DateTime startTime, @Query("endTime") DateTime endTime, @Query("timeGrain") String timeGrain, @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.web.Diagnostics listSiteDetectorResponses" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors") + Observable> listSiteDetectorResponses(@Path("resourceGroupName") String resourceGroupName, @Path("siteName") String siteName, @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.web.Diagnostics getSiteDetectorResponse" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors/{detectorName}") + Observable> getSiteDetectorResponse(@Path("resourceGroupName") String resourceGroupName, @Path("siteName") String siteName, @Path("detectorName") String detectorName, @Path("subscriptionId") String subscriptionId, @Query("startTime") DateTime startTime, @Query("endTime") DateTime endTime, @Query("timeGrain") String timeGrain, @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.web.Diagnostics listSiteDiagnosticCategories" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics") Observable> listSiteDiagnosticCategories(@Path("resourceGroupName") String resourceGroupName, @Path("siteName") String siteName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -91,6 +107,14 @@ interface DiagnosticsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute") Observable> executeSiteDetector(@Path("resourceGroupName") String resourceGroupName, @Path("siteName") String siteName, @Path("detectorName") String detectorName, @Path("diagnosticCategory") String diagnosticCategory, @Path("subscriptionId") String subscriptionId, @Query("startTime") DateTime startTime, @Query("endTime") DateTime endTime, @Query("timeGrain") String timeGrain, @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.web.Diagnostics listSiteDetectorResponsesSlot" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors") + Observable> listSiteDetectorResponsesSlot(@Path("resourceGroupName") String resourceGroupName, @Path("siteName") String siteName, @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.web.Diagnostics getSiteDetectorResponseSlot" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors/{detectorName}") + Observable> getSiteDetectorResponseSlot(@Path("resourceGroupName") String resourceGroupName, @Path("siteName") String siteName, @Path("detectorName") String detectorName, @Path("slot") String slot, @Path("subscriptionId") String subscriptionId, @Query("startTime") DateTime startTime, @Query("endTime") DateTime endTime, @Query("timeGrain") String timeGrain, @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.web.Diagnostics listSiteDiagnosticCategoriesSlot" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics") Observable> listSiteDiagnosticCategoriesSlot(@Path("resourceGroupName") String resourceGroupName, @Path("siteName") String siteName, @Path("slot") String slot, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -123,6 +147,14 @@ interface DiagnosticsService { @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute") Observable> executeSiteDetectorSlot(@Path("resourceGroupName") String resourceGroupName, @Path("siteName") String siteName, @Path("detectorName") String detectorName, @Path("diagnosticCategory") String diagnosticCategory, @Path("slot") String slot, @Path("subscriptionId") String subscriptionId, @Query("startTime") DateTime startTime, @Query("endTime") DateTime endTime, @Query("timeGrain") String timeGrain, @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.web.Diagnostics listHostingEnvironmentDetectorResponsesNext" }) + @GET + Observable> listHostingEnvironmentDetectorResponsesNext(@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.web.Diagnostics listSiteDetectorResponsesNext" }) + @GET + Observable> listSiteDetectorResponsesNext(@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.web.Diagnostics listSiteDiagnosticCategoriesNext" }) @GET Observable> listSiteDiagnosticCategoriesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -139,6 +171,10 @@ interface DiagnosticsService { @GET Observable> getSiteDetectorNext(@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.web.Diagnostics listSiteDetectorResponsesSlotNext" }) + @GET + Observable> listSiteDetectorResponsesSlotNext(@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.web.Diagnostics listSiteDiagnosticCategoriesSlotNext" }) @GET Observable> listSiteDiagnosticCategoriesSlotNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -158,117 +194,117 @@ interface DiagnosticsService { } /** - * Get Diagnostics Categories. - * Get Diagnostics Categories. + * List Hosting Environment Detector Responses. + * List Hosting Environment Detector Responses. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name + * @param name Site Name * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException 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<DiagnosticCategoryInner> object if successful. + * @return the PagedList<DetectorResponseInner> object if successful. */ - public PagedList listSiteDiagnosticCategories(final String resourceGroupName, final String siteName) { - ServiceResponse> response = listSiteDiagnosticCategoriesSinglePageAsync(resourceGroupName, siteName).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listHostingEnvironmentDetectorResponses(final String resourceGroupName, final String name) { + ServiceResponse> response = listHostingEnvironmentDetectorResponsesSinglePageAsync(resourceGroupName, name).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listSiteDiagnosticCategoriesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listHostingEnvironmentDetectorResponsesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Get Diagnostics Categories. - * Get Diagnostics Categories. + * List Hosting Environment Detector Responses. + * List Hosting Environment Detector Responses. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name + * @param name Site 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> listSiteDiagnosticCategoriesAsync(final String resourceGroupName, final String siteName, final ListOperationCallback serviceCallback) { + public ServiceFuture> listHostingEnvironmentDetectorResponsesAsync(final String resourceGroupName, final String name, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listSiteDiagnosticCategoriesSinglePageAsync(resourceGroupName, siteName), - new Func1>>>() { + listHostingEnvironmentDetectorResponsesSinglePageAsync(resourceGroupName, name), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listSiteDiagnosticCategoriesNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listHostingEnvironmentDetectorResponsesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Get Diagnostics Categories. - * Get Diagnostics Categories. + * List Hosting Environment Detector Responses. + * List Hosting Environment Detector Responses. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name + * @param name Site Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<DiagnosticCategoryInner> object + * @return the observable to the PagedList<DetectorResponseInner> object */ - public Observable> listSiteDiagnosticCategoriesAsync(final String resourceGroupName, final String siteName) { - return listSiteDiagnosticCategoriesWithServiceResponseAsync(resourceGroupName, siteName) - .map(new Func1>, Page>() { + public Observable> listHostingEnvironmentDetectorResponsesAsync(final String resourceGroupName, final String name) { + return listHostingEnvironmentDetectorResponsesWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Get Diagnostics Categories. - * Get Diagnostics Categories. + * List Hosting Environment Detector Responses. + * List Hosting Environment Detector Responses. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name + * @param name Site Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<DiagnosticCategoryInner> object + * @return the observable to the PagedList<DetectorResponseInner> object */ - public Observable>> listSiteDiagnosticCategoriesWithServiceResponseAsync(final String resourceGroupName, final String siteName) { - return listSiteDiagnosticCategoriesSinglePageAsync(resourceGroupName, siteName) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listHostingEnvironmentDetectorResponsesWithServiceResponseAsync(final String resourceGroupName, final String name) { + return listHostingEnvironmentDetectorResponsesSinglePageAsync(resourceGroupName, name) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listSiteDiagnosticCategoriesNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listHostingEnvironmentDetectorResponsesNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Get Diagnostics Categories. - * Get Diagnostics Categories. + * List Hosting Environment Detector Responses. + * List Hosting Environment Detector Responses. * - ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. - ServiceResponse> * @param siteName Site Name + ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. + ServiceResponse> * @param name Site Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<DiagnosticCategoryInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DetectorResponseInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listSiteDiagnosticCategoriesSinglePageAsync(final String resourceGroupName, final String siteName) { + public Observable>> listHostingEnvironmentDetectorResponsesSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } - if (siteName == null) { - throw new IllegalArgumentException("Parameter siteName 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-03-01"; - return service.listSiteDiagnosticCategories(resourceGroupName, siteName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listHostingEnvironmentDetectorResponses(resourceGroupName, name, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listSiteDiagnosticCategoriesDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listHostingEnvironmentDetectorResponsesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -276,93 +312,96 @@ public Observable>> call(Response< }); } - private ServiceResponse> listSiteDiagnosticCategoriesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listHostingEnvironmentDetectorResponsesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get Diagnostics Category. - * Get Diagnostics Category. + * Get Hosting Environment Detector Response. + * Get Hosting Environment Detector Response. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category + * @param name App Service Environment Name + * @param detectorName Detector Resource Name * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the DiagnosticCategoryInner object if successful. + * @return the DetectorResponseInner object if successful. */ - public DiagnosticCategoryInner getSiteDiagnosticCategory(String resourceGroupName, String siteName, String diagnosticCategory) { - return getSiteDiagnosticCategoryWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory).toBlocking().single().body(); + public DetectorResponseInner getHostingEnvironmentDetectorResponse(String resourceGroupName, String name, String detectorName) { + return getHostingEnvironmentDetectorResponseWithServiceResponseAsync(resourceGroupName, name, detectorName).toBlocking().single().body(); } /** - * Get Diagnostics Category. - * Get Diagnostics Category. + * Get Hosting Environment Detector Response. + * Get Hosting Environment Detector Response. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category + * @param name App Service Environment Name + * @param detectorName Detector Resource 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 getSiteDiagnosticCategoryAsync(String resourceGroupName, String siteName, String diagnosticCategory, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getSiteDiagnosticCategoryWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory), serviceCallback); + public ServiceFuture getHostingEnvironmentDetectorResponseAsync(String resourceGroupName, String name, String detectorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getHostingEnvironmentDetectorResponseWithServiceResponseAsync(resourceGroupName, name, detectorName), serviceCallback); } /** - * Get Diagnostics Category. - * Get Diagnostics Category. + * Get Hosting Environment Detector Response. + * Get Hosting Environment Detector Response. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category + * @param name App Service Environment Name + * @param detectorName Detector Resource Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DiagnosticCategoryInner object + * @return the observable to the DetectorResponseInner object */ - public Observable getSiteDiagnosticCategoryAsync(String resourceGroupName, String siteName, String diagnosticCategory) { - return getSiteDiagnosticCategoryWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory).map(new Func1, DiagnosticCategoryInner>() { + public Observable getHostingEnvironmentDetectorResponseAsync(String resourceGroupName, String name, String detectorName) { + return getHostingEnvironmentDetectorResponseWithServiceResponseAsync(resourceGroupName, name, detectorName).map(new Func1, DetectorResponseInner>() { @Override - public DiagnosticCategoryInner call(ServiceResponse response) { + public DetectorResponseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Get Diagnostics Category. - * Get Diagnostics Category. + * Get Hosting Environment Detector Response. + * Get Hosting Environment Detector Response. * * @param resourceGroupName Name of the resource group to which the resource belongs. - * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category + * @param name App Service Environment Name + * @param detectorName Detector Resource Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DiagnosticCategoryInner object + * @return the observable to the DetectorResponseInner object */ - public Observable> getSiteDiagnosticCategoryWithServiceResponseAsync(String resourceGroupName, String siteName, String diagnosticCategory) { + public Observable> getHostingEnvironmentDetectorResponseWithServiceResponseAsync(String resourceGroupName, String name, String detectorName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } - if (siteName == null) { - throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - if (diagnosticCategory == null) { - throw new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null."); + if (detectorName == null) { + throw new IllegalArgumentException("Parameter detectorName 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-03-01"; - return service.getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCategory, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final DateTime startTime = null; + final DateTime endTime = null; + final String timeGrain = null; + return service.getHostingEnvironmentDetectorResponse(resourceGroupName, name, detectorName, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = getSiteDiagnosticCategoryDelegate(response); + ServiceResponse clientResponse = getHostingEnvironmentDetectorResponseDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -371,133 +410,225 @@ public Observable> call(Response getSiteDiagnosticCategoryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + /** + * Get Hosting Environment Detector Response. + * Get Hosting Environment Detector Response. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name App Service Environment Name + * @param detectorName Detector Resource Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DetectorResponseInner object if successful. + */ + public DetectorResponseInner getHostingEnvironmentDetectorResponse(String resourceGroupName, String name, String detectorName, DateTime startTime, DateTime endTime, String timeGrain) { + return getHostingEnvironmentDetectorResponseWithServiceResponseAsync(resourceGroupName, name, detectorName, startTime, endTime, timeGrain).toBlocking().single().body(); + } + + /** + * Get Hosting Environment Detector Response. + * Get Hosting Environment Detector Response. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name App Service Environment Name + * @param detectorName Detector Resource Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain + * @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 getHostingEnvironmentDetectorResponseAsync(String resourceGroupName, String name, String detectorName, DateTime startTime, DateTime endTime, String timeGrain, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getHostingEnvironmentDetectorResponseWithServiceResponseAsync(resourceGroupName, name, detectorName, startTime, endTime, timeGrain), serviceCallback); + } + + /** + * Get Hosting Environment Detector Response. + * Get Hosting Environment Detector Response. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name App Service Environment Name + * @param detectorName Detector Resource Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DetectorResponseInner object + */ + public Observable getHostingEnvironmentDetectorResponseAsync(String resourceGroupName, String name, String detectorName, DateTime startTime, DateTime endTime, String timeGrain) { + return getHostingEnvironmentDetectorResponseWithServiceResponseAsync(resourceGroupName, name, detectorName, startTime, endTime, timeGrain).map(new Func1, DetectorResponseInner>() { + @Override + public DetectorResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Hosting Environment Detector Response. + * Get Hosting Environment Detector Response. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param name App Service Environment Name + * @param detectorName Detector Resource Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DetectorResponseInner object + */ + public Observable> getHostingEnvironmentDetectorResponseWithServiceResponseAsync(String resourceGroupName, String name, String detectorName, DateTime startTime, DateTime endTime, String timeGrain) { + 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 (detectorName == null) { + throw new IllegalArgumentException("Parameter detectorName 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-03-01"; + return service.getHostingEnvironmentDetectorResponse(resourceGroupName, name, detectorName, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getHostingEnvironmentDetectorResponseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getHostingEnvironmentDetectorResponseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get Site Analyses. - * Get Site Analyses. + * List Site Detector Responses. + * List Site Detector Responses. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException 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<AnalysisDefinitionInner> object if successful. + * @return the PagedList<DetectorResponseInner> object if successful. */ - public PagedList listSiteAnalyses(final String resourceGroupName, final String siteName, final String diagnosticCategory) { - ServiceResponse> response = listSiteAnalysesSinglePageAsync(resourceGroupName, siteName, diagnosticCategory).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listSiteDetectorResponses(final String resourceGroupName, final String siteName) { + ServiceResponse> response = listSiteDetectorResponsesSinglePageAsync(resourceGroupName, siteName).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return listSiteAnalysesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listSiteDetectorResponsesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Get Site Analyses. - * Get Site Analyses. + * List Site Detector Responses. + * List Site Detector Responses. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category * @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> listSiteAnalysesAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final ListOperationCallback serviceCallback) { + public ServiceFuture> listSiteDetectorResponsesAsync(final String resourceGroupName, final String siteName, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listSiteAnalysesSinglePageAsync(resourceGroupName, siteName, diagnosticCategory), - new Func1>>>() { + listSiteDetectorResponsesSinglePageAsync(resourceGroupName, siteName), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return listSiteAnalysesNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listSiteDetectorResponsesNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Get Site Analyses. - * Get Site Analyses. + * List Site Detector Responses. + * List Site Detector Responses. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AnalysisDefinitionInner> object + * @return the observable to the PagedList<DetectorResponseInner> object */ - public Observable> listSiteAnalysesAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { - return listSiteAnalysesWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory) - .map(new Func1>, Page>() { + public Observable> listSiteDetectorResponsesAsync(final String resourceGroupName, final String siteName) { + return listSiteDetectorResponsesWithServiceResponseAsync(resourceGroupName, siteName) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Get Site Analyses. - * Get Site Analyses. + * List Site Detector Responses. + * List Site Detector Responses. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<AnalysisDefinitionInner> object + * @return the observable to the PagedList<DetectorResponseInner> object */ - public Observable>> listSiteAnalysesWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { - return listSiteAnalysesSinglePageAsync(resourceGroupName, siteName, diagnosticCategory) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listSiteDetectorResponsesWithServiceResponseAsync(final String resourceGroupName, final String siteName) { + return listSiteDetectorResponsesSinglePageAsync(resourceGroupName, siteName) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(listSiteAnalysesNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listSiteDetectorResponsesNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Get Site Analyses. - * Get Site Analyses. + * List Site Detector Responses. + * List Site Detector Responses. * - ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. - ServiceResponse> * @param siteName Site Name - ServiceResponse> * @param diagnosticCategory Diagnostic Category + ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. + ServiceResponse> * @param siteName Site Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<AnalysisDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DetectorResponseInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listSiteAnalysesSinglePageAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { + public Observable>> listSiteDetectorResponsesSinglePageAsync(final String resourceGroupName, final String siteName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (siteName == null) { throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); } - if (diagnosticCategory == null) { - throw new IllegalArgumentException("Parameter diagnosticCategory 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-03-01"; - return service.listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listSiteDetectorResponses(resourceGroupName, siteName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listSiteAnalysesDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listSiteDetectorResponsesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -505,78 +636,980 @@ public Observable>> call(Response< }); } - private ServiceResponse> listSiteAnalysesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listSiteDetectorResponsesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get Site Analysis. - * Get Site Analysis. + * Get site detector response. + * Get site detector response. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category - * @param analysisName Analysis Name + * @param detectorName Detector Resource Name * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the DiagnosticAnalysisInner object if successful. + * @return the DetectorResponseInner object if successful. */ - public DiagnosticAnalysisInner getSiteAnalysis(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { - return getSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName).toBlocking().single().body(); + public DetectorResponseInner getSiteDetectorResponse(String resourceGroupName, String siteName, String detectorName) { + return getSiteDetectorResponseWithServiceResponseAsync(resourceGroupName, siteName, detectorName).toBlocking().single().body(); } /** - * Get Site Analysis. - * Get Site Analysis. + * Get site detector response. + * Get site detector response. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category - * @param analysisName Analysis Name + * @param detectorName Detector Resource 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 getSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName), serviceCallback); + public ServiceFuture getSiteDetectorResponseAsync(String resourceGroupName, String siteName, String detectorName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSiteDetectorResponseWithServiceResponseAsync(resourceGroupName, siteName, detectorName), serviceCallback); } /** - * Get Site Analysis. - * Get Site Analysis. + * Get site detector response. + * Get site detector response. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category - * @param analysisName Analysis Name + * @param detectorName Detector Resource Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DiagnosticAnalysisInner object + * @return the observable to the DetectorResponseInner object */ - public Observable getSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { - return getSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName).map(new Func1, DiagnosticAnalysisInner>() { + public Observable getSiteDetectorResponseAsync(String resourceGroupName, String siteName, String detectorName) { + return getSiteDetectorResponseWithServiceResponseAsync(resourceGroupName, siteName, detectorName).map(new Func1, DetectorResponseInner>() { @Override - public DiagnosticAnalysisInner call(ServiceResponse response) { + public DetectorResponseInner call(ServiceResponse response) { return response.body(); } }); } /** + * Get site detector response. + * Get site detector response. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param detectorName Detector Resource Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DetectorResponseInner object + */ + public Observable> getSiteDetectorResponseWithServiceResponseAsync(String resourceGroupName, String siteName, String detectorName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (siteName == null) { + throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); + } + if (detectorName == null) { + throw new IllegalArgumentException("Parameter detectorName 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-03-01"; + final DateTime startTime = null; + final DateTime endTime = null; + final String timeGrain = null; + return service.getSiteDetectorResponse(resourceGroupName, siteName, detectorName, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSiteDetectorResponseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get site detector response. + * Get site detector response. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param detectorName Detector Resource Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DetectorResponseInner object if successful. + */ + public DetectorResponseInner getSiteDetectorResponse(String resourceGroupName, String siteName, String detectorName, DateTime startTime, DateTime endTime, String timeGrain) { + return getSiteDetectorResponseWithServiceResponseAsync(resourceGroupName, siteName, detectorName, startTime, endTime, timeGrain).toBlocking().single().body(); + } + + /** + * Get site detector response. + * Get site detector response. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param detectorName Detector Resource Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain + * @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 getSiteDetectorResponseAsync(String resourceGroupName, String siteName, String detectorName, DateTime startTime, DateTime endTime, String timeGrain, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSiteDetectorResponseWithServiceResponseAsync(resourceGroupName, siteName, detectorName, startTime, endTime, timeGrain), serviceCallback); + } + + /** + * Get site detector response. + * Get site detector response. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param detectorName Detector Resource Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DetectorResponseInner object + */ + public Observable getSiteDetectorResponseAsync(String resourceGroupName, String siteName, String detectorName, DateTime startTime, DateTime endTime, String timeGrain) { + return getSiteDetectorResponseWithServiceResponseAsync(resourceGroupName, siteName, detectorName, startTime, endTime, timeGrain).map(new Func1, DetectorResponseInner>() { + @Override + public DetectorResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get site detector response. + * Get site detector response. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param detectorName Detector Resource Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DetectorResponseInner object + */ + public Observable> getSiteDetectorResponseWithServiceResponseAsync(String resourceGroupName, String siteName, String detectorName, DateTime startTime, DateTime endTime, String timeGrain) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (siteName == null) { + throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); + } + if (detectorName == null) { + throw new IllegalArgumentException("Parameter detectorName 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-03-01"; + return service.getSiteDetectorResponse(resourceGroupName, siteName, detectorName, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSiteDetectorResponseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSiteDetectorResponseDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get Diagnostics Categories. + * Get Diagnostics Categories. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<DiagnosticCategoryInner> object if successful. + */ + public PagedList listSiteDiagnosticCategories(final String resourceGroupName, final String siteName) { + ServiceResponse> response = listSiteDiagnosticCategoriesSinglePageAsync(resourceGroupName, siteName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSiteDiagnosticCategoriesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get Diagnostics Categories. + * Get Diagnostics Categories. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site 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> listSiteDiagnosticCategoriesAsync(final String resourceGroupName, final String siteName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSiteDiagnosticCategoriesSinglePageAsync(resourceGroupName, siteName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSiteDiagnosticCategoriesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get Diagnostics Categories. + * Get Diagnostics Categories. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DiagnosticCategoryInner> object + */ + public Observable> listSiteDiagnosticCategoriesAsync(final String resourceGroupName, final String siteName) { + return listSiteDiagnosticCategoriesWithServiceResponseAsync(resourceGroupName, siteName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get Diagnostics Categories. + * Get Diagnostics Categories. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DiagnosticCategoryInner> object + */ + public Observable>> listSiteDiagnosticCategoriesWithServiceResponseAsync(final String resourceGroupName, final String siteName) { + return listSiteDiagnosticCategoriesSinglePageAsync(resourceGroupName, siteName) + .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(listSiteDiagnosticCategoriesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get Diagnostics Categories. + * Get Diagnostics Categories. + * + ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. + ServiceResponse> * @param siteName Site Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DiagnosticCategoryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSiteDiagnosticCategoriesSinglePageAsync(final String resourceGroupName, final String siteName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (siteName == null) { + throw new IllegalArgumentException("Parameter siteName 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-03-01"; + return service.listSiteDiagnosticCategories(resourceGroupName, siteName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSiteDiagnosticCategoriesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSiteDiagnosticCategoriesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get Diagnostics Category. + * Get Diagnostics Category. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DiagnosticCategoryInner object if successful. + */ + public DiagnosticCategoryInner getSiteDiagnosticCategory(String resourceGroupName, String siteName, String diagnosticCategory) { + return getSiteDiagnosticCategoryWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory).toBlocking().single().body(); + } + + /** + * Get Diagnostics Category. + * Get Diagnostics Category. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @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 getSiteDiagnosticCategoryAsync(String resourceGroupName, String siteName, String diagnosticCategory, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSiteDiagnosticCategoryWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory), serviceCallback); + } + + /** + * Get Diagnostics Category. + * Get Diagnostics Category. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DiagnosticCategoryInner object + */ + public Observable getSiteDiagnosticCategoryAsync(String resourceGroupName, String siteName, String diagnosticCategory) { + return getSiteDiagnosticCategoryWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory).map(new Func1, DiagnosticCategoryInner>() { + @Override + public DiagnosticCategoryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get Diagnostics Category. + * Get Diagnostics Category. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DiagnosticCategoryInner object + */ + public Observable> getSiteDiagnosticCategoryWithServiceResponseAsync(String resourceGroupName, String siteName, String diagnosticCategory) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (siteName == null) { + throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); + } + if (diagnosticCategory == null) { + throw new IllegalArgumentException("Parameter diagnosticCategory 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-03-01"; + return service.getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCategory, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSiteDiagnosticCategoryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSiteDiagnosticCategoryDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get Site Analyses. + * Get Site Analyses. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<AnalysisDefinitionInner> object if successful. + */ + public PagedList listSiteAnalyses(final String resourceGroupName, final String siteName, final String diagnosticCategory) { + ServiceResponse> response = listSiteAnalysesSinglePageAsync(resourceGroupName, siteName, diagnosticCategory).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSiteAnalysesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get Site Analyses. + * Get Site Analyses. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @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> listSiteAnalysesAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSiteAnalysesSinglePageAsync(resourceGroupName, siteName, diagnosticCategory), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSiteAnalysesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get Site Analyses. + * Get Site Analyses. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AnalysisDefinitionInner> object + */ + public Observable> listSiteAnalysesAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { + return listSiteAnalysesWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get Site Analyses. + * Get Site Analyses. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AnalysisDefinitionInner> object + */ + public Observable>> listSiteAnalysesWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { + return listSiteAnalysesSinglePageAsync(resourceGroupName, siteName, diagnosticCategory) + .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(listSiteAnalysesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get Site Analyses. + * Get Site Analyses. + * + ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. + ServiceResponse> * @param siteName Site Name + ServiceResponse> * @param diagnosticCategory Diagnostic Category + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AnalysisDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSiteAnalysesSinglePageAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (siteName == null) { + throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); + } + if (diagnosticCategory == null) { + throw new IllegalArgumentException("Parameter diagnosticCategory 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-03-01"; + return service.listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSiteAnalysesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSiteAnalysesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get Site Analysis. + * Get Site Analysis. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @param analysisName Analysis Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DiagnosticAnalysisInner object if successful. + */ + public DiagnosticAnalysisInner getSiteAnalysis(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { + return getSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName).toBlocking().single().body(); + } + + /** + * Get Site Analysis. + * Get Site Analysis. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @param analysisName Analysis 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 getSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName), serviceCallback); + } + + /** + * Get Site Analysis. * Get Site Analysis. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @param analysisName Analysis Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DiagnosticAnalysisInner object + */ + public Observable getSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { + return getSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName).map(new Func1, DiagnosticAnalysisInner>() { + @Override + public DiagnosticAnalysisInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** * Get Site Analysis. + * Get Site Analysis. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @param analysisName Analysis Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DiagnosticAnalysisInner object + */ + public Observable> getSiteAnalysisWithServiceResponseAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (siteName == null) { + throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); + } + if (diagnosticCategory == null) { + throw new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null."); + } + if (analysisName == null) { + throw new IllegalArgumentException("Parameter analysisName 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-03-01"; + return service.getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSiteAnalysisDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSiteAnalysisDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Execute Analysis. + * Execute Analysis. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Category Name + * @param analysisName Analysis Resource Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DiagnosticAnalysisInner object if successful. + */ + public DiagnosticAnalysisInner executeSiteAnalysis(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { + return executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName).toBlocking().single().body(); + } + + /** + * Execute Analysis. + * Execute Analysis. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Category Name + * @param analysisName Analysis Resource 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 executeSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName), serviceCallback); + } + + /** + * Execute Analysis. + * Execute Analysis. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Category Name + * @param analysisName Analysis Resource Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DiagnosticAnalysisInner object + */ + public Observable executeSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { + return executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName).map(new Func1, DiagnosticAnalysisInner>() { + @Override + public DiagnosticAnalysisInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Execute Analysis. + * Execute Analysis. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Category Name + * @param analysisName Analysis Resource Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DiagnosticAnalysisInner object + */ + public Observable> executeSiteAnalysisWithServiceResponseAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (siteName == null) { + throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); + } + if (diagnosticCategory == null) { + throw new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null."); + } + if (analysisName == null) { + throw new IllegalArgumentException("Parameter analysisName 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-03-01"; + final DateTime startTime = null; + final DateTime endTime = null; + final String timeGrain = null; + return service.executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = executeSiteAnalysisDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Execute Analysis. + * Execute Analysis. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Category Name + * @param analysisName Analysis Resource Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DiagnosticAnalysisInner object if successful. + */ + public DiagnosticAnalysisInner executeSiteAnalysis(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, DateTime startTime, DateTime endTime, String timeGrain) { + return executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain).toBlocking().single().body(); + } + + /** + * Execute Analysis. + * Execute Analysis. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Category Name + * @param analysisName Analysis Resource Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain + * @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 executeSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, DateTime startTime, DateTime endTime, String timeGrain, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain), serviceCallback); + } + + /** + * Execute Analysis. + * Execute Analysis. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Category Name + * @param analysisName Analysis Resource Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DiagnosticAnalysisInner object + */ + public Observable executeSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, DateTime startTime, DateTime endTime, String timeGrain) { + return executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain).map(new Func1, DiagnosticAnalysisInner>() { + @Override + public DiagnosticAnalysisInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Execute Analysis. + * Execute Analysis. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Category Name + * @param analysisName Analysis Resource Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DiagnosticAnalysisInner object + */ + public Observable> executeSiteAnalysisWithServiceResponseAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, DateTime startTime, DateTime endTime, String timeGrain) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (siteName == null) { + throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); + } + if (diagnosticCategory == null) { + throw new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null."); + } + if (analysisName == null) { + throw new IllegalArgumentException("Parameter analysisName 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-03-01"; + return service.executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = executeSiteAnalysisDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse executeSiteAnalysisDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get Detectors. + * Get Detectors. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<DetectorDefinitionInner> object if successful. + */ + public PagedList listSiteDetectors(final String resourceGroupName, final String siteName, final String diagnosticCategory) { + ServiceResponse> response = listSiteDetectorsSinglePageAsync(resourceGroupName, siteName, diagnosticCategory).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSiteDetectorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get Detectors. + * Get Detectors. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @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> listSiteDetectorsAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSiteDetectorsSinglePageAsync(resourceGroupName, siteName, diagnosticCategory), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSiteDetectorsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get Detectors. + * Get Detectors. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name * @param diagnosticCategory Diagnostic Category - * @param analysisName Analysis Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DiagnosticAnalysisInner object + * @return the observable to the PagedList<DetectorDefinitionInner> object */ - public Observable> getSiteAnalysisWithServiceResponseAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { + public Observable> listSiteDetectorsAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { + return listSiteDetectorsWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get Detectors. + * Get Detectors. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site Name + * @param diagnosticCategory Diagnostic Category + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DetectorDefinitionInner> object + */ + public Observable>> listSiteDetectorsWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { + return listSiteDetectorsSinglePageAsync(resourceGroupName, siteName, diagnosticCategory) + .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(listSiteDetectorsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get Detectors. + * Get Detectors. + * + ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. + ServiceResponse> * @param siteName Site Name + ServiceResponse> * @param diagnosticCategory Diagnostic Category + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DetectorDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSiteDetectorsSinglePageAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -586,20 +1619,17 @@ public Observable> getSiteAnalysisWithS if (diagnosticCategory == null) { throw new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null."); } - if (analysisName == null) { - throw new IllegalArgumentException("Parameter analysisName 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-03-01"; - return service.getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = getSiteAnalysisDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listSiteDetectorsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -607,78 +1637,118 @@ public Observable> call(Response getSiteAnalysisDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse> listSiteDetectorsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Execute Analysis. - * Execute Analysis. + * Get Detector. + * Get Detector. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Category Name - * @param analysisName Analysis Resource Name + * @param diagnosticCategory Diagnostic Category + * @param detectorName Detector Name * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the DiagnosticAnalysisInner object if successful. + * @return the PagedList<DetectorDefinitionInner> object if successful. */ - public DiagnosticAnalysisInner executeSiteAnalysis(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { - return executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName).toBlocking().single().body(); + public PagedList getSiteDetector(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String detectorName) { + ServiceResponse> response = getSiteDetectorSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, detectorName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSiteDetectorNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** - * Execute Analysis. - * Execute Analysis. + * Get Detector. + * Get Detector. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Category Name - * @param analysisName Analysis Resource Name + * @param diagnosticCategory Diagnostic Category + * @param detectorName Detector 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 executeSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName), serviceCallback); + public ServiceFuture> getSiteDetectorAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String detectorName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSiteDetectorSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, detectorName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSiteDetectorNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** - * Execute Analysis. - * Execute Analysis. + * Get Detector. + * Get Detector. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Category Name - * @param analysisName Analysis Resource Name + * @param diagnosticCategory Diagnostic Category + * @param detectorName Detector Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DiagnosticAnalysisInner object + * @return the observable to the PagedList<DetectorDefinitionInner> object */ - public Observable executeSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { - return executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName).map(new Func1, DiagnosticAnalysisInner>() { - @Override - public DiagnosticAnalysisInner call(ServiceResponse response) { - return response.body(); - } - }); + public Observable> getSiteDetectorAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String detectorName) { + return getSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, detectorName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** - * Execute Analysis. - * Execute Analysis. + * Get Detector. + * Get Detector. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Category Name - * @param analysisName Analysis Resource Name + * @param diagnosticCategory Diagnostic Category + * @param detectorName Detector Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DiagnosticAnalysisInner object + * @return the observable to the PagedList<DetectorDefinitionInner> object */ - public Observable> executeSiteAnalysisWithServiceResponseAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName) { + public Observable>> getSiteDetectorWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String detectorName) { + return getSiteDetectorSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, detectorName) + .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(getSiteDetectorNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get Detector. + * Get Detector. + * + ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. + ServiceResponse> * @param siteName Site Name + ServiceResponse> * @param diagnosticCategory Diagnostic Category + ServiceResponse> * @param detectorName Detector Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DetectorDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSiteDetectorSinglePageAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String detectorName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -688,23 +1758,20 @@ public Observable> executeSiteAnalysisW if (diagnosticCategory == null) { throw new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null."); } - if (analysisName == null) { - throw new IllegalArgumentException("Parameter analysisName is required and cannot be null."); + if (detectorName == null) { + throw new IllegalArgumentException("Parameter detectorName 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-03-01"; - final DateTime startTime = null; - final DateTime endTime = null; - final String timeGrain = null; - return service.executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse clientResponse = executeSiteAnalysisDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = getSiteDetectorDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -712,105 +1779,103 @@ public Observable> call(Response> getSiteDetectorDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** - * Execute Analysis. - * Execute Analysis. + * Execute Detector. + * Execute Detector. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name + * @param detectorName Detector Resource Name * @param diagnosticCategory Category Name - * @param analysisName Analysis Resource Name - * @param startTime Start Time - * @param endTime End Time - * @param timeGrain Time Grain * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the DiagnosticAnalysisInner object if successful. + * @return the DiagnosticDetectorResponseInner object if successful. */ - public DiagnosticAnalysisInner executeSiteAnalysis(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, DateTime startTime, DateTime endTime, String timeGrain) { - return executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain).toBlocking().single().body(); + public DiagnosticDetectorResponseInner executeSiteDetector(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory) { + return executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory).toBlocking().single().body(); } /** - * Execute Analysis. - * Execute Analysis. + * Execute Detector. + * Execute Detector. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name + * @param detectorName Detector Resource Name * @param diagnosticCategory Category Name - * @param analysisName Analysis Resource Name - * @param startTime Start Time - * @param endTime End Time - * @param timeGrain Time Grain * @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 executeSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, DateTime startTime, DateTime endTime, String timeGrain, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain), serviceCallback); + public ServiceFuture executeSiteDetectorAsync(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory), serviceCallback); } /** - * Execute Analysis. - * Execute Analysis. + * Execute Detector. + * Execute Detector. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name + * @param detectorName Detector Resource Name * @param diagnosticCategory Category Name - * @param analysisName Analysis Resource Name - * @param startTime Start Time - * @param endTime End Time - * @param timeGrain Time Grain * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DiagnosticAnalysisInner object + * @return the observable to the DiagnosticDetectorResponseInner object */ - public Observable executeSiteAnalysisAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, DateTime startTime, DateTime endTime, String timeGrain) { - return executeSiteAnalysisWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain).map(new Func1, DiagnosticAnalysisInner>() { + public Observable executeSiteDetectorAsync(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory) { + return executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory).map(new Func1, DiagnosticDetectorResponseInner>() { @Override - public DiagnosticAnalysisInner call(ServiceResponse response) { + public DiagnosticDetectorResponseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Execute Analysis. - * Execute Analysis. + * Execute Detector. + * Execute Detector. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name + * @param detectorName Detector Resource Name * @param diagnosticCategory Category Name - * @param analysisName Analysis Resource Name - * @param startTime Start Time - * @param endTime End Time - * @param timeGrain Time Grain * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DiagnosticAnalysisInner object + * @return the observable to the DiagnosticDetectorResponseInner object */ - public Observable> executeSiteAnalysisWithServiceResponseAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, DateTime startTime, DateTime endTime, String timeGrain) { + public Observable> executeSiteDetectorWithServiceResponseAsync(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (siteName == null) { throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); } + if (detectorName == null) { + throw new IllegalArgumentException("Parameter detectorName is required and cannot be null."); + } if (diagnosticCategory == null) { throw new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null."); } - if (analysisName == null) { - throw new IllegalArgumentException("Parameter analysisName 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-03-01"; - return service.executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + final DateTime startTime = null; + final DateTime endTime = null; + final String timeGrain = null; + return service.executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = executeSiteAnalysisDelegate(response); + ServiceResponse clientResponse = executeSiteDetectorDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -819,119 +1884,92 @@ public Observable> call(Response executeSiteAnalysisDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** - * Get Detectors. - * Get Detectors. + * Execute Detector. + * Execute Detector. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category + * @param detectorName Detector Resource Name + * @param diagnosticCategory Category Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException 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<DetectorDefinitionInner> object if successful. + * @return the DiagnosticDetectorResponseInner object if successful. */ - public PagedList listSiteDetectors(final String resourceGroupName, final String siteName, final String diagnosticCategory) { - ServiceResponse> response = listSiteDetectorsSinglePageAsync(resourceGroupName, siteName, diagnosticCategory).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listSiteDetectorsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; + public DiagnosticDetectorResponseInner executeSiteDetector(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, DateTime startTime, DateTime endTime, String timeGrain) { + return executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain).toBlocking().single().body(); } /** - * Get Detectors. - * Get Detectors. + * Execute Detector. + * Execute Detector. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category + * @param detectorName Detector Resource Name + * @param diagnosticCategory Category Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain * @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> listSiteDetectorsAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listSiteDetectorsSinglePageAsync(resourceGroupName, siteName, diagnosticCategory), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listSiteDetectorsNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); + public ServiceFuture executeSiteDetectorAsync(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, DateTime startTime, DateTime endTime, String timeGrain, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain), serviceCallback); } /** - * Get Detectors. - * Get Detectors. + * Execute Detector. + * Execute Detector. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category + * @param detectorName Detector Resource Name + * @param diagnosticCategory Category Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<DetectorDefinitionInner> object + * @return the observable to the DiagnosticDetectorResponseInner object */ - public Observable> listSiteDetectorsAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { - return listSiteDetectorsWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable executeSiteDetectorAsync(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, DateTime startTime, DateTime endTime, String timeGrain) { + return executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain).map(new Func1, DiagnosticDetectorResponseInner>() { + @Override + public DiagnosticDetectorResponseInner call(ServiceResponse response) { + return response.body(); + } + }); } /** - * Get Detectors. - * Get Detectors. + * Execute Detector. + * Execute Detector. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<DetectorDefinitionInner> object - */ - public Observable>> listSiteDetectorsWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { - return listSiteDetectorsSinglePageAsync(resourceGroupName, siteName, diagnosticCategory) - .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(listSiteDetectorsNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Get Detectors. - * Get Detectors. - * - ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. - ServiceResponse> * @param siteName Site Name - ServiceResponse> * @param diagnosticCategory Diagnostic Category + * @param detectorName Detector Resource Name + * @param diagnosticCategory Category Name + * @param startTime Start Time + * @param endTime End Time + * @param timeGrain Time Grain * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<DetectorDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the observable to the DiagnosticDetectorResponseInner object */ - public Observable>> listSiteDetectorsSinglePageAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory) { + public Observable> executeSiteDetectorWithServiceResponseAsync(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, DateTime startTime, DateTime endTime, String timeGrain) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (siteName == null) { throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); } + if (detectorName == null) { + throw new IllegalArgumentException("Parameter detectorName is required and cannot be null."); + } if (diagnosticCategory == null) { throw new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null."); } @@ -939,13 +1977,13 @@ public Observable>> listSiteDetect throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2016-03-01"; - return service.listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable>> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse> result = listSiteDetectorsDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse clientResponse = executeSiteDetectorDelegate(response); + return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } @@ -953,141 +1991,133 @@ public Observable>> call(Response< }); } - private ServiceResponse> listSiteDetectorsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse executeSiteDetectorDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Get Detector. - * Get Detector. + * List Site Detector Responses. + * List Site Detector Responses. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category - * @param detectorName Detector Name + * @param slot Slot Name * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException 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<DetectorDefinitionInner> object if successful. + * @return the PagedList<DetectorResponseInner> object if successful. */ - public PagedList getSiteDetector(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String detectorName) { - ServiceResponse> response = getSiteDetectorSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, detectorName).toBlocking().single(); - return new PagedList(response.body()) { + public PagedList listSiteDetectorResponsesSlot(final String resourceGroupName, final String siteName, final String slot) { + ServiceResponse> response = listSiteDetectorResponsesSlotSinglePageAsync(resourceGroupName, siteName, slot).toBlocking().single(); + return new PagedList(response.body()) { @Override - public Page nextPage(String nextPageLink) { - return getSiteDetectorNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + public Page nextPage(String nextPageLink) { + return listSiteDetectorResponsesSlotNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } /** - * Get Detector. - * Get Detector. + * List Site Detector Responses. + * List Site Detector Responses. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category - * @param detectorName Detector Name + * @param slot Slot 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> getSiteDetectorAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String detectorName, final ListOperationCallback serviceCallback) { + public ServiceFuture> listSiteDetectorResponsesSlotAsync(final String resourceGroupName, final String siteName, final String slot, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - getSiteDetectorSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, detectorName), - new Func1>>>() { + listSiteDetectorResponsesSlotSinglePageAsync(resourceGroupName, siteName, slot), + new Func1>>>() { @Override - public Observable>> call(String nextPageLink) { - return getSiteDetectorNextSinglePageAsync(nextPageLink); + public Observable>> call(String nextPageLink) { + return listSiteDetectorResponsesSlotNextSinglePageAsync(nextPageLink); } }, serviceCallback); } /** - * Get Detector. - * Get Detector. + * List Site Detector Responses. + * List Site Detector Responses. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category - * @param detectorName Detector Name + * @param slot Slot Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<DetectorDefinitionInner> object + * @return the observable to the PagedList<DetectorResponseInner> object */ - public Observable> getSiteDetectorAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String detectorName) { - return getSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, diagnosticCategory, detectorName) - .map(new Func1>, Page>() { + public Observable> listSiteDetectorResponsesSlotAsync(final String resourceGroupName, final String siteName, final String slot) { + return listSiteDetectorResponsesSlotWithServiceResponseAsync(resourceGroupName, siteName, slot) + .map(new Func1>, Page>() { @Override - public Page call(ServiceResponse> response) { + public Page call(ServiceResponse> response) { return response.body(); } }); } /** - * Get Detector. - * Get Detector. + * List Site Detector Responses. + * List Site Detector Responses. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name - * @param diagnosticCategory Diagnostic Category - * @param detectorName Detector Name + * @param slot Slot Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<DetectorDefinitionInner> object + * @return the observable to the PagedList<DetectorResponseInner> object */ - public Observable>> getSiteDetectorWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String detectorName) { - return getSiteDetectorSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, detectorName) - .concatMap(new Func1>, Observable>>>() { + public Observable>> listSiteDetectorResponsesSlotWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String slot) { + return listSiteDetectorResponsesSlotSinglePageAsync(resourceGroupName, siteName, slot) + .concatMap(new Func1>, Observable>>>() { @Override - public Observable>> call(ServiceResponse> page) { + public Observable>> call(ServiceResponse> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } - return Observable.just(page).concatWith(getSiteDetectorNextWithServiceResponseAsync(nextPageLink)); + return Observable.just(page).concatWith(listSiteDetectorResponsesSlotNextWithServiceResponseAsync(nextPageLink)); } }); } /** - * Get Detector. - * Get Detector. + * List Site Detector Responses. + * List Site Detector Responses. * - ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. - ServiceResponse> * @param siteName Site Name - ServiceResponse> * @param diagnosticCategory Diagnostic Category - ServiceResponse> * @param detectorName Detector Name + ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. + ServiceResponse> * @param siteName Site Name + ServiceResponse> * @param slot Slot Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<DetectorDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DetectorResponseInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> getSiteDetectorSinglePageAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String detectorName) { + public Observable>> listSiteDetectorResponsesSlotSinglePageAsync(final String resourceGroupName, final String siteName, final String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (siteName == null) { throw new IllegalArgumentException("Parameter siteName is required and cannot be null."); } - if (diagnosticCategory == null) { - throw new IllegalArgumentException("Parameter diagnosticCategory is required and cannot be null."); - } - if (detectorName == null) { - throw new IllegalArgumentException("Parameter detectorName 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-03-01"; - return service.getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + return service.listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = getSiteDetectorDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); + ServiceResponse> result = listSiteDetectorResponsesSlotDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -1095,78 +2125,78 @@ public Observable>> call(Response< }); } - private ServiceResponse> getSiteDetectorDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listSiteDetectorResponsesSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } /** - * Execute Detector. - * Execute Detector. + * Get site detector response. + * Get site detector response. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name * @param detectorName Detector Resource Name - * @param diagnosticCategory Category Name + * @param slot Slot Name * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the DiagnosticDetectorResponseInner object if successful. + * @return the DetectorResponseInner object if successful. */ - public DiagnosticDetectorResponseInner executeSiteDetector(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory) { - return executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory).toBlocking().single().body(); + public DetectorResponseInner getSiteDetectorResponseSlot(String resourceGroupName, String siteName, String detectorName, String slot) { + return getSiteDetectorResponseSlotWithServiceResponseAsync(resourceGroupName, siteName, detectorName, slot).toBlocking().single().body(); } /** - * Execute Detector. - * Execute Detector. + * Get site detector response. + * Get site detector response. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name * @param detectorName Detector Resource Name - * @param diagnosticCategory Category Name + * @param slot Slot 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 executeSiteDetectorAsync(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory), serviceCallback); + public ServiceFuture getSiteDetectorResponseSlotAsync(String resourceGroupName, String siteName, String detectorName, String slot, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSiteDetectorResponseSlotWithServiceResponseAsync(resourceGroupName, siteName, detectorName, slot), serviceCallback); } /** - * Execute Detector. - * Execute Detector. + * Get site detector response. + * Get site detector response. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name * @param detectorName Detector Resource Name - * @param diagnosticCategory Category Name + * @param slot Slot Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DiagnosticDetectorResponseInner object + * @return the observable to the DetectorResponseInner object */ - public Observable executeSiteDetectorAsync(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory) { - return executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory).map(new Func1, DiagnosticDetectorResponseInner>() { + public Observable getSiteDetectorResponseSlotAsync(String resourceGroupName, String siteName, String detectorName, String slot) { + return getSiteDetectorResponseSlotWithServiceResponseAsync(resourceGroupName, siteName, detectorName, slot).map(new Func1, DetectorResponseInner>() { @Override - public DiagnosticDetectorResponseInner call(ServiceResponse response) { + public DetectorResponseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Execute Detector. - * Execute Detector. + * Get site detector response. + * Get site detector response. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name * @param detectorName Detector Resource Name - * @param diagnosticCategory Category Name + * @param slot Slot Name * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DiagnosticDetectorResponseInner object + * @return the observable to the DetectorResponseInner object */ - public Observable> executeSiteDetectorWithServiceResponseAsync(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory) { + public Observable> getSiteDetectorResponseSlotWithServiceResponseAsync(String resourceGroupName, String siteName, String detectorName, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1176,8 +2206,8 @@ public Observable> executeSiteD if (detectorName == null) { throw new IllegalArgumentException("Parameter detectorName is required and cannot be null."); } - if (diagnosticCategory == null) { - throw new IllegalArgumentException("Parameter diagnosticCategory 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."); @@ -1186,12 +2216,12 @@ public Observable> executeSiteD final DateTime startTime = null; final DateTime endTime = null; final String timeGrain = null; - return service.executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = executeSiteDetectorDelegate(response); + ServiceResponse clientResponse = getSiteDetectorResponseSlotDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1200,34 +2230,34 @@ public Observable> call(Respons }); } - /** - * Execute Detector. - * Execute Detector. + /** + * Get site detector response. + * Get site detector response. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name * @param detectorName Detector Resource Name - * @param diagnosticCategory Category Name + * @param slot Slot Name * @param startTime Start Time * @param endTime End Time * @param timeGrain Time Grain * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the DiagnosticDetectorResponseInner object if successful. + * @return the DetectorResponseInner object if successful. */ - public DiagnosticDetectorResponseInner executeSiteDetector(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, DateTime startTime, DateTime endTime, String timeGrain) { - return executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain).toBlocking().single().body(); + public DetectorResponseInner getSiteDetectorResponseSlot(String resourceGroupName, String siteName, String detectorName, String slot, DateTime startTime, DateTime endTime, String timeGrain) { + return getSiteDetectorResponseSlotWithServiceResponseAsync(resourceGroupName, siteName, detectorName, slot, startTime, endTime, timeGrain).toBlocking().single().body(); } /** - * Execute Detector. - * Execute Detector. + * Get site detector response. + * Get site detector response. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name * @param detectorName Detector Resource Name - * @param diagnosticCategory Category Name + * @param slot Slot Name * @param startTime Start Time * @param endTime End Time * @param timeGrain Time Grain @@ -1235,48 +2265,48 @@ public DiagnosticDetectorResponseInner executeSiteDetector(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture executeSiteDetectorAsync(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, DateTime startTime, DateTime endTime, String timeGrain, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain), serviceCallback); + public ServiceFuture getSiteDetectorResponseSlotAsync(String resourceGroupName, String siteName, String detectorName, String slot, DateTime startTime, DateTime endTime, String timeGrain, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSiteDetectorResponseSlotWithServiceResponseAsync(resourceGroupName, siteName, detectorName, slot, startTime, endTime, timeGrain), serviceCallback); } /** - * Execute Detector. - * Execute Detector. + * Get site detector response. + * Get site detector response. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name * @param detectorName Detector Resource Name - * @param diagnosticCategory Category Name + * @param slot Slot Name * @param startTime Start Time * @param endTime End Time * @param timeGrain Time Grain * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DiagnosticDetectorResponseInner object + * @return the observable to the DetectorResponseInner object */ - public Observable executeSiteDetectorAsync(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, DateTime startTime, DateTime endTime, String timeGrain) { - return executeSiteDetectorWithServiceResponseAsync(resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain).map(new Func1, DiagnosticDetectorResponseInner>() { + public Observable getSiteDetectorResponseSlotAsync(String resourceGroupName, String siteName, String detectorName, String slot, DateTime startTime, DateTime endTime, String timeGrain) { + return getSiteDetectorResponseSlotWithServiceResponseAsync(resourceGroupName, siteName, detectorName, slot, startTime, endTime, timeGrain).map(new Func1, DetectorResponseInner>() { @Override - public DiagnosticDetectorResponseInner call(ServiceResponse response) { + public DetectorResponseInner call(ServiceResponse response) { return response.body(); } }); } /** - * Execute Detector. - * Execute Detector. + * Get site detector response. + * Get site detector response. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Site Name * @param detectorName Detector Resource Name - * @param diagnosticCategory Category Name + * @param slot Slot Name * @param startTime Start Time * @param endTime End Time * @param timeGrain Time Grain * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the DiagnosticDetectorResponseInner object + * @return the observable to the DetectorResponseInner object */ - public Observable> executeSiteDetectorWithServiceResponseAsync(String resourceGroupName, String siteName, String detectorName, String diagnosticCategory, DateTime startTime, DateTime endTime, String timeGrain) { + public Observable> getSiteDetectorResponseSlotWithServiceResponseAsync(String resourceGroupName, String siteName, String detectorName, String slot, DateTime startTime, DateTime endTime, String timeGrain) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1286,19 +2316,19 @@ public Observable> executeSiteD if (detectorName == null) { throw new IllegalArgumentException("Parameter detectorName is required and cannot be null."); } - if (diagnosticCategory == null) { - throw new IllegalArgumentException("Parameter diagnosticCategory 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-03-01"; - return service.executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { + return service.getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, this.client.subscriptionId(), startTime, endTime, timeGrain, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { @Override - public Observable> call(Response response) { + public Observable> call(Response response) { try { - ServiceResponse clientResponse = executeSiteDetectorDelegate(response); + ServiceResponse clientResponse = getSiteDetectorResponseSlotDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -1307,9 +2337,9 @@ public Observable> call(Respons }); } - private ServiceResponse executeSiteDetectorDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) + private ServiceResponse getSiteDetectorResponseSlotDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -2545,6 +3575,238 @@ private ServiceResponse executeSiteDetectorSlot .build(response); } + /** + * List Hosting Environment Detector Responses. + * List Hosting Environment Detector Responses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<DetectorResponseInner> object if successful. + */ + public PagedList listHostingEnvironmentDetectorResponsesNext(final String nextPageLink) { + ServiceResponse> response = listHostingEnvironmentDetectorResponsesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listHostingEnvironmentDetectorResponsesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Hosting Environment Detector Responses. + * List Hosting Environment Detector Responses. + * + * @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> listHostingEnvironmentDetectorResponsesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listHostingEnvironmentDetectorResponsesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listHostingEnvironmentDetectorResponsesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Hosting Environment Detector Responses. + * List Hosting Environment Detector Responses. + * + * @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<DetectorResponseInner> object + */ + public Observable> listHostingEnvironmentDetectorResponsesNextAsync(final String nextPageLink) { + return listHostingEnvironmentDetectorResponsesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Hosting Environment Detector Responses. + * List Hosting Environment Detector Responses. + * + * @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<DetectorResponseInner> object + */ + public Observable>> listHostingEnvironmentDetectorResponsesNextWithServiceResponseAsync(final String nextPageLink) { + return listHostingEnvironmentDetectorResponsesNextSinglePageAsync(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(listHostingEnvironmentDetectorResponsesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Hosting Environment Detector Responses. + * List Hosting Environment Detector Responses. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DetectorResponseInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listHostingEnvironmentDetectorResponsesNextSinglePageAsync(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.listHostingEnvironmentDetectorResponsesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listHostingEnvironmentDetectorResponsesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listHostingEnvironmentDetectorResponsesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List Site Detector Responses. + * List Site Detector Responses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<DetectorResponseInner> object if successful. + */ + public PagedList listSiteDetectorResponsesNext(final String nextPageLink) { + ServiceResponse> response = listSiteDetectorResponsesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSiteDetectorResponsesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Site Detector Responses. + * List Site Detector Responses. + * + * @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> listSiteDetectorResponsesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSiteDetectorResponsesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSiteDetectorResponsesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Site Detector Responses. + * List Site Detector Responses. + * + * @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<DetectorResponseInner> object + */ + public Observable> listSiteDetectorResponsesNextAsync(final String nextPageLink) { + return listSiteDetectorResponsesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Site Detector Responses. + * List Site Detector Responses. + * + * @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<DetectorResponseInner> object + */ + public Observable>> listSiteDetectorResponsesNextWithServiceResponseAsync(final String nextPageLink) { + return listSiteDetectorResponsesNextSinglePageAsync(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(listSiteDetectorResponsesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Site Detector Responses. + * List Site Detector Responses. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DetectorResponseInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSiteDetectorResponsesNextSinglePageAsync(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.listSiteDetectorResponsesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSiteDetectorResponsesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSiteDetectorResponsesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Get Diagnostics Categories. * Get Diagnostics Categories. @@ -3009,6 +4271,122 @@ private ServiceResponse> getSiteDetectorNextDe .build(response); } + /** + * List Site Detector Responses. + * List Site Detector Responses. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<DetectorResponseInner> object if successful. + */ + public PagedList listSiteDetectorResponsesSlotNext(final String nextPageLink) { + ServiceResponse> response = listSiteDetectorResponsesSlotNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listSiteDetectorResponsesSlotNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List Site Detector Responses. + * List Site Detector Responses. + * + * @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> listSiteDetectorResponsesSlotNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSiteDetectorResponsesSlotNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listSiteDetectorResponsesSlotNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List Site Detector Responses. + * List Site Detector Responses. + * + * @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<DetectorResponseInner> object + */ + public Observable> listSiteDetectorResponsesSlotNextAsync(final String nextPageLink) { + return listSiteDetectorResponsesSlotNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List Site Detector Responses. + * List Site Detector Responses. + * + * @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<DetectorResponseInner> object + */ + public Observable>> listSiteDetectorResponsesSlotNextWithServiceResponseAsync(final String nextPageLink) { + return listSiteDetectorResponsesSlotNextSinglePageAsync(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(listSiteDetectorResponsesSlotNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List Site Detector Responses. + * List Site Detector Responses. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DetectorResponseInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSiteDetectorResponsesSlotNextSinglePageAsync(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.listSiteDetectorResponsesSlotNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listSiteDetectorResponsesSlotNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listSiteDetectorResponsesSlotNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Get Diagnostics Categories. * Get Diagnostics Categories. diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/RecommendationInner.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/RecommendationInner.java index e07ce8a4588..7dabbc8253f 100644 --- a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/RecommendationInner.java +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/RecommendationInner.java @@ -15,28 +15,31 @@ import com.microsoft.azure.management.web.Channels; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.web.ProxyOnlyResource; /** * Represents a recommendation result generated by the recommendation engine. */ -public class RecommendationInner { +@JsonFlatten +public class RecommendationInner extends ProxyOnlyResource { /** * Timestamp when this instance was created. */ - @JsonProperty(value = "creationTime") + @JsonProperty(value = "properties.creationTime") private DateTime creationTime; /** * A GUID value that each recommendation object is associated with. */ - @JsonProperty(value = "recommendationId") + @JsonProperty(value = "properties.recommendationId") private UUID recommendationId; /** * Full ARM resource ID string that this recommendation object is * associated with. */ - @JsonProperty(value = "resourceId") + @JsonProperty(value = "properties.resourceId") private String resourceId; /** @@ -44,25 +47,25 @@ public class RecommendationInner { * ServerFarm, Site. Possible values include: 'ServerFarm', 'Subscription', * 'WebSite'. */ - @JsonProperty(value = "resourceScope") + @JsonProperty(value = "properties.resourceScope") private ResourceScopeType resourceScope; /** * Unique name of the rule. */ - @JsonProperty(value = "ruleName") + @JsonProperty(value = "properties.ruleName") private String ruleName; /** * UI friendly name of the rule (may not be unique). */ - @JsonProperty(value = "displayName") + @JsonProperty(value = "properties.displayName") private String displayName; /** * Recommendation text. */ - @JsonProperty(value = "message") + @JsonProperty(value = "properties.message") private String message; /** @@ -70,88 +73,88 @@ public class RecommendationInner { * values include: 'Critical', 'Warning', 'Information', * 'NonUrgentSuggestion'. */ - @JsonProperty(value = "level") + @JsonProperty(value = "properties.level") private NotificationLevel level; /** * List of channels that this recommendation can apply. Possible values * include: 'Notification', 'Api', 'Email', 'Webhook', 'All'. */ - @JsonProperty(value = "channels") + @JsonProperty(value = "properties.channels") private Channels channels; /** * The list of category tags that this recommendation belongs to. */ - @JsonProperty(value = "tags") + @JsonProperty(value = "properties.tags") private List tags; /** * Name of action recommended by this object. */ - @JsonProperty(value = "actionName") + @JsonProperty(value = "properties.actionName") private String actionName; /** * The beginning time in UTC of a range that the recommendation refers to. */ - @JsonProperty(value = "startTime") + @JsonProperty(value = "properties.startTime") private DateTime startTime; /** * The end time in UTC of a range that the recommendation refers to. */ - @JsonProperty(value = "endTime") + @JsonProperty(value = "properties.endTime") private DateTime endTime; /** * When to notify this recommendation next in UTC. Null means that this * will never be notified anymore. */ - @JsonProperty(value = "nextNotificationTime") + @JsonProperty(value = "properties.nextNotificationTime") private DateTime nextNotificationTime; /** * Date and time in UTC when this notification expires. */ - @JsonProperty(value = "notificationExpirationTime") + @JsonProperty(value = "properties.notificationExpirationTime") private DateTime notificationExpirationTime; /** * Last timestamp in UTC this instance was actually notified. Null means * that this recommendation hasn't been notified yet. */ - @JsonProperty(value = "notifiedTime") + @JsonProperty(value = "properties.notifiedTime") private DateTime notifiedTime; /** * A metric value measured by the rule. */ - @JsonProperty(value = "score") + @JsonProperty(value = "properties.score") private Double score; /** * True if this is associated with a dynamically added rule. */ - @JsonProperty(value = "isDynamic") + @JsonProperty(value = "properties.isDynamic") private Boolean isDynamic; /** * Extension name of the portal if exists. */ - @JsonProperty(value = "extensionName") + @JsonProperty(value = "properties.extensionName") private String extensionName; /** * Deep link to a blade on the portal. */ - @JsonProperty(value = "bladeName") + @JsonProperty(value = "properties.bladeName") private String bladeName; /** * Forward link to an external document associated with the rule. */ - @JsonProperty(value = "forwardLink") + @JsonProperty(value = "properties.forwardLink") private String forwardLink; /** diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/RecommendationRuleInner.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/RecommendationRuleInner.java index ebda65a55c5..20b7d412ddd 100644 --- a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/RecommendationRuleInner.java +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/RecommendationRuleInner.java @@ -13,27 +13,30 @@ import com.microsoft.azure.management.web.Channels; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.web.ProxyOnlyResource; /** * Represents a recommendation rule that the recommendation engine can perform. */ -public class RecommendationRuleInner { +@JsonFlatten +public class RecommendationRuleInner extends ProxyOnlyResource { /** * Unique name of the rule. */ - @JsonProperty(value = "name") - private String name; + @JsonProperty(value = "properties.name") + private String recommendationRuleName; /** * UI friendly name of the rule. */ - @JsonProperty(value = "displayName") + @JsonProperty(value = "properties.displayName") private String displayName; /** * Localized name of the rule (Good for UI). */ - @JsonProperty(value = "message") + @JsonProperty(value = "properties.message") private String message; /** @@ -41,83 +44,83 @@ public class RecommendationRuleInner { * rule, if exists. * If such an object doesn't exist, it is set to null. */ - @JsonProperty(value = "recommendationId") + @JsonProperty(value = "properties.recommendationId") private UUID recommendationId; /** * Localized detailed description of the rule. */ - @JsonProperty(value = "description") + @JsonProperty(value = "properties.description") private String description; /** * Name of action that is recommended by this rule in string. */ - @JsonProperty(value = "actionName") + @JsonProperty(value = "properties.actionName") private String actionName; /** * Level of impact indicating how critical this rule is. Possible values * include: 'Critical', 'Warning', 'Information', 'NonUrgentSuggestion'. */ - @JsonProperty(value = "level") + @JsonProperty(value = "properties.level") private NotificationLevel level; /** * List of available channels that this rule applies. Possible values * include: 'Notification', 'Api', 'Email', 'Webhook', 'All'. */ - @JsonProperty(value = "channels") + @JsonProperty(value = "properties.channels") private Channels channels; /** * An array of category tags that the rule contains. */ - @JsonProperty(value = "tags") + @JsonProperty(value = "properties.tags") private List tags; /** * True if this is associated with a dynamically added rule. */ - @JsonProperty(value = "isDynamic") + @JsonProperty(value = "properties.isDynamic") private Boolean isDynamic; /** * Extension name of the portal if exists. Applicable to dynamic rule only. */ - @JsonProperty(value = "extensionName") + @JsonProperty(value = "properties.extensionName") private String extensionName; /** * Deep link to a blade on the portal. Applicable to dynamic rule only. */ - @JsonProperty(value = "bladeName") + @JsonProperty(value = "properties.bladeName") private String bladeName; /** * Forward link to an external document associated with the rule. * Applicable to dynamic rule only. */ - @JsonProperty(value = "forwardLink") + @JsonProperty(value = "properties.forwardLink") private String forwardLink; /** - * Get the name value. + * Get the recommendationRuleName value. * - * @return the name value + * @return the recommendationRuleName value */ - public String name() { - return this.name; + public String recommendationRuleName() { + return this.recommendationRuleName; } /** - * Set the name value. + * Set the recommendationRuleName value. * - * @param name the name value to set + * @param recommendationRuleName the recommendationRuleName value to set * @return the RecommendationRuleInner object itself. */ - public RecommendationRuleInner withName(String name) { - this.name = name; + public RecommendationRuleInner withRecommendationRuleName(String recommendationRuleName) { + this.recommendationRuleName = recommendationRuleName; return this; } diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/RecommendationsInner.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/RecommendationsInner.java index 65565799b6f..489f62d4c17 100644 --- a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/RecommendationsInner.java +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/RecommendationsInner.java @@ -10,7 +10,9 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -25,6 +27,7 @@ import retrofit2.http.Path; import retrofit2.http.POST; import retrofit2.http.Query; +import retrofit2.http.Url; import retrofit2.Response; import rx.functions.Func1; import rx.Observable; @@ -63,6 +66,10 @@ interface RecommendationsService { @POST("subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset") Observable> resetAllFilters(@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.web.Recommendations disableRecommendationForSubscription" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable") + Observable> disableRecommendationForSubscription(@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.web.Recommendations listHistoryForWebApp" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory") Observable> listHistoryForWebApp(@Path("resourceGroupName") String resourceGroupName, @Path("siteName") String siteName, @Path("subscriptionId") String subscriptionId, @Query(value = "$filter", encoded = true) String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -81,7 +88,23 @@ interface RecommendationsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.web.Recommendations getRuleDetailsByWebApp" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}") - Observable> getRuleDetailsByWebApp(@Path("resourceGroupName") String resourceGroupName, @Path("siteName") String siteName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("updateSeen") Boolean updateSeen, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> getRuleDetailsByWebApp(@Path("resourceGroupName") String resourceGroupName, @Path("siteName") String siteName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("updateSeen") Boolean updateSeen, @Query("recommendationId") String recommendationId, @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.web.Recommendations disableRecommendationForSite" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable") + Observable> disableRecommendationForSite(@Path("resourceGroupName") String resourceGroupName, @Path("siteName") String siteName, @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.web.Recommendations listNext" }) + @GET + Observable> listNext(@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.web.Recommendations listHistoryForWebAppNext" }) + @GET + Observable> listHistoryForWebAppNext(@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.web.Recommendations listRecommendedRulesForWebAppNext" }) + @GET + Observable> listRecommendedRulesForWebAppNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } @@ -89,16 +112,17 @@ interface RecommendationsService { * List all recommendations for a subscription. * List all recommendations for a subscription. * - * @return the PagedList object if successful. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<RecommendationInner> object if successful. */ public PagedList list() { - PageImpl1 page = new PageImpl1<>(); - page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); - page.setNextPageLink(null); - return new PagedList(page) { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { - return null; + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } @@ -108,36 +132,67 @@ public Page nextPage(String nextPageLink) { * List all recommendations for a subscription. * * @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> listAsync(final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** * List all recommendations for a subscription. * List all recommendations for a subscription. * - * @return the observable to the List<RecommendationInner> object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationInner> object */ public Observable> listAsync() { - return listWithServiceResponseAsync().map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - PageImpl1 page = new PageImpl1<>(); - page.setItems(response.body()); - return page; - } - }); + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all recommendations for a subscription. + * List all recommendations for a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .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(listNextWithServiceResponseAsync(nextPageLink)); + } + }); } /** * List all recommendations for a subscription. * List all recommendations for a subscription. * - * @return the observable to the List<RecommendationInner> object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecommendationInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listWithServiceResponseAsync() { + public Observable>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -145,13 +200,12 @@ public Observable>> listWithServiceRes final Boolean featured = null; final String filter = null; return service.list(this.client.subscriptionId(), featured, filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); - return Observable.just(clientResponse); + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -165,16 +219,17 @@ public Observable>> call(Response object if successful. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<RecommendationInner> object if successful. */ - public PagedList list(Boolean featured, String filter) { - PageImpl1 page = new PageImpl1<>(); - page.setItems(listWithServiceResponseAsync(featured, filter).toBlocking().single().body()); - page.setNextPageLink(null); - return new PagedList(page) { + public PagedList list(final Boolean featured, final String filter) { + ServiceResponse> response = listSinglePageAsync(featured, filter).toBlocking().single(); + return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { - return null; + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; } @@ -186,10 +241,19 @@ public Page nextPage(String nextPageLink) { * @param featured Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. * @param filter Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[PT1H|PT1M|P1D] * @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> listAsync(Boolean featured, String filter, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listWithServiceResponseAsync(featured, filter), serviceCallback); + public ServiceFuture> listAsync(final Boolean featured, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(featured, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** @@ -198,17 +262,17 @@ public ServiceFuture> listAsync(Boolean featured, Stri * * @param featured Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. * @param filter Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[PT1H|PT1M|P1D] - * @return the observable to the List<RecommendationInner> object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationInner> object */ - public Observable> listAsync(Boolean featured, String filter) { - return listWithServiceResponseAsync(featured, filter).map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - PageImpl1 page = new PageImpl1<>(); - page.setItems(response.body()); - return page; - } - }); + public Observable> listAsync(final Boolean featured, final String filter) { + return listWithServiceResponseAsync(featured, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** @@ -217,21 +281,44 @@ public Page call(ServiceResponse> * * @param featured Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. * @param filter Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[PT1H|PT1M|P1D] - * @return the observable to the List<RecommendationInner> object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationInner> object */ - public Observable>> listWithServiceResponseAsync(Boolean featured, String filter) { + public Observable>> listWithServiceResponseAsync(final Boolean featured, final String filter) { + return listSinglePageAsync(featured, filter) + .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(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all recommendations for a subscription. + * List all recommendations for a subscription. + * + ServiceResponse> * @param featured Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + ServiceResponse> * @param filter Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[PT1H|PT1M|P1D] + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecommendationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final Boolean featured, final String filter) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2016-03-01"; return service.list(this.client.subscriptionId(), featured, filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> result = listDelegate(response); - ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); - return Observable.just(clientResponse); + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -239,9 +326,9 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -319,6 +406,86 @@ private ServiceResponse resetAllFiltersDelegate(Response res .build(response); } + /** + * Disables the specified rule so it will not apply to a subscription in the future. + * Disables the specified rule so it will not apply to a subscription in the future. + * + * @param name Rule name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disableRecommendationForSubscription(String name) { + disableRecommendationForSubscriptionWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Disables the specified rule so it will not apply to a subscription in the future. + * Disables the specified rule so it will not apply to a subscription in the future. + * + * @param name Rule 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 disableRecommendationForSubscriptionAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableRecommendationForSubscriptionWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Disables the specified rule so it will not apply to a subscription in the future. + * Disables the specified rule so it will not apply to a subscription in the future. + * + * @param name Rule name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disableRecommendationForSubscriptionAsync(String name) { + return disableRecommendationForSubscriptionWithServiceResponseAsync(name).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables the specified rule so it will not apply to a subscription in the future. + * Disables the specified rule so it will not apply to a subscription in the future. + * + * @param name Rule name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disableRecommendationForSubscriptionWithServiceResponseAsync(String name) { + 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-03-01"; + return service.disableRecommendationForSubscription(name, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disableRecommendationForSubscriptionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse disableRecommendationForSubscriptionDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Get past recommendations for an app, optionally specified by the time range. * Get past recommendations for an app, optionally specified by the time range. @@ -328,10 +495,16 @@ private ServiceResponse resetAllFiltersDelegate(Response res * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the List<RecommendationInner> object if successful. + * @return the PagedList<RecommendationInner> object if successful. */ - public List listHistoryForWebApp(String resourceGroupName, String siteName) { - return listHistoryForWebAppWithServiceResponseAsync(resourceGroupName, siteName).toBlocking().single().body(); + public PagedList listHistoryForWebApp(final String resourceGroupName, final String siteName) { + ServiceResponse> response = listHistoryForWebAppSinglePageAsync(resourceGroupName, siteName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listHistoryForWebAppNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** @@ -344,8 +517,16 @@ public List listHistoryForWebApp(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listHistoryForWebAppAsync(String resourceGroupName, String siteName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listHistoryForWebAppWithServiceResponseAsync(resourceGroupName, siteName), serviceCallback); + public ServiceFuture> listHistoryForWebAppAsync(final String resourceGroupName, final String siteName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listHistoryForWebAppSinglePageAsync(resourceGroupName, siteName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listHistoryForWebAppNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** @@ -355,15 +536,16 @@ public ServiceFuture> listHistoryForWebAppAsync(String * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Name of the app. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<RecommendationInner> object + * @return the observable to the PagedList<RecommendationInner> object */ - public Observable> listHistoryForWebAppAsync(String resourceGroupName, String siteName) { - return listHistoryForWebAppWithServiceResponseAsync(resourceGroupName, siteName).map(new Func1>, List>() { - @Override - public List call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable> listHistoryForWebAppAsync(final String resourceGroupName, final String siteName) { + return listHistoryForWebAppWithServiceResponseAsync(resourceGroupName, siteName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** @@ -373,9 +555,32 @@ public List call(ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Name of the app. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<RecommendationInner> object + * @return the observable to the PagedList<RecommendationInner> object */ - public Observable>> listHistoryForWebAppWithServiceResponseAsync(String resourceGroupName, String siteName) { + public Observable>> listHistoryForWebAppWithServiceResponseAsync(final String resourceGroupName, final String siteName) { + return listHistoryForWebAppSinglePageAsync(resourceGroupName, siteName) + .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(listHistoryForWebAppNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get past recommendations for an app, optionally specified by the time range. + * Get past recommendations for an app, optionally specified by the time range. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecommendationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listHistoryForWebAppSinglePageAsync(final String resourceGroupName, final String siteName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -388,12 +593,12 @@ public Observable>> listHistoryForWebA final String apiVersion = "2016-03-01"; final String filter = null; return service.listHistoryForWebApp(resourceGroupName, siteName, this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> clientResponse = listHistoryForWebAppDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listHistoryForWebAppDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -411,10 +616,16 @@ public Observable>> call(Response listHistoryForWebApp(String resourceGroupName, String siteName, String filter) { - return listHistoryForWebAppWithServiceResponseAsync(resourceGroupName, siteName, filter).toBlocking().single().body(); + public PagedList listHistoryForWebApp(final String resourceGroupName, final String siteName, final String filter) { + ServiceResponse> response = listHistoryForWebAppSinglePageAsync(resourceGroupName, siteName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listHistoryForWebAppNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** @@ -428,8 +639,16 @@ public List listHistoryForWebApp(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listHistoryForWebAppAsync(String resourceGroupName, String siteName, String filter, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listHistoryForWebAppWithServiceResponseAsync(resourceGroupName, siteName, filter), serviceCallback); + public ServiceFuture> listHistoryForWebAppAsync(final String resourceGroupName, final String siteName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listHistoryForWebAppSinglePageAsync(resourceGroupName, siteName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listHistoryForWebAppNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** @@ -440,15 +659,16 @@ public ServiceFuture> listHistoryForWebAppAsync(String * @param siteName Name of the app. * @param filter Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[PT1H|PT1M|P1D] * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<RecommendationInner> object + * @return the observable to the PagedList<RecommendationInner> object */ - public Observable> listHistoryForWebAppAsync(String resourceGroupName, String siteName, String filter) { - return listHistoryForWebAppWithServiceResponseAsync(resourceGroupName, siteName, filter).map(new Func1>, List>() { - @Override - public List call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable> listHistoryForWebAppAsync(final String resourceGroupName, final String siteName, final String filter) { + return listHistoryForWebAppWithServiceResponseAsync(resourceGroupName, siteName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** @@ -459,9 +679,33 @@ public List call(ServiceResponse> * @param siteName Name of the app. * @param filter Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[PT1H|PT1M|P1D] * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<RecommendationInner> object + * @return the observable to the PagedList<RecommendationInner> object + */ + public Observable>> listHistoryForWebAppWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String filter) { + return listHistoryForWebAppSinglePageAsync(resourceGroupName, siteName, filter) + .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(listHistoryForWebAppNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get past recommendations for an app, optionally specified by the time range. + * Get past recommendations for an app, optionally specified by the time range. + * + ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. + ServiceResponse> * @param siteName Name of the app. + ServiceResponse> * @param filter Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[PT1H|PT1M|P1D] + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecommendationInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listHistoryForWebAppWithServiceResponseAsync(String resourceGroupName, String siteName, String filter) { + public Observable>> listHistoryForWebAppSinglePageAsync(final String resourceGroupName, final String siteName, final String filter) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -473,12 +717,12 @@ public Observable>> listHistoryForWebA } final String apiVersion = "2016-03-01"; return service.listHistoryForWebApp(resourceGroupName, siteName, this.client.subscriptionId(), filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> clientResponse = listHistoryForWebAppDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listHistoryForWebAppDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -486,9 +730,9 @@ public Observable>> call(Response> listHistoryForWebAppDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listHistoryForWebAppDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -502,10 +746,16 @@ private ServiceResponse> listHistoryForWebAppDelegate( * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the List<RecommendationInner> object if successful. + * @return the PagedList<RecommendationInner> object if successful. */ - public List listRecommendedRulesForWebApp(String resourceGroupName, String siteName) { - return listRecommendedRulesForWebAppWithServiceResponseAsync(resourceGroupName, siteName).toBlocking().single().body(); + public PagedList listRecommendedRulesForWebApp(final String resourceGroupName, final String siteName) { + ServiceResponse> response = listRecommendedRulesForWebAppSinglePageAsync(resourceGroupName, siteName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRecommendedRulesForWebAppNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** @@ -518,8 +768,16 @@ public List listRecommendedRulesForWebApp(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listRecommendedRulesForWebAppAsync(String resourceGroupName, String siteName, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listRecommendedRulesForWebAppWithServiceResponseAsync(resourceGroupName, siteName), serviceCallback); + public ServiceFuture> listRecommendedRulesForWebAppAsync(final String resourceGroupName, final String siteName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRecommendedRulesForWebAppSinglePageAsync(resourceGroupName, siteName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRecommendedRulesForWebAppNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** @@ -529,15 +787,39 @@ public ServiceFuture> listRecommendedRulesForWebAppAsy * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Name of the app. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<RecommendationInner> object + * @return the observable to the PagedList<RecommendationInner> object */ - public Observable> listRecommendedRulesForWebAppAsync(String resourceGroupName, String siteName) { - return listRecommendedRulesForWebAppWithServiceResponseAsync(resourceGroupName, siteName).map(new Func1>, List>() { - @Override - public List call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable> listRecommendedRulesForWebAppAsync(final String resourceGroupName, final String siteName) { + return listRecommendedRulesForWebAppWithServiceResponseAsync(resourceGroupName, siteName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all recommendations for an app. + * Get all recommendations for an app. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Name of the app. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RecommendationInner> object + */ + public Observable>> listRecommendedRulesForWebAppWithServiceResponseAsync(final String resourceGroupName, final String siteName) { + return listRecommendedRulesForWebAppSinglePageAsync(resourceGroupName, siteName) + .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(listRecommendedRulesForWebAppNextWithServiceResponseAsync(nextPageLink)); + } + }); } /** @@ -547,9 +829,9 @@ public List call(ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. * @param siteName Name of the app. * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<RecommendationInner> object + * @return the PagedList<RecommendationInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listRecommendedRulesForWebAppWithServiceResponseAsync(String resourceGroupName, String siteName) { + public Observable>> listRecommendedRulesForWebAppSinglePageAsync(final String resourceGroupName, final String siteName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -563,12 +845,12 @@ public Observable>> listRecommendedRul final Boolean featured = null; final String filter = null; return service.listRecommendedRulesForWebApp(resourceGroupName, siteName, this.client.subscriptionId(), featured, filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> clientResponse = listRecommendedRulesForWebAppDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listRecommendedRulesForWebAppDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -587,10 +869,16 @@ public Observable>> call(Response listRecommendedRulesForWebApp(String resourceGroupName, String siteName, Boolean featured, String filter) { - return listRecommendedRulesForWebAppWithServiceResponseAsync(resourceGroupName, siteName, featured, filter).toBlocking().single().body(); + public PagedList listRecommendedRulesForWebApp(final String resourceGroupName, final String siteName, final Boolean featured, final String filter) { + ServiceResponse> response = listRecommendedRulesForWebAppSinglePageAsync(resourceGroupName, siteName, featured, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRecommendedRulesForWebAppNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; } /** @@ -605,8 +893,16 @@ public List listRecommendedRulesForWebApp(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture> listRecommendedRulesForWebAppAsync(String resourceGroupName, String siteName, Boolean featured, String filter, final ServiceCallback> serviceCallback) { - return ServiceFuture.fromResponse(listRecommendedRulesForWebAppWithServiceResponseAsync(resourceGroupName, siteName, featured, filter), serviceCallback); + public ServiceFuture> listRecommendedRulesForWebAppAsync(final String resourceGroupName, final String siteName, final Boolean featured, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRecommendedRulesForWebAppSinglePageAsync(resourceGroupName, siteName, featured, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRecommendedRulesForWebAppNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); } /** @@ -618,15 +914,16 @@ public ServiceFuture> listRecommendedRulesForWebAppAsy * @param featured Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<RecommendationInner> object + * @return the observable to the PagedList<RecommendationInner> object */ - public Observable> listRecommendedRulesForWebAppAsync(String resourceGroupName, String siteName, Boolean featured, String filter) { - return listRecommendedRulesForWebAppWithServiceResponseAsync(resourceGroupName, siteName, featured, filter).map(new Func1>, List>() { - @Override - public List call(ServiceResponse> response) { - return response.body(); - } - }); + public Observable> listRecommendedRulesForWebAppAsync(final String resourceGroupName, final String siteName, final Boolean featured, final String filter) { + return listRecommendedRulesForWebAppWithServiceResponseAsync(resourceGroupName, siteName, featured, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); } /** @@ -638,9 +935,34 @@ public List call(ServiceResponse> * @param featured Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the List<RecommendationInner> object + * @return the observable to the PagedList<RecommendationInner> object + */ + public Observable>> listRecommendedRulesForWebAppWithServiceResponseAsync(final String resourceGroupName, final String siteName, final Boolean featured, final String filter) { + return listRecommendedRulesForWebAppSinglePageAsync(resourceGroupName, siteName, featured, filter) + .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(listRecommendedRulesForWebAppNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all recommendations for an app. + * Get all recommendations for an app. + * + ServiceResponse> * @param resourceGroupName Name of the resource group to which the resource belongs. + ServiceResponse> * @param siteName Name of the app. + ServiceResponse> * @param featured Specify <code>true</code> to return only the most critical recommendations. The default is <code>false</code>, which returns all recommendations. + ServiceResponse> * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecommendationInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listRecommendedRulesForWebAppWithServiceResponseAsync(String resourceGroupName, String siteName, Boolean featured, String filter) { + public Observable>> listRecommendedRulesForWebAppSinglePageAsync(final String resourceGroupName, final String siteName, final Boolean featured, final String filter) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -652,12 +974,12 @@ public Observable>> listRecommendedRul } final String apiVersion = "2016-03-01"; return service.listRecommendedRulesForWebApp(resourceGroupName, siteName, this.client.subscriptionId(), featured, filter, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { + .flatMap(new Func1, Observable>>>() { @Override - public Observable>> call(Response response) { + public Observable>> call(Response response) { try { - ServiceResponse> clientResponse = listRecommendedRulesForWebAppDelegate(response); - return Observable.just(clientResponse); + ServiceResponse> result = listRecommendedRulesForWebAppDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } @@ -665,9 +987,9 @@ public Observable>> call(Response> listRecommendedRulesForWebAppDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listRecommendedRulesForWebAppDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -921,7 +1243,8 @@ public Observable> getRuleDetailsByWebA } final String apiVersion = "2016-03-01"; final Boolean updateSeen = null; - return service.getRuleDetailsByWebApp(resourceGroupName, siteName, name, this.client.subscriptionId(), updateSeen, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + final String recommendationId = null; + return service.getRuleDetailsByWebApp(resourceGroupName, siteName, name, this.client.subscriptionId(), updateSeen, recommendationId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -943,13 +1266,14 @@ public Observable> call(Response getRuleDetailsByWebAppAsync(String resourceGroupName, String siteName, String name, Boolean updateSeen, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(getRuleDetailsByWebAppWithServiceResponseAsync(resourceGroupName, siteName, name, updateSeen), serviceCallback); + public ServiceFuture getRuleDetailsByWebAppAsync(String resourceGroupName, String siteName, String name, Boolean updateSeen, String recommendationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getRuleDetailsByWebAppWithServiceResponseAsync(resourceGroupName, siteName, name, updateSeen, recommendationId), serviceCallback); } /** @@ -976,11 +1301,12 @@ public ServiceFuture getRuleDetailsByWebAppAsync(String * @param siteName Name of the app. * @param name Name of the recommendation. * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation object. + * @param recommendationId The GUID of the recommedation object if you query an expired one. You don't need to specify it to query an active entry. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RecommendationRuleInner object */ - public Observable getRuleDetailsByWebAppAsync(String resourceGroupName, String siteName, String name, Boolean updateSeen) { - return getRuleDetailsByWebAppWithServiceResponseAsync(resourceGroupName, siteName, name, updateSeen).map(new Func1, RecommendationRuleInner>() { + public Observable getRuleDetailsByWebAppAsync(String resourceGroupName, String siteName, String name, Boolean updateSeen, String recommendationId) { + return getRuleDetailsByWebAppWithServiceResponseAsync(resourceGroupName, siteName, name, updateSeen, recommendationId).map(new Func1, RecommendationRuleInner>() { @Override public RecommendationRuleInner call(ServiceResponse response) { return response.body(); @@ -996,10 +1322,11 @@ public RecommendationRuleInner call(ServiceResponse res * @param siteName Name of the app. * @param name Name of the recommendation. * @param updateSeen Specify <code>true</code> to update the last-seen timestamp of the recommendation object. + * @param recommendationId The GUID of the recommedation object if you query an expired one. You don't need to specify it to query an active entry. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RecommendationRuleInner object */ - public Observable> getRuleDetailsByWebAppWithServiceResponseAsync(String resourceGroupName, String siteName, String name, Boolean updateSeen) { + public Observable> getRuleDetailsByWebAppWithServiceResponseAsync(String resourceGroupName, String siteName, String name, Boolean updateSeen, String recommendationId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1013,7 +1340,7 @@ public Observable> getRuleDetailsByWebA throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2016-03-01"; - return service.getRuleDetailsByWebApp(resourceGroupName, siteName, name, this.client.subscriptionId(), updateSeen, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.getRuleDetailsByWebApp(resourceGroupName, siteName, name, this.client.subscriptionId(), updateSeen, recommendationId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1034,4 +1361,446 @@ private ServiceResponse getRuleDetailsByWebAppDelegate( .build(response); } + /** + * Disables the specific rule for a web site permanently. + * Disables the specific rule for a web site permanently. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site name + * @param name Rule name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disableRecommendationForSite(String resourceGroupName, String siteName, String name) { + disableRecommendationForSiteWithServiceResponseAsync(resourceGroupName, siteName, name).toBlocking().single().body(); + } + + /** + * Disables the specific rule for a web site permanently. + * Disables the specific rule for a web site permanently. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site name + * @param name Rule 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 disableRecommendationForSiteAsync(String resourceGroupName, String siteName, String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableRecommendationForSiteWithServiceResponseAsync(resourceGroupName, siteName, name), serviceCallback); + } + + /** + * Disables the specific rule for a web site permanently. + * Disables the specific rule for a web site permanently. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site name + * @param name Rule name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disableRecommendationForSiteAsync(String resourceGroupName, String siteName, String name) { + return disableRecommendationForSiteWithServiceResponseAsync(resourceGroupName, siteName, name).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables the specific rule for a web site permanently. + * Disables the specific rule for a web site permanently. + * + * @param resourceGroupName Name of the resource group to which the resource belongs. + * @param siteName Site name + * @param name Rule name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disableRecommendationForSiteWithServiceResponseAsync(String resourceGroupName, String siteName, String name) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (siteName == null) { + throw new IllegalArgumentException("Parameter siteName 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-03-01"; + return service.disableRecommendationForSite(resourceGroupName, siteName, name, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disableRecommendationForSiteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse disableRecommendationForSiteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all recommendations for a subscription. + * List all recommendations for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<RecommendationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all recommendations for a subscription. + * List all recommendations for a subscription. + * + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all recommendations for a subscription. + * List all recommendations for a subscription. + * + * @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<RecommendationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all recommendations for a subscription. + * List all recommendations for a subscription. + * + * @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<RecommendationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(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(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List all recommendations for a subscription. + * List all recommendations for a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecommendationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(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.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get past recommendations for an app, optionally specified by the time range. + * Get past recommendations for an app, optionally specified by the time range. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<RecommendationInner> object if successful. + */ + public PagedList listHistoryForWebAppNext(final String nextPageLink) { + ServiceResponse> response = listHistoryForWebAppNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listHistoryForWebAppNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get past recommendations for an app, optionally specified by the time range. + * Get past recommendations for an app, optionally specified by the time range. + * + * @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> listHistoryForWebAppNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listHistoryForWebAppNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listHistoryForWebAppNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get past recommendations for an app, optionally specified by the time range. + * Get past recommendations for an app, optionally specified by the time range. + * + * @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<RecommendationInner> object + */ + public Observable> listHistoryForWebAppNextAsync(final String nextPageLink) { + return listHistoryForWebAppNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get past recommendations for an app, optionally specified by the time range. + * Get past recommendations for an app, optionally specified by the time range. + * + * @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<RecommendationInner> object + */ + public Observable>> listHistoryForWebAppNextWithServiceResponseAsync(final String nextPageLink) { + return listHistoryForWebAppNextSinglePageAsync(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(listHistoryForWebAppNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get past recommendations for an app, optionally specified by the time range. + * Get past recommendations for an app, optionally specified by the time range. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecommendationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listHistoryForWebAppNextSinglePageAsync(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.listHistoryForWebAppNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listHistoryForWebAppNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listHistoryForWebAppNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get all recommendations for an app. + * Get all recommendations for an app. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<RecommendationInner> object if successful. + */ + public PagedList listRecommendedRulesForWebAppNext(final String nextPageLink) { + ServiceResponse> response = listRecommendedRulesForWebAppNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listRecommendedRulesForWebAppNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get all recommendations for an app. + * Get all recommendations for an app. + * + * @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> listRecommendedRulesForWebAppNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listRecommendedRulesForWebAppNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listRecommendedRulesForWebAppNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get all recommendations for an app. + * Get all recommendations for an app. + * + * @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<RecommendationInner> object + */ + public Observable> listRecommendedRulesForWebAppNextAsync(final String nextPageLink) { + return listRecommendedRulesForWebAppNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get all recommendations for an app. + * Get all recommendations for an app. + * + * @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<RecommendationInner> object + */ + public Observable>> listRecommendedRulesForWebAppNextWithServiceResponseAsync(final String nextPageLink) { + return listRecommendedRulesForWebAppNextSinglePageAsync(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(listRecommendedRulesForWebAppNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get all recommendations for an app. + * Get all recommendations for an app. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RecommendationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listRecommendedRulesForWebAppNextSinglePageAsync(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.listRecommendedRulesForWebAppNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listRecommendedRulesForWebAppNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listRecommendedRulesForWebAppNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + } diff --git a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/WebAppsInner.java b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/WebAppsInner.java index c9ce727a47d..65e6692b580 100644 --- a/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/WebAppsInner.java +++ b/azure-mgmt-web/src/main/java/com/microsoft/azure/management/web/implementation/WebAppsInner.java @@ -84,19 +84,19 @@ interface WebAppsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.web.WebApps createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}") - Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body SiteInner siteEnvelope, @Query("skipDnsRegistration") Boolean skipDnsRegistration, @Query("skipCustomDomainVerification") Boolean skipCustomDomainVerification, @Query("forceDnsRegistration") Boolean forceDnsRegistration, @Query("ttlInSeconds") String ttlInSeconds, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body SiteInner siteEnvelope, @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.web.WebApps beginCreateOrUpdate" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}") - Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body SiteInner siteEnvelope, @Query("skipDnsRegistration") Boolean skipDnsRegistration, @Query("skipCustomDomainVerification") Boolean skipCustomDomainVerification, @Query("forceDnsRegistration") Boolean forceDnsRegistration, @Query("ttlInSeconds") String ttlInSeconds, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body SiteInner siteEnvelope, @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.web.WebApps delete" }) @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", method = "DELETE", hasBody = true) - Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("deleteMetrics") Boolean deleteMetrics, @Query("deleteEmptyServerFarm") Boolean deleteEmptyServerFarm, @Query("skipDnsRegistration") Boolean skipDnsRegistration, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("deleteMetrics") Boolean deleteMetrics, @Query("deleteEmptyServerFarm") Boolean deleteEmptyServerFarm, @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.web.WebApps update" }) @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}") - Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body SitePatchResourceInner siteEnvelope, @Query("skipDnsRegistration") Boolean skipDnsRegistration, @Query("skipCustomDomainVerification") Boolean skipCustomDomainVerification, @Query("forceDnsRegistration") Boolean forceDnsRegistration, @Query("ttlInSeconds") String ttlInSeconds, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Body SitePatchResourceInner siteEnvelope, @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.web.WebApps analyzeCustomHostname" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname") @@ -2143,109 +2143,7 @@ public Observable> createOrUpdateWithServiceResponseA } Validator.validate(siteEnvelope); final String apiVersion = "2016-08-01"; - final Boolean skipDnsRegistration = null; - final Boolean skipCustomDomainVerification = null; - final Boolean forceDnsRegistration = null; - final String ttlInSeconds = null; - Observable> observable = service.createOrUpdate(resourceGroupName, name, this.client.subscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); - } - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * 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 JSON representation of the app properties. See example. - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation. - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS. - * @param ttlInSeconds Time to live in seconds for web app's default domain name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the SiteInner object if successful. - */ - public SiteInner createOrUpdate(String resourceGroupName, String name, SiteInner siteEnvelope, Boolean skipDnsRegistration, Boolean skipCustomDomainVerification, Boolean forceDnsRegistration, String ttlInSeconds) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).toBlocking().last().body(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * 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 JSON representation of the app properties. See example. - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation. - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS. - * @param ttlInSeconds Time to live in seconds for web app's default domain 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 createOrUpdateAsync(String resourceGroupName, String name, SiteInner siteEnvelope, Boolean skipDnsRegistration, Boolean skipCustomDomainVerification, Boolean forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds), serviceCallback); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * 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 JSON representation of the app properties. See example. - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation. - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS. - * @param ttlInSeconds Time to live in seconds for web app's default domain name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable createOrUpdateAsync(String resourceGroupName, String name, SiteInner siteEnvelope, Boolean skipDnsRegistration, Boolean skipCustomDomainVerification, Boolean forceDnsRegistration, String ttlInSeconds) { - return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).map(new Func1, SiteInner>() { - @Override - public SiteInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * 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 JSON representation of the app properties. See example. - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation. - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS. - * @param ttlInSeconds Time to live in seconds for web app's default domain name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, SiteInner siteEnvelope, Boolean skipDnsRegistration, Boolean skipCustomDomainVerification, Boolean forceDnsRegistration, String ttlInSeconds) { - 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 (siteEnvelope == null) { - throw new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null."); - } - Validator.validate(siteEnvelope); - final String apiVersion = "2016-08-01"; - Observable> observable = service.createOrUpdate(resourceGroupName, name, this.client.subscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + Observable> observable = service.createOrUpdate(resourceGroupName, name, this.client.subscriptionId(), siteEnvelope, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -2324,120 +2222,7 @@ public Observable> beginCreateOrUpdateWithServiceResp } Validator.validate(siteEnvelope); final String apiVersion = "2016-08-01"; - final Boolean skipDnsRegistration = null; - final Boolean skipCustomDomainVerification = null; - final Boolean forceDnsRegistration = null; - final String ttlInSeconds = null; - return service.beginCreateOrUpdate(resourceGroupName, name, this.client.subscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * 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 JSON representation of the app properties. See example. - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation. - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS. - * @param ttlInSeconds Time to live in seconds for web app's default domain name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the SiteInner object if successful. - */ - public SiteInner beginCreateOrUpdate(String resourceGroupName, String name, SiteInner siteEnvelope, Boolean skipDnsRegistration, Boolean skipCustomDomainVerification, Boolean forceDnsRegistration, String ttlInSeconds) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).toBlocking().single().body(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * 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 JSON representation of the app properties. See example. - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation. - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS. - * @param ttlInSeconds Time to live in seconds for web app's default domain 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 beginCreateOrUpdateAsync(String resourceGroupName, String name, SiteInner siteEnvelope, Boolean skipDnsRegistration, Boolean skipCustomDomainVerification, Boolean forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds), serviceCallback); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * 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 JSON representation of the app properties. See example. - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation. - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS. - * @param ttlInSeconds Time to live in seconds for web app's default domain name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SiteInner object - */ - public Observable beginCreateOrUpdateAsync(String resourceGroupName, String name, SiteInner siteEnvelope, Boolean skipDnsRegistration, Boolean skipCustomDomainVerification, Boolean forceDnsRegistration, String ttlInSeconds) { - return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).map(new Func1, SiteInner>() { - @Override - public SiteInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * 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 JSON representation of the app properties. See example. - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation. - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS. - * @param ttlInSeconds Time to live in seconds for web app's default domain name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SiteInner object - */ - public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, SiteInner siteEnvelope, Boolean skipDnsRegistration, Boolean skipCustomDomainVerification, Boolean forceDnsRegistration, String ttlInSeconds) { - 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 (siteEnvelope == null) { - throw new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null."); - } - Validator.validate(siteEnvelope); - final String apiVersion = "2016-08-01"; - return service.beginCreateOrUpdate(resourceGroupName, name, this.client.subscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginCreateOrUpdate(resourceGroupName, name, this.client.subscriptionId(), siteEnvelope, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -2527,8 +2312,7 @@ public Observable> deleteWithServiceResponseAsync(String r final String apiVersion = "2016-08-01"; final Boolean deleteMetrics = null; final Boolean deleteEmptyServerFarm = null; - final Boolean skipDnsRegistration = null; - return service.delete(resourceGroupName, name, this.client.subscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.delete(resourceGroupName, name, this.client.subscriptionId(), deleteMetrics, deleteEmptyServerFarm, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -2550,13 +2334,12 @@ public Observable> call(Response response) { * @param name Name of the app to delete. * @param deleteMetrics If true, web app metrics are also deleted. * @param deleteEmptyServerFarm Specify true if the App Service plan will be empty after app deletion and you want to delete the empty App Service plan. By default, the empty App Service plan is not deleted. - * @param skipDnsRegistration If true, DNS registration is skipped. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ - public void delete(String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm, Boolean skipDnsRegistration) { - deleteWithServiceResponseAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration).toBlocking().single().body(); + public void delete(String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm) { + deleteWithServiceResponseAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm).toBlocking().single().body(); } /** @@ -2567,13 +2350,12 @@ public void delete(String resourceGroupName, String name, Boolean deleteMetrics, * @param name Name of the app to delete. * @param deleteMetrics If true, web app metrics are also deleted. * @param deleteEmptyServerFarm Specify true if the App Service plan will be empty after app deletion and you want to delete the empty App Service plan. By default, the empty App Service plan is not deleted. - * @param skipDnsRegistration If true, DNS registration is skipped. * @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 deleteAsync(String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm, Boolean skipDnsRegistration, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration), serviceCallback); + public ServiceFuture deleteAsync(String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm), serviceCallback); } /** @@ -2584,12 +2366,11 @@ public ServiceFuture deleteAsync(String resourceGroupName, String name, Bo * @param name Name of the app to delete. * @param deleteMetrics If true, web app metrics are also deleted. * @param deleteEmptyServerFarm Specify true if the App Service plan will be empty after app deletion and you want to delete the empty App Service plan. By default, the empty App Service plan is not deleted. - * @param skipDnsRegistration If true, DNS registration is skipped. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable deleteAsync(String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm, Boolean skipDnsRegistration) { - return deleteWithServiceResponseAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration).map(new Func1, Void>() { + public Observable deleteAsync(String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm) { + return deleteWithServiceResponseAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm).map(new Func1, Void>() { @Override public Void call(ServiceResponse response) { return response.body(); @@ -2605,11 +2386,10 @@ public Void call(ServiceResponse response) { * @param name Name of the app to delete. * @param deleteMetrics If true, web app metrics are also deleted. * @param deleteEmptyServerFarm Specify true if the App Service plan will be empty after app deletion and you want to delete the empty App Service plan. By default, the empty App Service plan is not deleted. - * @param skipDnsRegistration If true, DNS registration is skipped. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm, Boolean skipDnsRegistration) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String name, Boolean deleteMetrics, Boolean deleteEmptyServerFarm) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2620,7 +2400,7 @@ public Observable> deleteWithServiceResponseAsync(String r throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } final String apiVersion = "2016-08-01"; - return service.delete(resourceGroupName, name, this.client.subscriptionId(), deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.delete(resourceGroupName, name, this.client.subscriptionId(), deleteMetrics, deleteEmptyServerFarm, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -2718,120 +2498,7 @@ public Observable> updateWithServiceResponseAsync(Str } Validator.validate(siteEnvelope); final String apiVersion = "2016-08-01"; - final Boolean skipDnsRegistration = null; - final Boolean skipCustomDomainVerification = null; - final Boolean forceDnsRegistration = null; - final String ttlInSeconds = null; - return service.update(resourceGroupName, name, this.client.subscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = updateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * 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 JSON representation of the app properties. See example. - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation. - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS. - * @param ttlInSeconds Time to live in seconds for web app's default domain name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the SiteInner object if successful. - */ - public SiteInner update(String resourceGroupName, String name, SitePatchResourceInner siteEnvelope, Boolean skipDnsRegistration, Boolean skipCustomDomainVerification, Boolean forceDnsRegistration, String ttlInSeconds) { - return updateWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).toBlocking().single().body(); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * 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 JSON representation of the app properties. See example. - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation. - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS. - * @param ttlInSeconds Time to live in seconds for web app's default domain 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 updateAsync(String resourceGroupName, String name, SitePatchResourceInner siteEnvelope, Boolean skipDnsRegistration, Boolean skipCustomDomainVerification, Boolean forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds), serviceCallback); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * 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 JSON representation of the app properties. See example. - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation. - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS. - * @param ttlInSeconds Time to live in seconds for web app's default domain name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SiteInner object - */ - public Observable updateAsync(String resourceGroupName, String name, SitePatchResourceInner siteEnvelope, Boolean skipDnsRegistration, Boolean skipCustomDomainVerification, Boolean forceDnsRegistration, String ttlInSeconds) { - return updateWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).map(new Func1, SiteInner>() { - @Override - public SiteInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Creates a new web, mobile, or API app in an existing resource group, or updates an existing app. - * 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 JSON representation of the app properties. See example. - * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is - only used for app creation. - * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. - * @param forceDnsRegistration If true, web app hostname is force registered with DNS. - * @param ttlInSeconds Time to live in seconds for web app's default domain name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the SiteInner object - */ - public Observable> updateWithServiceResponseAsync(String resourceGroupName, String name, SitePatchResourceInner siteEnvelope, Boolean skipDnsRegistration, Boolean skipCustomDomainVerification, Boolean forceDnsRegistration, String ttlInSeconds) { - 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 (siteEnvelope == null) { - throw new IllegalArgumentException("Parameter siteEnvelope is required and cannot be null."); - } - Validator.validate(siteEnvelope); - final String apiVersion = "2016-08-01"; - return service.update(resourceGroupName, name, this.client.subscriptionId(), siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + return service.update(resourceGroupName, name, this.client.subscriptionId(), siteEnvelope, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) {