diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/CustomInstances.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/CustomInstances.java new file mode 100644 index 0000000000000..6025384328f0d --- /dev/null +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/CustomInstances.java @@ -0,0 +1,163 @@ +/** + * 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.customsearch; + +import com.microsoft.azure.cognitiveservices.search.customsearch.models.ErrorResponseException; +import com.microsoft.azure.cognitiveservices.search.customsearch.models.SafeSearch; +import com.microsoft.azure.cognitiveservices.search.customsearch.models.SearchResponse; +import com.microsoft.azure.cognitiveservices.search.customsearch.models.TextFormat; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CustomInstances. + */ +public interface CustomInstances { + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @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 customConfig, String query); + + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @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 customConfig, String query, final ServiceCallback serviceCallback); + + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + Observable searchAsync(String customConfig, String query); + + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + Observable> searchWithServiceResponseAsync(String customConfig, String query); + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @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 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 count The number of search results to return in the response. The default is 10 and the maximum value is 50. The actual number delivered may be less than requested.Use this parameter along with the offset parameter to page results.For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). It is possible for multiple pages to include some overlap in results. + * @param market The market where the results come from. Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in Market Codes, Bing uses a best fit market code based on an internal mapping that is subject to change. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param offset The zero-based offset that indicates the number of search results to skip before returning results. The default is 0. The offset should be less than (totalEstimatedMatches - count). Use this parameter along with the count parameter to page results. For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). it is possible for multiple pages to include some overlap in 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 textDecorations A Boolean value that determines whether display strings should contain decoration markers such as hit highlighting characters. If true, the strings may include markers. The default is false. To specify whether to use Unicode characters or HTML tags as the markers, see the textFormat query parameter. + * @param textFormat The type of markers to use for text decorations (see the textDecorations query parameter). Possible values are Raw—Use Unicode characters to mark content that needs special formatting. The Unicode characters are in the range E000 through E019. For example, Bing uses E000 and E001 to mark the beginning and end of query terms for hit highlighting. HTML—Use HTML tags to mark content that needs special formatting. For example, use <b> tags to highlight query terms in display strings. The default is Raw. For display strings that contain escapable HTML characters such as <, >, and &, if textFormat is set to HTML, Bing escapes the characters as appropriate (for example, < is escaped to &lt;). Possible values include: 'Raw', 'Html' + * @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 customConfig, String query, String acceptLanguage, String userAgent, String clientId, String clientIp, String location, String countryCode, Integer count, String market, Integer offset, SafeSearch safeSearch, String setLang, Boolean textDecorations, TextFormat textFormat); + + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @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 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 count The number of search results to return in the response. The default is 10 and the maximum value is 50. The actual number delivered may be less than requested.Use this parameter along with the offset parameter to page results.For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). It is possible for multiple pages to include some overlap in results. + * @param market The market where the results come from. Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in Market Codes, Bing uses a best fit market code based on an internal mapping that is subject to change. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param offset The zero-based offset that indicates the number of search results to skip before returning results. The default is 0. The offset should be less than (totalEstimatedMatches - count). Use this parameter along with the count parameter to page results. For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). it is possible for multiple pages to include some overlap in 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 textDecorations A Boolean value that determines whether display strings should contain decoration markers such as hit highlighting characters. If true, the strings may include markers. The default is false. To specify whether to use Unicode characters or HTML tags as the markers, see the textFormat query parameter. + * @param textFormat The type of markers to use for text decorations (see the textDecorations query parameter). Possible values are Raw—Use Unicode characters to mark content that needs special formatting. The Unicode characters are in the range E000 through E019. For example, Bing uses E000 and E001 to mark the beginning and end of query terms for hit highlighting. HTML—Use HTML tags to mark content that needs special formatting. For example, use <b> tags to highlight query terms in display strings. The default is Raw. For display strings that contain escapable HTML characters such as <, >, and &, if textFormat is set to HTML, Bing escapes the characters as appropriate (for example, < is escaped to &lt;). Possible values include: 'Raw', 'Html' + * @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 customConfig, String query, String acceptLanguage, String userAgent, String clientId, String clientIp, String location, String countryCode, Integer count, String market, Integer offset, SafeSearch safeSearch, String setLang, Boolean textDecorations, TextFormat textFormat, final ServiceCallback serviceCallback); + + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @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 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 count The number of search results to return in the response. The default is 10 and the maximum value is 50. The actual number delivered may be less than requested.Use this parameter along with the offset parameter to page results.For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). It is possible for multiple pages to include some overlap in results. + * @param market The market where the results come from. Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in Market Codes, Bing uses a best fit market code based on an internal mapping that is subject to change. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param offset The zero-based offset that indicates the number of search results to skip before returning results. The default is 0. The offset should be less than (totalEstimatedMatches - count). Use this parameter along with the count parameter to page results. For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). it is possible for multiple pages to include some overlap in 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 textDecorations A Boolean value that determines whether display strings should contain decoration markers such as hit highlighting characters. If true, the strings may include markers. The default is false. To specify whether to use Unicode characters or HTML tags as the markers, see the textFormat query parameter. + * @param textFormat The type of markers to use for text decorations (see the textDecorations query parameter). Possible values are Raw—Use Unicode characters to mark content that needs special formatting. The Unicode characters are in the range E000 through E019. For example, Bing uses E000 and E001 to mark the beginning and end of query terms for hit highlighting. HTML—Use HTML tags to mark content that needs special formatting. For example, use <b> tags to highlight query terms in display strings. The default is Raw. For display strings that contain escapable HTML characters such as <, >, and &, if textFormat is set to HTML, Bing escapes the characters as appropriate (for example, < is escaped to &lt;). Possible values include: 'Raw', 'Html' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + Observable searchAsync(String customConfig, String query, String acceptLanguage, String userAgent, String clientId, String clientIp, String location, String countryCode, Integer count, String market, Integer offset, SafeSearch safeSearch, String setLang, Boolean textDecorations, TextFormat textFormat); + + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @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 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 count The number of search results to return in the response. The default is 10 and the maximum value is 50. The actual number delivered may be less than requested.Use this parameter along with the offset parameter to page results.For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). It is possible for multiple pages to include some overlap in results. + * @param market The market where the results come from. Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in Market Codes, Bing uses a best fit market code based on an internal mapping that is subject to change. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param offset The zero-based offset that indicates the number of search results to skip before returning results. The default is 0. The offset should be less than (totalEstimatedMatches - count). Use this parameter along with the count parameter to page results. For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). it is possible for multiple pages to include some overlap in 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 textDecorations A Boolean value that determines whether display strings should contain decoration markers such as hit highlighting characters. If true, the strings may include markers. The default is false. To specify whether to use Unicode characters or HTML tags as the markers, see the textFormat query parameter. + * @param textFormat The type of markers to use for text decorations (see the textDecorations query parameter). Possible values are Raw—Use Unicode characters to mark content that needs special formatting. The Unicode characters are in the range E000 through E019. For example, Bing uses E000 and E001 to mark the beginning and end of query terms for hit highlighting. HTML—Use HTML tags to mark content that needs special formatting. For example, use <b> tags to highlight query terms in display strings. The default is Raw. For display strings that contain escapable HTML characters such as <, >, and &, if textFormat is set to HTML, Bing escapes the characters as appropriate (for example, < is escaped to &lt;). Possible values include: 'Raw', 'Html' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + Observable> searchWithServiceResponseAsync(String customConfig, String query, String acceptLanguage, String userAgent, String clientId, String clientIp, String location, String countryCode, Integer count, String market, Integer offset, SafeSearch safeSearch, String setLang, Boolean textDecorations, TextFormat textFormat); + +} diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/CustomSearchClient.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/CustomSearchClient.java new file mode 100644 index 0000000000000..12d3758a0c401 --- /dev/null +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/CustomSearchClient.java @@ -0,0 +1,89 @@ +/** + * 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.customsearch; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for CustomSearchClient class. + */ +public interface CustomSearchClient { + /** + * 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 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 + */ + CustomSearchClient 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 + */ + CustomSearchClient 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 + */ + CustomSearchClient withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the CustomInstances object to access its operations. + * @return the CustomInstances object. + */ + CustomInstances customInstances(); + +} diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/implementation/CustomInstancesImpl.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/implementation/CustomInstancesImpl.java new file mode 100644 index 0000000000000..6ef90cddacd3a --- /dev/null +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/implementation/CustomInstancesImpl.java @@ -0,0 +1,283 @@ +/** + * 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.customsearch.implementation; + +import retrofit2.Retrofit; +import com.microsoft.azure.cognitiveservices.search.customsearch.CustomInstances; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.cognitiveservices.search.customsearch.models.ErrorResponseException; +import com.microsoft.azure.cognitiveservices.search.customsearch.models.SafeSearch; +import com.microsoft.azure.cognitiveservices.search.customsearch.models.SearchResponse; +import com.microsoft.azure.cognitiveservices.search.customsearch.models.TextFormat; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in CustomInstances. + */ +public class CustomInstancesImpl implements CustomInstances { + /** The Retrofit service to perform REST calls. */ + private CustomInstancesService service; + /** The service client containing this operation class. */ + private CustomSearchClientImpl client; + + /** + * Initializes an instance of CustomInstancesImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CustomInstancesImpl(Retrofit retrofit, CustomSearchClientImpl client) { + this.service = retrofit.create(CustomInstancesService.class); + this.client = client; + } + + /** + * The interface defining all the services for CustomInstances to be + * used by Retrofit to perform actually REST calls. + */ + interface CustomInstancesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.cognitiveservices.search.customsearch.CustomInstances search" }) + @GET("search") + Observable> search(@Header("X-BingApis-SDK") String xBingApisSDK, @Header("Accept-Language") String acceptLanguage, @Header("User-Agent") String userAgent, @Header("X-MSEdge-ClientID") String clientId, @Header("X-MSEdge-ClientIP") String clientIp, @Header("X-Search-Location") String location, @Query("customConfig") String customConfig, @Query("cc") String countryCode, @Query("count") Integer count, @Query("mkt") String market, @Query("offset") Integer offset, @Query("q") String query, @Query("safeSearch") SafeSearch safeSearch, @Query("setLang") String setLang, @Query("textDecorations") Boolean textDecorations, @Query("textFormat") TextFormat textFormat, @Header("User-Agent") String userAgent); + + } + + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @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 customConfig, String query) { + return searchWithServiceResponseAsync(customConfig, query).toBlocking().single().body(); + } + + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @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 customConfig, String query, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(searchWithServiceResponseAsync(customConfig, query), serviceCallback); + } + + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + public Observable searchAsync(String customConfig, String query) { + return searchWithServiceResponseAsync(customConfig, query).map(new Func1, SearchResponse>() { + @Override + public SearchResponse call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + public Observable> searchWithServiceResponseAsync(String customConfig, String query) { + if (customConfig == null) { + throw new IllegalArgumentException("Parameter customConfig 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 userAgent = null; + final String clientId = null; + final String clientIp = null; + final String location = null; + final String countryCode = null; + final Integer count = null; + final String market = null; + final Integer offset = null; + final SafeSearch safeSearch = null; + final String setLang = null; + final Boolean textDecorations = null; + final TextFormat textFormat = null; + return service.search(xBingApisSDK, acceptLanguage, userAgent, clientId, clientIp, location, customConfig, countryCode, count, market, offset, query, safeSearch, setLang, textDecorations, textFormat, 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 Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @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 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 count The number of search results to return in the response. The default is 10 and the maximum value is 50. The actual number delivered may be less than requested.Use this parameter along with the offset parameter to page results.For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). It is possible for multiple pages to include some overlap in results. + * @param market The market where the results come from. Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in Market Codes, Bing uses a best fit market code based on an internal mapping that is subject to change. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param offset The zero-based offset that indicates the number of search results to skip before returning results. The default is 0. The offset should be less than (totalEstimatedMatches - count). Use this parameter along with the count parameter to page results. For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). it is possible for multiple pages to include some overlap in 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 textDecorations A Boolean value that determines whether display strings should contain decoration markers such as hit highlighting characters. If true, the strings may include markers. The default is false. To specify whether to use Unicode characters or HTML tags as the markers, see the textFormat query parameter. + * @param textFormat The type of markers to use for text decorations (see the textDecorations query parameter). Possible values are Raw—Use Unicode characters to mark content that needs special formatting. The Unicode characters are in the range E000 through E019. For example, Bing uses E000 and E001 to mark the beginning and end of query terms for hit highlighting. HTML—Use HTML tags to mark content that needs special formatting. For example, use <b> tags to highlight query terms in display strings. The default is Raw. For display strings that contain escapable HTML characters such as <, >, and &, if textFormat is set to HTML, Bing escapes the characters as appropriate (for example, < is escaped to &lt;). Possible values include: 'Raw', 'Html' + * @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 customConfig, String query, String acceptLanguage, String userAgent, String clientId, String clientIp, String location, String countryCode, Integer count, String market, Integer offset, SafeSearch safeSearch, String setLang, Boolean textDecorations, TextFormat textFormat) { + return searchWithServiceResponseAsync(customConfig, query, acceptLanguage, userAgent, clientId, clientIp, location, countryCode, count, market, offset, safeSearch, setLang, textDecorations, textFormat).toBlocking().single().body(); + } + + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @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 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 count The number of search results to return in the response. The default is 10 and the maximum value is 50. The actual number delivered may be less than requested.Use this parameter along with the offset parameter to page results.For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). It is possible for multiple pages to include some overlap in results. + * @param market The market where the results come from. Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in Market Codes, Bing uses a best fit market code based on an internal mapping that is subject to change. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param offset The zero-based offset that indicates the number of search results to skip before returning results. The default is 0. The offset should be less than (totalEstimatedMatches - count). Use this parameter along with the count parameter to page results. For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). it is possible for multiple pages to include some overlap in 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 textDecorations A Boolean value that determines whether display strings should contain decoration markers such as hit highlighting characters. If true, the strings may include markers. The default is false. To specify whether to use Unicode characters or HTML tags as the markers, see the textFormat query parameter. + * @param textFormat The type of markers to use for text decorations (see the textDecorations query parameter). Possible values are Raw—Use Unicode characters to mark content that needs special formatting. The Unicode characters are in the range E000 through E019. For example, Bing uses E000 and E001 to mark the beginning and end of query terms for hit highlighting. HTML—Use HTML tags to mark content that needs special formatting. For example, use <b> tags to highlight query terms in display strings. The default is Raw. For display strings that contain escapable HTML characters such as <, >, and &, if textFormat is set to HTML, Bing escapes the characters as appropriate (for example, < is escaped to &lt;). Possible values include: 'Raw', 'Html' + * @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 customConfig, String query, String acceptLanguage, String userAgent, String clientId, String clientIp, String location, String countryCode, Integer count, String market, Integer offset, SafeSearch safeSearch, String setLang, Boolean textDecorations, TextFormat textFormat, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(searchWithServiceResponseAsync(customConfig, query, acceptLanguage, userAgent, clientId, clientIp, location, countryCode, count, market, offset, safeSearch, setLang, textDecorations, textFormat), serviceCallback); + } + + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @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 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 count The number of search results to return in the response. The default is 10 and the maximum value is 50. The actual number delivered may be less than requested.Use this parameter along with the offset parameter to page results.For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). It is possible for multiple pages to include some overlap in results. + * @param market The market where the results come from. Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in Market Codes, Bing uses a best fit market code based on an internal mapping that is subject to change. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param offset The zero-based offset that indicates the number of search results to skip before returning results. The default is 0. The offset should be less than (totalEstimatedMatches - count). Use this parameter along with the count parameter to page results. For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). it is possible for multiple pages to include some overlap in 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 textDecorations A Boolean value that determines whether display strings should contain decoration markers such as hit highlighting characters. If true, the strings may include markers. The default is false. To specify whether to use Unicode characters or HTML tags as the markers, see the textFormat query parameter. + * @param textFormat The type of markers to use for text decorations (see the textDecorations query parameter). Possible values are Raw—Use Unicode characters to mark content that needs special formatting. The Unicode characters are in the range E000 through E019. For example, Bing uses E000 and E001 to mark the beginning and end of query terms for hit highlighting. HTML—Use HTML tags to mark content that needs special formatting. For example, use <b> tags to highlight query terms in display strings. The default is Raw. For display strings that contain escapable HTML characters such as <, >, and &, if textFormat is set to HTML, Bing escapes the characters as appropriate (for example, < is escaped to &lt;). Possible values include: 'Raw', 'Html' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + public Observable searchAsync(String customConfig, String query, String acceptLanguage, String userAgent, String clientId, String clientIp, String location, String countryCode, Integer count, String market, Integer offset, SafeSearch safeSearch, String setLang, Boolean textDecorations, TextFormat textFormat) { + return searchWithServiceResponseAsync(customConfig, query, acceptLanguage, userAgent, clientId, clientIp, location, countryCode, count, market, offset, safeSearch, setLang, textDecorations, textFormat).map(new Func1, SearchResponse>() { + @Override + public SearchResponse call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * The Custom Search API lets you send a search query to Bing and get back web pages found in your custom view of the web. + * + * @param customConfig The identifier for the custom search configuration + * @param query The user's search query term. The term may not be empty. The term may contain Bing Advanced Operators. For example, to limit results to a specific domain, use the site: operator. + * @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 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 count The number of search results to return in the response. The default is 10 and the maximum value is 50. The actual number delivered may be less than requested.Use this parameter along with the offset parameter to page results.For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). It is possible for multiple pages to include some overlap in results. + * @param market The market where the results come from. Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in Market Codes, Bing uses a best fit market code based on an internal mapping that is subject to change. This parameter and the cc query parameter are mutually exclusive—do not specify both. + * @param offset The zero-based offset that indicates the number of search results to skip before returning results. The default is 0. The offset should be less than (totalEstimatedMatches - count). Use this parameter along with the count parameter to page results. For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 10 (for example, 0, 10, 20). it is possible for multiple pages to include some overlap in 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 textDecorations A Boolean value that determines whether display strings should contain decoration markers such as hit highlighting characters. If true, the strings may include markers. The default is false. To specify whether to use Unicode characters or HTML tags as the markers, see the textFormat query parameter. + * @param textFormat The type of markers to use for text decorations (see the textDecorations query parameter). Possible values are Raw—Use Unicode characters to mark content that needs special formatting. The Unicode characters are in the range E000 through E019. For example, Bing uses E000 and E001 to mark the beginning and end of query terms for hit highlighting. HTML—Use HTML tags to mark content that needs special formatting. For example, use <b> tags to highlight query terms in display strings. The default is Raw. For display strings that contain escapable HTML characters such as <, >, and &, if textFormat is set to HTML, Bing escapes the characters as appropriate (for example, < is escaped to &lt;). Possible values include: 'Raw', 'Html' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchResponse object + */ + public Observable> searchWithServiceResponseAsync(String customConfig, String query, String acceptLanguage, String userAgent, String clientId, String clientIp, String location, String countryCode, Integer count, String market, Integer offset, SafeSearch safeSearch, String setLang, Boolean textDecorations, TextFormat textFormat) { + if (customConfig == null) { + throw new IllegalArgumentException("Parameter customConfig is required and cannot be null."); + } + if (query == null) { + throw new IllegalArgumentException("Parameter query is required and cannot be null."); + } + final String xBingApisSDK = "true"; + return service.search(xBingApisSDK, acceptLanguage, userAgent, clientId, clientIp, location, customConfig, countryCode, count, market, offset, query, safeSearch, setLang, textDecorations, textFormat, 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/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/implementation/CustomSearchClientImpl.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/implementation/CustomSearchClientImpl.java new file mode 100644 index 0000000000000..0e721b0d908cf --- /dev/null +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/implementation/CustomSearchClientImpl.java @@ -0,0 +1,162 @@ +/** + * 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.customsearch.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.cognitiveservices.search.customsearch.CustomInstances; +import com.microsoft.azure.cognitiveservices.search.customsearch.CustomSearchClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the CustomSearchClientImpl class. + */ +public class CustomSearchClientImpl extends AzureServiceClient implements CustomSearchClient { + /** 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; + } + + /** 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 CustomSearchClientImpl 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 CustomSearchClientImpl 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 CustomSearchClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The CustomInstances object to access its operations. + */ + private CustomInstances customInstances; + + /** + * Gets the CustomInstances object to access its operations. + * @return the CustomInstances object. + */ + public CustomInstances customInstances() { + return this.customInstances; + } + + /** + * Initializes an instance of CustomSearchClient client. + * + * @param credentials the management credentials for Azure + */ + public CustomSearchClientImpl(ServiceClientCredentials credentials) { + this("https://api.cognitive.microsoft.com/bingcustomsearch/v7.0", credentials); + } + + /** + * Initializes an instance of CustomSearchClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public CustomSearchClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of CustomSearchClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public CustomSearchClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.customInstances = new CustomInstancesImpl(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(), "CustomSearchClient", "1.0"); + } +} diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/implementation/package-info.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/implementation/package-info.java index 99a8c4e01b418..fc454825982d7 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/implementation/package-info.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/implementation/package-info.java @@ -5,7 +5,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the implementation classes for BingCustomSearchAPI. + * This package contains the implementation classes for CustomSearchClient. * The Bing Custom Search API lets you send a search query to Bing and get back search results customized to meet your custom search definition. */ package com.microsoft.azure.cognitiveservices.search.customsearch.implementation; diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Answer.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Answer.java index 8f683caacb037..efa1721e4c605 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Answer.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Answer.java @@ -17,7 +17,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/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/CreativeWork.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/CreativeWork.java index f0ba1fc2d7ade..a09f01dcf6e46 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/CreativeWork.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/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 = "WebPage", value = WebPage.class) @@ -42,7 +42,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 */ @@ -51,7 +51,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/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Error.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Error.java index 6e26b07fae1bc..c5355c7bd525e 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Error.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/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/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/ErrorResponse.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/ErrorResponse.java index 789031d39c002..00e983c7e842c 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/ErrorResponse.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/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/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Identifiable.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Identifiable.java index c092df6777fc5..1b02cd463bf3d 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Identifiable.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/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/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Query.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Query.java index 74bd885b60eae..ee945b7f08e0f 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Query.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Query.java @@ -44,7 +44,7 @@ public class Query { private String searchLink; /** - * Get the text value. + * Get the query string. Use this string as the query term in a new search request. * * @return the text value */ @@ -53,7 +53,7 @@ public String text() { } /** - * Set the text value. + * Set the query string. Use this string as the query term in a new search request. * * @param text the text value to set * @return the Query object itself. @@ -64,7 +64,7 @@ public Query withText(String text) { } /** - * Get the displayText value. + * Get the display version of the query term. This version of the query term may contain special characters that highlight the search term found in the query string. The string contains the highlighting characters only if the query enabled hit highlighting. * * @return the displayText value */ @@ -73,7 +73,7 @@ public String displayText() { } /** - * Get the webSearchUrl value. + * Get the URL that takes the user to the Bing search results page for the query.Only related search results include this field. * * @return the webSearchUrl value */ diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/QueryContext.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/QueryContext.java index b141d95ee0e6e..edaed179b2a42 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/QueryContext.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/QueryContext.java @@ -49,7 +49,7 @@ public class QueryContext { private Boolean adultIntent; /** - * Get the originalQuery value. + * Get the query string as specified in the request. * * @return the originalQuery value */ @@ -58,7 +58,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. @@ -69,7 +69,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 */ @@ -78,7 +78,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 */ @@ -87,7 +87,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 */ diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Response.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Response.java index 39499060a5898..598c5e0b8d88c 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Response.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Response.java @@ -17,7 +17,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 = "SearchResponse", value = SearchResponse.class), @@ -33,7 +33,7 @@ public class Response extends Identifiable { private String webSearchUrl; /** - * 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/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/ResponseBase.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/ResponseBase.java index 547401f97f12f..f9c161128288e 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/ResponseBase.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/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/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/SearchResponse.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/SearchResponse.java index 31605aff780b4..f7aafdb78d8be 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/SearchResponse.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/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 { /** @@ -35,7 +35,7 @@ public class SearchResponse extends Response { private WebWebAnswer webPages; /** - * 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 */ @@ -44,7 +44,7 @@ public QueryContext queryContext() { } /** - * Get the webPages value. + * Get a list of webpages that are relevant to the search query. * * @return the webPages value */ diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/SearchResultsAnswer.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/SearchResultsAnswer.java index db6853f79f688..5d8e9ca1f69b0 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/SearchResultsAnswer.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/SearchResultsAnswer.java @@ -16,7 +16,7 @@ /** * 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 = "Web/WebAnswer", value = WebWebAnswer.class) @@ -52,7 +52,7 @@ public QueryContext queryContext() { } /** - * Get the totalEstimatedMatches value. + * Get the estimated number of webpages that are relevant to the query. Use this number along with the count and offset query parameters to page the results. * * @return the totalEstimatedMatches value */ diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Thing.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Thing.java index 40a3f6622c9ae..d2755d8e040f9 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/Thing.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/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 = "CreativeWork", value = CreativeWork.class) @@ -48,7 +48,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 */ @@ -57,7 +57,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 */ @@ -66,7 +66,7 @@ public String url() { } /** - * Get the description value. + * Get a short description of the item. * * @return the description value */ @@ -75,7 +75,7 @@ public String description() { } /** - * Get the bingId value. + * Get an ID that uniquely identifies this item. * * @return the bingId value */ diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/WebMetaTag.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/WebMetaTag.java index badea4f302a5b..6b3a872b64e76 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/WebMetaTag.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/WebMetaTag.java @@ -27,7 +27,7 @@ public class WebMetaTag { private String content; /** - * Get the name value. + * Get the metadata. * * @return the name value */ @@ -36,7 +36,7 @@ public String name() { } /** - * Get the content value. + * Get the name of the metadata. * * @return the content value */ diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/WebPage.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/WebPage.java index 807a695fc34d3..c0f5cc12fa9de 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/WebPage.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/WebPage.java @@ -16,7 +16,7 @@ /** * Defines a webpage that is relevant to the query. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = WebPage.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("WebPage") public class WebPage extends CreativeWork { /** @@ -58,7 +58,7 @@ public class WebPage extends CreativeWork { private List searchTags; /** - * Get the displayUrl value. + * Get the display URL of the webpage. The URL is meant for display purposes only and is not well formed. * * @return the displayUrl value */ @@ -67,7 +67,7 @@ public String displayUrl() { } /** - * Get the snippet value. + * Get a snippet of text from the webpage that describes its contents. * * @return the snippet value */ @@ -76,7 +76,7 @@ public String snippet() { } /** - * Get the deepLinks value. + * Get a list of links to related content that Bing found in the website that contains this webpage. The Webpage object in this context includes only the name, url, urlPingSuffix, and snippet fields. * * @return the deepLinks value */ @@ -85,7 +85,7 @@ public List deepLinks() { } /** - * Get the dateLastCrawled value. + * Get the last time that Bing crawled the webpage. The date is in the form, YYYY-MM-DDTHH:MM:SS. For example, 2015-04-13T05:23:39. * * @return the dateLastCrawled value */ @@ -94,7 +94,7 @@ public String dateLastCrawled() { } /** - * Get the searchTags value. + * Get a list of search tags that the webpage owner specified on the webpage. The API returns only indexed search tags. The name field of the MetaTag object contains the indexed search tag. Search tags begin with search.* (for example, search.assetId). The content field contains the tag's value. * * @return the searchTags value */ diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/WebWebAnswer.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/WebWebAnswer.java index 55fdaad5c771a..9685741f32e5d 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/WebWebAnswer.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/WebWebAnswer.java @@ -16,7 +16,7 @@ /** * Defines a list of relevant webpage links. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type", defaultImpl = WebWebAnswer.class) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "_type") @JsonTypeName("Web/WebAnswer") public class WebWebAnswer extends SearchResultsAnswer { /** @@ -34,7 +34,7 @@ public class WebWebAnswer extends SearchResultsAnswer { private Boolean someResultsRemoved; /** - * Get the value value. + * Get a list of webpages that are relevant to the query. * * @return the value value */ @@ -43,7 +43,7 @@ public List value() { } /** - * Set the value value. + * Set a list of webpages that are relevant to the query. * * @param value the value value to set * @return the WebWebAnswer object itself. @@ -54,7 +54,7 @@ public WebWebAnswer withValue(List value) { } /** - * Get the someResultsRemoved value. + * Get a Boolean value that indicates whether the response excluded some results from the answer. If Bing excluded some results, the value is true. * * @return the someResultsRemoved value */ diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/package-info.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/package-info.java index 9d862117810c0..4f2d3893d63d9 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/package-info.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/models/package-info.java @@ -5,7 +5,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the models classes for BingCustomSearchAPI. + * This package contains the models classes for CustomSearchClient. * The Bing Custom Search API lets you send a search query to Bing and get back search results customized to meet your custom search definition. */ package com.microsoft.azure.cognitiveservices.search.customsearch.models; diff --git a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/package-info.java b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/package-info.java index f5d68b012ea2e..66fa3931ddd9a 100644 --- a/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/package-info.java +++ b/cognitiveservices/data-plane/search/bingcustomsearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customsearch/package-info.java @@ -5,7 +5,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the classes for BingCustomSearchAPI. + * This package contains the classes for CustomSearchClient. * The Bing Custom Search API lets you send a search query to Bing and get back search results customized to meet your custom search definition. */ package com.microsoft.azure.cognitiveservices.search.customsearch;