diff --git a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/AnomalyDetectorClient.java b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/AnomalyDetectorClient.java index dd0390a9a5d1..3d83f84278b4 100644 --- a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/AnomalyDetectorClient.java +++ b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/AnomalyDetectorClient.java @@ -9,12 +9,12 @@ package com.microsoft.azure.cognitiveservices.anomalydetector; import com.microsoft.azure.AzureClient; -import com.microsoft.azure.cognitiveservices.anomalydetector.models.APIErrorException; +import com.microsoft.azure.cognitiveservices.anomalydetector.models.AnomalyDetectorErrorException; import com.microsoft.azure.cognitiveservices.anomalydetector.models.ChangePointDetectRequest; import com.microsoft.azure.cognitiveservices.anomalydetector.models.ChangePointDetectResponse; +import com.microsoft.azure.cognitiveservices.anomalydetector.models.DetectRequest; import com.microsoft.azure.cognitiveservices.anomalydetector.models.EntireDetectResponse; import com.microsoft.azure.cognitiveservices.anomalydetector.models.LastDetectResponse; -import com.microsoft.azure.cognitiveservices.anomalydetector.models.Request; import com.microsoft.rest.RestClient; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; @@ -112,11 +112,11 @@ public interface AnomalyDetectorClient { * * @param body Time series points and period if needed. Advanced model parameters can also be set in the request. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws APIErrorException thrown if the request is rejected by server + * @throws AnomalyDetectorErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the EntireDetectResponse object if successful. */ - EntireDetectResponse entireDetect(Request body); + EntireDetectResponse detectEntireSeries(DetectRequest body); /** * Detect anomalies for the entire series in batch. @@ -127,7 +127,7 @@ public interface AnomalyDetectorClient { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - ServiceFuture entireDetectAsync(Request body, final ServiceCallback serviceCallback); + ServiceFuture detectEntireSeriesAsync(DetectRequest body, final ServiceCallback serviceCallback); /** * Detect anomalies for the entire series in batch. @@ -137,7 +137,7 @@ public interface AnomalyDetectorClient { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the EntireDetectResponse object */ - Observable entireDetectAsync(Request body); + Observable detectEntireSeriesAsync(DetectRequest body); /** * Detect anomalies for the entire series in batch. @@ -147,7 +147,7 @@ public interface AnomalyDetectorClient { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the EntireDetectResponse object */ - Observable> entireDetectWithServiceResponseAsync(Request body); + Observable> detectEntireSeriesWithServiceResponseAsync(DetectRequest body); /** * Detect anomaly status of the latest point in time series. @@ -155,11 +155,11 @@ public interface AnomalyDetectorClient { * * @param body Time series points and period if needed. Advanced model parameters can also be set in the request. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws APIErrorException thrown if the request is rejected by server + * @throws AnomalyDetectorErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the LastDetectResponse object if successful. */ - LastDetectResponse lastDetect(Request body); + LastDetectResponse detectLastPoint(DetectRequest body); /** * Detect anomaly status of the latest point in time series. @@ -170,7 +170,7 @@ public interface AnomalyDetectorClient { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - ServiceFuture lastDetectAsync(Request body, final ServiceCallback serviceCallback); + ServiceFuture detectLastPointAsync(DetectRequest body, final ServiceCallback serviceCallback); /** * Detect anomaly status of the latest point in time series. @@ -180,7 +180,7 @@ public interface AnomalyDetectorClient { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the LastDetectResponse object */ - Observable lastDetectAsync(Request body); + Observable detectLastPointAsync(DetectRequest body); /** * Detect anomaly status of the latest point in time series. @@ -190,7 +190,7 @@ public interface AnomalyDetectorClient { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the LastDetectResponse object */ - Observable> lastDetectWithServiceResponseAsync(Request body); + Observable> detectLastPointWithServiceResponseAsync(DetectRequest body); /** * Detect change point for the entire series. @@ -198,11 +198,11 @@ public interface AnomalyDetectorClient { * * @param body Time series points and granularity is needed. Advanced model parameters can also be set in the request if needed. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws APIErrorException thrown if the request is rejected by server + * @throws AnomalyDetectorErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ChangePointDetectResponse object if successful. */ - ChangePointDetectResponse changePointDetect(ChangePointDetectRequest body); + ChangePointDetectResponse detectChangePoint(ChangePointDetectRequest body); /** * Detect change point for the entire series. @@ -213,7 +213,7 @@ public interface AnomalyDetectorClient { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - ServiceFuture changePointDetectAsync(ChangePointDetectRequest body, final ServiceCallback serviceCallback); + ServiceFuture detectChangePointAsync(ChangePointDetectRequest body, final ServiceCallback serviceCallback); /** * Detect change point for the entire series. @@ -223,7 +223,7 @@ public interface AnomalyDetectorClient { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ChangePointDetectResponse object */ - Observable changePointDetectAsync(ChangePointDetectRequest body); + Observable detectChangePointAsync(ChangePointDetectRequest body); /** * Detect change point for the entire series. @@ -233,6 +233,6 @@ public interface AnomalyDetectorClient { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ChangePointDetectResponse object */ - Observable> changePointDetectWithServiceResponseAsync(ChangePointDetectRequest body); + Observable> detectChangePointWithServiceResponseAsync(ChangePointDetectRequest body); } diff --git a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/implementation/AnomalyDetectorClientImpl.java b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/implementation/AnomalyDetectorClientImpl.java index 88010c52e739..38cd2d9cdc38 100644 --- a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/implementation/AnomalyDetectorClientImpl.java +++ b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/implementation/AnomalyDetectorClientImpl.java @@ -13,12 +13,12 @@ import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; import com.microsoft.azure.cognitiveservices.anomalydetector.AnomalyDetectorClient; -import com.microsoft.azure.cognitiveservices.anomalydetector.models.APIErrorException; +import com.microsoft.azure.cognitiveservices.anomalydetector.models.AnomalyDetectorErrorException; import com.microsoft.azure.cognitiveservices.anomalydetector.models.ChangePointDetectRequest; import com.microsoft.azure.cognitiveservices.anomalydetector.models.ChangePointDetectResponse; +import com.microsoft.azure.cognitiveservices.anomalydetector.models.DetectRequest; import com.microsoft.azure.cognitiveservices.anomalydetector.models.EntireDetectResponse; import com.microsoft.azure.cognitiveservices.anomalydetector.models.LastDetectResponse; -import com.microsoft.azure.cognitiveservices.anomalydetector.models.Request; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; import com.microsoft.rest.ServiceCallback; @@ -201,17 +201,17 @@ private void initializeService() { * used by Retrofit to perform actually REST calls. */ interface AnomalyDetectorClientService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.anomalydetector.AnomalyDetectorClient entireDetect" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.anomalydetector.AnomalyDetectorClient detectEntireSeries" }) @POST("timeseries/entire/detect") - Observable> entireDetect(@Body Request body, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + Observable> detectEntireSeries(@Body DetectRequest body, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.anomalydetector.AnomalyDetectorClient lastDetect" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.anomalydetector.AnomalyDetectorClient detectLastPoint" }) @POST("timeseries/last/detect") - Observable> lastDetect(@Body Request body, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + Observable> detectLastPoint(@Body DetectRequest body, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.anomalydetector.AnomalyDetectorClient changePointDetect" }) - @POST("timeseries/changePoint/detect") - Observable> changePointDetect(@Body ChangePointDetectRequest body, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.anomalydetector.AnomalyDetectorClient detectChangePoint" }) + @POST("timeseries/changepoint/detect") + Observable> detectChangePoint(@Body ChangePointDetectRequest body, @Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); } @@ -221,12 +221,12 @@ interface AnomalyDetectorClientService { * * @param body Time series points and period if needed. Advanced model parameters can also be set in the request. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws APIErrorException thrown if the request is rejected by server + * @throws AnomalyDetectorErrorException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the EntireDetectResponse object if successful. */ - public EntireDetectResponse entireDetect(Request body) { - return entireDetectWithServiceResponseAsync(body).toBlocking().single().body(); + public EntireDetectResponse detectEntireSeries(DetectRequest body) { + return detectEntireSeriesWithServiceResponseAsync(body).toBlocking().single().body(); } /** @@ -238,8 +238,8 @@ public EntireDetectResponse entireDetect(Request body) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture entireDetectAsync(Request body, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(entireDetectWithServiceResponseAsync(body), serviceCallback); + public ServiceFuture detectEntireSeriesAsync(DetectRequest body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectEntireSeriesWithServiceResponseAsync(body), serviceCallback); } /** @@ -250,8 +250,8 @@ public ServiceFuture entireDetectAsync(Request body, final * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the EntireDetectResponse object */ - public Observable entireDetectAsync(Request body) { - return entireDetectWithServiceResponseAsync(body).map(new Func1, EntireDetectResponse>() { + public Observable detectEntireSeriesAsync(DetectRequest body) { + return detectEntireSeriesWithServiceResponseAsync(body).map(new Func1, EntireDetectResponse>() { @Override public EntireDetectResponse call(ServiceResponse response) { return response.body(); @@ -267,7 +267,7 @@ public EntireDetectResponse call(ServiceResponse response) * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the EntireDetectResponse object */ - public Observable> entireDetectWithServiceResponseAsync(Request body) { + public Observable> detectEntireSeriesWithServiceResponseAsync(DetectRequest body) { if (this.endpoint() == null) { throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); } @@ -276,12 +276,12 @@ public Observable> entireDetectWithService } Validator.validate(body); String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); - return service.entireDetect(body, this.acceptLanguage(), parameterizedHost, this.userAgent()) + return service.detectEntireSeries(body, this.acceptLanguage(), parameterizedHost, this.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = entireDetectDelegate(response); + ServiceResponse clientResponse = detectEntireSeriesDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -290,10 +290,10 @@ public Observable> call(Response entireDetectDelegate(Response response) throws APIErrorException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + private ServiceResponse detectEntireSeriesDelegate(Response response) throws AnomalyDetectorErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(APIErrorException.class) + .registerError(AnomalyDetectorErrorException.class) .build(response); } @@ -303,12 +303,12 @@ private ServiceResponse entireDetectDelegate(Response lastDetectAsync(Request body, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(lastDetectWithServiceResponseAsync(body), serviceCallback); + public ServiceFuture detectLastPointAsync(DetectRequest body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectLastPointWithServiceResponseAsync(body), serviceCallback); } /** @@ -332,8 +332,8 @@ public ServiceFuture lastDetectAsync(Request body, final Ser * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the LastDetectResponse object */ - public Observable lastDetectAsync(Request body) { - return lastDetectWithServiceResponseAsync(body).map(new Func1, LastDetectResponse>() { + public Observable detectLastPointAsync(DetectRequest body) { + return detectLastPointWithServiceResponseAsync(body).map(new Func1, LastDetectResponse>() { @Override public LastDetectResponse call(ServiceResponse response) { return response.body(); @@ -349,7 +349,7 @@ public LastDetectResponse call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the LastDetectResponse object */ - public Observable> lastDetectWithServiceResponseAsync(Request body) { + public Observable> detectLastPointWithServiceResponseAsync(DetectRequest body) { if (this.endpoint() == null) { throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); } @@ -358,12 +358,12 @@ public Observable> lastDetectWithServiceResp } Validator.validate(body); String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); - return service.lastDetect(body, this.acceptLanguage(), parameterizedHost, this.userAgent()) + return service.detectLastPoint(body, this.acceptLanguage(), parameterizedHost, this.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = lastDetectDelegate(response); + ServiceResponse clientResponse = detectLastPointDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -372,10 +372,10 @@ public Observable> call(Response lastDetectDelegate(Response response) throws APIErrorException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + private ServiceResponse detectLastPointDelegate(Response response) throws AnomalyDetectorErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(APIErrorException.class) + .registerError(AnomalyDetectorErrorException.class) .build(response); } @@ -385,12 +385,12 @@ private ServiceResponse lastDetectDelegate(Response changePointDetectAsync(ChangePointDetectRequest body, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(changePointDetectWithServiceResponseAsync(body), serviceCallback); + public ServiceFuture detectChangePointAsync(ChangePointDetectRequest body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(detectChangePointWithServiceResponseAsync(body), serviceCallback); } /** @@ -414,8 +414,8 @@ public ServiceFuture changePointDetectAsync(ChangePoi * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ChangePointDetectResponse object */ - public Observable changePointDetectAsync(ChangePointDetectRequest body) { - return changePointDetectWithServiceResponseAsync(body).map(new Func1, ChangePointDetectResponse>() { + public Observable detectChangePointAsync(ChangePointDetectRequest body) { + return detectChangePointWithServiceResponseAsync(body).map(new Func1, ChangePointDetectResponse>() { @Override public ChangePointDetectResponse call(ServiceResponse response) { return response.body(); @@ -431,7 +431,7 @@ public ChangePointDetectResponse call(ServiceResponse * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ChangePointDetectResponse object */ - public Observable> changePointDetectWithServiceResponseAsync(ChangePointDetectRequest body) { + public Observable> detectChangePointWithServiceResponseAsync(ChangePointDetectRequest body) { if (this.endpoint() == null) { throw new IllegalArgumentException("Parameter this.endpoint() is required and cannot be null."); } @@ -440,12 +440,12 @@ public Observable> changePointDetectW } Validator.validate(body); String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.endpoint()); - return service.changePointDetect(body, this.acceptLanguage(), parameterizedHost, this.userAgent()) + return service.detectChangePoint(body, this.acceptLanguage(), parameterizedHost, this.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = changePointDetectDelegate(response); + ServiceResponse clientResponse = detectChangePointDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -454,10 +454,10 @@ public Observable> call(Response changePointDetectDelegate(Response response) throws APIErrorException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + private ServiceResponse detectChangePointDelegate(Response response) throws AnomalyDetectorErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(APIErrorException.class) + .registerError(AnomalyDetectorErrorException.class) .build(response); } diff --git a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/APIError.java b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/AnomalyDetectorError.java similarity index 83% rename from cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/APIError.java rename to cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/AnomalyDetectorError.java index 38eda592b00c..c9a2747ba61a 100644 --- a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/APIError.java +++ b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/AnomalyDetectorError.java @@ -13,7 +13,7 @@ /** * Error information returned by the API. */ -public class APIError { +public class AnomalyDetectorError { /** * The error code. */ @@ -39,9 +39,9 @@ public Object code() { * Set the error code. * * @param code the code value to set - * @return the APIError object itself. + * @return the AnomalyDetectorError object itself. */ - public APIError withCode(Object code) { + public AnomalyDetectorError withCode(Object code) { this.code = code; return this; } @@ -59,9 +59,9 @@ public String message() { * Set a message explaining the error reported by the service. * * @param message the message value to set - * @return the APIError object itself. + * @return the AnomalyDetectorError object itself. */ - public APIError withMessage(String message) { + public AnomalyDetectorError withMessage(String message) { this.message = message; return this; } diff --git a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/APIErrorException.java b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/AnomalyDetectorErrorException.java similarity index 58% rename from cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/APIErrorException.java rename to cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/AnomalyDetectorErrorException.java index c07c6cc689cb..4d8dd2dc4aac 100644 --- a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/APIErrorException.java +++ b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/AnomalyDetectorErrorException.java @@ -13,32 +13,33 @@ import retrofit2.Response; /** - * Exception thrown for an invalid response with APIError information. + * Exception thrown for an invalid response with AnomalyDetectorError + * information. */ -public class APIErrorException extends RestException { +public class AnomalyDetectorErrorException extends RestException { /** - * Initializes a new instance of the APIErrorException class. + * Initializes a new instance of the AnomalyDetectorErrorException class. * * @param message the exception message or the response content if a message is not available * @param response the HTTP response */ - public APIErrorException(final String message, final Response response) { + public AnomalyDetectorErrorException(final String message, final Response response) { super(message, response); } /** - * Initializes a new instance of the APIErrorException class. + * Initializes a new instance of the AnomalyDetectorErrorException class. * * @param message the exception message or the response content if a message is not available * @param response the HTTP response * @param body the deserialized response body */ - public APIErrorException(final String message, final Response response, final APIError body) { + public AnomalyDetectorErrorException(final String message, final Response response, final AnomalyDetectorError body) { super(message, response, body); } @Override - public APIError body() { - return (APIError) super.body(); + public AnomalyDetectorError body() { + return (AnomalyDetectorError) super.body(); } } diff --git a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/ChangePointDetectRequest.java b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/ChangePointDetectRequest.java index bfd5da815c27..1dc0491dc9ee 100644 --- a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/ChangePointDetectRequest.java +++ b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/ChangePointDetectRequest.java @@ -20,16 +20,16 @@ public class ChangePointDetectRequest { * ascending order to match the change point detection result. */ @JsonProperty(value = "series", required = true) - private List series; + private List series; /** * Can only be one of yearly, monthly, weekly, daily, hourly, minutely or * secondly. Granularity is used for verify whether input series is valid. * Possible values include: 'yearly', 'monthly', 'weekly', 'daily', - * 'hourly', 'minutely', 'secondly'. + * 'hourly', 'perMinute', 'perSecond'. */ @JsonProperty(value = "granularity", required = true) - private Granularity granularity; + private TimeGranularity granularity; /** * Custom Interval is used to set non-standard time interval, for example, @@ -66,7 +66,7 @@ public class ChangePointDetectRequest { * * @return the series value */ - public List series() { + public List series() { return this.series; } @@ -76,27 +76,27 @@ public List series() { * @param series the series value to set * @return the ChangePointDetectRequest object itself. */ - public ChangePointDetectRequest withSeries(List series) { + public ChangePointDetectRequest withSeries(List series) { this.series = series; return this; } /** - * Get can only be one of yearly, monthly, weekly, daily, hourly, minutely or secondly. Granularity is used for verify whether input series is valid. Possible values include: 'yearly', 'monthly', 'weekly', 'daily', 'hourly', 'minutely', 'secondly'. + * Get can only be one of yearly, monthly, weekly, daily, hourly, minutely or secondly. Granularity is used for verify whether input series is valid. Possible values include: 'yearly', 'monthly', 'weekly', 'daily', 'hourly', 'perMinute', 'perSecond'. * * @return the granularity value */ - public Granularity granularity() { + public TimeGranularity granularity() { return this.granularity; } /** - * Set can only be one of yearly, monthly, weekly, daily, hourly, minutely or secondly. Granularity is used for verify whether input series is valid. Possible values include: 'yearly', 'monthly', 'weekly', 'daily', 'hourly', 'minutely', 'secondly'. + * Set can only be one of yearly, monthly, weekly, daily, hourly, minutely or secondly. Granularity is used for verify whether input series is valid. Possible values include: 'yearly', 'monthly', 'weekly', 'daily', 'hourly', 'perMinute', 'perSecond'. * * @param granularity the granularity value to set * @return the ChangePointDetectRequest object itself. */ - public ChangePointDetectRequest withGranularity(Granularity granularity) { + public ChangePointDetectRequest withGranularity(TimeGranularity granularity) { this.granularity = granularity; return this; } diff --git a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/Request.java b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/DetectRequest.java similarity index 83% rename from cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/Request.java rename to cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/DetectRequest.java index adf1eea40073..22a89666e0c9 100644 --- a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/Request.java +++ b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/DetectRequest.java @@ -12,9 +12,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The Request model. + * The DetectRequest model. */ -public class Request { +public class DetectRequest { /** * Time series data points. Points should be sorted by timestamp in * ascending order to match the anomaly detection result. If the data is @@ -22,14 +22,14 @@ public class Request { * work. In such case, an error message will be returned. */ @JsonProperty(value = "series", required = true) - private List series; + private List series; /** * Possible values include: 'yearly', 'monthly', 'weekly', 'daily', - * 'hourly', 'minutely', 'secondly'. + * 'hourly', 'perMinute', 'perSecond'. */ @JsonProperty(value = "granularity", required = true) - private Granularity granularity; + private TimeGranularity granularity; /** * Custom Interval is used to set non-standard time interval, for example, @@ -66,7 +66,7 @@ public class Request { * * @return the series value */ - public List series() { + public List series() { return this.series; } @@ -74,29 +74,29 @@ public List series() { * Set time series data points. Points should be sorted by timestamp in ascending order to match the anomaly detection result. If the data is not sorted correctly or there is duplicated timestamp, the API will not work. In such case, an error message will be returned. * * @param series the series value to set - * @return the Request object itself. + * @return the DetectRequest object itself. */ - public Request withSeries(List series) { + public DetectRequest withSeries(List series) { this.series = series; return this; } /** - * Get possible values include: 'yearly', 'monthly', 'weekly', 'daily', 'hourly', 'minutely', 'secondly'. + * Get possible values include: 'yearly', 'monthly', 'weekly', 'daily', 'hourly', 'perMinute', 'perSecond'. * * @return the granularity value */ - public Granularity granularity() { + public TimeGranularity granularity() { return this.granularity; } /** - * Set possible values include: 'yearly', 'monthly', 'weekly', 'daily', 'hourly', 'minutely', 'secondly'. + * Set possible values include: 'yearly', 'monthly', 'weekly', 'daily', 'hourly', 'perMinute', 'perSecond'. * * @param granularity the granularity value to set - * @return the Request object itself. + * @return the DetectRequest object itself. */ - public Request withGranularity(Granularity granularity) { + public DetectRequest withGranularity(TimeGranularity granularity) { this.granularity = granularity; return this; } @@ -114,9 +114,9 @@ public Integer customInterval() { * Set custom Interval is used to set non-standard time interval, for example, if the series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}. * * @param customInterval the customInterval value to set - * @return the Request object itself. + * @return the DetectRequest object itself. */ - public Request withCustomInterval(Integer customInterval) { + public DetectRequest withCustomInterval(Integer customInterval) { this.customInterval = customInterval; return this; } @@ -134,9 +134,9 @@ public Integer periodProperty() { * Set optional argument, periodic value of a time series. If the value is null or does not present, the API will determine the period automatically. * * @param periodProperty the periodProperty value to set - * @return the Request object itself. + * @return the DetectRequest object itself. */ - public Request withPeriodProperty(Integer periodProperty) { + public DetectRequest withPeriodProperty(Integer periodProperty) { this.periodProperty = periodProperty; return this; } @@ -154,9 +154,9 @@ public Double maxAnomalyRatio() { * Set optional argument, advanced model parameter, max anomaly ratio in a time series. * * @param maxAnomalyRatio the maxAnomalyRatio value to set - * @return the Request object itself. + * @return the DetectRequest object itself. */ - public Request withMaxAnomalyRatio(Double maxAnomalyRatio) { + public DetectRequest withMaxAnomalyRatio(Double maxAnomalyRatio) { this.maxAnomalyRatio = maxAnomalyRatio; return this; } @@ -174,9 +174,9 @@ public Integer sensitivity() { * Set optional argument, advanced model parameter, between 0-99, the lower the value is, the larger the margin value will be which means less anomalies will be accepted. * * @param sensitivity the sensitivity value to set - * @return the Request object itself. + * @return the DetectRequest object itself. */ - public Request withSensitivity(Integer sensitivity) { + public DetectRequest withSensitivity(Integer sensitivity) { this.sensitivity = sensitivity; return this; } diff --git a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/Granularity.java b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/TimeGranularity.java similarity index 67% rename from cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/Granularity.java rename to cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/TimeGranularity.java index a061069b3f0c..bc95c723fca7 100644 --- a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/Granularity.java +++ b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/TimeGranularity.java @@ -12,9 +12,9 @@ import com.fasterxml.jackson.annotation.JsonValue; /** - * Defines values for Granularity. + * Defines values for TimeGranularity. */ -public enum Granularity { +public enum TimeGranularity { /** Enum value yearly. */ YEARLY("yearly"), @@ -31,28 +31,28 @@ public enum Granularity { HOURLY("hourly"), /** Enum value minutely. */ - MINUTELY("minutely"), + PER_MINUTE("minutely"), /** Enum value secondly. */ - SECONDLY("secondly"); + PER_SECOND("secondly"); - /** The actual serialized value for a Granularity instance. */ + /** The actual serialized value for a TimeGranularity instance. */ private String value; - Granularity(String value) { + TimeGranularity(String value) { this.value = value; } /** - * Parses a serialized value to a Granularity instance. + * Parses a serialized value to a TimeGranularity instance. * * @param value the serialized value to parse. - * @return the parsed Granularity object, or null if unable to parse. + * @return the parsed TimeGranularity object, or null if unable to parse. */ @JsonCreator - public static Granularity fromString(String value) { - Granularity[] items = Granularity.values(); - for (Granularity item : items) { + public static TimeGranularity fromString(String value) { + TimeGranularity[] items = TimeGranularity.values(); + for (TimeGranularity item : items) { if (item.toString().equalsIgnoreCase(value)) { return item; } diff --git a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/Point.java b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/TimeSeriesPoint.java similarity index 83% rename from cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/Point.java rename to cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/TimeSeriesPoint.java index 86911636460b..1d72bd73cb33 100644 --- a/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/Point.java +++ b/cognitiveservices/data-plane/anomalydetector/src/main/java/com/microsoft/azure/cognitiveservices/anomalydetector/models/TimeSeriesPoint.java @@ -12,9 +12,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The Point model. + * The TimeSeriesPoint model. */ -public class Point { +public class TimeSeriesPoint { /** * Timestamp of a data point (ISO8601 format). */ @@ -40,9 +40,9 @@ public DateTime timestamp() { * Set timestamp of a data point (ISO8601 format). * * @param timestamp the timestamp value to set - * @return the Point object itself. + * @return the TimeSeriesPoint object itself. */ - public Point withTimestamp(DateTime timestamp) { + public TimeSeriesPoint withTimestamp(DateTime timestamp) { this.timestamp = timestamp; return this; } @@ -60,9 +60,9 @@ public double value() { * Set the measurement of that point, should be float. * * @param value the value value to set - * @return the Point object itself. + * @return the TimeSeriesPoint object itself. */ - public Point withValue(double value) { + public TimeSeriesPoint withValue(double value) { this.value = value; return this; }