diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/Entities.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/Entities.java new file mode 100644 index 000000000000..d70dbd48f534 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/Entities.java @@ -0,0 +1,153 @@ +/** + * 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.search.entitysearch; + +import com.microsoft.azure.cognitiveservices.search.entitysearch.models.AnswerType; +import com.microsoft.azure.cognitiveservices.search.entitysearch.models.ErrorResponseException; +import com.microsoft.azure.cognitiveservices.search.entitysearch.models.ResponseFormat; +import com.microsoft.azure.cognitiveservices.search.entitysearch.models.SafeSearch; +import com.microsoft.azure.cognitiveservices.search.entitysearch.models.SearchResponse; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Entities. + */ +public interface Entities { + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @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 SearchResponse object if successful. + */ + SearchResponse search(String query); + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture searchAsync(String query, final ServiceCallback serviceCallback); + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + Observable searchAsync(String query); + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + Observable> searchWithServiceResponseAsync(String query); + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @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 query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the cc query parameter. Bing will use the first supported language it finds from the list, and combine that language with the cc parameter value to determine the market to return results for. If the list does not include a supported language, Bing will find the closest language and market that supports the request, and may use an aggregated or default market for the results instead of a specified one. You should use this header and the cc query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. A user interface string is a string that's used as a label in a user interface. There are very few user interface strings in the JSON response objects. Any links in the response objects to Bing.com properties will apply the specified language. + * @param pragma By default, Bing returns cached content, if available. To prevent Bing from returning cached content, set the Pragma header to no-cache (for example, Pragma: no-cache). + * @param userAgent The user agent originating the request. Bing uses the user agent to provide mobile users with an optimized experience. Although optional, you are strongly encouraged to always specify this header. The user-agent should be the same string that any commonly used browser would send. For information about user agents, see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + * @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 countryCode A 2-character country code of the country where the results come from. This API supports only the United States market. If you specify this query parameter, it must be set to us. If you set this parameter, you must also specify the Accept-Language 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 query parameter are mutually exclusive—do not specify both. + * @param market The market where the results come from. You are strongly encouraged to always specify the market, if known. Specifying the market helps Bing route the request and return an appropriate and optimal response. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param responseFilter A comma-delimited list of answers to include in the response. If you do not specify this parameter, the response includes all search answers for which there's relevant data. + * @param responseFormat The media type to use for the response. The following are the possible case-insensitive values: JSON, JSONLD. The default is JSON. If you specify JSONLD, the response body includes JSON-LD objects that contain the search results. + * @param safeSearch A filter used to filter adult content. Off: Return webpages with adult text, images, or videos. Moderate: Return webpages with adult text, but not adult images or videos. Strict: Do not return webpages with adult text, images, or videos. 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 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 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. + * @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 SearchResponse object if successful. + */ + SearchResponse search(String query, String acceptLanguage, String pragma, String userAgent, String clientId, String clientIp, String location, String countryCode, String market, List responseFilter, List responseFormat, SafeSearch safeSearch, String setLang); + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @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 query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the cc query parameter. Bing will use the first supported language it finds from the list, and combine that language with the cc parameter value to determine the market to return results for. If the list does not include a supported language, Bing will find the closest language and market that supports the request, and may use an aggregated or default market for the results instead of a specified one. You should use this header and the cc query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. A user interface string is a string that's used as a label in a user interface. There are very few user interface strings in the JSON response objects. Any links in the response objects to Bing.com properties will apply the specified language. + * @param pragma By default, Bing returns cached content, if available. To prevent Bing from returning cached content, set the Pragma header to no-cache (for example, Pragma: no-cache). + * @param userAgent The user agent originating the request. Bing uses the user agent to provide mobile users with an optimized experience. Although optional, you are strongly encouraged to always specify this header. The user-agent should be the same string that any commonly used browser would send. For information about user agents, see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + * @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 countryCode A 2-character country code of the country where the results come from. This API supports only the United States market. If you specify this query parameter, it must be set to us. If you set this parameter, you must also specify the Accept-Language 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 query parameter are mutually exclusive—do not specify both. + * @param market The market where the results come from. You are strongly encouraged to always specify the market, if known. Specifying the market helps Bing route the request and return an appropriate and optimal response. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param responseFilter A comma-delimited list of answers to include in the response. If you do not specify this parameter, the response includes all search answers for which there's relevant data. + * @param responseFormat The media type to use for the response. The following are the possible case-insensitive values: JSON, JSONLD. The default is JSON. If you specify JSONLD, the response body includes JSON-LD objects that contain the search results. + * @param safeSearch A filter used to filter adult content. Off: Return webpages with adult text, images, or videos. Moderate: Return webpages with adult text, but not adult images or videos. Strict: Do not return webpages with adult text, images, or videos. 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 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 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture searchAsync(String query, String acceptLanguage, String pragma, String userAgent, String clientId, String clientIp, String location, String countryCode, String market, List responseFilter, List responseFormat, SafeSearch safeSearch, String setLang, final ServiceCallback serviceCallback); + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @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 query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the cc query parameter. Bing will use the first supported language it finds from the list, and combine that language with the cc parameter value to determine the market to return results for. If the list does not include a supported language, Bing will find the closest language and market that supports the request, and may use an aggregated or default market for the results instead of a specified one. You should use this header and the cc query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. A user interface string is a string that's used as a label in a user interface. There are very few user interface strings in the JSON response objects. Any links in the response objects to Bing.com properties will apply the specified language. + * @param pragma By default, Bing returns cached content, if available. To prevent Bing from returning cached content, set the Pragma header to no-cache (for example, Pragma: no-cache). + * @param userAgent The user agent originating the request. Bing uses the user agent to provide mobile users with an optimized experience. Although optional, you are strongly encouraged to always specify this header. The user-agent should be the same string that any commonly used browser would send. For information about user agents, see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + * @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 countryCode A 2-character country code of the country where the results come from. This API supports only the United States market. If you specify this query parameter, it must be set to us. If you set this parameter, you must also specify the Accept-Language 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 query parameter are mutually exclusive—do not specify both. + * @param market The market where the results come from. You are strongly encouraged to always specify the market, if known. Specifying the market helps Bing route the request and return an appropriate and optimal response. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param responseFilter A comma-delimited list of answers to include in the response. If you do not specify this parameter, the response includes all search answers for which there's relevant data. + * @param responseFormat The media type to use for the response. The following are the possible case-insensitive values: JSON, JSONLD. The default is JSON. If you specify JSONLD, the response body includes JSON-LD objects that contain the search results. + * @param safeSearch A filter used to filter adult content. Off: Return webpages with adult text, images, or videos. Moderate: Return webpages with adult text, but not adult images or videos. Strict: Do not return webpages with adult text, images, or videos. 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + Observable searchAsync(String query, String acceptLanguage, String pragma, String userAgent, String clientId, String clientIp, String location, String countryCode, String market, List responseFilter, List responseFormat, SafeSearch safeSearch, String setLang); + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @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 query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the cc query parameter. Bing will use the first supported language it finds from the list, and combine that language with the cc parameter value to determine the market to return results for. If the list does not include a supported language, Bing will find the closest language and market that supports the request, and may use an aggregated or default market for the results instead of a specified one. You should use this header and the cc query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. A user interface string is a string that's used as a label in a user interface. There are very few user interface strings in the JSON response objects. Any links in the response objects to Bing.com properties will apply the specified language. + * @param pragma By default, Bing returns cached content, if available. To prevent Bing from returning cached content, set the Pragma header to no-cache (for example, Pragma: no-cache). + * @param userAgent The user agent originating the request. Bing uses the user agent to provide mobile users with an optimized experience. Although optional, you are strongly encouraged to always specify this header. The user-agent should be the same string that any commonly used browser would send. For information about user agents, see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + * @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 countryCode A 2-character country code of the country where the results come from. This API supports only the United States market. If you specify this query parameter, it must be set to us. If you set this parameter, you must also specify the Accept-Language 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 query parameter are mutually exclusive—do not specify both. + * @param market The market where the results come from. You are strongly encouraged to always specify the market, if known. Specifying the market helps Bing route the request and return an appropriate and optimal response. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param responseFilter A comma-delimited list of answers to include in the response. If you do not specify this parameter, the response includes all search answers for which there's relevant data. + * @param responseFormat The media type to use for the response. The following are the possible case-insensitive values: JSON, JSONLD. The default is JSON. If you specify JSONLD, the response body includes JSON-LD objects that contain the search results. + * @param safeSearch A filter used to filter adult content. Off: Return webpages with adult text, images, or videos. Moderate: Return webpages with adult text, but not adult images or videos. Strict: Do not return webpages with adult text, images, or videos. 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + Observable> searchWithServiceResponseAsync(String query, String acceptLanguage, String pragma, String userAgent, String clientId, String clientIp, String location, String countryCode, String market, List responseFilter, List responseFormat, SafeSearch safeSearch, String setLang); + +} diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/EntitySearchClient.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/EntitySearchClient.java new file mode 100644 index 000000000000..43c1dedb31d9 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/EntitySearchClient.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.cognitiveservices.search.entitysearch; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for EntitySearchClient class. + */ +public interface EntitySearchClient { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: "https://westus.api.cognitive.microsoft.com", "https://api.cognitive.microsoft.com").. + * + * @return the endpoint value. + */ + String endpoint(); + + /** + * Sets Supported Cognitive Services endpoints (protocol and hostname, for example: "https://westus.api.cognitive.microsoft.com", "https://api.cognitive.microsoft.com").. + * + * @param endpoint the endpoint value. + * @return the service client itself + */ + EntitySearchClient withEndpoint(String endpoint); + + /** + * Gets The preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets The preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + EntitySearchClient withAcceptLanguage(String acceptLanguage); + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + EntitySearchClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. 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. + */ + boolean generateClientRequestId(); + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. 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 + */ + EntitySearchClient withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the Entities object to access its operations. + * @return the Entities object. + */ + Entities entities(); + +} diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/implementation/EntitiesImpl.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/implementation/EntitiesImpl.java new file mode 100644 index 000000000000..cb51d14ac5c5 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/implementation/EntitiesImpl.java @@ -0,0 +1,281 @@ +/** + * 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.search.entitysearch.implementation; + +import retrofit2.Retrofit; +import com.microsoft.azure.cognitiveservices.search.entitysearch.Entities; +import com.google.common.base.Joiner; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.cognitiveservices.search.entitysearch.models.AnswerType; +import com.microsoft.azure.cognitiveservices.search.entitysearch.models.ErrorResponseException; +import com.microsoft.azure.cognitiveservices.search.entitysearch.models.ResponseFormat; +import com.microsoft.azure.cognitiveservices.search.entitysearch.models.SafeSearch; +import com.microsoft.azure.cognitiveservices.search.entitysearch.models.SearchResponse; +import com.microsoft.rest.CollectionFormat; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Entities. + */ +public class EntitiesImpl implements Entities { + /** The Retrofit service to perform REST calls. */ + private EntitiesService service; + /** The service client containing this operation class. */ + private EntitySearchClientImpl client; + + /** + * Initializes an instance of EntitiesImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EntitiesImpl(Retrofit retrofit, EntitySearchClientImpl client) { + this.service = retrofit.create(EntitiesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Entities to be + * used by Retrofit to perform actually REST calls. + */ + interface EntitiesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.search.entitysearch.Entities search" }) + @GET("entities") + Observable> search(@Header("X-BingApis-SDK") String xBingApisSDK, @Header("Accept-Language") String acceptLanguage, @Header("Pragma") String pragma, @Header("User-Agent") String userAgent, @Header("X-MSEdge-ClientID") String clientId, @Header("X-MSEdge-ClientIP") String clientIp, @Header("X-Search-Location") String location, @Query("cc") String countryCode, @Query("mkt") String market, @Query("q") String query, @Query("ResponseFilter") String responseFilter, @Query("ResponseFormat") String responseFormat, @Query("SafeSearch") SafeSearch safeSearch, @Query("SetLang") String setLang, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + } + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @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 SearchResponse object if successful. + */ + public SearchResponse search(String query) { + return searchWithServiceResponseAsync(query).toBlocking().single().body(); + } + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @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 searchAsync(String query, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(searchWithServiceResponseAsync(query), serviceCallback); + } + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + public Observable searchAsync(String query) { + return searchWithServiceResponseAsync(query).map(new Func1, SearchResponse>() { + @Override + public SearchResponse call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + public Observable> searchWithServiceResponseAsync(String query) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (query == null) { + throw new IllegalArgumentException("Parameter query is required and cannot be null."); + } + final String xBingApisSDK = "true"; + final String acceptLanguage = null; + final String pragma = null; + final String userAgent = null; + final String clientId = null; + final String clientIp = null; + final String location = null; + final String countryCode = null; + final String market = null; + final List responseFilter = null; + final List responseFormat = null; + final SafeSearch safeSearch = null; + final String setLang = null; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + String responseFilterConverted = this.client.serializerAdapter().serializeList(responseFilter, CollectionFormat.CSV);String responseFormatConverted = this.client.serializerAdapter().serializeList(responseFormat, CollectionFormat.CSV); + return service.search(xBingApisSDK, acceptLanguage, pragma, userAgent, clientId, clientIp, location, countryCode, market, query, responseFilterConverted, responseFormatConverted, safeSearch, setLang, parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = searchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @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 query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the cc query parameter. Bing will use the first supported language it finds from the list, and combine that language with the cc parameter value to determine the market to return results for. If the list does not include a supported language, Bing will find the closest language and market that supports the request, and may use an aggregated or default market for the results instead of a specified one. You should use this header and the cc query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. A user interface string is a string that's used as a label in a user interface. There are very few user interface strings in the JSON response objects. Any links in the response objects to Bing.com properties will apply the specified language. + * @param pragma By default, Bing returns cached content, if available. To prevent Bing from returning cached content, set the Pragma header to no-cache (for example, Pragma: no-cache). + * @param userAgent The user agent originating the request. Bing uses the user agent to provide mobile users with an optimized experience. Although optional, you are strongly encouraged to always specify this header. The user-agent should be the same string that any commonly used browser would send. For information about user agents, see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + * @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 countryCode A 2-character country code of the country where the results come from. This API supports only the United States market. If you specify this query parameter, it must be set to us. If you set this parameter, you must also specify the Accept-Language 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 query parameter are mutually exclusive—do not specify both. + * @param market The market where the results come from. You are strongly encouraged to always specify the market, if known. Specifying the market helps Bing route the request and return an appropriate and optimal response. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param responseFilter A comma-delimited list of answers to include in the response. If you do not specify this parameter, the response includes all search answers for which there's relevant data. + * @param responseFormat The media type to use for the response. The following are the possible case-insensitive values: JSON, JSONLD. The default is JSON. If you specify JSONLD, the response body includes JSON-LD objects that contain the search results. + * @param safeSearch A filter used to filter adult content. Off: Return webpages with adult text, images, or videos. Moderate: Return webpages with adult text, but not adult images or videos. Strict: Do not return webpages with adult text, images, or videos. 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 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 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. + * @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 SearchResponse object if successful. + */ + public SearchResponse search(String query, String acceptLanguage, String pragma, String userAgent, String clientId, String clientIp, String location, String countryCode, String market, List responseFilter, List responseFormat, SafeSearch safeSearch, String setLang) { + return searchWithServiceResponseAsync(query, acceptLanguage, pragma, userAgent, clientId, clientIp, location, countryCode, market, responseFilter, responseFormat, safeSearch, setLang).toBlocking().single().body(); + } + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @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 query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the cc query parameter. Bing will use the first supported language it finds from the list, and combine that language with the cc parameter value to determine the market to return results for. If the list does not include a supported language, Bing will find the closest language and market that supports the request, and may use an aggregated or default market for the results instead of a specified one. You should use this header and the cc query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. A user interface string is a string that's used as a label in a user interface. There are very few user interface strings in the JSON response objects. Any links in the response objects to Bing.com properties will apply the specified language. + * @param pragma By default, Bing returns cached content, if available. To prevent Bing from returning cached content, set the Pragma header to no-cache (for example, Pragma: no-cache). + * @param userAgent The user agent originating the request. Bing uses the user agent to provide mobile users with an optimized experience. Although optional, you are strongly encouraged to always specify this header. The user-agent should be the same string that any commonly used browser would send. For information about user agents, see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + * @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 countryCode A 2-character country code of the country where the results come from. This API supports only the United States market. If you specify this query parameter, it must be set to us. If you set this parameter, you must also specify the Accept-Language 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 query parameter are mutually exclusive—do not specify both. + * @param market The market where the results come from. You are strongly encouraged to always specify the market, if known. Specifying the market helps Bing route the request and return an appropriate and optimal response. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param responseFilter A comma-delimited list of answers to include in the response. If you do not specify this parameter, the response includes all search answers for which there's relevant data. + * @param responseFormat The media type to use for the response. The following are the possible case-insensitive values: JSON, JSONLD. The default is JSON. If you specify JSONLD, the response body includes JSON-LD objects that contain the search results. + * @param safeSearch A filter used to filter adult content. Off: Return webpages with adult text, images, or videos. Moderate: Return webpages with adult text, but not adult images or videos. Strict: Do not return webpages with adult text, images, or videos. 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 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 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 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 searchAsync(String query, String acceptLanguage, String pragma, String userAgent, String clientId, String clientIp, String location, String countryCode, String market, List responseFilter, List responseFormat, SafeSearch safeSearch, String setLang, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(searchWithServiceResponseAsync(query, acceptLanguage, pragma, userAgent, clientId, clientIp, location, countryCode, market, responseFilter, responseFormat, safeSearch, setLang), serviceCallback); + } + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @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 query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the cc query parameter. Bing will use the first supported language it finds from the list, and combine that language with the cc parameter value to determine the market to return results for. If the list does not include a supported language, Bing will find the closest language and market that supports the request, and may use an aggregated or default market for the results instead of a specified one. You should use this header and the cc query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. A user interface string is a string that's used as a label in a user interface. There are very few user interface strings in the JSON response objects. Any links in the response objects to Bing.com properties will apply the specified language. + * @param pragma By default, Bing returns cached content, if available. To prevent Bing from returning cached content, set the Pragma header to no-cache (for example, Pragma: no-cache). + * @param userAgent The user agent originating the request. Bing uses the user agent to provide mobile users with an optimized experience. Although optional, you are strongly encouraged to always specify this header. The user-agent should be the same string that any commonly used browser would send. For information about user agents, see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + * @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 countryCode A 2-character country code of the country where the results come from. This API supports only the United States market. If you specify this query parameter, it must be set to us. If you set this parameter, you must also specify the Accept-Language 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 query parameter are mutually exclusive—do not specify both. + * @param market The market where the results come from. You are strongly encouraged to always specify the market, if known. Specifying the market helps Bing route the request and return an appropriate and optimal response. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param responseFilter A comma-delimited list of answers to include in the response. If you do not specify this parameter, the response includes all search answers for which there's relevant data. + * @param responseFormat The media type to use for the response. The following are the possible case-insensitive values: JSON, JSONLD. The default is JSON. If you specify JSONLD, the response body includes JSON-LD objects that contain the search results. + * @param safeSearch A filter used to filter adult content. Off: Return webpages with adult text, images, or videos. Moderate: Return webpages with adult text, but not adult images or videos. Strict: Do not return webpages with adult text, images, or videos. 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + public Observable searchAsync(String query, String acceptLanguage, String pragma, String userAgent, String clientId, String clientIp, String location, String countryCode, String market, List responseFilter, List responseFormat, SafeSearch safeSearch, String setLang) { + return searchWithServiceResponseAsync(query, acceptLanguage, pragma, userAgent, clientId, clientIp, location, countryCode, market, responseFilter, responseFormat, safeSearch, setLang).map(new Func1, SearchResponse>() { + @Override + public SearchResponse call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. + * + * @param query The user's search term. + * @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 query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the cc query parameter. Bing will use the first supported language it finds from the list, and combine that language with the cc parameter value to determine the market to return results for. If the list does not include a supported language, Bing will find the closest language and market that supports the request, and may use an aggregated or default market for the results instead of a specified one. You should use this header and the cc query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. A user interface string is a string that's used as a label in a user interface. There are very few user interface strings in the JSON response objects. Any links in the response objects to Bing.com properties will apply the specified language. + * @param pragma By default, Bing returns cached content, if available. To prevent Bing from returning cached content, set the Pragma header to no-cache (for example, Pragma: no-cache). + * @param userAgent The user agent originating the request. Bing uses the user agent to provide mobile users with an optimized experience. Although optional, you are strongly encouraged to always specify this header. The user-agent should be the same string that any commonly used browser would send. For information about user agents, see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + * @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 countryCode A 2-character country code of the country where the results come from. This API supports only the United States market. If you specify this query parameter, it must be set to us. If you set this parameter, you must also specify the Accept-Language 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 query parameter are mutually exclusive—do not specify both. + * @param market The market where the results come from. You are strongly encouraged to always specify the market, if known. Specifying the market helps Bing route the request and return an appropriate and optimal response. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param responseFilter A comma-delimited list of answers to include in the response. If you do not specify this parameter, the response includes all search answers for which there's relevant data. + * @param responseFormat The media type to use for the response. The following are the possible case-insensitive values: JSON, JSONLD. The default is JSON. If you specify JSONLD, the response body includes JSON-LD objects that contain the search results. + * @param safeSearch A filter used to filter adult content. Off: Return webpages with adult text, images, or videos. Moderate: Return webpages with adult text, but not adult images or videos. Strict: Do not return webpages with adult text, images, or videos. 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 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + public Observable> searchWithServiceResponseAsync(String query, String acceptLanguage, String pragma, String userAgent, String clientId, String clientIp, String location, String countryCode, String market, List responseFilter, List responseFormat, SafeSearch safeSearch, String setLang) { + if (this.client.endpoint() == null) { + throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); + } + if (query == null) { + throw new IllegalArgumentException("Parameter query is required and cannot be null."); + } + Validator.validate(responseFilter); + Validator.validate(responseFormat); + final String xBingApisSDK = "true"; + String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint()); + String responseFilterConverted = this.client.serializerAdapter().serializeList(responseFilter, CollectionFormat.CSV);String responseFormatConverted = this.client.serializerAdapter().serializeList(responseFormat, CollectionFormat.CSV); + return service.search(xBingApisSDK, acceptLanguage, pragma, userAgent, clientId, clientIp, location, countryCode, market, query, responseFilterConverted, responseFormatConverted, safeSearch, setLang, parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = searchDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse searchDelegate(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/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/implementation/EntitySearchClientImpl.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/implementation/EntitySearchClientImpl.java new file mode 100644 index 000000000000..ae59fcd2c22b --- /dev/null +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/implementation/EntitySearchClientImpl.java @@ -0,0 +1,186 @@ +/** + * 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.search.entitysearch.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.cognitiveservices.search.entitysearch.Entities; +import com.microsoft.azure.cognitiveservices.search.entitysearch.EntitySearchClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the EntitySearchClientImpl class. + */ +public class EntitySearchClientImpl extends AzureServiceClient implements EntitySearchClient { + /** 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; + } + + /** Supported Cognitive Services endpoints (protocol and hostname, for example: "https://westus.api.cognitive.microsoft.com", "https://api.cognitive.microsoft.com"). */ + private String endpoint; + + /** + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: "https://westus.api.cognitive.microsoft.com", "https://api.cognitive.microsoft.com"). + * + * @return the endpoint value. + */ + public String endpoint() { + return this.endpoint; + } + + /** + * Sets Supported Cognitive Services endpoints (protocol and hostname, for example: "https://westus.api.cognitive.microsoft.com", "https://api.cognitive.microsoft.com"). + * + * @param endpoint the endpoint value. + * @return the service client itself + */ + public EntitySearchClientImpl withEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public EntitySearchClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * 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 EntitySearchClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. 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 Whether a unique x-ms-client-request-id should be generated. 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 Whether a unique x-ms-client-request-id should be generated. 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 EntitySearchClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The Entities object to access its operations. + */ + private Entities entities; + + /** + * Gets the Entities object to access its operations. + * @return the Entities object. + */ + public Entities entities() { + return this.entities; + } + + /** + * Initializes an instance of EntitySearchClient client. + * + * @param credentials the management credentials for Azure + */ + public EntitySearchClientImpl(ServiceClientCredentials credentials) { + this("https://{Endpoint}/bing/v7.0", credentials); + } + + /** + * Initializes an instance of EntitySearchClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + private EntitySearchClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of EntitySearchClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public EntitySearchClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.endpoint = "https://api.cognitive.microsoft.com"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.entities = new EntitiesImpl(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(), "EntitySearchClient", "1.0"); + } +} diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/implementation/package-info.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/implementation/package-info.java index 6b113a1c98ba..97656b19947a 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/implementation/package-info.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/implementation/package-info.java @@ -5,7 +5,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the implementation classes for BingEntitySearchAPI. + * This package contains the implementation classes for EntitySearchClient. * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. */ package com.microsoft.azure.cognitiveservices.search.entitysearch.implementation; diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Airport.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Airport.java index 4b58f603b52d..080ba15cb982 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Airport.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Airport.java @@ -15,7 +15,7 @@ /** * The Airport model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Airport.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("Airport") public class Airport extends CivicStructure { /** diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Answer.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Answer.java index 0053e334a7af..c53a9ce566a0 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Answer.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Answer.java @@ -15,7 +15,7 @@ /** * The Answer model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Answer.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("Answer") @JsonSubTypes({ @JsonSubTypes.Type(name = "SearchResultsAnswer", value = SearchResultsAnswer.class) diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/CivicStructure.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/CivicStructure.java index 44be984b2d51..1ad415ba8298 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/CivicStructure.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/CivicStructure.java @@ -15,7 +15,7 @@ /** * The CivicStructure model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = CivicStructure.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("CivicStructure") @JsonSubTypes({ @JsonSubTypes.Type(name = "Airport", value = Airport.class) diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesAttribution.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesAttribution.java index 978653fd4e7b..1636f837adab 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesAttribution.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesAttribution.java @@ -16,7 +16,7 @@ /** * The ContractualRulesAttribution model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = ContractualRulesAttribution.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("ContractualRules/Attribution") @JsonSubTypes({ @JsonSubTypes.Type(name = "ContractualRules/LicenseAttribution", value = ContractualRulesLicenseAttribution.class), @@ -36,7 +36,7 @@ public class ContractualRulesAttribution extends ContractualRulesContractualRule private Boolean mustBeCloseToContent; /** - * Get the mustBeCloseToContent value. + * Get a Boolean value that determines whether the contents of the rule must be placed in close proximity to the field that the rule applies to. If true, the contents must be placed in close proximity. If false, or this field does not exist, the contents may be placed at the caller's discretion. * * @return the mustBeCloseToContent value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesContractualRule.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesContractualRule.java index 53e4f86343d1..aeb726ea4ef0 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesContractualRule.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesContractualRule.java @@ -16,7 +16,7 @@ /** * The ContractualRulesContractualRule model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = ContractualRulesContractualRule.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("ContractualRules/ContractualRule") @JsonSubTypes({ @JsonSubTypes.Type(name = "ContractualRules/Attribution", value = ContractualRulesAttribution.class) @@ -29,7 +29,7 @@ public class ContractualRulesContractualRule { private String targetPropertyName; /** - * Get the targetPropertyName value. + * Get the name of the field that the rule applies to. * * @return the targetPropertyName value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesLicenseAttribution.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesLicenseAttribution.java index 67d55681a677..16619b2f3081 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesLicenseAttribution.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesLicenseAttribution.java @@ -15,7 +15,7 @@ /** * Defines a contractual rule for license attribution. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = ContractualRulesLicenseAttribution.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("ContractualRules/LicenseAttribution") public class ContractualRulesLicenseAttribution extends ContractualRulesAttribution { /** @@ -31,7 +31,7 @@ public class ContractualRulesLicenseAttribution extends ContractualRulesAttribut private String licenseNotice; /** - * Get the license value. + * Get the license under which the content may be used. * * @return the license value */ @@ -40,7 +40,7 @@ public License license() { } /** - * Get the licenseNotice value. + * Get the license to display next to the targeted field. * * @return the licenseNotice value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesLinkAttribution.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesLinkAttribution.java index b0f2f0f924ec..e968a6f09012 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesLinkAttribution.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesLinkAttribution.java @@ -15,7 +15,7 @@ /** * Defines a contractual rule for link attribution. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = ContractualRulesLinkAttribution.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("ContractualRules/LinkAttribution") public class ContractualRulesLinkAttribution extends ContractualRulesAttribution { /** @@ -38,7 +38,7 @@ public class ContractualRulesLinkAttribution extends ContractualRulesAttribution private Boolean optionalForListDisplay; /** - * Get the text value. + * Get the attribution text. * * @return the text value */ @@ -47,7 +47,7 @@ public String text() { } /** - * Set the text value. + * Set the attribution text. * * @param text the text value to set * @return the ContractualRulesLinkAttribution object itself. @@ -58,7 +58,7 @@ public ContractualRulesLinkAttribution withText(String text) { } /** - * Get the url value. + * Get the URL to the provider's website. Use text and URL to create the hyperlink. * * @return the url value */ @@ -67,7 +67,7 @@ public String url() { } /** - * Set the url value. + * Set the URL to the provider's website. Use text and URL to create the hyperlink. * * @param url the url value to set * @return the ContractualRulesLinkAttribution object itself. @@ -78,7 +78,7 @@ public ContractualRulesLinkAttribution withUrl(String url) { } /** - * Get the optionalForListDisplay value. + * Get indicates whether this provider's attribution is optional. * * @return the optionalForListDisplay value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesMediaAttribution.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesMediaAttribution.java index b201c809a260..689d37388451 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesMediaAttribution.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesMediaAttribution.java @@ -15,7 +15,7 @@ /** * Defines a contractual rule for media attribution. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = ContractualRulesMediaAttribution.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("ContractualRules/MediaAttribution") public class ContractualRulesMediaAttribution extends ContractualRulesAttribution { /** @@ -27,7 +27,7 @@ public class ContractualRulesMediaAttribution extends ContractualRulesAttributio private String url; /** - * Get the url value. + * Get the URL that you use to create of hyperlink of the media content. For example, if the target is an image, you would use the URL to make the image clickable. * * @return the url value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesTextAttribution.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesTextAttribution.java index c424c5063b83..e9e0e7d194e2 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesTextAttribution.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ContractualRulesTextAttribution.java @@ -15,7 +15,7 @@ /** * Defines a contractual rule for text attribution. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = ContractualRulesTextAttribution.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("ContractualRules/TextAttribution") public class ContractualRulesTextAttribution extends ContractualRulesAttribution { /** @@ -35,7 +35,7 @@ public class ContractualRulesTextAttribution extends ContractualRulesAttribution private Boolean optionalForListDisplay; /** - * Get the text value. + * Get the attribution text. Text attribution applies to the entity as a whole and should be displayed immediately following the entity presentation. If there are multiple text or link attribution rules that do not specify a target, you should concatenate them and display them using a "Data from:" label. * * @return the text value */ @@ -44,7 +44,7 @@ public String text() { } /** - * Set the text value. + * Set the attribution text. Text attribution applies to the entity as a whole and should be displayed immediately following the entity presentation. If there are multiple text or link attribution rules that do not specify a target, you should concatenate them and display them using a "Data from:" label. * * @param text the text value to set * @return the ContractualRulesTextAttribution object itself. @@ -55,7 +55,7 @@ public ContractualRulesTextAttribution withText(String text) { } /** - * Get the optionalForListDisplay value. + * Get indicates whether this provider's attribution is optional. * * @return the optionalForListDisplay value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/CreativeWork.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/CreativeWork.java index 3c321304d335..936a37fc247b 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/CreativeWork.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/CreativeWork.java @@ -17,7 +17,7 @@ /** * The CreativeWork model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = CreativeWork.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("CreativeWork") @JsonSubTypes({ @JsonSubTypes.Type(name = "MediaObject", value = MediaObject.class), @@ -43,7 +43,7 @@ public class CreativeWork extends Thing { private String text; /** - * Get the thumbnailUrl value. + * Get the URL to a thumbnail of the item. * * @return the thumbnailUrl value */ @@ -52,7 +52,7 @@ public String thumbnailUrl() { } /** - * Get the provider value. + * Get the source of the creative work. * * @return the provider value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/EntertainmentBusiness.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/EntertainmentBusiness.java index 1b28aabbf1b5..127102fba09d 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/EntertainmentBusiness.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/EntertainmentBusiness.java @@ -15,7 +15,7 @@ /** * The EntertainmentBusiness model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = EntertainmentBusiness.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("EntertainmentBusiness") @JsonSubTypes({ @JsonSubTypes.Type(name = "MovieTheater", value = MovieTheater.class) diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Entities.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Entities.java new file mode 100644 index 000000000000..2b93f44d7336 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Entities.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.search.entitysearch.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Defines an entity answer. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") +@JsonTypeName("Entities") +public class Entities extends SearchResultsAnswer { + /** + * The supported query scenario. This field is set to DominantEntity or + * DisambiguationItem. The field is set to DominantEntity if Bing + * determines that only a single entity satisfies the request. For example, + * a book, movie, person, or attraction. If multiple entities could satisfy + * the request, the field is set to DisambiguationItem. For example, if the + * request uses the generic title of a movie franchise, the entity's type + * would likely be DisambiguationItem. But, if the request specifies a + * specific title from the franchise, the entity's type would likely be + * DominantEntity. Possible values include: 'DominantEntity', + * 'DominantEntityWithDisambiguation', 'Disambiguation', 'List', + * 'ListWithPivot'. + */ + @JsonProperty(value = "queryScenario", access = JsonProperty.Access.WRITE_ONLY) + private EntityQueryScenario queryScenario; + + /** + * A list of entities. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the supported query scenario. This field is set to DominantEntity or DisambiguationItem. The field is set to DominantEntity if Bing determines that only a single entity satisfies the request. For example, a book, movie, person, or attraction. If multiple entities could satisfy the request, the field is set to DisambiguationItem. For example, if the request uses the generic title of a movie franchise, the entity's type would likely be DisambiguationItem. But, if the request specifies a specific title from the franchise, the entity's type would likely be DominantEntity. Possible values include: 'DominantEntity', 'DominantEntityWithDisambiguation', 'Disambiguation', 'List', 'ListWithPivot'. + * + * @return the queryScenario value + */ + public EntityQueryScenario queryScenario() { + return this.queryScenario; + } + + /** + * Get a list of entities. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set a list of entities. + * + * @param value the value value to set + * @return the Entities object itself. + */ + public Entities withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/EntitiesEntityPresentationInfo.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/EntitiesEntityPresentationInfo.java index 3d517efea08a..67acbf95a4d2 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/EntitiesEntityPresentationInfo.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/EntitiesEntityPresentationInfo.java @@ -39,7 +39,7 @@ public class EntitiesEntityPresentationInfo { private String entityTypeDisplayHint; /** - * Get the entityScenario value. + * Get the supported scenario. Possible values include: 'DominantEntity', 'DisambiguationItem', 'ListItem'. * * @return the entityScenario value */ @@ -48,7 +48,7 @@ public EntityScenario entityScenario() { } /** - * Set the entityScenario value. + * Set the supported scenario. Possible values include: 'DominantEntity', 'DisambiguationItem', 'ListItem'. * * @param entityScenario the entityScenario value to set * @return the EntitiesEntityPresentationInfo object itself. @@ -59,7 +59,7 @@ public EntitiesEntityPresentationInfo withEntityScenario(EntityScenario entitySc } /** - * Get the entityTypeHints value. + * Get a list of hints that indicate the entity's type. The list could contain a single hint such as Movie or a list of hints such as Place, LocalBusiness, Restaurant. Each successive hint in the array narrows the entity's type. * * @return the entityTypeHints value */ @@ -68,7 +68,7 @@ public List entityTypeHints() { } /** - * Get the entityTypeDisplayHint value. + * Get a display version of the entity hint. For example, if entityTypeHints is Artist, this field may be set to American Singer. * * @return the entityTypeDisplayHint value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Error.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Error.java index fed0f1756322..6f069e67c7a3 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Error.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Error.java @@ -57,7 +57,7 @@ public class Error { private String value; /** - * Get the code value. + * Get the error code that identifies the category of error. Possible values include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. * * @return the code value */ @@ -66,7 +66,7 @@ public ErrorCode code() { } /** - * Set the code value. + * 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. @@ -77,7 +77,7 @@ public Error withCode(ErrorCode code) { } /** - * Get the subCode value. + * 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 */ @@ -86,7 +86,7 @@ public ErrorSubCode subCode() { } /** - * Get the message value. + * Get a description of the error. * * @return the message value */ @@ -95,7 +95,7 @@ public String message() { } /** - * Set the message value. + * Set a description of the error. * * @param message the message value to set * @return the Error object itself. @@ -106,7 +106,7 @@ public Error withMessage(String message) { } /** - * Get the moreDetails value. + * Get a description that provides additional information about the error. * * @return the moreDetails value */ @@ -115,7 +115,7 @@ public String moreDetails() { } /** - * Get the parameter value. + * Get the parameter in the request that caused the error. * * @return the parameter value */ @@ -124,7 +124,7 @@ public String parameter() { } /** - * Get the value value. + * Get the parameter's value in the request that was not valid. * * @return the value value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ErrorResponse.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ErrorResponse.java index 4009bb43e031..08e466f871a3 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ErrorResponse.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ErrorResponse.java @@ -16,7 +16,7 @@ /** * The top-level response that represents a failed request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = ErrorResponse.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("ErrorResponse") public class ErrorResponse extends Response { /** @@ -26,7 +26,7 @@ public class ErrorResponse extends Response { private List errors; /** - * Get the errors value. + * Get a list of errors that describe the reasons why the request failed. * * @return the errors value */ @@ -35,7 +35,7 @@ public List errors() { } /** - * Set the errors value. + * 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. diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/FoodEstablishment.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/FoodEstablishment.java index 92d757b6a6b3..40b837e55e4e 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/FoodEstablishment.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/FoodEstablishment.java @@ -15,7 +15,7 @@ /** * The FoodEstablishment model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = FoodEstablishment.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("FoodEstablishment") @JsonSubTypes({ @JsonSubTypes.Type(name = "Restaurant", value = Restaurant.class) diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Hotel.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Hotel.java index f352cedb2cb8..382bf7f4eca1 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Hotel.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Hotel.java @@ -16,7 +16,7 @@ /** * The Hotel model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Hotel.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("Hotel") public class Hotel extends LodgingBusiness { /** diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Identifiable.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Identifiable.java index 50593fdddd4e..c421bd996fda 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Identifiable.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Identifiable.java @@ -16,7 +16,7 @@ /** * Defines the identity of a resource. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Identifiable.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("Identifiable") @JsonSubTypes({ @JsonSubTypes.Type(name = "Response", value = Response.class) @@ -29,7 +29,7 @@ public class Identifiable extends ResponseBase { private String id; /** - * Get the id value. + * Get a String identifier. * * @return the id value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ImageObject.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ImageObject.java index d0d10e744bc3..82a590a62d7a 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ImageObject.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ImageObject.java @@ -15,7 +15,7 @@ /** * Defines an image. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = ImageObject.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("ImageObject") public class ImageObject extends MediaObject { /** @@ -25,7 +25,7 @@ public class ImageObject extends MediaObject { private ImageObject thumbnail; /** - * Get the thumbnail value. + * Get the URL to a thumbnail of the image. * * @return the thumbnail value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Intangible.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Intangible.java index cb5deb841c92..9c3763f8a105 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Intangible.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Intangible.java @@ -15,7 +15,7 @@ /** * The Intangible model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Intangible.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("Intangible") @JsonSubTypes({ @JsonSubTypes.Type(name = "StructuredValue", value = StructuredValue.class) diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/License.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/License.java index 195bc6d152a1..24ef6246fdad 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/License.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/License.java @@ -14,7 +14,7 @@ /** * Defines the license under which the text or photo may be used. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = License.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("License") public class License extends CreativeWork { } diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/LocalBusiness.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/LocalBusiness.java index 49a3a7225241..edc7d2591fce 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/LocalBusiness.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/LocalBusiness.java @@ -17,7 +17,7 @@ /** * The LocalBusiness model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = LocalBusiness.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("LocalBusiness") @JsonSubTypes({ @JsonSubTypes.Type(name = "EntertainmentBusiness", value = EntertainmentBusiness.class), @@ -50,7 +50,7 @@ public class LocalBusiness extends Place { private String tagLine; /** - * Get the priceRange value. + * Get $$. * * @return the priceRange value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/LodgingBusiness.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/LodgingBusiness.java index 3554ce75bea5..02fa7809fcac 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/LodgingBusiness.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/LodgingBusiness.java @@ -15,7 +15,7 @@ /** * The LodgingBusiness model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = LodgingBusiness.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("LodgingBusiness") @JsonSubTypes({ @JsonSubTypes.Type(name = "Hotel", value = Hotel.class) diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/MediaObject.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/MediaObject.java index 65c7be296839..b4b961f59cc1 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/MediaObject.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/MediaObject.java @@ -16,7 +16,7 @@ /** * The MediaObject model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = MediaObject.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("MediaObject") @JsonSubTypes({ @JsonSubTypes.Type(name = "ImageObject", value = ImageObject.class) @@ -48,7 +48,7 @@ public class MediaObject extends CreativeWork { private Integer height; /** - * Get the contentUrl value. + * Get original URL to retrieve the source (file) for the media object (e.g the source URL for the image). * * @return the contentUrl value */ @@ -57,7 +57,7 @@ public String contentUrl() { } /** - * Get the hostPageUrl value. + * Get uRL of the page that hosts the media object. * * @return the hostPageUrl value */ @@ -66,7 +66,7 @@ public String hostPageUrl() { } /** - * Get the width value. + * Get the width of the source media object, in pixels. * * @return the width value */ @@ -75,7 +75,7 @@ public Integer width() { } /** - * Get the height value. + * Get the height of the source media object, in pixels. * * @return the height value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/MovieTheater.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/MovieTheater.java index f01ef75d0820..856a9f9f0432 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/MovieTheater.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/MovieTheater.java @@ -15,7 +15,7 @@ /** * The MovieTheater model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = MovieTheater.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("MovieTheater") public class MovieTheater extends EntertainmentBusiness { /** diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Organization.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Organization.java index ec1849f13e9d..31d2be182cc2 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Organization.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Organization.java @@ -14,7 +14,7 @@ /** * Defines an organization. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Organization.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("Organization") public class Organization extends Thing { } diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Place.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Place.java index c2bd3bd14f3d..6031bcb01c1d 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Place.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Place.java @@ -16,7 +16,7 @@ /** * Defines information about a local entity, such as a restaurant or hotel. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Place.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("Place") @JsonSubTypes({ @JsonSubTypes.Type(name = "CivicStructure", value = CivicStructure.class), @@ -37,7 +37,7 @@ public class Place extends Thing { private String telephone; /** - * Get the address value. + * Get the postal address of where the entity is located. * * @return the address value */ @@ -46,7 +46,7 @@ public PostalAddress address() { } /** - * Get the telephone value. + * Get the entity's telephone number. * * @return the telephone value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Places.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Places.java index 5d11dbf32c61..5a50c42335e3 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Places.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Places.java @@ -16,7 +16,7 @@ /** * Defines a local entity answer. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Places.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("Places") public class Places extends SearchResultsAnswer { /** @@ -26,7 +26,7 @@ public class Places extends SearchResultsAnswer { private List value; /** - * Get the value value. + * Get a list of local entities, such as restaurants or hotels. * * @return the value value */ @@ -35,7 +35,7 @@ public List value() { } /** - * Set the value value. + * Set a list of local entities, such as restaurants or hotels. * * @param value the value value to set * @return the Places object itself. diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/PostalAddress.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/PostalAddress.java index f6add299afb7..2251918ce84f 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/PostalAddress.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/PostalAddress.java @@ -15,7 +15,7 @@ /** * Defines a postal address. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = PostalAddress.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("PostalAddress") public class PostalAddress extends StructuredValue { /** @@ -66,7 +66,7 @@ public class PostalAddress extends StructuredValue { private String addressCountry; /** - * The two letter ISO code of this countr. For example, US. + * The two letter ISO code of this country. For example, US. */ @JsonProperty(value = "countryIso", access = JsonProperty.Access.WRITE_ONLY) private String countryIso; @@ -101,7 +101,7 @@ public String streetAddress() { } /** - * Get the addressLocality value. + * Get the city where the street address is located. For example, Seattle. * * @return the addressLocality value */ @@ -119,7 +119,7 @@ public String addressSubregion() { } /** - * Get the addressRegion value. + * Get the state or province code where the street address is located. This could be the two-letter code. For example, WA, or the full name , Washington. * * @return the addressRegion value */ @@ -128,7 +128,7 @@ public String addressRegion() { } /** - * Get the postalCode value. + * Get the zip code or postal code where the street address is located. For example, 98052. * * @return the postalCode value */ @@ -146,7 +146,7 @@ public String postOfficeBoxNumber() { } /** - * Get the addressCountry value. + * Get the country/region where the street address is located. This could be the two-letter ISO code. For example, US, or the full name, United States. * * @return the addressCountry value */ @@ -155,7 +155,7 @@ public String addressCountry() { } /** - * Get the countryIso value. + * Get the two letter ISO code of this country. For example, US. * * @return the countryIso value */ @@ -164,7 +164,7 @@ public String countryIso() { } /** - * Get the neighborhood value. + * Get the neighborhood where the street address is located. For example, Westlake. * * @return the neighborhood value */ @@ -173,7 +173,7 @@ public String neighborhood() { } /** - * Get the addressRegionAbbreviation value. + * Get region Abbreviation. For example, WA. * * @return the addressRegionAbbreviation value */ @@ -182,7 +182,7 @@ public String addressRegionAbbreviation() { } /** - * Get the text value. + * Get the complete address. For example, 2100 Westlake Ave N, Bellevue, WA 98052. * * @return the text value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/QueryContext.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/QueryContext.java index 4b55d815dcb8..c5ae18ae5b18 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/QueryContext.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/QueryContext.java @@ -63,7 +63,7 @@ public class QueryContext { private Boolean askUserForLocation; /** - * Get the originalQuery value. + * Get the query string as specified in the request. * * @return the originalQuery value */ @@ -72,7 +72,7 @@ public String originalQuery() { } /** - * Set the originalQuery value. + * Set the query string as specified in the request. * * @param originalQuery the originalQuery value to set * @return the QueryContext object itself. @@ -83,7 +83,7 @@ public QueryContext withOriginalQuery(String originalQuery) { } /** - * Get the alteredQuery value. + * Get the query string used by Bing to perform the query. Bing uses the altered query string if the original query string contained spelling mistakes. For example, if the query string is "saling downwind", the altered query string will be "sailing downwind". This field is included only if the original query string contains a spelling mistake. * * @return the alteredQuery value */ @@ -92,7 +92,7 @@ public String alteredQuery() { } /** - * Get the alterationOverrideQuery value. + * Get the query string to use to force Bing to use the original string. For example, if the query string is "saling downwind", the override query string will be "+saling downwind". Remember to encode the query string which results in "%2Bsaling+downwind". This field is included only if the original query string contains a spelling mistake. * * @return the alterationOverrideQuery value */ @@ -101,7 +101,7 @@ public String alterationOverrideQuery() { } /** - * Get the adultIntent value. + * Get a Boolean value that indicates whether the specified query has adult intent. The value is true if the query has adult intent; otherwise, false. * * @return the adultIntent value */ @@ -110,7 +110,7 @@ public Boolean adultIntent() { } /** - * Get the askUserForLocation value. + * Get a Boolean value that indicates whether Bing requires the user's location to provide accurate results. If you specified the user's location by using the X-MSEdge-ClientIP and X-Search-Location headers, you can ignore this field. For location aware queries, such as "today's weather" or "restaurants near me" that need the user's location to provide accurate results, this field is set to true. For location aware queries that include the location (for example, "Seattle weather"), this field is set to false. This field is also set to false for queries that are not location aware, such as "best sellers". * * @return the askUserForLocation value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Response.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Response.java index bab5dfa1cfd3..a7b3990ffb58 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Response.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Response.java @@ -18,7 +18,7 @@ * 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", defaultImpl = Response.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("Response") @JsonSubTypes({ @JsonSubTypes.Type(name = "Thing", value = Thing.class), @@ -40,7 +40,7 @@ public class Response extends Identifiable { private String webSearchUrl; /** - * Get the contractualRules value. + * Get a list of rules that you must adhere to if you display the item. * * @return the contractualRules value */ @@ -49,7 +49,7 @@ public List contractualRules() { } /** - * Get the webSearchUrl value. + * Get the URL To Bing's search result for this item. * * @return the webSearchUrl value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ResponseBase.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ResponseBase.java index ce861caca50e..3c59d1034d08 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ResponseBase.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/ResponseBase.java @@ -15,7 +15,7 @@ /** * The ResponseBase model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = ResponseBase.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("ResponseBase") @JsonSubTypes({ @JsonSubTypes.Type(name = "Identifiable", value = Identifiable.class) diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Restaurant.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Restaurant.java index 757f0916644e..ef6b5c83207e 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Restaurant.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Restaurant.java @@ -16,7 +16,7 @@ /** * The Restaurant model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Restaurant.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("Restaurant") public class Restaurant extends FoodEstablishment { /** diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/SearchResponse.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/SearchResponse.java index 492343c2d242..09bc51f7d71a 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/SearchResponse.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/SearchResponse.java @@ -16,7 +16,7 @@ * Defines the top-level object that the response includes when the request * succeeds. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = SearchResponse.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("SearchResponse") public class SearchResponse extends Response { /** @@ -32,7 +32,7 @@ public class SearchResponse extends Response { * A list of entities that are relevant to the search query. */ @JsonProperty(value = "entities", access = JsonProperty.Access.WRITE_ONLY) - private EntitiesModel entities; + private Entities entities; /** * A list of local entities such as restaurants or hotels that are relevant @@ -42,7 +42,7 @@ public class SearchResponse extends Response { private Places places; /** - * Get the queryContext value. + * Get an object that contains the query string that Bing used for the request. This object contains the query string as entered by the user. It may also contain an altered query string that Bing used for the query if the query string contained a spelling mistake. * * @return the queryContext value */ @@ -51,16 +51,16 @@ public QueryContext queryContext() { } /** - * Get the entities value. + * Get a list of entities that are relevant to the search query. * * @return the entities value */ - public EntitiesModel entities() { + public Entities entities() { return this.entities; } /** - * Get the places value. + * Get a list of local entities such as restaurants or hotels that are relevant to the query. * * @return the places value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/SearchResultsAnswer.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/SearchResultsAnswer.java index 831eeca37f64..8d93af2c1d75 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/SearchResultsAnswer.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/SearchResultsAnswer.java @@ -16,10 +16,10 @@ /** * The SearchResultsAnswer model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = SearchResultsAnswer.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("SearchResultsAnswer") @JsonSubTypes({ - @JsonSubTypes.Type(name = "Entities", value = EntitiesModel.class), + @JsonSubTypes.Type(name = "Entities", value = Entities.class), @JsonSubTypes.Type(name = "Places", value = Places.class) }) public class SearchResultsAnswer extends Answer { diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/StructuredValue.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/StructuredValue.java index 4588395eaeca..ec57413eed56 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/StructuredValue.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/StructuredValue.java @@ -15,7 +15,7 @@ /** * The StructuredValue model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = StructuredValue.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("StructuredValue") @JsonSubTypes({ @JsonSubTypes.Type(name = "PostalAddress", value = PostalAddress.class) diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Thing.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Thing.java index 709bee958535..803ea9ee1356 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Thing.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/Thing.java @@ -16,7 +16,7 @@ /** * The Thing model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = Thing.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("Thing") @JsonSubTypes({ @JsonSubTypes.Type(name = "Place", value = Place.class), @@ -65,7 +65,7 @@ public class Thing extends Response { private String bingId; /** - * Get the name value. + * Get the name of the thing represented by this object. * * @return the name value */ @@ -74,7 +74,7 @@ public String name() { } /** - * Get the url value. + * Get the URL to get more information about the thing represented by this object. * * @return the url value */ @@ -92,7 +92,7 @@ public ImageObject image() { } /** - * Get the description value. + * Get a short description of the item. * * @return the description value */ @@ -101,7 +101,7 @@ public String description() { } /** - * Get the entityPresentationInfo value. + * Get additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. * * @return the entityPresentationInfo value */ @@ -110,7 +110,7 @@ public EntitiesEntityPresentationInfo entityPresentationInfo() { } /** - * Get the bingId value. + * Get an ID that uniquely identifies this item. * * @return the bingId value */ diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/TouristAttraction.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/TouristAttraction.java index f6bd64eca1fd..b42513fd5a9c 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/TouristAttraction.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/TouristAttraction.java @@ -14,7 +14,7 @@ /** * The TouristAttraction model. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = TouristAttraction.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("TouristAttraction") public class TouristAttraction extends Place { } diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/package-info.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/package-info.java index f52616923390..de383e86fa0a 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/package-info.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/models/package-info.java @@ -5,7 +5,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the models classes for BingEntitySearchAPI. + * This package contains the models classes for EntitySearchClient. * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. */ package com.microsoft.azure.cognitiveservices.search.entitysearch.models; diff --git a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/package-info.java b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/package-info.java index 027426726ce7..be349c9c5444 100644 --- a/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/package-info.java +++ b/cognitiveservices/data-plane/search/bingentitysearch/src/main/java/com/microsoft/azure/cognitiveservices/search/entitysearch/package-info.java @@ -5,7 +5,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the classes for BingEntitySearchAPI. + * This package contains the classes for EntitySearchClient. * The Entity Search API lets you send a search query to Bing and get back search results that include entities and places. Place results include restaurants, hotel, or other local businesses. For places, the query can specify the name of the local business or it can ask for a list (for example, restaurants near me). Entity results include persons, places, or things. Place in this context is tourist attractions, states, countries, etc. */ package com.microsoft.azure.cognitiveservices.search.entitysearch;