diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Answer.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Answer.java new file mode 100644 index 000000000000..bed88b3f34f7 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Answer.java @@ -0,0 +1,24 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines an answer. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") +@JsonTypeName("Answer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SearchResultsAnswer", value = SearchResultsAnswer.class) +}) +public class Answer extends Response { +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/CreativeWork.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/CreativeWork.java new file mode 100644 index 000000000000..8ca5206be103 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/CreativeWork.java @@ -0,0 +1,73 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The most generic kind of creative work, including books, movies, + * photographs, software programs, etc. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") +@JsonTypeName("CreativeWork") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "MediaObject", value = MediaObject.class), + @JsonSubTypes.Type(name = "WebPage", value = WebPage.class) +}) +public class CreativeWork extends Thing { + /** + * The URL to a thumbnail of the item. + */ + @JsonProperty(value = "thumbnailUrl", access = JsonProperty.Access.WRITE_ONLY) + private String thumbnailUrl; + + /** + * The source of the creative work. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private List provider; + + /** + * Text content of this creative work. + */ + @JsonProperty(value = "text", access = JsonProperty.Access.WRITE_ONLY) + private String text; + + /** + * Get the URL to a thumbnail of the item. + * + * @return the thumbnailUrl value + */ + public String thumbnailUrl() { + return this.thumbnailUrl; + } + + /** + * Get the source of the creative work. + * + * @return the provider value + */ + public List provider() { + return this.provider; + } + + /** + * Get text content of this creative work. + * + * @return the text value + */ + public String text() { + return this.text; + } + +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Error.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Error.java new file mode 100644 index 000000000000..26513dc69d16 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Error.java @@ -0,0 +1,135 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines the error that occurred. + */ +public class Error { + /** + * The error code that identifies the category of error. Possible values + * include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', + * 'InvalidAuthorization', 'InsufficientAuthorization'. + */ + @JsonProperty(value = "code", required = true) + private ErrorCode code; + + /** + * The error code that further helps to identify the error. Possible values + * include: 'UnexpectedError', 'ResourceError', 'NotImplemented', + * 'ParameterMissing', 'ParameterInvalidValue', 'HttpNotAllowed', + * 'Blocked', 'AuthorizationMissing', 'AuthorizationRedundancy', + * 'AuthorizationDisabled', 'AuthorizationExpired'. + */ + @JsonProperty(value = "subCode", access = JsonProperty.Access.WRITE_ONLY) + private ErrorSubCode subCode; + + /** + * A description of the error. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * A description that provides additional information about the error. + */ + @JsonProperty(value = "moreDetails", access = JsonProperty.Access.WRITE_ONLY) + private String moreDetails; + + /** + * The parameter in the request that caused the error. + */ + @JsonProperty(value = "parameter", access = JsonProperty.Access.WRITE_ONLY) + private String parameter; + + /** + * The parameter's value in the request that was not valid. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the error code that identifies the category of error. Possible values include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. + * + * @return the code value + */ + public ErrorCode code() { + return this.code; + } + + /** + * Set the error code that identifies the category of error. Possible values include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(ErrorCode code) { + this.code = code; + return this; + } + + /** + * Get the error code that further helps to identify the error. Possible values include: 'UnexpectedError', 'ResourceError', 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired'. + * + * @return the subCode value + */ + public ErrorSubCode subCode() { + return this.subCode; + } + + /** + * Get a description of the error. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set a description of the error. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get a description that provides additional information about the error. + * + * @return the moreDetails value + */ + public String moreDetails() { + return this.moreDetails; + } + + /** + * Get the parameter in the request that caused the error. + * + * @return the parameter value + */ + public String parameter() { + return this.parameter; + } + + /** + * Get the parameter's value in the request that was not valid. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ErrorCode.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ErrorCode.java new file mode 100644 index 000000000000..424f5311fee4 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ErrorCode.java @@ -0,0 +1,53 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ErrorCode. + */ +public final class ErrorCode extends ExpandableStringEnum { + /** Static value None for ErrorCode. */ + public static final ErrorCode NONE = fromString("None"); + + /** Static value ServerError for ErrorCode. */ + public static final ErrorCode SERVER_ERROR = fromString("ServerError"); + + /** Static value InvalidRequest for ErrorCode. */ + public static final ErrorCode INVALID_REQUEST = fromString("InvalidRequest"); + + /** Static value RateLimitExceeded for ErrorCode. */ + public static final ErrorCode RATE_LIMIT_EXCEEDED = fromString("RateLimitExceeded"); + + /** Static value InvalidAuthorization for ErrorCode. */ + public static final ErrorCode INVALID_AUTHORIZATION = fromString("InvalidAuthorization"); + + /** Static value InsufficientAuthorization for ErrorCode. */ + public static final ErrorCode INSUFFICIENT_AUTHORIZATION = fromString("InsufficientAuthorization"); + + /** + * Creates or finds a ErrorCode from its string representation. + * @param name a name to look for + * @return the corresponding ErrorCode + */ + @JsonCreator + public static ErrorCode fromString(String name) { + return fromString(name, ErrorCode.class); + } + + /** + * @return known ErrorCode values + */ + public static Collection values() { + return values(ErrorCode.class); + } +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ErrorResponse.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ErrorResponse.java new file mode 100644 index 000000000000..40177820e7ae --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ErrorResponse.java @@ -0,0 +1,48 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The top-level response that represents a failed request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") +@JsonTypeName("ErrorResponse") +public class ErrorResponse extends Response { + /** + * A list of errors that describe the reasons why the request failed. + */ + @JsonProperty(value = "errors", required = true) + private List errors; + + /** + * Get a list of errors that describe the reasons why the request failed. + * + * @return the errors value + */ + public List errors() { + return this.errors; + } + + /** + * Set a list of errors that describe the reasons why the request failed. + * + * @param errors the errors value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withErrors(List errors) { + this.errors = errors; + return this; + } + +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ErrorResponseException.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ErrorResponseException.java new file mode 100644 index 000000000000..0c7b2b78ec05 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException 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 ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ErrorSubCode.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ErrorSubCode.java new file mode 100644 index 000000000000..cfec7774b2dd --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ErrorSubCode.java @@ -0,0 +1,68 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ErrorSubCode. + */ +public final class ErrorSubCode extends ExpandableStringEnum { + /** Static value UnexpectedError for ErrorSubCode. */ + public static final ErrorSubCode UNEXPECTED_ERROR = fromString("UnexpectedError"); + + /** Static value ResourceError for ErrorSubCode. */ + public static final ErrorSubCode RESOURCE_ERROR = fromString("ResourceError"); + + /** Static value NotImplemented for ErrorSubCode. */ + public static final ErrorSubCode NOT_IMPLEMENTED = fromString("NotImplemented"); + + /** Static value ParameterMissing for ErrorSubCode. */ + public static final ErrorSubCode PARAMETER_MISSING = fromString("ParameterMissing"); + + /** Static value ParameterInvalidValue for ErrorSubCode. */ + public static final ErrorSubCode PARAMETER_INVALID_VALUE = fromString("ParameterInvalidValue"); + + /** Static value HttpNotAllowed for ErrorSubCode. */ + public static final ErrorSubCode HTTP_NOT_ALLOWED = fromString("HttpNotAllowed"); + + /** Static value Blocked for ErrorSubCode. */ + public static final ErrorSubCode BLOCKED = fromString("Blocked"); + + /** Static value AuthorizationMissing for ErrorSubCode. */ + public static final ErrorSubCode AUTHORIZATION_MISSING = fromString("AuthorizationMissing"); + + /** Static value AuthorizationRedundancy for ErrorSubCode. */ + public static final ErrorSubCode AUTHORIZATION_REDUNDANCY = fromString("AuthorizationRedundancy"); + + /** Static value AuthorizationDisabled for ErrorSubCode. */ + public static final ErrorSubCode AUTHORIZATION_DISABLED = fromString("AuthorizationDisabled"); + + /** Static value AuthorizationExpired for ErrorSubCode. */ + public static final ErrorSubCode AUTHORIZATION_EXPIRED = fromString("AuthorizationExpired"); + + /** + * Creates or finds a ErrorSubCode from its string representation. + * @param name a name to look for + * @return the corresponding ErrorSubCode + */ + @JsonCreator + public static ErrorSubCode fromString(String name) { + return fromString(name, ErrorSubCode.class); + } + + /** + * @return known ErrorSubCode values + */ + public static Collection values() { + return values(ErrorSubCode.class); + } +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Freshness.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Freshness.java new file mode 100644 index 000000000000..53bbf1dc12db --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Freshness.java @@ -0,0 +1,44 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Freshness. + */ +public final class Freshness extends ExpandableStringEnum { + /** Static value Day for Freshness. */ + public static final Freshness DAY = fromString("Day"); + + /** Static value Week for Freshness. */ + public static final Freshness WEEK = fromString("Week"); + + /** Static value Month for Freshness. */ + public static final Freshness MONTH = fromString("Month"); + + /** + * Creates or finds a Freshness from its string representation. + * @param name a name to look for + * @return the corresponding Freshness + */ + @JsonCreator + public static Freshness fromString(String name) { + return fromString(name, Freshness.class); + } + + /** + * @return known Freshness values + */ + public static Collection values() { + return values(Freshness.class); + } +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Identifiable.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Identifiable.java new file mode 100644 index 000000000000..125f9ead8e43 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Identifiable.java @@ -0,0 +1,40 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines the identity of a resource. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") +@JsonTypeName("Identifiable") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Response", value = Response.class) +}) +public class Identifiable extends ResponseBase { + /** + * A String identifier. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Get a String identifier. + * + * @return the id value + */ + public String id() { + return this.id; + } + +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageAspect.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageAspect.java new file mode 100644 index 000000000000..44fd6410c3e0 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageAspect.java @@ -0,0 +1,47 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImageAspect. + */ +public final class ImageAspect extends ExpandableStringEnum { + /** Static value All for ImageAspect. */ + public static final ImageAspect ALL = fromString("All"); + + /** Static value Square for ImageAspect. */ + public static final ImageAspect SQUARE = fromString("Square"); + + /** Static value Wide for ImageAspect. */ + public static final ImageAspect WIDE = fromString("Wide"); + + /** Static value Tall for ImageAspect. */ + public static final ImageAspect TALL = fromString("Tall"); + + /** + * Creates or finds a ImageAspect from its string representation. + * @param name a name to look for + * @return the corresponding ImageAspect + */ + @JsonCreator + public static ImageAspect fromString(String name) { + return fromString(name, ImageAspect.class); + } + + /** + * @return known ImageAspect values + */ + public static Collection values() { + return values(ImageAspect.class); + } +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageColor.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageColor.java new file mode 100644 index 000000000000..850440860946 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageColor.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.cognitiveservices.customimagesearch; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImageColor. + */ +public final class ImageColor extends ExpandableStringEnum { + /** Static value ColorOnly for ImageColor. */ + public static final ImageColor COLOR_ONLY = fromString("ColorOnly"); + + /** Static value Monochrome for ImageColor. */ + public static final ImageColor MONOCHROME = fromString("Monochrome"); + + /** Static value Black for ImageColor. */ + public static final ImageColor BLACK = fromString("Black"); + + /** Static value Blue for ImageColor. */ + public static final ImageColor BLUE = fromString("Blue"); + + /** Static value Brown for ImageColor. */ + public static final ImageColor BROWN = fromString("Brown"); + + /** Static value Gray for ImageColor. */ + public static final ImageColor GRAY = fromString("Gray"); + + /** Static value Green for ImageColor. */ + public static final ImageColor GREEN = fromString("Green"); + + /** Static value Orange for ImageColor. */ + public static final ImageColor ORANGE = fromString("Orange"); + + /** Static value Pink for ImageColor. */ + public static final ImageColor PINK = fromString("Pink"); + + /** Static value Purple for ImageColor. */ + public static final ImageColor PURPLE = fromString("Purple"); + + /** Static value Red for ImageColor. */ + public static final ImageColor RED = fromString("Red"); + + /** Static value Teal for ImageColor. */ + public static final ImageColor TEAL = fromString("Teal"); + + /** Static value White for ImageColor. */ + public static final ImageColor WHITE = fromString("White"); + + /** Static value Yellow for ImageColor. */ + public static final ImageColor YELLOW = fromString("Yellow"); + + /** + * Creates or finds a ImageColor from its string representation. + * @param name a name to look for + * @return the corresponding ImageColor + */ + @JsonCreator + public static ImageColor fromString(String name) { + return fromString(name, ImageColor.class); + } + + /** + * @return known ImageColor values + */ + public static Collection values() { + return values(ImageColor.class); + } +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageContent.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageContent.java new file mode 100644 index 000000000000..2f733fb2224c --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageContent.java @@ -0,0 +1,41 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImageContent. + */ +public final class ImageContent extends ExpandableStringEnum { + /** Static value Face for ImageContent. */ + public static final ImageContent FACE = fromString("Face"); + + /** Static value Portrait for ImageContent. */ + public static final ImageContent PORTRAIT = fromString("Portrait"); + + /** + * Creates or finds a ImageContent from its string representation. + * @param name a name to look for + * @return the corresponding ImageContent + */ + @JsonCreator + public static ImageContent fromString(String name) { + return fromString(name, ImageContent.class); + } + + /** + * @return known ImageContent values + */ + public static Collection values() { + return values(ImageContent.class); + } +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageLicense.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageLicense.java new file mode 100644 index 000000000000..5efb517552dc --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageLicense.java @@ -0,0 +1,56 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImageLicense. + */ +public final class ImageLicense extends ExpandableStringEnum { + /** Static value All for ImageLicense. */ + public static final ImageLicense ALL = fromString("All"); + + /** Static value Any for ImageLicense. */ + public static final ImageLicense ANY = fromString("Any"); + + /** Static value Public for ImageLicense. */ + public static final ImageLicense PUBLIC = fromString("Public"); + + /** Static value Share for ImageLicense. */ + public static final ImageLicense SHARE = fromString("Share"); + + /** Static value ShareCommercially for ImageLicense. */ + public static final ImageLicense SHARE_COMMERCIALLY = fromString("ShareCommercially"); + + /** Static value Modify for ImageLicense. */ + public static final ImageLicense MODIFY = fromString("Modify"); + + /** Static value ModifyCommercially for ImageLicense. */ + public static final ImageLicense MODIFY_COMMERCIALLY = fromString("ModifyCommercially"); + + /** + * Creates or finds a ImageLicense from its string representation. + * @param name a name to look for + * @return the corresponding ImageLicense + */ + @JsonCreator + public static ImageLicense fromString(String name) { + return fromString(name, ImageLicense.class); + } + + /** + * @return known ImageLicense values + */ + public static Collection values() { + return values(ImageLicense.class); + } +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageObject.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageObject.java new file mode 100644 index 000000000000..f566fb45d1cd --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageObject.java @@ -0,0 +1,100 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines an image. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") +@JsonTypeName("ImageObject") +public class ImageObject extends MediaObject { + /** + * The URL to a thumbnail of the image. + */ + @JsonProperty(value = "thumbnail", access = JsonProperty.Access.WRITE_ONLY) + private ImageObject thumbnail; + + /** + * The token that you use in a subsequent call to the Image Search API to + * get additional information about the image. For information about using + * this token, see the insightsToken query parameter. + */ + @JsonProperty(value = "imageInsightsToken", access = JsonProperty.Access.WRITE_ONLY) + private String imageInsightsToken; + + /** + * Unique Id for the image. + */ + @JsonProperty(value = "imageId", access = JsonProperty.Access.WRITE_ONLY) + private String imageId; + + /** + * A three-byte hexadecimal number that represents the color that dominates + * the image. Use the color as the temporary background in your client + * until the image is loaded. + */ + @JsonProperty(value = "accentColor", access = JsonProperty.Access.WRITE_ONLY) + private String accentColor; + + /** + * Visual representation of the image. Used for getting more sizes. + */ + @JsonProperty(value = "visualWords", access = JsonProperty.Access.WRITE_ONLY) + private String visualWords; + + /** + * Get the URL to a thumbnail of the image. + * + * @return the thumbnail value + */ + public ImageObject thumbnail() { + return this.thumbnail; + } + + /** + * Get the token that you use in a subsequent call to the Image Search API to get additional information about the image. For information about using this token, see the insightsToken query parameter. + * + * @return the imageInsightsToken value + */ + public String imageInsightsToken() { + return this.imageInsightsToken; + } + + /** + * Get unique Id for the image. + * + * @return the imageId value + */ + public String imageId() { + return this.imageId; + } + + /** + * Get a three-byte hexadecimal number that represents the color that dominates the image. Use the color as the temporary background in your client until the image is loaded. + * + * @return the accentColor value + */ + public String accentColor() { + return this.accentColor; + } + + /** + * Get visual representation of the image. Used for getting more sizes. + * + * @return the visualWords value + */ + public String visualWords() { + return this.visualWords; + } + +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageSize.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageSize.java new file mode 100644 index 000000000000..b6bff07ea7e0 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageSize.java @@ -0,0 +1,50 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImageSize. + */ +public final class ImageSize extends ExpandableStringEnum { + /** Static value All for ImageSize. */ + public static final ImageSize ALL = fromString("All"); + + /** Static value Small for ImageSize. */ + public static final ImageSize SMALL = fromString("Small"); + + /** Static value Medium for ImageSize. */ + public static final ImageSize MEDIUM = fromString("Medium"); + + /** Static value Large for ImageSize. */ + public static final ImageSize LARGE = fromString("Large"); + + /** Static value Wallpaper for ImageSize. */ + public static final ImageSize WALLPAPER = fromString("Wallpaper"); + + /** + * Creates or finds a ImageSize from its string representation. + * @param name a name to look for + * @return the corresponding ImageSize + */ + @JsonCreator + public static ImageSize fromString(String name) { + return fromString(name, ImageSize.class); + } + + /** + * @return known ImageSize values + */ + public static Collection values() { + return values(ImageSize.class); + } +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageType.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageType.java new file mode 100644 index 000000000000..6babfb597c2c --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ImageType.java @@ -0,0 +1,53 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImageType. + */ +public final class ImageType extends ExpandableStringEnum { + /** Static value AnimatedGif for ImageType. */ + public static final ImageType ANIMATED_GIF = fromString("AnimatedGif"); + + /** Static value Clipart for ImageType. */ + public static final ImageType CLIPART = fromString("Clipart"); + + /** Static value Line for ImageType. */ + public static final ImageType LINE = fromString("Line"); + + /** Static value Photo for ImageType. */ + public static final ImageType PHOTO = fromString("Photo"); + + /** Static value Shopping for ImageType. */ + public static final ImageType SHOPPING = fromString("Shopping"); + + /** Static value Transparent for ImageType. */ + public static final ImageType TRANSPARENT = fromString("Transparent"); + + /** + * Creates or finds a ImageType from its string representation. + * @param name a name to look for + * @return the corresponding ImageType + */ + @JsonCreator + public static ImageType fromString(String name) { + return fromString(name, ImageType.class); + } + + /** + * @return known ImageType values + */ + public static Collection values() { + return values(ImageType.class); + } +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/MediaObject.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/MediaObject.java new file mode 100644 index 000000000000..2edc2deafa15 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/MediaObject.java @@ -0,0 +1,131 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines a media object. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") +@JsonTypeName("MediaObject") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ImageObject", value = ImageObject.class) +}) +public class MediaObject extends CreativeWork { + /** + * Original URL to retrieve the source (file) for the media object (e.g the + * source URL for the image). + */ + @JsonProperty(value = "contentUrl", access = JsonProperty.Access.WRITE_ONLY) + private String contentUrl; + + /** + * URL of the page that hosts the media object. + */ + @JsonProperty(value = "hostPageUrl", access = JsonProperty.Access.WRITE_ONLY) + private String hostPageUrl; + + /** + * Size of the media object content (use format "value unit" e.g "1024 B"). + */ + @JsonProperty(value = "contentSize", access = JsonProperty.Access.WRITE_ONLY) + private String contentSize; + + /** + * Encoding format (e.g mp3, mp4, jpeg, etc). + */ + @JsonProperty(value = "encodingFormat", access = JsonProperty.Access.WRITE_ONLY) + private String encodingFormat; + + /** + * Display URL of the page that hosts the media object. + */ + @JsonProperty(value = "hostPageDisplayUrl", access = JsonProperty.Access.WRITE_ONLY) + private String hostPageDisplayUrl; + + /** + * The width of the media object, in pixels. + */ + @JsonProperty(value = "width", access = JsonProperty.Access.WRITE_ONLY) + private Integer width; + + /** + * The height of the media object, in pixels. + */ + @JsonProperty(value = "height", access = JsonProperty.Access.WRITE_ONLY) + private Integer height; + + /** + * Get original URL to retrieve the source (file) for the media object (e.g the source URL for the image). + * + * @return the contentUrl value + */ + public String contentUrl() { + return this.contentUrl; + } + + /** + * Get uRL of the page that hosts the media object. + * + * @return the hostPageUrl value + */ + public String hostPageUrl() { + return this.hostPageUrl; + } + + /** + * Get size of the media object content (use format "value unit" e.g "1024 B"). + * + * @return the contentSize value + */ + public String contentSize() { + return this.contentSize; + } + + /** + * Get encoding format (e.g mp3, mp4, jpeg, etc). + * + * @return the encodingFormat value + */ + public String encodingFormat() { + return this.encodingFormat; + } + + /** + * Get display URL of the page that hosts the media object. + * + * @return the hostPageDisplayUrl value + */ + public String hostPageDisplayUrl() { + return this.hostPageDisplayUrl; + } + + /** + * Get the width of the media object, in pixels. + * + * @return the width value + */ + public Integer width() { + return this.width; + } + + /** + * Get the height of the media object, in pixels. + * + * @return the height value + */ + public Integer height() { + return this.height; + } + +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Query.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Query.java new file mode 100644 index 000000000000..a3d8833494b3 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Query.java @@ -0,0 +1,112 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines a search query. + */ +public class Query { + /** + * The query string. Use this string as the query term in a new search + * request. + */ + @JsonProperty(value = "text", required = true) + private String text; + + /** + * The display version of the query term. This version of the query term + * may contain special characters that highlight the search term found in + * the query string. The string contains the highlighting characters only + * if the query enabled hit highlighting. + */ + @JsonProperty(value = "displayText", access = JsonProperty.Access.WRITE_ONLY) + private String displayText; + + /** + * The URL that takes the user to the Bing search results page for the + * query.Only related search results include this field. + */ + @JsonProperty(value = "webSearchUrl", access = JsonProperty.Access.WRITE_ONLY) + private String webSearchUrl; + + /** + * The URL that you use to get the results of the related search. Before + * using the URL, you must append query parameters as appropriate and + * include the Ocp-Apim-Subscription-Key header. Use this URL if you're + * displaying the results in your own user interface. Otherwise, use the + * webSearchUrl URL. + */ + @JsonProperty(value = "searchLink", access = JsonProperty.Access.WRITE_ONLY) + private String searchLink; + + /** + * The URL to a thumbnail of a related image. + */ + @JsonProperty(value = "thumbnail", access = JsonProperty.Access.WRITE_ONLY) + private ImageObject thumbnail; + + /** + * Get the query string. Use this string as the query term in a new search request. + * + * @return the text value + */ + public String text() { + return this.text; + } + + /** + * Set the query string. Use this string as the query term in a new search request. + * + * @param text the text value to set + * @return the Query object itself. + */ + public Query withText(String text) { + this.text = text; + return this; + } + + /** + * Get the display version of the query term. This version of the query term may contain special characters that highlight the search term found in the query string. The string contains the highlighting characters only if the query enabled hit highlighting. + * + * @return the displayText value + */ + public String displayText() { + return this.displayText; + } + + /** + * Get the URL that takes the user to the Bing search results page for the query.Only related search results include this field. + * + * @return the webSearchUrl value + */ + public String webSearchUrl() { + return this.webSearchUrl; + } + + /** + * Get the URL that you use to get the results of the related search. Before using the URL, you must append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. Use this URL if you're displaying the results in your own user interface. Otherwise, use the webSearchUrl URL. + * + * @return the searchLink value + */ + public String searchLink() { + return this.searchLink; + } + + /** + * Get the URL to a thumbnail of a related image. + * + * @return the thumbnail value + */ + public ImageObject thumbnail() { + return this.thumbnail; + } + +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Response.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Response.java new file mode 100644 index 000000000000..b98f5fcec234 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Response.java @@ -0,0 +1,58 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines a response. All schemas that could be returned at the root of a + * response should inherit from this. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") +@JsonTypeName("Response") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Answer", value = Answer.class), + @JsonSubTypes.Type(name = "Thing", value = Thing.class), + @JsonSubTypes.Type(name = "ErrorResponse", value = ErrorResponse.class) +}) +public class Response extends Identifiable { + /** + * The URL that returns this resource. + */ + @JsonProperty(value = "readLink", access = JsonProperty.Access.WRITE_ONLY) + private String readLink; + + /** + * The URL To Bing's search result for this item. + */ + @JsonProperty(value = "webSearchUrl", access = JsonProperty.Access.WRITE_ONLY) + private String webSearchUrl; + + /** + * Get the URL that returns this resource. + * + * @return the readLink value + */ + public String readLink() { + return this.readLink; + } + + /** + * Get the URL To Bing's search result for this item. + * + * @return the webSearchUrl value + */ + public String webSearchUrl() { + return this.webSearchUrl; + } + +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ResponseBase.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ResponseBase.java new file mode 100644 index 000000000000..86ef19e31378 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/ResponseBase.java @@ -0,0 +1,24 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Response base. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") +@JsonTypeName("ResponseBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Identifiable", value = Identifiable.class) +}) +public class ResponseBase { +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/SafeSearch.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/SafeSearch.java new file mode 100644 index 000000000000..42e44690f01d --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/SafeSearch.java @@ -0,0 +1,44 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SafeSearch. + */ +public final class SafeSearch extends ExpandableStringEnum { + /** Static value Off for SafeSearch. */ + public static final SafeSearch OFF = fromString("Off"); + + /** Static value Moderate for SafeSearch. */ + public static final SafeSearch MODERATE = fromString("Moderate"); + + /** Static value Strict for SafeSearch. */ + public static final SafeSearch STRICT = fromString("Strict"); + + /** + * Creates or finds a SafeSearch from its string representation. + * @param name a name to look for + * @return the corresponding SafeSearch + */ + @JsonCreator + public static SafeSearch fromString(String name) { + return fromString(name, SafeSearch.class); + } + + /** + * @return known SafeSearch values + */ + public static Collection values() { + return values(SafeSearch.class); + } +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/SearchResultsAnswer.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/SearchResultsAnswer.java new file mode 100644 index 000000000000..4116fe37fd90 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/SearchResultsAnswer.java @@ -0,0 +1,42 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines a search result answer. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") +@JsonTypeName("SearchResultsAnswer") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Images", value = ImagesInner.class) +}) +public class SearchResultsAnswer extends Answer { + /** + * The estimated number of webpages that are relevant to the query. Use + * this number along with the count and offset query parameters to page the + * results. + */ + @JsonProperty(value = "totalEstimatedMatches", access = JsonProperty.Access.WRITE_ONLY) + private Long totalEstimatedMatches; + + /** + * Get the estimated number of webpages that are relevant to the query. Use this number along with the count and offset query parameters to page the results. + * + * @return the totalEstimatedMatches value + */ + public Long totalEstimatedMatches() { + return this.totalEstimatedMatches; + } + +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Thing.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Thing.java new file mode 100644 index 000000000000..a12f7ba3f964 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/Thing.java @@ -0,0 +1,116 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Defines a thing. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") +@JsonTypeName("Thing") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "CreativeWork", value = CreativeWork.class) +}) +public class Thing extends Response { + /** + * The name of the thing represented by this object. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The URL to get more information about the thing represented by this + * object. + */ + @JsonProperty(value = "url", access = JsonProperty.Access.WRITE_ONLY) + private String url; + + /** + * An image of the item. + */ + @JsonProperty(value = "image", access = JsonProperty.Access.WRITE_ONLY) + private ImageObject image; + + /** + * A short description of the item. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * An alias for the item. + */ + @JsonProperty(value = "alternateName", access = JsonProperty.Access.WRITE_ONLY) + private String alternateName; + + /** + * An ID that uniquely identifies this item. + */ + @JsonProperty(value = "bingId", access = JsonProperty.Access.WRITE_ONLY) + private String bingId; + + /** + * Get the name of the thing represented by this object. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the URL to get more information about the thing represented by this object. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Get an image of the item. + * + * @return the image value + */ + public ImageObject image() { + return this.image; + } + + /** + * Get a short description of the item. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get an alias for the item. + * + * @return the alternateName value + */ + public String alternateName() { + return this.alternateName; + } + + /** + * Get an ID that uniquely identifies this item. + * + * @return the bingId value + */ + public String bingId() { + return this.bingId; + } + +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/WebPage.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/WebPage.java new file mode 100644 index 000000000000..1814c0787c8f --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/WebPage.java @@ -0,0 +1,20 @@ +/** + * 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.cognitiveservices.customimagesearch; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines a webpage that is relevant to the query. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") +@JsonTypeName("WebPage") +public class WebPage extends CreativeWork { +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/implementation/CustomImageSearchAPIImpl.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/implementation/CustomImageSearchAPIImpl.java new file mode 100644 index 000000000000..4b90f09b300d --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/implementation/CustomImageSearchAPIImpl.java @@ -0,0 +1,160 @@ +/** + * 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.cognitiveservices.customimagesearch.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the CustomImageSearchAPIImpl class. + */ +public class CustomImageSearchAPIImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public CustomImageSearchAPIImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public CustomImageSearchAPIImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public CustomImageSearchAPIImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The CustomInstancesInner object to access its operations. + */ + private CustomInstancesInner customInstances; + + /** + * Gets the CustomInstancesInner object to access its operations. + * @return the CustomInstancesInner object. + */ + public CustomInstancesInner customInstances() { + return this.customInstances; + } + + /** + * Initializes an instance of CustomImageSearchAPI client. + * + * @param credentials the management credentials for Azure + */ + public CustomImageSearchAPIImpl(ServiceClientCredentials credentials) { + this("https://api.cognitive.microsoft.com/bingcustomsearch/v7.0", credentials); + } + + /** + * Initializes an instance of CustomImageSearchAPI client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public CustomImageSearchAPIImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of CustomImageSearchAPI client. + * + * @param restClient the REST client to connect to Azure. + */ + public CustomImageSearchAPIImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.customInstances = new CustomInstancesInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "CustomImageSearchAPI", "1.0"); + } +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/implementation/CustomInstancesInner.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/implementation/CustomInstancesInner.java new file mode 100644 index 000000000000..99f39b463453 --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/implementation/CustomInstancesInner.java @@ -0,0 +1,346 @@ +/** + * 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.cognitiveservices.customimagesearch.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.cognitiveservices.customimagesearch.ErrorResponseException; +import com.microsoft.azure.cognitiveservices.customimagesearch.Freshness; +import com.microsoft.azure.cognitiveservices.customimagesearch.ImageAspect; +import com.microsoft.azure.cognitiveservices.customimagesearch.ImageColor; +import com.microsoft.azure.cognitiveservices.customimagesearch.ImageContent; +import com.microsoft.azure.cognitiveservices.customimagesearch.ImageLicense; +import com.microsoft.azure.cognitiveservices.customimagesearch.ImageSize; +import com.microsoft.azure.cognitiveservices.customimagesearch.ImageType; +import com.microsoft.azure.cognitiveservices.customimagesearch.SafeSearch; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CustomInstances. + */ +public class CustomInstancesInner { + /** The Retrofit service to perform REST calls. */ + private CustomInstancesService service; + /** The service client containing this operation class. */ + private CustomImageSearchAPIImpl client; + + /** + * Initializes an instance of CustomInstancesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CustomInstancesInner(Retrofit retrofit, CustomImageSearchAPIImpl client) { + this.service = retrofit.create(CustomInstancesService.class); + this.client = client; + } + + /** + * The interface defining all the services for CustomInstances to be + * used by Retrofit to perform actually REST calls. + */ + interface CustomInstancesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.customimagesearch.CustomInstances imageSearch" }) + @GET("images/search") + Observable> imageSearch(@Header("X-BingApis-SDK") String xBingApisSDK, @Header("Accept-Language") String acceptLanguage, @Header("User-Agent") String userAgent, @Header("X-MSEdge-ClientID") String clientId, @Header("X-MSEdge-ClientIP") String clientIp, @Header("X-Search-Location") String location, @Query("customConfig") long customConfig, @Query("aspect") ImageAspect aspect, @Query("color") ImageColor color, @Query("cc") String countryCode, @Query("count") Integer count, @Query("freshness") Freshness freshness, @Query("height") Integer height, @Query("id") String id, @Query("imageContent") ImageContent imageContent, @Query("imageType") ImageType imageType, @Query("license") ImageLicense license, @Query("mkt") String market, @Query("maxFileSize") Long maxFileSize, @Query("maxHeight") Long maxHeight, @Query("maxWidth") Long maxWidth, @Query("minFileSize") Long minFileSize, @Query("minHeight") Long minHeight, @Query("minWidth") Long minWidth, @Query("offset") Long offset, @Query("q") String query, @Query("safeSearch") SafeSearch safeSearch, @Query("size") ImageSize size, @Query("setLang") String setLang, @Query("width") Integer width, @Header("User-Agent") String userAgent); + + } + + /** + * The Custom Image Search API lets you send an image search query to Bing and get image results found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term cannot be empty. The term may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, to limit images to a specific domain, use the [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. To help improve relevance of an insights query (see [insightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#insightstoken)), you should always include the user's query term. Use this parameter only with the Image Search API.Do not specify this parameter when calling the Trending Images API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagesInner object if successful. + */ + public ImagesInner imageSearch(long customConfig, String query) { + return imageSearchWithServiceResponseAsync(customConfig, query).toBlocking().single().body(); + } + + /** + * The Custom Image Search API lets you send an image search query to Bing and get image results found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term cannot be empty. The term may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, to limit images to a specific domain, use the [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. To help improve relevance of an insights query (see [insightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#insightstoken)), you should always include the user's query term. Use this parameter only with the Image Search API.Do not specify this parameter when calling the Trending Images API. + * @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 imageSearchAsync(long customConfig, String query, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(imageSearchWithServiceResponseAsync(customConfig, query), serviceCallback); + } + + /** + * The Custom Image Search API lets you send an image search query to Bing and get image results found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term cannot be empty. The term may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, to limit images to a specific domain, use the [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. To help improve relevance of an insights query (see [insightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#insightstoken)), you should always include the user's query term. Use this parameter only with the Image Search API.Do not specify this parameter when calling the Trending Images API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagesInner object + */ + public Observable imageSearchAsync(long customConfig, String query) { + return imageSearchWithServiceResponseAsync(customConfig, query).map(new Func1, ImagesInner>() { + @Override + public ImagesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Custom Image Search API lets you send an image search query to Bing and get image results found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term cannot be empty. The term may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, to limit images to a specific domain, use the [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. To help improve relevance of an insights query (see [insightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#insightstoken)), you should always include the user's query term. Use this parameter only with the Image Search API.Do not specify this parameter when calling the Trending Images API. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagesInner object + */ + public Observable> imageSearchWithServiceResponseAsync(long customConfig, String query) { + if (query == null) { + throw new IllegalArgumentException("Parameter query is required and cannot be null."); + } + final String xBingApisSDK = "true"; + final String acceptLanguage = null; + final String clientId = null; + final String clientIp = null; + final String location = null; + final ImageAspect aspect = null; + final ImageColor color = null; + final String countryCode = null; + final Integer count = null; + final Freshness freshness = null; + final Integer height = null; + final String id = null; + final ImageContent imageContent = null; + final ImageType imageType = null; + final ImageLicense license = null; + final String market = null; + final Long maxFileSize = null; + final Long maxHeight = null; + final Long maxWidth = null; + final Long minFileSize = null; + final Long minHeight = null; + final Long minWidth = null; + final Long offset = null; + final SafeSearch safeSearch = null; + final ImageSize size = null; + final String setLang = null; + final Integer width = null; + return service.imageSearch(xBingApisSDK, acceptLanguage, this.client.userAgent(), clientId, clientIp, location, customConfig, aspect, color, countryCode, count, freshness, height, id, imageContent, imageType, license, market, maxFileSize, maxHeight, maxWidth, minFileSize, minHeight, minWidth, offset, query, safeSearch, size, setLang, width, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = imageSearchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The Custom Image Search API lets you send an image search query to Bing and get image results found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term cannot be empty. The term may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, to limit images to a specific domain, use the [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. To help improve relevance of an insights query (see [insightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#insightstoken)), you should always include the user's query term. Use this parameter only with the Image Search API.Do not specify this parameter when calling the Trending Images API. + * @param acceptLanguage A comma-delimited list of one or more languages to use for user interface strings. The list is in decreasing order of preference. For additional information, including expected format, see [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This header and the [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#setlang) query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#cc) query parameter. To determine the market to return results for, Bing uses the first supported language it finds from the list and combines it with the cc parameter value. If the list does not include a supported language, Bing finds the closest language and market that supports the request or it uses an aggregated or default market for the results. To determine the market that Bing used, see the BingAPIs-Market header. Use this header and the cc query parameter only if you specify multiple languages. Otherwise, use the [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#mkt) and [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#setlang) query parameters. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Any links to Bing.com properties in the response objects apply the specified language. + * @param clientId Bing uses this header to provide users with consistent behavior across Bing API calls. Bing often flights new features and improvements, and it uses the client ID as a key for assigning traffic on different flights. If you do not use the same client ID for a user across multiple requests, then Bing may assign the user to multiple conflicting flights. Being assigned to multiple conflicting flights can lead to an inconsistent user experience. For example, if the second request has a different flight assignment than the first, the experience may be unexpected. Also, Bing can use the client ID to tailor web results to that client ID’s search history, providing a richer experience for the user. Bing also uses this header to help improve result rankings by analyzing the activity generated by a client ID. The relevance improvements help with better quality of results delivered by Bing APIs and in turn enables higher click-through rates for the API consumer. IMPORTANT: Although optional, you should consider this header required. Persisting the client ID across multiple requests for the same end user and device combination enables 1) the API consumer to receive a consistent user experience, and 2) higher click-through rates via better quality of results from the Bing APIs. Each user that uses your application on the device must have a unique, Bing generated client ID. If you do not include this header in the request, Bing generates an ID and returns it in the X-MSEdge-ClientID response header. The only time that you should NOT include this header in a request is the first time the user uses your app on that device. Use the client ID for each Bing API request that your app makes for this user on the device. Persist the client ID. To persist the ID in a browser app, use a persistent HTTP cookie to ensure the ID is used across all sessions. Do not use a session cookie. For other apps such as mobile apps, use the device's persistent storage to persist the ID. The next time the user uses your app on that device, get the client ID that you persisted. Bing responses may or may not include this header. If the response includes this header, capture the client ID and use it for all subsequent Bing requests for the user on that device. If you include the X-MSEdge-ClientID, you must not include cookies in the request. + * @param clientIp The IPv4 or IPv6 address of the client device. The IP address is used to discover the user's location. Bing uses the location information to determine safe search behavior. Although optional, you are encouraged to always specify this header and the X-Search-Location header. Do not obfuscate the address (for example, by changing the last octet to 0). Obfuscating the address results in the location not being anywhere near the device's actual location, which may result in Bing serving erroneous results. + * @param location A semicolon-delimited list of key/value pairs that describe the client's geographical location. Bing uses the location information to determine safe search behavior and to return relevant local content. Specify the key/value pair as <key>:<value>. The following are the keys that you use to specify the user's location. lat (required): The latitude of the client's location, in degrees. The latitude must be greater than or equal to -90.0 and less than or equal to +90.0. Negative values indicate southern latitudes and positive values indicate northern latitudes. long (required): The longitude of the client's location, in degrees. The longitude must be greater than or equal to -180.0 and less than or equal to +180.0. Negative values indicate western longitudes and positive values indicate eastern longitudes. re (required): The radius, in meters, which specifies the horizontal accuracy of the coordinates. Pass the value returned by the device's location service. Typical values might be 22m for GPS/Wi-Fi, 380m for cell tower triangulation, and 18,000m for reverse IP lookup. ts (optional): The UTC UNIX timestamp of when the client was at the location. (The UNIX timestamp is the number of seconds since January 1, 1970.) head (optional): The client's relative heading or direction of travel. Specify the direction of travel as degrees from 0 through 360, counting clockwise relative to true north. Specify this key only if the sp key is nonzero. sp (optional): The horizontal velocity (speed), in meters per second, that the client device is traveling. alt (optional): The altitude of the client device, in meters. are (optional): The radius, in meters, that specifies the vertical accuracy of the coordinates. Specify this key only if you specify the alt key. Although many of the keys are optional, the more information that you provide, the more accurate the location results are. Although optional, you are encouraged to always specify the user's geographical location. Providing the location is especially important if the client's IP address does not accurately reflect the user's physical location (for example, if the client uses VPN). For optimal results, you should include this header and the X-MSEdge-ClientIP header, but at a minimum, you should include this header. + * @param aspect Filter images by the following aspect ratios. All: Do not filter by aspect.Specifying this value is the same as not specifying the aspect parameter. Square: Return images with standard aspect ratio. Wide: Return images with wide screen aspect ratio. Tall: Return images with tall aspect ratio. Possible values include: 'All', 'Square', 'Wide', 'Tall' + * @param color Filter images by the following color options. ColorOnly: Return color images. Monochrome: Return black and white images. Return images with one of the following dominant colors: Black, Blue, Brown, Gray, Green, Orange, Pink, Purple, Red, Teal, White, Yellow. Possible values include: 'ColorOnly', 'Monochrome', 'Black', 'Blue', 'Brown', 'Gray', 'Green', 'Orange', 'Pink', 'Purple', 'Red', 'Teal', 'White', 'Yellow' + * @param countryCode A 2-character country code of the country where the results come from. For a list of possible values, see [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#market-codes). If you set this parameter, you must also specify the [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#acceptlanguage) header. Bing uses the first supported language it finds from the languages list, and combine that language with the country code that you specify to determine the market to return results for. If the languages list does not include a supported language, Bing finds the closest language and market that supports the request, or it may use an aggregated or default market for the results instead of a specified one. You should use this query parameter and the Accept-Language query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. This parameter and the [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#mkt) query parameter are mutually exclusive—do not specify both. + * @param count The number of images to return in the response. The actual number delivered may be less than requested. The default is 35. The maximum value is 150. You use this parameter along with the offset parameter to page results.For example, if your user interface displays 20 images per page, set count to 20 and offset to 0 to get the first page of results.For each subsequent page, increment offset by 20 (for example, 0, 20, 40). Use this parameter only with the Image Search API.Do not specify this parameter when calling the Insights, Trending Images, or Web Search APIs. + * @param freshness Filter images by the following discovery options. Day: Return images discovered by Bing within the last 24 hours. Week: Return images discovered by Bing within the last 7 days. Month: Return images discovered by Bing within the last 30 days. Possible values include: 'Day', 'Week', 'Month' + * @param height Filter images that have the specified height, in pixels. You may use this filter with the size filter to return small images that have a height of 150 pixels. + * @param id An ID that uniquely identifies an image. Use this parameter to ensure that the specified image is the first image in the list of images that Bing returns. The [Image](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image) object's imageId field contains the ID that you set this parameter to. + * @param imageContent Filter images by the following content types. Face: Return images that show only a person's face. Portrait: Return images that show only a person's head and shoulders. Possible values include: 'Face', 'Portrait' + * @param imageType Filter images by the following image types. AnimatedGif: Return only animated GIFs. Clipart: Return only clip art images. Line: Return only line drawings. Photo: Return only photographs(excluding line drawings, animated Gifs, and clip art). Shopping: Return only images that contain items where Bing knows of a merchant that is selling the items. This option is valid in the en - US market only.Transparent: Return only images with a transparent background. Possible values include: 'AnimatedGif', 'Clipart', 'Line', 'Photo', 'Shopping', 'Transparent' + * @param license Filter images by the following license types. All: Do not filter by license type.Specifying this value is the same as not specifying the license parameter. Any: Return images that are under any license type. The response doesn't include images that do not specify a license or the license is unknown. Public: Return images where the creator has waived their exclusive rights, to the fullest extent allowed by law. Share: Return images that may be shared with others. Changing or editing the image might not be allowed. Also, modifying, sharing, and using the image for commercial purposes might not be allowed. Typically, this option returns the most images. ShareCommercially: Return images that may be shared with others for personal or commercial purposes. Changing or editing the image might not be allowed. Modify: Return images that may be modified, shared, and used. Changing or editing the image might not be allowed. Modifying, sharing, and using the image for commercial purposes might not be allowed. ModifyCommercially: Return images that may be modified, shared, and used for personal or commercial purposes. Typically, this option returns the fewest images. For more information about these license types, see [Filter Images By License Type](http://go.microsoft.com/fwlink/?LinkId=309768). Possible values include: 'All', 'Any', 'Public', 'Share', 'ShareCommercially', 'Modify', 'ModifyCommercially' + * @param market The market where the results come from. Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. For a list of possible market values, see [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#market-codes). NOTE: If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#market-codes), Bing uses a best fit market code based on an internal mapping that is subject to change. This parameter and the [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#cc) query parameter are mutually exclusive—do not specify both. + * @param maxFileSize Filter images that are less than or equal to the specified file size. The maximum file size that you may specify is 520,192 bytes. If you specify a larger value, the API uses 520,192. It is possible that the response may include images that are slightly larger than the specified maximum. You may specify this filter and minFileSize to filter images within a range of file sizes. + * @param maxHeight Filter images that have a height that is less than or equal to the specified height. Specify the height in pixels. You may specify this filter and minHeight to filter images within a range of heights. This filter and the height filter are mutually exclusive. + * @param maxWidth Filter images that have a width that is less than or equal to the specified width. Specify the width in pixels. You may specify this filter and maxWidth to filter images within a range of widths. This filter and the width filter are mutually exclusive. + * @param minFileSize Filter images that are greater than or equal to the specified file size. The maximum file size that you may specify is 520,192 bytes. If you specify a larger value, the API uses 520,192. It is possible that the response may include images that are slightly smaller than the specified minimum. You may specify this filter and maxFileSize to filter images within a range of file sizes. + * @param minHeight Filter images that have a height that is greater than or equal to the specified height. Specify the height in pixels. You may specify this filter and maxHeight to filter images within a range of heights. This filter and the height filter are mutually exclusive. + * @param minWidth Filter images that have a width that is greater than or equal to the specified width. Specify the width in pixels. You may specify this filter and maxWidth to filter images within a range of widths. This filter and the width filter are mutually exclusive. + * @param offset The zero-based offset that indicates the number of images to skip before returning images. The default is 0. The offset should be less than ([totalEstimatedMatches](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#totalestimatedmatches) - count). Use this parameter along with the count parameter to page results. For example, if your user interface displays 20 images per page, set count to 20 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 20 (for example, 0, 20, 40). It is possible for multiple pages to include some overlap in results. To prevent duplicates, see [nextOffset](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#nextoffset). Use this parameter only with the Image API. Do not specify this parameter when calling the Trending Images API or the Web Search API. + * @param safeSearch Filter images for adult content. The following are the possible filter values. Off: May return images with adult content. If the request is through the Image Search API, the response includes thumbnail images that are clear (non-fuzzy). However, if the request is through the Web Search API, the response includes thumbnail images that are pixelated (fuzzy). Moderate: If the request is through the Image Search API, the response doesn't include images with adult content. If the request is through the Web Search API, the response may include images with adult content (the thumbnail images are pixelated (fuzzy)). Strict: Do not return images with adult content. The default is Moderate. If the request comes from a market that Bing's adult policy requires that safeSearch is set to Strict, Bing ignores the safeSearch value and uses Strict. If you use the site: query operator, there is the chance that the response may contain adult content regardless of what the safeSearch query parameter is set to. Use site: only if you are aware of the content on the site and your scenario supports the possibility of adult content. Possible values include: 'Off', 'Moderate', 'Strict' + * @param size Filter images by the following sizes. All: Do not filter by size. Specifying this value is the same as not specifying the size parameter. Small: Return images that are less than 200x200 pixels. Medium: Return images that are greater than or equal to 200x200 pixels but less than 500x500 pixels. Large: Return images that are 500x500 pixels or larger. Wallpaper: Return wallpaper images. You may use this parameter along with the height or width parameters. For example, you may use height and size to request small images that are 150 pixels tall. Possible values include: 'All', 'Small', 'Medium', 'Large', 'Wallpaper' + * @param setLang The language to use for user interface strings. Specify the language using the ISO 639-1 2-letter language code. For example, the language code for English is EN. The default is EN (English). Although optional, you should always specify the language. Typically, you set setLang to the same language specified by mkt unless the user wants the user interface strings displayed in a different language. This parameter and the [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#acceptlanguage) header are mutually exclusive; do not specify both. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Also, any links to Bing.com properties in the response objects apply the specified language. + * @param width Filter images that have the specified width, in pixels. You may use this filter with the size filter to return small images that have a width of 150 pixels. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ImagesInner object if successful. + */ + public ImagesInner imageSearch(long customConfig, String query, String acceptLanguage, String clientId, String clientIp, String location, ImageAspect aspect, ImageColor color, String countryCode, Integer count, Freshness freshness, Integer height, String id, ImageContent imageContent, ImageType imageType, ImageLicense license, String market, Long maxFileSize, Long maxHeight, Long maxWidth, Long minFileSize, Long minHeight, Long minWidth, Long offset, SafeSearch safeSearch, ImageSize size, String setLang, Integer width) { + return imageSearchWithServiceResponseAsync(customConfig, query, acceptLanguage, clientId, clientIp, location, aspect, color, countryCode, count, freshness, height, id, imageContent, imageType, license, market, maxFileSize, maxHeight, maxWidth, minFileSize, minHeight, minWidth, offset, safeSearch, size, setLang, width).toBlocking().single().body(); + } + + /** + * The Custom Image Search API lets you send an image search query to Bing and get image results found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term cannot be empty. The term may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, to limit images to a specific domain, use the [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. To help improve relevance of an insights query (see [insightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#insightstoken)), you should always include the user's query term. Use this parameter only with the Image Search API.Do not specify this parameter when calling the Trending Images API. + * @param acceptLanguage A comma-delimited list of one or more languages to use for user interface strings. The list is in decreasing order of preference. For additional information, including expected format, see [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This header and the [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#setlang) query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#cc) query parameter. To determine the market to return results for, Bing uses the first supported language it finds from the list and combines it with the cc parameter value. If the list does not include a supported language, Bing finds the closest language and market that supports the request or it uses an aggregated or default market for the results. To determine the market that Bing used, see the BingAPIs-Market header. Use this header and the cc query parameter only if you specify multiple languages. Otherwise, use the [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#mkt) and [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#setlang) query parameters. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Any links to Bing.com properties in the response objects apply the specified language. + * @param clientId Bing uses this header to provide users with consistent behavior across Bing API calls. Bing often flights new features and improvements, and it uses the client ID as a key for assigning traffic on different flights. If you do not use the same client ID for a user across multiple requests, then Bing may assign the user to multiple conflicting flights. Being assigned to multiple conflicting flights can lead to an inconsistent user experience. For example, if the second request has a different flight assignment than the first, the experience may be unexpected. Also, Bing can use the client ID to tailor web results to that client ID’s search history, providing a richer experience for the user. Bing also uses this header to help improve result rankings by analyzing the activity generated by a client ID. The relevance improvements help with better quality of results delivered by Bing APIs and in turn enables higher click-through rates for the API consumer. IMPORTANT: Although optional, you should consider this header required. Persisting the client ID across multiple requests for the same end user and device combination enables 1) the API consumer to receive a consistent user experience, and 2) higher click-through rates via better quality of results from the Bing APIs. Each user that uses your application on the device must have a unique, Bing generated client ID. If you do not include this header in the request, Bing generates an ID and returns it in the X-MSEdge-ClientID response header. The only time that you should NOT include this header in a request is the first time the user uses your app on that device. Use the client ID for each Bing API request that your app makes for this user on the device. Persist the client ID. To persist the ID in a browser app, use a persistent HTTP cookie to ensure the ID is used across all sessions. Do not use a session cookie. For other apps such as mobile apps, use the device's persistent storage to persist the ID. The next time the user uses your app on that device, get the client ID that you persisted. Bing responses may or may not include this header. If the response includes this header, capture the client ID and use it for all subsequent Bing requests for the user on that device. If you include the X-MSEdge-ClientID, you must not include cookies in the request. + * @param clientIp The IPv4 or IPv6 address of the client device. The IP address is used to discover the user's location. Bing uses the location information to determine safe search behavior. Although optional, you are encouraged to always specify this header and the X-Search-Location header. Do not obfuscate the address (for example, by changing the last octet to 0). Obfuscating the address results in the location not being anywhere near the device's actual location, which may result in Bing serving erroneous results. + * @param location A semicolon-delimited list of key/value pairs that describe the client's geographical location. Bing uses the location information to determine safe search behavior and to return relevant local content. Specify the key/value pair as <key>:<value>. The following are the keys that you use to specify the user's location. lat (required): The latitude of the client's location, in degrees. The latitude must be greater than or equal to -90.0 and less than or equal to +90.0. Negative values indicate southern latitudes and positive values indicate northern latitudes. long (required): The longitude of the client's location, in degrees. The longitude must be greater than or equal to -180.0 and less than or equal to +180.0. Negative values indicate western longitudes and positive values indicate eastern longitudes. re (required): The radius, in meters, which specifies the horizontal accuracy of the coordinates. Pass the value returned by the device's location service. Typical values might be 22m for GPS/Wi-Fi, 380m for cell tower triangulation, and 18,000m for reverse IP lookup. ts (optional): The UTC UNIX timestamp of when the client was at the location. (The UNIX timestamp is the number of seconds since January 1, 1970.) head (optional): The client's relative heading or direction of travel. Specify the direction of travel as degrees from 0 through 360, counting clockwise relative to true north. Specify this key only if the sp key is nonzero. sp (optional): The horizontal velocity (speed), in meters per second, that the client device is traveling. alt (optional): The altitude of the client device, in meters. are (optional): The radius, in meters, that specifies the vertical accuracy of the coordinates. Specify this key only if you specify the alt key. Although many of the keys are optional, the more information that you provide, the more accurate the location results are. Although optional, you are encouraged to always specify the user's geographical location. Providing the location is especially important if the client's IP address does not accurately reflect the user's physical location (for example, if the client uses VPN). For optimal results, you should include this header and the X-MSEdge-ClientIP header, but at a minimum, you should include this header. + * @param aspect Filter images by the following aspect ratios. All: Do not filter by aspect.Specifying this value is the same as not specifying the aspect parameter. Square: Return images with standard aspect ratio. Wide: Return images with wide screen aspect ratio. Tall: Return images with tall aspect ratio. Possible values include: 'All', 'Square', 'Wide', 'Tall' + * @param color Filter images by the following color options. ColorOnly: Return color images. Monochrome: Return black and white images. Return images with one of the following dominant colors: Black, Blue, Brown, Gray, Green, Orange, Pink, Purple, Red, Teal, White, Yellow. Possible values include: 'ColorOnly', 'Monochrome', 'Black', 'Blue', 'Brown', 'Gray', 'Green', 'Orange', 'Pink', 'Purple', 'Red', 'Teal', 'White', 'Yellow' + * @param countryCode A 2-character country code of the country where the results come from. For a list of possible values, see [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#market-codes). If you set this parameter, you must also specify the [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#acceptlanguage) header. Bing uses the first supported language it finds from the languages list, and combine that language with the country code that you specify to determine the market to return results for. If the languages list does not include a supported language, Bing finds the closest language and market that supports the request, or it may use an aggregated or default market for the results instead of a specified one. You should use this query parameter and the Accept-Language query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. This parameter and the [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#mkt) query parameter are mutually exclusive—do not specify both. + * @param count The number of images to return in the response. The actual number delivered may be less than requested. The default is 35. The maximum value is 150. You use this parameter along with the offset parameter to page results.For example, if your user interface displays 20 images per page, set count to 20 and offset to 0 to get the first page of results.For each subsequent page, increment offset by 20 (for example, 0, 20, 40). Use this parameter only with the Image Search API.Do not specify this parameter when calling the Insights, Trending Images, or Web Search APIs. + * @param freshness Filter images by the following discovery options. Day: Return images discovered by Bing within the last 24 hours. Week: Return images discovered by Bing within the last 7 days. Month: Return images discovered by Bing within the last 30 days. Possible values include: 'Day', 'Week', 'Month' + * @param height Filter images that have the specified height, in pixels. You may use this filter with the size filter to return small images that have a height of 150 pixels. + * @param id An ID that uniquely identifies an image. Use this parameter to ensure that the specified image is the first image in the list of images that Bing returns. The [Image](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image) object's imageId field contains the ID that you set this parameter to. + * @param imageContent Filter images by the following content types. Face: Return images that show only a person's face. Portrait: Return images that show only a person's head and shoulders. Possible values include: 'Face', 'Portrait' + * @param imageType Filter images by the following image types. AnimatedGif: Return only animated GIFs. Clipart: Return only clip art images. Line: Return only line drawings. Photo: Return only photographs(excluding line drawings, animated Gifs, and clip art). Shopping: Return only images that contain items where Bing knows of a merchant that is selling the items. This option is valid in the en - US market only.Transparent: Return only images with a transparent background. Possible values include: 'AnimatedGif', 'Clipart', 'Line', 'Photo', 'Shopping', 'Transparent' + * @param license Filter images by the following license types. All: Do not filter by license type.Specifying this value is the same as not specifying the license parameter. Any: Return images that are under any license type. The response doesn't include images that do not specify a license or the license is unknown. Public: Return images where the creator has waived their exclusive rights, to the fullest extent allowed by law. Share: Return images that may be shared with others. Changing or editing the image might not be allowed. Also, modifying, sharing, and using the image for commercial purposes might not be allowed. Typically, this option returns the most images. ShareCommercially: Return images that may be shared with others for personal or commercial purposes. Changing or editing the image might not be allowed. Modify: Return images that may be modified, shared, and used. Changing or editing the image might not be allowed. Modifying, sharing, and using the image for commercial purposes might not be allowed. ModifyCommercially: Return images that may be modified, shared, and used for personal or commercial purposes. Typically, this option returns the fewest images. For more information about these license types, see [Filter Images By License Type](http://go.microsoft.com/fwlink/?LinkId=309768). Possible values include: 'All', 'Any', 'Public', 'Share', 'ShareCommercially', 'Modify', 'ModifyCommercially' + * @param market The market where the results come from. Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. For a list of possible market values, see [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#market-codes). NOTE: If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#market-codes), Bing uses a best fit market code based on an internal mapping that is subject to change. This parameter and the [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#cc) query parameter are mutually exclusive—do not specify both. + * @param maxFileSize Filter images that are less than or equal to the specified file size. The maximum file size that you may specify is 520,192 bytes. If you specify a larger value, the API uses 520,192. It is possible that the response may include images that are slightly larger than the specified maximum. You may specify this filter and minFileSize to filter images within a range of file sizes. + * @param maxHeight Filter images that have a height that is less than or equal to the specified height. Specify the height in pixels. You may specify this filter and minHeight to filter images within a range of heights. This filter and the height filter are mutually exclusive. + * @param maxWidth Filter images that have a width that is less than or equal to the specified width. Specify the width in pixels. You may specify this filter and maxWidth to filter images within a range of widths. This filter and the width filter are mutually exclusive. + * @param minFileSize Filter images that are greater than or equal to the specified file size. The maximum file size that you may specify is 520,192 bytes. If you specify a larger value, the API uses 520,192. It is possible that the response may include images that are slightly smaller than the specified minimum. You may specify this filter and maxFileSize to filter images within a range of file sizes. + * @param minHeight Filter images that have a height that is greater than or equal to the specified height. Specify the height in pixels. You may specify this filter and maxHeight to filter images within a range of heights. This filter and the height filter are mutually exclusive. + * @param minWidth Filter images that have a width that is greater than or equal to the specified width. Specify the width in pixels. You may specify this filter and maxWidth to filter images within a range of widths. This filter and the width filter are mutually exclusive. + * @param offset The zero-based offset that indicates the number of images to skip before returning images. The default is 0. The offset should be less than ([totalEstimatedMatches](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#totalestimatedmatches) - count). Use this parameter along with the count parameter to page results. For example, if your user interface displays 20 images per page, set count to 20 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 20 (for example, 0, 20, 40). It is possible for multiple pages to include some overlap in results. To prevent duplicates, see [nextOffset](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#nextoffset). Use this parameter only with the Image API. Do not specify this parameter when calling the Trending Images API or the Web Search API. + * @param safeSearch Filter images for adult content. The following are the possible filter values. Off: May return images with adult content. If the request is through the Image Search API, the response includes thumbnail images that are clear (non-fuzzy). However, if the request is through the Web Search API, the response includes thumbnail images that are pixelated (fuzzy). Moderate: If the request is through the Image Search API, the response doesn't include images with adult content. If the request is through the Web Search API, the response may include images with adult content (the thumbnail images are pixelated (fuzzy)). Strict: Do not return images with adult content. The default is Moderate. If the request comes from a market that Bing's adult policy requires that safeSearch is set to Strict, Bing ignores the safeSearch value and uses Strict. If you use the site: query operator, there is the chance that the response may contain adult content regardless of what the safeSearch query parameter is set to. Use site: only if you are aware of the content on the site and your scenario supports the possibility of adult content. Possible values include: 'Off', 'Moderate', 'Strict' + * @param size Filter images by the following sizes. All: Do not filter by size. Specifying this value is the same as not specifying the size parameter. Small: Return images that are less than 200x200 pixels. Medium: Return images that are greater than or equal to 200x200 pixels but less than 500x500 pixels. Large: Return images that are 500x500 pixels or larger. Wallpaper: Return wallpaper images. You may use this parameter along with the height or width parameters. For example, you may use height and size to request small images that are 150 pixels tall. Possible values include: 'All', 'Small', 'Medium', 'Large', 'Wallpaper' + * @param setLang The language to use for user interface strings. Specify the language using the ISO 639-1 2-letter language code. For example, the language code for English is EN. The default is EN (English). Although optional, you should always specify the language. Typically, you set setLang to the same language specified by mkt unless the user wants the user interface strings displayed in a different language. This parameter and the [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#acceptlanguage) header are mutually exclusive; do not specify both. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Also, any links to Bing.com properties in the response objects apply the specified language. + * @param width Filter images that have the specified width, in pixels. You may use this filter with the size filter to return small images that have a width of 150 pixels. + * @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 imageSearchAsync(long customConfig, String query, String acceptLanguage, String clientId, String clientIp, String location, ImageAspect aspect, ImageColor color, String countryCode, Integer count, Freshness freshness, Integer height, String id, ImageContent imageContent, ImageType imageType, ImageLicense license, String market, Long maxFileSize, Long maxHeight, Long maxWidth, Long minFileSize, Long minHeight, Long minWidth, Long offset, SafeSearch safeSearch, ImageSize size, String setLang, Integer width, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(imageSearchWithServiceResponseAsync(customConfig, query, acceptLanguage, clientId, clientIp, location, aspect, color, countryCode, count, freshness, height, id, imageContent, imageType, license, market, maxFileSize, maxHeight, maxWidth, minFileSize, minHeight, minWidth, offset, safeSearch, size, setLang, width), serviceCallback); + } + + /** + * The Custom Image Search API lets you send an image search query to Bing and get image results found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term cannot be empty. The term may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, to limit images to a specific domain, use the [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. To help improve relevance of an insights query (see [insightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#insightstoken)), you should always include the user's query term. Use this parameter only with the Image Search API.Do not specify this parameter when calling the Trending Images API. + * @param acceptLanguage A comma-delimited list of one or more languages to use for user interface strings. The list is in decreasing order of preference. For additional information, including expected format, see [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This header and the [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#setlang) query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#cc) query parameter. To determine the market to return results for, Bing uses the first supported language it finds from the list and combines it with the cc parameter value. If the list does not include a supported language, Bing finds the closest language and market that supports the request or it uses an aggregated or default market for the results. To determine the market that Bing used, see the BingAPIs-Market header. Use this header and the cc query parameter only if you specify multiple languages. Otherwise, use the [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#mkt) and [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#setlang) query parameters. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Any links to Bing.com properties in the response objects apply the specified language. + * @param clientId Bing uses this header to provide users with consistent behavior across Bing API calls. Bing often flights new features and improvements, and it uses the client ID as a key for assigning traffic on different flights. If you do not use the same client ID for a user across multiple requests, then Bing may assign the user to multiple conflicting flights. Being assigned to multiple conflicting flights can lead to an inconsistent user experience. For example, if the second request has a different flight assignment than the first, the experience may be unexpected. Also, Bing can use the client ID to tailor web results to that client ID’s search history, providing a richer experience for the user. Bing also uses this header to help improve result rankings by analyzing the activity generated by a client ID. The relevance improvements help with better quality of results delivered by Bing APIs and in turn enables higher click-through rates for the API consumer. IMPORTANT: Although optional, you should consider this header required. Persisting the client ID across multiple requests for the same end user and device combination enables 1) the API consumer to receive a consistent user experience, and 2) higher click-through rates via better quality of results from the Bing APIs. Each user that uses your application on the device must have a unique, Bing generated client ID. If you do not include this header in the request, Bing generates an ID and returns it in the X-MSEdge-ClientID response header. The only time that you should NOT include this header in a request is the first time the user uses your app on that device. Use the client ID for each Bing API request that your app makes for this user on the device. Persist the client ID. To persist the ID in a browser app, use a persistent HTTP cookie to ensure the ID is used across all sessions. Do not use a session cookie. For other apps such as mobile apps, use the device's persistent storage to persist the ID. The next time the user uses your app on that device, get the client ID that you persisted. Bing responses may or may not include this header. If the response includes this header, capture the client ID and use it for all subsequent Bing requests for the user on that device. If you include the X-MSEdge-ClientID, you must not include cookies in the request. + * @param clientIp The IPv4 or IPv6 address of the client device. The IP address is used to discover the user's location. Bing uses the location information to determine safe search behavior. Although optional, you are encouraged to always specify this header and the X-Search-Location header. Do not obfuscate the address (for example, by changing the last octet to 0). Obfuscating the address results in the location not being anywhere near the device's actual location, which may result in Bing serving erroneous results. + * @param location A semicolon-delimited list of key/value pairs that describe the client's geographical location. Bing uses the location information to determine safe search behavior and to return relevant local content. Specify the key/value pair as <key>:<value>. The following are the keys that you use to specify the user's location. lat (required): The latitude of the client's location, in degrees. The latitude must be greater than or equal to -90.0 and less than or equal to +90.0. Negative values indicate southern latitudes and positive values indicate northern latitudes. long (required): The longitude of the client's location, in degrees. The longitude must be greater than or equal to -180.0 and less than or equal to +180.0. Negative values indicate western longitudes and positive values indicate eastern longitudes. re (required): The radius, in meters, which specifies the horizontal accuracy of the coordinates. Pass the value returned by the device's location service. Typical values might be 22m for GPS/Wi-Fi, 380m for cell tower triangulation, and 18,000m for reverse IP lookup. ts (optional): The UTC UNIX timestamp of when the client was at the location. (The UNIX timestamp is the number of seconds since January 1, 1970.) head (optional): The client's relative heading or direction of travel. Specify the direction of travel as degrees from 0 through 360, counting clockwise relative to true north. Specify this key only if the sp key is nonzero. sp (optional): The horizontal velocity (speed), in meters per second, that the client device is traveling. alt (optional): The altitude of the client device, in meters. are (optional): The radius, in meters, that specifies the vertical accuracy of the coordinates. Specify this key only if you specify the alt key. Although many of the keys are optional, the more information that you provide, the more accurate the location results are. Although optional, you are encouraged to always specify the user's geographical location. Providing the location is especially important if the client's IP address does not accurately reflect the user's physical location (for example, if the client uses VPN). For optimal results, you should include this header and the X-MSEdge-ClientIP header, but at a minimum, you should include this header. + * @param aspect Filter images by the following aspect ratios. All: Do not filter by aspect.Specifying this value is the same as not specifying the aspect parameter. Square: Return images with standard aspect ratio. Wide: Return images with wide screen aspect ratio. Tall: Return images with tall aspect ratio. Possible values include: 'All', 'Square', 'Wide', 'Tall' + * @param color Filter images by the following color options. ColorOnly: Return color images. Monochrome: Return black and white images. Return images with one of the following dominant colors: Black, Blue, Brown, Gray, Green, Orange, Pink, Purple, Red, Teal, White, Yellow. Possible values include: 'ColorOnly', 'Monochrome', 'Black', 'Blue', 'Brown', 'Gray', 'Green', 'Orange', 'Pink', 'Purple', 'Red', 'Teal', 'White', 'Yellow' + * @param countryCode A 2-character country code of the country where the results come from. For a list of possible values, see [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#market-codes). If you set this parameter, you must also specify the [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#acceptlanguage) header. Bing uses the first supported language it finds from the languages list, and combine that language with the country code that you specify to determine the market to return results for. If the languages list does not include a supported language, Bing finds the closest language and market that supports the request, or it may use an aggregated or default market for the results instead of a specified one. You should use this query parameter and the Accept-Language query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. This parameter and the [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#mkt) query parameter are mutually exclusive—do not specify both. + * @param count The number of images to return in the response. The actual number delivered may be less than requested. The default is 35. The maximum value is 150. You use this parameter along with the offset parameter to page results.For example, if your user interface displays 20 images per page, set count to 20 and offset to 0 to get the first page of results.For each subsequent page, increment offset by 20 (for example, 0, 20, 40). Use this parameter only with the Image Search API.Do not specify this parameter when calling the Insights, Trending Images, or Web Search APIs. + * @param freshness Filter images by the following discovery options. Day: Return images discovered by Bing within the last 24 hours. Week: Return images discovered by Bing within the last 7 days. Month: Return images discovered by Bing within the last 30 days. Possible values include: 'Day', 'Week', 'Month' + * @param height Filter images that have the specified height, in pixels. You may use this filter with the size filter to return small images that have a height of 150 pixels. + * @param id An ID that uniquely identifies an image. Use this parameter to ensure that the specified image is the first image in the list of images that Bing returns. The [Image](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image) object's imageId field contains the ID that you set this parameter to. + * @param imageContent Filter images by the following content types. Face: Return images that show only a person's face. Portrait: Return images that show only a person's head and shoulders. Possible values include: 'Face', 'Portrait' + * @param imageType Filter images by the following image types. AnimatedGif: Return only animated GIFs. Clipart: Return only clip art images. Line: Return only line drawings. Photo: Return only photographs(excluding line drawings, animated Gifs, and clip art). Shopping: Return only images that contain items where Bing knows of a merchant that is selling the items. This option is valid in the en - US market only.Transparent: Return only images with a transparent background. Possible values include: 'AnimatedGif', 'Clipart', 'Line', 'Photo', 'Shopping', 'Transparent' + * @param license Filter images by the following license types. All: Do not filter by license type.Specifying this value is the same as not specifying the license parameter. Any: Return images that are under any license type. The response doesn't include images that do not specify a license or the license is unknown. Public: Return images where the creator has waived their exclusive rights, to the fullest extent allowed by law. Share: Return images that may be shared with others. Changing or editing the image might not be allowed. Also, modifying, sharing, and using the image for commercial purposes might not be allowed. Typically, this option returns the most images. ShareCommercially: Return images that may be shared with others for personal or commercial purposes. Changing or editing the image might not be allowed. Modify: Return images that may be modified, shared, and used. Changing or editing the image might not be allowed. Modifying, sharing, and using the image for commercial purposes might not be allowed. ModifyCommercially: Return images that may be modified, shared, and used for personal or commercial purposes. Typically, this option returns the fewest images. For more information about these license types, see [Filter Images By License Type](http://go.microsoft.com/fwlink/?LinkId=309768). Possible values include: 'All', 'Any', 'Public', 'Share', 'ShareCommercially', 'Modify', 'ModifyCommercially' + * @param market The market where the results come from. Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. For a list of possible market values, see [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#market-codes). NOTE: If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#market-codes), Bing uses a best fit market code based on an internal mapping that is subject to change. This parameter and the [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#cc) query parameter are mutually exclusive—do not specify both. + * @param maxFileSize Filter images that are less than or equal to the specified file size. The maximum file size that you may specify is 520,192 bytes. If you specify a larger value, the API uses 520,192. It is possible that the response may include images that are slightly larger than the specified maximum. You may specify this filter and minFileSize to filter images within a range of file sizes. + * @param maxHeight Filter images that have a height that is less than or equal to the specified height. Specify the height in pixels. You may specify this filter and minHeight to filter images within a range of heights. This filter and the height filter are mutually exclusive. + * @param maxWidth Filter images that have a width that is less than or equal to the specified width. Specify the width in pixels. You may specify this filter and maxWidth to filter images within a range of widths. This filter and the width filter are mutually exclusive. + * @param minFileSize Filter images that are greater than or equal to the specified file size. The maximum file size that you may specify is 520,192 bytes. If you specify a larger value, the API uses 520,192. It is possible that the response may include images that are slightly smaller than the specified minimum. You may specify this filter and maxFileSize to filter images within a range of file sizes. + * @param minHeight Filter images that have a height that is greater than or equal to the specified height. Specify the height in pixels. You may specify this filter and maxHeight to filter images within a range of heights. This filter and the height filter are mutually exclusive. + * @param minWidth Filter images that have a width that is greater than or equal to the specified width. Specify the width in pixels. You may specify this filter and maxWidth to filter images within a range of widths. This filter and the width filter are mutually exclusive. + * @param offset The zero-based offset that indicates the number of images to skip before returning images. The default is 0. The offset should be less than ([totalEstimatedMatches](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#totalestimatedmatches) - count). Use this parameter along with the count parameter to page results. For example, if your user interface displays 20 images per page, set count to 20 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 20 (for example, 0, 20, 40). It is possible for multiple pages to include some overlap in results. To prevent duplicates, see [nextOffset](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#nextoffset). Use this parameter only with the Image API. Do not specify this parameter when calling the Trending Images API or the Web Search API. + * @param safeSearch Filter images for adult content. The following are the possible filter values. Off: May return images with adult content. If the request is through the Image Search API, the response includes thumbnail images that are clear (non-fuzzy). However, if the request is through the Web Search API, the response includes thumbnail images that are pixelated (fuzzy). Moderate: If the request is through the Image Search API, the response doesn't include images with adult content. If the request is through the Web Search API, the response may include images with adult content (the thumbnail images are pixelated (fuzzy)). Strict: Do not return images with adult content. The default is Moderate. If the request comes from a market that Bing's adult policy requires that safeSearch is set to Strict, Bing ignores the safeSearch value and uses Strict. If you use the site: query operator, there is the chance that the response may contain adult content regardless of what the safeSearch query parameter is set to. Use site: only if you are aware of the content on the site and your scenario supports the possibility of adult content. Possible values include: 'Off', 'Moderate', 'Strict' + * @param size Filter images by the following sizes. All: Do not filter by size. Specifying this value is the same as not specifying the size parameter. Small: Return images that are less than 200x200 pixels. Medium: Return images that are greater than or equal to 200x200 pixels but less than 500x500 pixels. Large: Return images that are 500x500 pixels or larger. Wallpaper: Return wallpaper images. You may use this parameter along with the height or width parameters. For example, you may use height and size to request small images that are 150 pixels tall. Possible values include: 'All', 'Small', 'Medium', 'Large', 'Wallpaper' + * @param setLang The language to use for user interface strings. Specify the language using the ISO 639-1 2-letter language code. For example, the language code for English is EN. The default is EN (English). Although optional, you should always specify the language. Typically, you set setLang to the same language specified by mkt unless the user wants the user interface strings displayed in a different language. This parameter and the [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#acceptlanguage) header are mutually exclusive; do not specify both. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Also, any links to Bing.com properties in the response objects apply the specified language. + * @param width Filter images that have the specified width, in pixels. You may use this filter with the size filter to return small images that have a width of 150 pixels. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagesInner object + */ + public Observable imageSearchAsync(long customConfig, String query, String acceptLanguage, String clientId, String clientIp, String location, ImageAspect aspect, ImageColor color, String countryCode, Integer count, Freshness freshness, Integer height, String id, ImageContent imageContent, ImageType imageType, ImageLicense license, String market, Long maxFileSize, Long maxHeight, Long maxWidth, Long minFileSize, Long minHeight, Long minWidth, Long offset, SafeSearch safeSearch, ImageSize size, String setLang, Integer width) { + return imageSearchWithServiceResponseAsync(customConfig, query, acceptLanguage, clientId, clientIp, location, aspect, color, countryCode, count, freshness, height, id, imageContent, imageType, license, market, maxFileSize, maxHeight, maxWidth, minFileSize, minHeight, minWidth, offset, safeSearch, size, setLang, width).map(new Func1, ImagesInner>() { + @Override + public ImagesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Custom Image Search API lets you send an image search query to Bing and get image results found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term cannot be empty. The term may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, to limit images to a specific domain, use the [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. To help improve relevance of an insights query (see [insightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#insightstoken)), you should always include the user's query term. Use this parameter only with the Image Search API.Do not specify this parameter when calling the Trending Images API. + * @param acceptLanguage A comma-delimited list of one or more languages to use for user interface strings. The list is in decreasing order of preference. For additional information, including expected format, see [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This header and the [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#setlang) query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#cc) query parameter. To determine the market to return results for, Bing uses the first supported language it finds from the list and combines it with the cc parameter value. If the list does not include a supported language, Bing finds the closest language and market that supports the request or it uses an aggregated or default market for the results. To determine the market that Bing used, see the BingAPIs-Market header. Use this header and the cc query parameter only if you specify multiple languages. Otherwise, use the [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#mkt) and [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#setlang) query parameters. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Any links to Bing.com properties in the response objects apply the specified language. + * @param clientId Bing uses this header to provide users with consistent behavior across Bing API calls. Bing often flights new features and improvements, and it uses the client ID as a key for assigning traffic on different flights. If you do not use the same client ID for a user across multiple requests, then Bing may assign the user to multiple conflicting flights. Being assigned to multiple conflicting flights can lead to an inconsistent user experience. For example, if the second request has a different flight assignment than the first, the experience may be unexpected. Also, Bing can use the client ID to tailor web results to that client ID’s search history, providing a richer experience for the user. Bing also uses this header to help improve result rankings by analyzing the activity generated by a client ID. The relevance improvements help with better quality of results delivered by Bing APIs and in turn enables higher click-through rates for the API consumer. IMPORTANT: Although optional, you should consider this header required. Persisting the client ID across multiple requests for the same end user and device combination enables 1) the API consumer to receive a consistent user experience, and 2) higher click-through rates via better quality of results from the Bing APIs. Each user that uses your application on the device must have a unique, Bing generated client ID. If you do not include this header in the request, Bing generates an ID and returns it in the X-MSEdge-ClientID response header. The only time that you should NOT include this header in a request is the first time the user uses your app on that device. Use the client ID for each Bing API request that your app makes for this user on the device. Persist the client ID. To persist the ID in a browser app, use a persistent HTTP cookie to ensure the ID is used across all sessions. Do not use a session cookie. For other apps such as mobile apps, use the device's persistent storage to persist the ID. The next time the user uses your app on that device, get the client ID that you persisted. Bing responses may or may not include this header. If the response includes this header, capture the client ID and use it for all subsequent Bing requests for the user on that device. If you include the X-MSEdge-ClientID, you must not include cookies in the request. + * @param clientIp The IPv4 or IPv6 address of the client device. The IP address is used to discover the user's location. Bing uses the location information to determine safe search behavior. Although optional, you are encouraged to always specify this header and the X-Search-Location header. Do not obfuscate the address (for example, by changing the last octet to 0). Obfuscating the address results in the location not being anywhere near the device's actual location, which may result in Bing serving erroneous results. + * @param location A semicolon-delimited list of key/value pairs that describe the client's geographical location. Bing uses the location information to determine safe search behavior and to return relevant local content. Specify the key/value pair as <key>:<value>. The following are the keys that you use to specify the user's location. lat (required): The latitude of the client's location, in degrees. The latitude must be greater than or equal to -90.0 and less than or equal to +90.0. Negative values indicate southern latitudes and positive values indicate northern latitudes. long (required): The longitude of the client's location, in degrees. The longitude must be greater than or equal to -180.0 and less than or equal to +180.0. Negative values indicate western longitudes and positive values indicate eastern longitudes. re (required): The radius, in meters, which specifies the horizontal accuracy of the coordinates. Pass the value returned by the device's location service. Typical values might be 22m for GPS/Wi-Fi, 380m for cell tower triangulation, and 18,000m for reverse IP lookup. ts (optional): The UTC UNIX timestamp of when the client was at the location. (The UNIX timestamp is the number of seconds since January 1, 1970.) head (optional): The client's relative heading or direction of travel. Specify the direction of travel as degrees from 0 through 360, counting clockwise relative to true north. Specify this key only if the sp key is nonzero. sp (optional): The horizontal velocity (speed), in meters per second, that the client device is traveling. alt (optional): The altitude of the client device, in meters. are (optional): The radius, in meters, that specifies the vertical accuracy of the coordinates. Specify this key only if you specify the alt key. Although many of the keys are optional, the more information that you provide, the more accurate the location results are. Although optional, you are encouraged to always specify the user's geographical location. Providing the location is especially important if the client's IP address does not accurately reflect the user's physical location (for example, if the client uses VPN). For optimal results, you should include this header and the X-MSEdge-ClientIP header, but at a minimum, you should include this header. + * @param aspect Filter images by the following aspect ratios. All: Do not filter by aspect.Specifying this value is the same as not specifying the aspect parameter. Square: Return images with standard aspect ratio. Wide: Return images with wide screen aspect ratio. Tall: Return images with tall aspect ratio. Possible values include: 'All', 'Square', 'Wide', 'Tall' + * @param color Filter images by the following color options. ColorOnly: Return color images. Monochrome: Return black and white images. Return images with one of the following dominant colors: Black, Blue, Brown, Gray, Green, Orange, Pink, Purple, Red, Teal, White, Yellow. Possible values include: 'ColorOnly', 'Monochrome', 'Black', 'Blue', 'Brown', 'Gray', 'Green', 'Orange', 'Pink', 'Purple', 'Red', 'Teal', 'White', 'Yellow' + * @param countryCode A 2-character country code of the country where the results come from. For a list of possible values, see [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#market-codes). If you set this parameter, you must also specify the [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#acceptlanguage) header. Bing uses the first supported language it finds from the languages list, and combine that language with the country code that you specify to determine the market to return results for. If the languages list does not include a supported language, Bing finds the closest language and market that supports the request, or it may use an aggregated or default market for the results instead of a specified one. You should use this query parameter and the Accept-Language query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. This parameter and the [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#mkt) query parameter are mutually exclusive—do not specify both. + * @param count The number of images to return in the response. The actual number delivered may be less than requested. The default is 35. The maximum value is 150. You use this parameter along with the offset parameter to page results.For example, if your user interface displays 20 images per page, set count to 20 and offset to 0 to get the first page of results.For each subsequent page, increment offset by 20 (for example, 0, 20, 40). Use this parameter only with the Image Search API.Do not specify this parameter when calling the Insights, Trending Images, or Web Search APIs. + * @param freshness Filter images by the following discovery options. Day: Return images discovered by Bing within the last 24 hours. Week: Return images discovered by Bing within the last 7 days. Month: Return images discovered by Bing within the last 30 days. Possible values include: 'Day', 'Week', 'Month' + * @param height Filter images that have the specified height, in pixels. You may use this filter with the size filter to return small images that have a height of 150 pixels. + * @param id An ID that uniquely identifies an image. Use this parameter to ensure that the specified image is the first image in the list of images that Bing returns. The [Image](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image) object's imageId field contains the ID that you set this parameter to. + * @param imageContent Filter images by the following content types. Face: Return images that show only a person's face. Portrait: Return images that show only a person's head and shoulders. Possible values include: 'Face', 'Portrait' + * @param imageType Filter images by the following image types. AnimatedGif: Return only animated GIFs. Clipart: Return only clip art images. Line: Return only line drawings. Photo: Return only photographs(excluding line drawings, animated Gifs, and clip art). Shopping: Return only images that contain items where Bing knows of a merchant that is selling the items. This option is valid in the en - US market only.Transparent: Return only images with a transparent background. Possible values include: 'AnimatedGif', 'Clipart', 'Line', 'Photo', 'Shopping', 'Transparent' + * @param license Filter images by the following license types. All: Do not filter by license type.Specifying this value is the same as not specifying the license parameter. Any: Return images that are under any license type. The response doesn't include images that do not specify a license or the license is unknown. Public: Return images where the creator has waived their exclusive rights, to the fullest extent allowed by law. Share: Return images that may be shared with others. Changing or editing the image might not be allowed. Also, modifying, sharing, and using the image for commercial purposes might not be allowed. Typically, this option returns the most images. ShareCommercially: Return images that may be shared with others for personal or commercial purposes. Changing or editing the image might not be allowed. Modify: Return images that may be modified, shared, and used. Changing or editing the image might not be allowed. Modifying, sharing, and using the image for commercial purposes might not be allowed. ModifyCommercially: Return images that may be modified, shared, and used for personal or commercial purposes. Typically, this option returns the fewest images. For more information about these license types, see [Filter Images By License Type](http://go.microsoft.com/fwlink/?LinkId=309768). Possible values include: 'All', 'Any', 'Public', 'Share', 'ShareCommercially', 'Modify', 'ModifyCommercially' + * @param market The market where the results come from. Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. For a list of possible market values, see [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#market-codes). NOTE: If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#market-codes), Bing uses a best fit market code based on an internal mapping that is subject to change. This parameter and the [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#cc) query parameter are mutually exclusive—do not specify both. + * @param maxFileSize Filter images that are less than or equal to the specified file size. The maximum file size that you may specify is 520,192 bytes. If you specify a larger value, the API uses 520,192. It is possible that the response may include images that are slightly larger than the specified maximum. You may specify this filter and minFileSize to filter images within a range of file sizes. + * @param maxHeight Filter images that have a height that is less than or equal to the specified height. Specify the height in pixels. You may specify this filter and minHeight to filter images within a range of heights. This filter and the height filter are mutually exclusive. + * @param maxWidth Filter images that have a width that is less than or equal to the specified width. Specify the width in pixels. You may specify this filter and maxWidth to filter images within a range of widths. This filter and the width filter are mutually exclusive. + * @param minFileSize Filter images that are greater than or equal to the specified file size. The maximum file size that you may specify is 520,192 bytes. If you specify a larger value, the API uses 520,192. It is possible that the response may include images that are slightly smaller than the specified minimum. You may specify this filter and maxFileSize to filter images within a range of file sizes. + * @param minHeight Filter images that have a height that is greater than or equal to the specified height. Specify the height in pixels. You may specify this filter and maxHeight to filter images within a range of heights. This filter and the height filter are mutually exclusive. + * @param minWidth Filter images that have a width that is greater than or equal to the specified width. Specify the width in pixels. You may specify this filter and maxWidth to filter images within a range of widths. This filter and the width filter are mutually exclusive. + * @param offset The zero-based offset that indicates the number of images to skip before returning images. The default is 0. The offset should be less than ([totalEstimatedMatches](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#totalestimatedmatches) - count). Use this parameter along with the count parameter to page results. For example, if your user interface displays 20 images per page, set count to 20 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 20 (for example, 0, 20, 40). It is possible for multiple pages to include some overlap in results. To prevent duplicates, see [nextOffset](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#nextoffset). Use this parameter only with the Image API. Do not specify this parameter when calling the Trending Images API or the Web Search API. + * @param safeSearch Filter images for adult content. The following are the possible filter values. Off: May return images with adult content. If the request is through the Image Search API, the response includes thumbnail images that are clear (non-fuzzy). However, if the request is through the Web Search API, the response includes thumbnail images that are pixelated (fuzzy). Moderate: If the request is through the Image Search API, the response doesn't include images with adult content. If the request is through the Web Search API, the response may include images with adult content (the thumbnail images are pixelated (fuzzy)). Strict: Do not return images with adult content. The default is Moderate. If the request comes from a market that Bing's adult policy requires that safeSearch is set to Strict, Bing ignores the safeSearch value and uses Strict. If you use the site: query operator, there is the chance that the response may contain adult content regardless of what the safeSearch query parameter is set to. Use site: only if you are aware of the content on the site and your scenario supports the possibility of adult content. Possible values include: 'Off', 'Moderate', 'Strict' + * @param size Filter images by the following sizes. All: Do not filter by size. Specifying this value is the same as not specifying the size parameter. Small: Return images that are less than 200x200 pixels. Medium: Return images that are greater than or equal to 200x200 pixels but less than 500x500 pixels. Large: Return images that are 500x500 pixels or larger. Wallpaper: Return wallpaper images. You may use this parameter along with the height or width parameters. For example, you may use height and size to request small images that are 150 pixels tall. Possible values include: 'All', 'Small', 'Medium', 'Large', 'Wallpaper' + * @param setLang The language to use for user interface strings. Specify the language using the ISO 639-1 2-letter language code. For example, the language code for English is EN. The default is EN (English). Although optional, you should always specify the language. Typically, you set setLang to the same language specified by mkt unless the user wants the user interface strings displayed in a different language. This parameter and the [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#acceptlanguage) header are mutually exclusive; do not specify both. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Also, any links to Bing.com properties in the response objects apply the specified language. + * @param width Filter images that have the specified width, in pixels. You may use this filter with the size filter to return small images that have a width of 150 pixels. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ImagesInner object + */ + public Observable> imageSearchWithServiceResponseAsync(long customConfig, String query, String acceptLanguage, String clientId, String clientIp, String location, ImageAspect aspect, ImageColor color, String countryCode, Integer count, Freshness freshness, Integer height, String id, ImageContent imageContent, ImageType imageType, ImageLicense license, String market, Long maxFileSize, Long maxHeight, Long maxWidth, Long minFileSize, Long minHeight, Long minWidth, Long offset, SafeSearch safeSearch, ImageSize size, String setLang, Integer width) { + if (query == null) { + throw new IllegalArgumentException("Parameter query is required and cannot be null."); + } + final String xBingApisSDK = "true"; + return service.imageSearch(xBingApisSDK, acceptLanguage, this.client.userAgent(), clientId, clientIp, location, customConfig, aspect, color, countryCode, count, freshness, height, id, imageContent, imageType, license, market, maxFileSize, maxHeight, maxWidth, minFileSize, minHeight, minWidth, offset, query, safeSearch, size, setLang, width, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = imageSearchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse imageSearchDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/implementation/ImagesInner.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/implementation/ImagesInner.java new file mode 100644 index 000000000000..f51c6f1180ee --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/implementation/ImagesInner.java @@ -0,0 +1,67 @@ +/** + * 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.cognitiveservices.customimagesearch.implementation; + +import java.util.List; +import com.microsoft.azure.cognitiveservices.customimagesearch.ImageObject; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.cognitiveservices.customimagesearch.SearchResultsAnswer; + +/** + * Defines an image answer. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") +@JsonTypeName("Images") +public class ImagesInner extends SearchResultsAnswer { + /** + * Used as part of deduping. Tells client the next offset that client + * should use in the next pagination request. + */ + @JsonProperty(value = "nextOffset", access = JsonProperty.Access.WRITE_ONLY) + private Integer nextOffset; + + /** + * A list of image objects that are relevant to the query. If there are no + * results, the List is empty. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get used as part of deduping. Tells client the next offset that client should use in the next pagination request. + * + * @return the nextOffset value + */ + public Integer nextOffset() { + return this.nextOffset; + } + + /** + * Get a list of image objects that are relevant to the query. If there are no results, the List is empty. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of image objects that are relevant to the query. If there are no results, the List is empty. + * + * @param value the value value to set + * @return the ImagesInner object itself. + */ + public ImagesInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/implementation/package-info.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/implementation/package-info.java new file mode 100644 index 000000000000..bf289cbae84a --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/implementation/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the implementation classes for CustomImageSearchAPI. + * The Bing Custom Image Search API lets you send an image search query to Bing and get back image search results customized to meet your custom search definition. + */ +package com.microsoft.azure.cognitiveservices.customimagesearch.implementation; diff --git a/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/package-info.java b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/package-info.java new file mode 100644 index 000000000000..e5ded5a57b9b --- /dev/null +++ b/azure-cognitiveservices/customimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/customimagesearch/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the classes for CustomImageSearchAPI. + * The Bing Custom Image Search API lets you send an image search query to Bing and get back image search results customized to meet your custom search definition. + */ +package com.microsoft.azure.cognitiveservices.customimagesearch;