| | | 1 | | // <auto-generated> |
| | | 2 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | | 3 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | | 4 | | // regenerated. |
| | | 5 | | // </auto-generated> |
| | | 6 | | |
| | | 7 | | namespace Microsoft.Azure.CognitiveServices.Search.VideoSearch |
| | | 8 | | { |
| | | 9 | | using Models; |
| | | 10 | | using System.Collections; |
| | | 11 | | using System.Collections.Generic; |
| | | 12 | | using System.Threading; |
| | | 13 | | using System.Threading.Tasks; |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// Extension methods for VideosOperations. |
| | | 17 | | /// </summary> |
| | | 18 | | public static partial class VideosOperationsExtensions |
| | | 19 | | { |
| | | 20 | | /// <summary> |
| | | 21 | | /// The Video Search API lets you send a search query to Bing and get back a |
| | | 22 | | /// list of videos that are relevant to the search query. This section provides |
| | | 23 | | /// technical details about the query parameters and headers that you use to |
| | | 24 | | /// request videos and the JSON response objects that contain them. For |
| | | 25 | | /// examples that show how to make requests, see [Searching the Web for |
| | | 26 | | /// Videos](https://docs.microsoft.com/azure/cognitive-services/bing-video-search/search-the-web). |
| | | 27 | | /// </summary> |
| | | 28 | | /// <param name='operations'> |
| | | 29 | | /// The operations group for this extension method. |
| | | 30 | | /// </param> |
| | | 31 | | /// <param name='query'> |
| | | 32 | | /// The user's search query string. The query string cannot be empty. The query |
| | | 33 | | /// string may contain [Bing Advanced |
| | | 34 | | /// Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, |
| | | 35 | | /// to limit videos to a specific domain, use the |
| | | 36 | | /// [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. Use this |
| | | 37 | | /// parameter only with the Video Search API. Do not specify this parameter |
| | | 38 | | /// when calling the Trending Videos API. |
| | | 39 | | /// </param> |
| | | 40 | | /// <param name='acceptLanguage'> |
| | | 41 | | /// A comma-delimited list of one or more languages to use for user interface |
| | | 42 | | /// strings. The list is in decreasing order of preference. For additional |
| | | 43 | | /// information, including expected format, see |
| | | 44 | | /// [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This |
| | | 45 | | /// header and the |
| | | 46 | | /// [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#setlan |
| | | 47 | | /// query parameter are mutually exclusive; do not specify both. If you set |
| | | 48 | | /// this header, you must also specify the |
| | | 49 | | /// [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#cc) |
| | | 50 | | /// query parameter. To determine the market to return results for, Bing uses |
| | | 51 | | /// the first supported language it finds from the list and combines it with |
| | | 52 | | /// the cc parameter value. If the list does not include a supported language, |
| | | 53 | | /// Bing finds the closest language and market that supports the request or it |
| | | 54 | | /// uses an aggregated or default market for the results. To determine the |
| | | 55 | | /// market that Bing used, see the BingAPIs-Market header. Use this header and |
| | | 56 | | /// the cc query parameter only if you specify multiple languages. Otherwise, |
| | | 57 | | /// use the |
| | | 58 | | /// [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#mkt) |
| | | 59 | | /// and |
| | | 60 | | /// [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#setlan |
| | | 61 | | /// query parameters. A user interface string is a string that's used as a |
| | | 62 | | /// label in a user interface. There are few user interface strings in the JSON |
| | | 63 | | /// response objects. Any links to Bing.com properties in the response objects |
| | | 64 | | /// apply the specified language. |
| | | 65 | | /// </param> |
| | | 66 | | /// <param name='userAgent'> |
| | | 67 | | /// The user agent originating the request. Bing uses the user agent to provide |
| | | 68 | | /// mobile users with an optimized experience. Although optional, you are |
| | | 69 | | /// encouraged to always specify this header. The user-agent should be the same |
| | | 70 | | /// string that any commonly used browser sends. For information about user |
| | | 71 | | /// agents, see [RFC |
| | | 72 | | /// 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The |
| | | 73 | | /// following are examples of user-agent strings. Windows Phone: Mozilla/5.0 |
| | | 74 | | /// (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; |
| | | 75 | | /// Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android 2.3.5; |
| | | 76 | | /// en - us; SCH - I500 Build / GINGERBREAD) AppleWebKit / 533.1 (KHTML; like |
| | | 77 | | /// Gecko) Version / 4.0 Mobile Safari / 533.1. iPhone: Mozilla / 5.0 (iPhone; |
| | | 78 | | /// CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 536.26 (KHTML; like Gecko) |
| | | 79 | | /// Mobile / 10B142 iPhone4; 1 BingWeb / 3.03.1428.20120423. PC: Mozilla / 5.0 |
| | | 80 | | /// (Windows NT 6.3; WOW64; Trident / 7.0; Touch; rv:11.0) like Gecko. iPad: |
| | | 81 | | /// Mozilla / 5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit / 537.51.1 |
| | | 82 | | /// (KHTML, like Gecko) Version / 7.0 Mobile / 11A465 Safari / 9537.53 |
| | | 83 | | /// </param> |
| | | 84 | | /// <param name='clientId'> |
| | | 85 | | /// Bing uses this header to provide users with consistent behavior across Bing |
| | | 86 | | /// API calls. Bing often flights new features and improvements, and it uses |
| | | 87 | | /// the client ID as a key for assigning traffic on different flights. If you |
| | | 88 | | /// do not use the same client ID for a user across multiple requests, then |
| | | 89 | | /// Bing may assign the user to multiple conflicting flights. Being assigned to |
| | | 90 | | /// multiple conflicting flights can lead to an inconsistent user experience. |
| | | 91 | | /// For example, if the second request has a different flight assignment than |
| | | 92 | | /// the first, the experience may be unexpected. Also, Bing can use the client |
| | | 93 | | /// ID to tailor web results to that client ID’s search history, providing a |
| | | 94 | | /// richer experience for the user. Bing also uses this header to help improve |
| | | 95 | | /// result rankings by analyzing the activity generated by a client ID. The |
| | | 96 | | /// relevance improvements help with better quality of results delivered by |
| | | 97 | | /// Bing APIs and in turn enables higher click-through rates for the API |
| | | 98 | | /// consumer. IMPORTANT: Although optional, you should consider this header |
| | | 99 | | /// required. Persisting the client ID across multiple requests for the same |
| | | 100 | | /// end user and device combination enables 1) the API consumer to receive a |
| | | 101 | | /// consistent user experience, and 2) higher click-through rates via better |
| | | 102 | | /// quality of results from the Bing APIs. Each user that uses your application |
| | | 103 | | /// on the device must have a unique, Bing generated client ID. If you do not |
| | | 104 | | /// include this header in the request, Bing generates an ID and returns it in |
| | | 105 | | /// the X-MSEdge-ClientID response header. The only time that you should NOT |
| | | 106 | | /// include this header in a request is the first time the user uses your app |
| | | 107 | | /// on that device. Use the client ID for each Bing API request that your app |
| | | 108 | | /// makes for this user on the device. Persist the client ID. To persist the ID |
| | | 109 | | /// in a browser app, use a persistent HTTP cookie to ensure the ID is used |
| | | 110 | | /// across all sessions. Do not use a session cookie. For other apps such as |
| | | 111 | | /// mobile apps, use the device's persistent storage to persist the ID. The |
| | | 112 | | /// next time the user uses your app on that device, get the client ID that you |
| | | 113 | | /// persisted. Bing responses may or may not include this header. If the |
| | | 114 | | /// response includes this header, capture the client ID and use it for all |
| | | 115 | | /// subsequent Bing requests for the user on that device. If you include the |
| | | 116 | | /// X-MSEdge-ClientID, you must not include cookies in the request. |
| | | 117 | | /// </param> |
| | | 118 | | /// <param name='clientIp'> |
| | | 119 | | /// The IPv4 or IPv6 address of the client device. The IP address is used to |
| | | 120 | | /// discover the user's location. Bing uses the location information to |
| | | 121 | | /// determine safe search behavior. Although optional, you are encouraged to |
| | | 122 | | /// always specify this header and the X-Search-Location header. Do not |
| | | 123 | | /// obfuscate the address (for example, by changing the last octet to 0). |
| | | 124 | | /// Obfuscating the address results in the location not being anywhere near the |
| | | 125 | | /// device's actual location, which may result in Bing serving erroneous |
| | | 126 | | /// results. |
| | | 127 | | /// </param> |
| | | 128 | | /// <param name='location'> |
| | | 129 | | /// A semicolon-delimited list of key/value pairs that describe the client's |
| | | 130 | | /// geographical location. Bing uses the location information to determine safe |
| | | 131 | | /// search behavior and to return relevant local content. Specify the key/value |
| | | 132 | | /// pair as <key>:<value>. The following are the keys that you use |
| | | 133 | | /// to specify the user's location. lat (required): The latitude of the |
| | | 134 | | /// client's location, in degrees. The latitude must be greater than or equal |
| | | 135 | | /// to -90.0 and less than or equal to +90.0. Negative values indicate southern |
| | | 136 | | /// latitudes and positive values indicate northern latitudes. long (required): |
| | | 137 | | /// The longitude of the client's location, in degrees. The longitude must be |
| | | 138 | | /// greater than or equal to -180.0 and less than or equal to +180.0. Negative |
| | | 139 | | /// values indicate western longitudes and positive values indicate eastern |
| | | 140 | | /// longitudes. re (required): The radius, in meters, which specifies the |
| | | 141 | | /// horizontal accuracy of the coordinates. Pass the value returned by the |
| | | 142 | | /// device's location service. Typical values might be 22m for GPS/Wi-Fi, 380m |
| | | 143 | | /// for cell tower triangulation, and 18,000m for reverse IP lookup. ts |
| | | 144 | | /// (optional): The UTC UNIX timestamp of when the client was at the location. |
| | | 145 | | /// (The UNIX timestamp is the number of seconds since January 1, 1970.) head |
| | | 146 | | /// (optional): The client's relative heading or direction of travel. Specify |
| | | 147 | | /// the direction of travel as degrees from 0 through 360, counting clockwise |
| | | 148 | | /// relative to true north. Specify this key only if the sp key is nonzero. sp |
| | | 149 | | /// (optional): The horizontal velocity (speed), in meters per second, that the |
| | | 150 | | /// client device is traveling. alt (optional): The altitude of the client |
| | | 151 | | /// device, in meters. are (optional): The radius, in meters, that specifies |
| | | 152 | | /// the vertical accuracy of the coordinates. Specify this key only if you |
| | | 153 | | /// specify the alt key. Although many of the keys are optional, the more |
| | | 154 | | /// information that you provide, the more accurate the location results are. |
| | | 155 | | /// Although optional, you are encouraged to always specify the user's |
| | | 156 | | /// geographical location. Providing the location is especially important if |
| | | 157 | | /// the client's IP address does not accurately reflect the user's physical |
| | | 158 | | /// location (for example, if the client uses VPN). For optimal results, you |
| | | 159 | | /// should include this header and the X-MSEdge-ClientIP header, but at a |
| | | 160 | | /// minimum, you should include this header. |
| | | 161 | | /// </param> |
| | | 162 | | /// <param name='countryCode'> |
| | | 163 | | /// A 2-character country code of the country where the results come from. This |
| | | 164 | | /// API supports only the United States market. If you specify this query |
| | | 165 | | /// parameter, it must be set to us. If you set this parameter, you must also |
| | | 166 | | /// specify the Accept-Language header. Bing uses the first supported language |
| | | 167 | | /// it finds from the languages list, and combine that language with the |
| | | 168 | | /// country code that you specify to determine the market to return results |
| | | 169 | | /// for. If the languages list does not include a supported language, Bing |
| | | 170 | | /// finds the closest language and market that supports the request, or it may |
| | | 171 | | /// use an aggregated or default market for the results instead of a specified |
| | | 172 | | /// one. You should use this query parameter and the Accept-Language query |
| | | 173 | | /// parameter only if you specify multiple languages; otherwise, you should use |
| | | 174 | | /// the mkt and setLang query parameters. This parameter and the mkt query |
| | | 175 | | /// parameter are mutually exclusive—do not specify both. |
| | | 176 | | /// </param> |
| | | 177 | | /// <param name='count'> |
| | | 178 | | /// The number of videos to return in the response. The actual number delivered |
| | | 179 | | /// may be less than requested. The default is 35. The maximum is 105. You may |
| | | 180 | | /// use this parameter along with the offset parameter to page results. For |
| | | 181 | | /// example, if your user interface presents 20 videos per page, set count to |
| | | 182 | | /// 20 and offset to 0 to get the first page of results. For each subsequent |
| | | 183 | | /// page, increment offset by 20 (for example, 0, 20, 40). Use this parameter |
| | | 184 | | /// only with the Video Search API. Do not specify this parameter when calling |
| | | 185 | | /// the Trending Videos API or the Web Search API. |
| | | 186 | | /// </param> |
| | | 187 | | /// <param name='freshness'> |
| | | 188 | | /// Filter videos by the date and time that Bing discovered the video. The |
| | | 189 | | /// following are the possible filter values. Day: Return videos discovered |
| | | 190 | | /// within the last 24 hours. Week: Return videos discovered within the last 7 |
| | | 191 | | /// days. Month: Return videos discovered within the last 30 days. Possible |
| | | 192 | | /// values include: 'Day', 'Week', 'Month' |
| | | 193 | | /// </param> |
| | | 194 | | /// <param name='id'> |
| | | 195 | | /// An ID that uniquely identifies a video. The |
| | | 196 | | /// [Video](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#video) |
| | | 197 | | /// object's videoId field contains the ID that you set this parameter to. You |
| | | 198 | | /// use this parameter to ensure that the specified video is the first video in |
| | | 199 | | /// the list of videos that Bing returns. |
| | | 200 | | /// </param> |
| | | 201 | | /// <param name='length'> |
| | | 202 | | /// Filter videos by the following lengths: Short: Return videos that are less |
| | | 203 | | /// than 5 minutes. Medium: Return videos that are between 5 and 20 minutes, |
| | | 204 | | /// inclusive. Long: Return videos that are longer than 20 minutes. All: Do not |
| | | 205 | | /// filter by length.Specifying this value is the same as not specifying the |
| | | 206 | | /// videoLength parameter. Possible values include: 'All', 'Short', 'Medium', |
| | | 207 | | /// 'Long' |
| | | 208 | | /// </param> |
| | | 209 | | /// <param name='market'> |
| | | 210 | | /// The market where the results come from. Typically, mkt is the country where |
| | | 211 | | /// the user is making the request from. However, it could be a different |
| | | 212 | | /// country if the user is not located in a country where Bing delivers |
| | | 213 | | /// results. The market must be in the form <language code>-<country |
| | | 214 | | /// code>. For example, en-US. The string is case insensitive. For a list of |
| | | 215 | | /// possible market values, see [Market |
| | | 216 | | /// Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#market-co |
| | | 217 | | /// NOTE: If known, you are encouraged to always specify the market. Specifying |
| | | 218 | | /// the market helps Bing route the request and return an appropriate and |
| | | 219 | | /// optimal response. If you specify a market that is not listed in [Market |
| | | 220 | | /// Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#market-co |
| | | 221 | | /// Bing uses a best fit market code based on an internal mapping that is |
| | | 222 | | /// subject to change. This parameter and the |
| | | 223 | | /// [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#cc) |
| | | 224 | | /// query parameter are mutually exclusive—do not specify both. |
| | | 225 | | /// </param> |
| | | 226 | | /// <param name='offset'> |
| | | 227 | | /// The zero-based offset that indicates the number of videos to skip before |
| | | 228 | | /// returning videos. The default is 0. The offset should be less than |
| | | 229 | | /// ([totalEstimatedMatches](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-r |
| | | 230 | | /// - count). Use this parameter along with the count parameter to page |
| | | 231 | | /// results. For example, if your user interface displays 20 videos per page, |
| | | 232 | | /// set count to 20 and offset to 0 to get the first page of results. For each |
| | | 233 | | /// subsequent page, increment offset by 20 (for example, 0, 20, 40). It is |
| | | 234 | | /// possible for multiple pages to include some overlap in results. To prevent |
| | | 235 | | /// duplicates, see |
| | | 236 | | /// [nextOffset](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#vid |
| | | 237 | | /// Use this parameter only with the Video Search API. |
| | | 238 | | /// </param> |
| | | 239 | | /// <param name='pricing'> |
| | | 240 | | /// Filter videos by the following pricing options: Free: Return videos that |
| | | 241 | | /// are free to view. Paid: Return videos that require a subscription or |
| | | 242 | | /// payment to view. All: Do not filter by pricing.Specifying this value is the |
| | | 243 | | /// same as not specifying the pricing parameter. Possible values include: |
| | | 244 | | /// 'All', 'Free', 'Paid' |
| | | 245 | | /// </param> |
| | | 246 | | /// <param name='resolution'> |
| | | 247 | | /// Filter videos by the following resolutions: SD480p: Return videos with a |
| | | 248 | | /// 480p or higher resolution. HD720p: Return videos with a 720p or higher |
| | | 249 | | /// resolution. HD1080p: Return videos with a 1080p or higher resolution. All: |
| | | 250 | | /// Do not filter by resolution.Specifying this value is the same as not |
| | | 251 | | /// specifying the resolution parameter. Possible values include: 'All', |
| | | 252 | | /// 'SD480p', 'HD720p', 'HD1080p' |
| | | 253 | | /// </param> |
| | | 254 | | /// <param name='safeSearch'> |
| | | 255 | | /// Filter videos for adult content. The following are the possible filter |
| | | 256 | | /// values. Off: If the request is through the Video Search API, the response |
| | | 257 | | /// includes adult videos and the thumbnail images of the videos are clear |
| | | 258 | | /// (non-fuzzy). If the request is through the Web Search API, the response |
| | | 259 | | /// includes adult videos but the thumbnail images of the videos are pixelated |
| | | 260 | | /// (fuzzy). Moderate: If the request is through the Video Search API, the |
| | | 261 | | /// response does not include videos with adult content. If the request is |
| | | 262 | | /// through the Web Search API, the response may include videos with adult |
| | | 263 | | /// content but the thumbnail images of the videos are pixelated (fuzzy). |
| | | 264 | | /// Strict: Does not return videos with adult content. The default is Moderate. |
| | | 265 | | /// If the request comes from a market that Bing's adult policy requires that |
| | | 266 | | /// safeSearch is set to Strict, Bing ignores the safeSearch value and uses |
| | | 267 | | /// Strict. If you use the site: query operator, there is the chance that the |
| | | 268 | | /// response may contain adult content regardless of what the safeSearch query |
| | | 269 | | /// parameter is set to. Use site: only if you are aware of the content on the |
| | | 270 | | /// site and your scenario supports the possibility of adult content. Possible |
| | | 271 | | /// values include: 'Off', 'Moderate', 'Strict' |
| | | 272 | | /// </param> |
| | | 273 | | /// <param name='setLang'> |
| | | 274 | | /// The language to use for user interface strings. Specify the language using |
| | | 275 | | /// the ISO 639-1 2-letter language code. For example, the language code for |
| | | 276 | | /// English is EN. The default is EN (English). Although optional, you should |
| | | 277 | | /// always specify the language. Typically, you set setLang to the same |
| | | 278 | | /// language specified by mkt unless the user wants the user interface strings |
| | | 279 | | /// displayed in a different language. This parameter and the |
| | | 280 | | /// [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-referenc |
| | | 281 | | /// header are mutually exclusive; do not specify both. A user interface string |
| | | 282 | | /// is a string that's used as a label in a user interface. There are few user |
| | | 283 | | /// interface strings in the JSON response objects. Also, any links to Bing.com |
| | | 284 | | /// properties in the response objects apply the specified language. |
| | | 285 | | /// </param> |
| | | 286 | | /// <param name='textDecorations'> |
| | | 287 | | /// A Boolean value that determines whether display strings contain decoration |
| | | 288 | | /// markers such as hit highlighting characters. If true, the strings may |
| | | 289 | | /// include markers. The default is false. To specify whether to use Unicode |
| | | 290 | | /// characters or HTML tags as the markers, see the |
| | | 291 | | /// [textFormat](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#tex |
| | | 292 | | /// query parameter. For information about hit highlighting, see [Hit |
| | | 293 | | /// Highlighting](https://docs.microsoft.com/azure/cognitive-services/bing-news-search/hit-highlighting). |
| | | 294 | | /// </param> |
| | | 295 | | /// <param name='textFormat'> |
| | | 296 | | /// The type of markers to use for text decorations (see the textDecorations |
| | | 297 | | /// query parameter). Possible values are Raw—Use Unicode characters to mark |
| | | 298 | | /// content that needs special formatting. The Unicode characters are in the |
| | | 299 | | /// range E000 through E019. For example, Bing uses E000 and E001 to mark the |
| | | 300 | | /// beginning and end of query terms for hit highlighting. HTML—Use HTML tags |
| | | 301 | | /// to mark content that needs special formatting. For example, use <b> |
| | | 302 | | /// tags to highlight query terms in display strings. The default is Raw. For |
| | | 303 | | /// display strings that contain escapable HTML characters such as <, >, |
| | | 304 | | /// and &, if textFormat is set to HTML, Bing escapes the characters as |
| | | 305 | | /// appropriate (for example, < is escaped to &lt;). Possible values |
| | | 306 | | /// include: 'Raw', 'Html' |
| | | 307 | | /// </param> |
| | | 308 | | /// <param name='cancellationToken'> |
| | | 309 | | /// The cancellation token. |
| | | 310 | | /// </param> |
| | | 311 | | public static async Task<Videos> SearchAsync(this IVideosOperations operations, string query, string acceptL |
| | | 312 | | { |
| | 2 | 313 | | using (var _result = await operations.SearchWithHttpMessagesAsync(query, acceptLanguage, userAgent, clie |
| | | 314 | | { |
| | 2 | 315 | | return _result.Body; |
| | | 316 | | } |
| | 2 | 317 | | } |
| | | 318 | | |
| | | 319 | | /// <summary> |
| | | 320 | | /// The Video Detail Search API lets you search on Bing and get back insights |
| | | 321 | | /// about a video, such as related videos. This section provides technical |
| | | 322 | | /// details about the query parameters and headers that you use to request |
| | | 323 | | /// insights of videos and the JSON response objects that contain them. For |
| | | 324 | | /// examples that show how to make requests, see [Searching the Web for |
| | | 325 | | /// Videos](https://docs.microsoft.com/azure/cognitive-services/bing-video-search/search-the-web). |
| | | 326 | | /// </summary> |
| | | 327 | | /// <param name='operations'> |
| | | 328 | | /// The operations group for this extension method. |
| | | 329 | | /// </param> |
| | | 330 | | /// <param name='query'> |
| | | 331 | | /// The user's search query string. The query string cannot be empty. The query |
| | | 332 | | /// string may contain [Bing Advanced |
| | | 333 | | /// Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, |
| | | 334 | | /// to limit videos to a specific domain, use the |
| | | 335 | | /// [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. Use this |
| | | 336 | | /// parameter only with the Video Search API. Do not specify this parameter |
| | | 337 | | /// when calling the Trending Videos API. |
| | | 338 | | /// </param> |
| | | 339 | | /// <param name='acceptLanguage'> |
| | | 340 | | /// A comma-delimited list of one or more languages to use for user interface |
| | | 341 | | /// strings. The list is in decreasing order of preference. For additional |
| | | 342 | | /// information, including expected format, see |
| | | 343 | | /// [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This |
| | | 344 | | /// header and the |
| | | 345 | | /// [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#setlan |
| | | 346 | | /// query parameter are mutually exclusive; do not specify both. If you set |
| | | 347 | | /// this header, you must also specify the |
| | | 348 | | /// [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#cc) |
| | | 349 | | /// query parameter. To determine the market to return results for, Bing uses |
| | | 350 | | /// the first supported language it finds from the list and combines it with |
| | | 351 | | /// the cc parameter value. If the list does not include a supported language, |
| | | 352 | | /// Bing finds the closest language and market that supports the request or it |
| | | 353 | | /// uses an aggregated or default market for the results. To determine the |
| | | 354 | | /// market that Bing used, see the BingAPIs-Market header. Use this header and |
| | | 355 | | /// the cc query parameter only if you specify multiple languages. Otherwise, |
| | | 356 | | /// use the |
| | | 357 | | /// [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#mkt) |
| | | 358 | | /// and |
| | | 359 | | /// [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#setlan |
| | | 360 | | /// query parameters. A user interface string is a string that's used as a |
| | | 361 | | /// label in a user interface. There are few user interface strings in the JSON |
| | | 362 | | /// response objects. Any links to Bing.com properties in the response objects |
| | | 363 | | /// apply the specified language. |
| | | 364 | | /// </param> |
| | | 365 | | /// <param name='userAgent'> |
| | | 366 | | /// The user agent originating the request. Bing uses the user agent to provide |
| | | 367 | | /// mobile users with an optimized experience. Although optional, you are |
| | | 368 | | /// encouraged to always specify this header. The user-agent should be the same |
| | | 369 | | /// string that any commonly used browser sends. For information about user |
| | | 370 | | /// agents, see [RFC |
| | | 371 | | /// 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The |
| | | 372 | | /// following are examples of user-agent strings. Windows Phone: Mozilla/5.0 |
| | | 373 | | /// (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; |
| | | 374 | | /// Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android 2.3.5; |
| | | 375 | | /// en - us; SCH - I500 Build / GINGERBREAD) AppleWebKit / 533.1 (KHTML; like |
| | | 376 | | /// Gecko) Version / 4.0 Mobile Safari / 533.1. iPhone: Mozilla / 5.0 (iPhone; |
| | | 377 | | /// CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 536.26 (KHTML; like Gecko) |
| | | 378 | | /// Mobile / 10B142 iPhone4; 1 BingWeb / 3.03.1428.20120423. PC: Mozilla / 5.0 |
| | | 379 | | /// (Windows NT 6.3; WOW64; Trident / 7.0; Touch; rv:11.0) like Gecko. iPad: |
| | | 380 | | /// Mozilla / 5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit / 537.51.1 |
| | | 381 | | /// (KHTML, like Gecko) Version / 7.0 Mobile / 11A465 Safari / 9537.53 |
| | | 382 | | /// </param> |
| | | 383 | | /// <param name='clientId'> |
| | | 384 | | /// Bing uses this header to provide users with consistent behavior across Bing |
| | | 385 | | /// API calls. Bing often flights new features and improvements, and it uses |
| | | 386 | | /// the client ID as a key for assigning traffic on different flights. If you |
| | | 387 | | /// do not use the same client ID for a user across multiple requests, then |
| | | 388 | | /// Bing may assign the user to multiple conflicting flights. Being assigned to |
| | | 389 | | /// multiple conflicting flights can lead to an inconsistent user experience. |
| | | 390 | | /// For example, if the second request has a different flight assignment than |
| | | 391 | | /// the first, the experience may be unexpected. Also, Bing can use the client |
| | | 392 | | /// ID to tailor web results to that client ID’s search history, providing a |
| | | 393 | | /// richer experience for the user. Bing also uses this header to help improve |
| | | 394 | | /// result rankings by analyzing the activity generated by a client ID. The |
| | | 395 | | /// relevance improvements help with better quality of results delivered by |
| | | 396 | | /// Bing APIs and in turn enables higher click-through rates for the API |
| | | 397 | | /// consumer. IMPORTANT: Although optional, you should consider this header |
| | | 398 | | /// required. Persisting the client ID across multiple requests for the same |
| | | 399 | | /// end user and device combination enables 1) the API consumer to receive a |
| | | 400 | | /// consistent user experience, and 2) higher click-through rates via better |
| | | 401 | | /// quality of results from the Bing APIs. Each user that uses your application |
| | | 402 | | /// on the device must have a unique, Bing generated client ID. If you do not |
| | | 403 | | /// include this header in the request, Bing generates an ID and returns it in |
| | | 404 | | /// the X-MSEdge-ClientID response header. The only time that you should NOT |
| | | 405 | | /// include this header in a request is the first time the user uses your app |
| | | 406 | | /// on that device. Use the client ID for each Bing API request that your app |
| | | 407 | | /// makes for this user on the device. Persist the client ID. To persist the ID |
| | | 408 | | /// in a browser app, use a persistent HTTP cookie to ensure the ID is used |
| | | 409 | | /// across all sessions. Do not use a session cookie. For other apps such as |
| | | 410 | | /// mobile apps, use the device's persistent storage to persist the ID. The |
| | | 411 | | /// next time the user uses your app on that device, get the client ID that you |
| | | 412 | | /// persisted. Bing responses may or may not include this header. If the |
| | | 413 | | /// response includes this header, capture the client ID and use it for all |
| | | 414 | | /// subsequent Bing requests for the user on that device. If you include the |
| | | 415 | | /// X-MSEdge-ClientID, you must not include cookies in the request. |
| | | 416 | | /// </param> |
| | | 417 | | /// <param name='clientIp'> |
| | | 418 | | /// The IPv4 or IPv6 address of the client device. The IP address is used to |
| | | 419 | | /// discover the user's location. Bing uses the location information to |
| | | 420 | | /// determine safe search behavior. Although optional, you are encouraged to |
| | | 421 | | /// always specify this header and the X-Search-Location header. Do not |
| | | 422 | | /// obfuscate the address (for example, by changing the last octet to 0). |
| | | 423 | | /// Obfuscating the address results in the location not being anywhere near the |
| | | 424 | | /// device's actual location, which may result in Bing serving erroneous |
| | | 425 | | /// results. |
| | | 426 | | /// </param> |
| | | 427 | | /// <param name='location'> |
| | | 428 | | /// A semicolon-delimited list of key/value pairs that describe the client's |
| | | 429 | | /// geographical location. Bing uses the location information to determine safe |
| | | 430 | | /// search behavior and to return relevant local content. Specify the key/value |
| | | 431 | | /// pair as <key>:<value>. The following are the keys that you use |
| | | 432 | | /// to specify the user's location. lat (required): The latitude of the |
| | | 433 | | /// client's location, in degrees. The latitude must be greater than or equal |
| | | 434 | | /// to -90.0 and less than or equal to +90.0. Negative values indicate southern |
| | | 435 | | /// latitudes and positive values indicate northern latitudes. long (required): |
| | | 436 | | /// The longitude of the client's location, in degrees. The longitude must be |
| | | 437 | | /// greater than or equal to -180.0 and less than or equal to +180.0. Negative |
| | | 438 | | /// values indicate western longitudes and positive values indicate eastern |
| | | 439 | | /// longitudes. re (required): The radius, in meters, which specifies the |
| | | 440 | | /// horizontal accuracy of the coordinates. Pass the value returned by the |
| | | 441 | | /// device's location service. Typical values might be 22m for GPS/Wi-Fi, 380m |
| | | 442 | | /// for cell tower triangulation, and 18,000m for reverse IP lookup. ts |
| | | 443 | | /// (optional): The UTC UNIX timestamp of when the client was at the location. |
| | | 444 | | /// (The UNIX timestamp is the number of seconds since January 1, 1970.) head |
| | | 445 | | /// (optional): The client's relative heading or direction of travel. Specify |
| | | 446 | | /// the direction of travel as degrees from 0 through 360, counting clockwise |
| | | 447 | | /// relative to true north. Specify this key only if the sp key is nonzero. sp |
| | | 448 | | /// (optional): The horizontal velocity (speed), in meters per second, that the |
| | | 449 | | /// client device is traveling. alt (optional): The altitude of the client |
| | | 450 | | /// device, in meters. are (optional): The radius, in meters, that specifies |
| | | 451 | | /// the vertical accuracy of the coordinates. Specify this key only if you |
| | | 452 | | /// specify the alt key. Although many of the keys are optional, the more |
| | | 453 | | /// information that you provide, the more accurate the location results are. |
| | | 454 | | /// Although optional, you are encouraged to always specify the user's |
| | | 455 | | /// geographical location. Providing the location is especially important if |
| | | 456 | | /// the client's IP address does not accurately reflect the user's physical |
| | | 457 | | /// location (for example, if the client uses VPN). For optimal results, you |
| | | 458 | | /// should include this header and the X-MSEdge-ClientIP header, but at a |
| | | 459 | | /// minimum, you should include this header. |
| | | 460 | | /// </param> |
| | | 461 | | /// <param name='countryCode'> |
| | | 462 | | /// A 2-character country code of the country where the results come from. This |
| | | 463 | | /// API supports only the United States market. If you specify this query |
| | | 464 | | /// parameter, it must be set to us. If you set this parameter, you must also |
| | | 465 | | /// specify the Accept-Language header. Bing uses the first supported language |
| | | 466 | | /// it finds from the languages list, and combine that language with the |
| | | 467 | | /// country code that you specify to determine the market to return results |
| | | 468 | | /// for. If the languages list does not include a supported language, Bing |
| | | 469 | | /// finds the closest language and market that supports the request, or it may |
| | | 470 | | /// use an aggregated or default market for the results instead of a specified |
| | | 471 | | /// one. You should use this query parameter and the Accept-Language query |
| | | 472 | | /// parameter only if you specify multiple languages; otherwise, you should use |
| | | 473 | | /// the mkt and setLang query parameters. This parameter and the mkt query |
| | | 474 | | /// parameter are mutually exclusive—do not specify both. |
| | | 475 | | /// </param> |
| | | 476 | | /// <param name='id'> |
| | | 477 | | /// An ID that uniquely identifies a video. The |
| | | 478 | | /// [Video](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#video) |
| | | 479 | | /// object's videoId field contains the ID that you set this parameter to. You |
| | | 480 | | /// use this parameter to identify the video to get insights of. |
| | | 481 | | /// </param> |
| | | 482 | | /// <param name='modules'> |
| | | 483 | | /// A comma-delimited list of insights to request. The following are the |
| | | 484 | | /// possible case-insensitive values. All: Return all available insights. |
| | | 485 | | /// RelatedVideos: Return a list of videos that are similar to the video |
| | | 486 | | /// specified by the id query parameter. VideoResult: Return the video that |
| | | 487 | | /// you're requesting insights of (this is the video that you set the id query |
| | | 488 | | /// parameter to in your insights request). If you specify an insight and there |
| | | 489 | | /// is no data for it, the response object does not include the related field. |
| | | 490 | | /// For example, if you specify RelatedVideos and none exist, the response does |
| | | 491 | | /// not include the relatedVideos field. Although the user's query term is not |
| | | 492 | | /// required, you should always include it because it helps to improve |
| | | 493 | | /// relevance and the results. |
| | | 494 | | /// </param> |
| | | 495 | | /// <param name='market'> |
| | | 496 | | /// The market where the results come from. Typically, mkt is the country where |
| | | 497 | | /// the user is making the request from. However, it could be a different |
| | | 498 | | /// country if the user is not located in a country where Bing delivers |
| | | 499 | | /// results. The market must be in the form <language code>-<country |
| | | 500 | | /// code>. For example, en-US. The string is case insensitive. For a list of |
| | | 501 | | /// possible market values, see [Market |
| | | 502 | | /// Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#market-co |
| | | 503 | | /// NOTE: If known, you are encouraged to always specify the market. Specifying |
| | | 504 | | /// the market helps Bing route the request and return an appropriate and |
| | | 505 | | /// optimal response. If you specify a market that is not listed in [Market |
| | | 506 | | /// Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#market-co |
| | | 507 | | /// Bing uses a best fit market code based on an internal mapping that is |
| | | 508 | | /// subject to change. This parameter and the |
| | | 509 | | /// [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#cc) |
| | | 510 | | /// query parameter are mutually exclusive—do not specify both. |
| | | 511 | | /// </param> |
| | | 512 | | /// <param name='resolution'> |
| | | 513 | | /// Filter videos by the following resolutions: SD480p: Return videos with a |
| | | 514 | | /// 480p or higher resolution. HD720p: Return videos with a 720p or higher |
| | | 515 | | /// resolution. HD1080p: Return videos with a 1080p or higher resolution. All: |
| | | 516 | | /// Do not filter by resolution.Specifying this value is the same as not |
| | | 517 | | /// specifying the resolution parameter. Possible values include: 'All', |
| | | 518 | | /// 'SD480p', 'HD720p', 'HD1080p' |
| | | 519 | | /// </param> |
| | | 520 | | /// <param name='safeSearch'> |
| | | 521 | | /// Filter videos for adult content. The following are the possible filter |
| | | 522 | | /// values. Off: If the request is through the Video Search API, the response |
| | | 523 | | /// includes adult videos and the thumbnail images of the videos are clear |
| | | 524 | | /// (non-fuzzy). If the request is through the Web Search API, the response |
| | | 525 | | /// includes adult videos but the thumbnail images of the videos are pixelated |
| | | 526 | | /// (fuzzy). Moderate: If the request is through the Video Search API, the |
| | | 527 | | /// response does not include videos with adult content. If the request is |
| | | 528 | | /// through the Web Search API, the response may include videos with adult |
| | | 529 | | /// content but the thumbnail images of the videos are pixelated (fuzzy). |
| | | 530 | | /// Strict: Does not return videos with adult content. The default is Moderate. |
| | | 531 | | /// If the request comes from a market that Bing's adult policy requires that |
| | | 532 | | /// safeSearch is set to Strict, Bing ignores the safeSearch value and uses |
| | | 533 | | /// Strict. If you use the site: query operator, there is the chance that the |
| | | 534 | | /// response may contain adult content regardless of what the safeSearch query |
| | | 535 | | /// parameter is set to. Use site: only if you are aware of the content on the |
| | | 536 | | /// site and your scenario supports the possibility of adult content. Possible |
| | | 537 | | /// values include: 'Off', 'Moderate', 'Strict' |
| | | 538 | | /// </param> |
| | | 539 | | /// <param name='setLang'> |
| | | 540 | | /// The language to use for user interface strings. Specify the language using |
| | | 541 | | /// the ISO 639-1 2-letter language code. For example, the language code for |
| | | 542 | | /// English is EN. The default is EN (English). Although optional, you should |
| | | 543 | | /// always specify the language. Typically, you set setLang to the same |
| | | 544 | | /// language specified by mkt unless the user wants the user interface strings |
| | | 545 | | /// displayed in a different language. This parameter and the |
| | | 546 | | /// [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-referenc |
| | | 547 | | /// header are mutually exclusive; do not specify both. A user interface string |
| | | 548 | | /// is a string that's used as a label in a user interface. There are few user |
| | | 549 | | /// interface strings in the JSON response objects. Also, any links to Bing.com |
| | | 550 | | /// properties in the response objects apply the specified language. |
| | | 551 | | /// </param> |
| | | 552 | | /// <param name='textDecorations'> |
| | | 553 | | /// A Boolean value that determines whether display strings contain decoration |
| | | 554 | | /// markers such as hit highlighting characters. If true, the strings may |
| | | 555 | | /// include markers. The default is false. To specify whether to use Unicode |
| | | 556 | | /// characters or HTML tags as the markers, see the |
| | | 557 | | /// [textFormat](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#tex |
| | | 558 | | /// query parameter. For information about hit highlighting, see [Hit |
| | | 559 | | /// Highlighting](https://docs.microsoft.com/azure/cognitive-services/bing-news-search/hit-highlighting). |
| | | 560 | | /// </param> |
| | | 561 | | /// <param name='textFormat'> |
| | | 562 | | /// The type of markers to use for text decorations (see the textDecorations |
| | | 563 | | /// query parameter). Possible values are Raw—Use Unicode characters to mark |
| | | 564 | | /// content that needs special formatting. The Unicode characters are in the |
| | | 565 | | /// range E000 through E019. For example, Bing uses E000 and E001 to mark the |
| | | 566 | | /// beginning and end of query terms for hit highlighting. HTML—Use HTML tags |
| | | 567 | | /// to mark content that needs special formatting. For example, use <b> |
| | | 568 | | /// tags to highlight query terms in display strings. The default is Raw. For |
| | | 569 | | /// display strings that contain escapable HTML characters such as <, >, |
| | | 570 | | /// and &, if textFormat is set to HTML, Bing escapes the characters as |
| | | 571 | | /// appropriate (for example, < is escaped to &lt;). Possible values |
| | | 572 | | /// include: 'Raw', 'Html' |
| | | 573 | | /// </param> |
| | | 574 | | /// <param name='cancellationToken'> |
| | | 575 | | /// The cancellation token. |
| | | 576 | | /// </param> |
| | | 577 | | public static async Task<VideoDetails> DetailsAsync(this IVideosOperations operations, string query, string |
| | | 578 | | { |
| | 2 | 579 | | using (var _result = await operations.DetailsWithHttpMessagesAsync(query, acceptLanguage, userAgent, cli |
| | | 580 | | { |
| | 2 | 581 | | return _result.Body; |
| | | 582 | | } |
| | 2 | 583 | | } |
| | | 584 | | |
| | | 585 | | /// <summary> |
| | | 586 | | /// The Video Trending Search API lets you search on Bing and get back a list |
| | | 587 | | /// of videos that are trending based on search requests made by others. The |
| | | 588 | | /// videos are broken out into different categories. For example, Top Music |
| | | 589 | | /// Videos. For a list of markets that support trending videos, see [Trending |
| | | 590 | | /// Videos](https://docs.microsoft.com/azure/cognitive-services/bing-video-search/trending-videos). |
| | | 591 | | /// </summary> |
| | | 592 | | /// <param name='operations'> |
| | | 593 | | /// The operations group for this extension method. |
| | | 594 | | /// </param> |
| | | 595 | | /// <param name='acceptLanguage'> |
| | | 596 | | /// A comma-delimited list of one or more languages to use for user interface |
| | | 597 | | /// strings. The list is in decreasing order of preference. For additional |
| | | 598 | | /// information, including expected format, see |
| | | 599 | | /// [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This |
| | | 600 | | /// header and the |
| | | 601 | | /// [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#setlan |
| | | 602 | | /// query parameter are mutually exclusive; do not specify both. If you set |
| | | 603 | | /// this header, you must also specify the |
| | | 604 | | /// [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#cc) |
| | | 605 | | /// query parameter. To determine the market to return results for, Bing uses |
| | | 606 | | /// the first supported language it finds from the list and combines it with |
| | | 607 | | /// the cc parameter value. If the list does not include a supported language, |
| | | 608 | | /// Bing finds the closest language and market that supports the request or it |
| | | 609 | | /// uses an aggregated or default market for the results. To determine the |
| | | 610 | | /// market that Bing used, see the BingAPIs-Market header. Use this header and |
| | | 611 | | /// the cc query parameter only if you specify multiple languages. Otherwise, |
| | | 612 | | /// use the |
| | | 613 | | /// [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#mkt) |
| | | 614 | | /// and |
| | | 615 | | /// [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#setlan |
| | | 616 | | /// query parameters. A user interface string is a string that's used as a |
| | | 617 | | /// label in a user interface. There are few user interface strings in the JSON |
| | | 618 | | /// response objects. Any links to Bing.com properties in the response objects |
| | | 619 | | /// apply the specified language. |
| | | 620 | | /// </param> |
| | | 621 | | /// <param name='userAgent'> |
| | | 622 | | /// The user agent originating the request. Bing uses the user agent to provide |
| | | 623 | | /// mobile users with an optimized experience. Although optional, you are |
| | | 624 | | /// encouraged to always specify this header. The user-agent should be the same |
| | | 625 | | /// string that any commonly used browser sends. For information about user |
| | | 626 | | /// agents, see [RFC |
| | | 627 | | /// 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The |
| | | 628 | | /// following are examples of user-agent strings. Windows Phone: Mozilla/5.0 |
| | | 629 | | /// (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; |
| | | 630 | | /// Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android 2.3.5; |
| | | 631 | | /// en - us; SCH - I500 Build / GINGERBREAD) AppleWebKit / 533.1 (KHTML; like |
| | | 632 | | /// Gecko) Version / 4.0 Mobile Safari / 533.1. iPhone: Mozilla / 5.0 (iPhone; |
| | | 633 | | /// CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 536.26 (KHTML; like Gecko) |
| | | 634 | | /// Mobile / 10B142 iPhone4; 1 BingWeb / 3.03.1428.20120423. PC: Mozilla / 5.0 |
| | | 635 | | /// (Windows NT 6.3; WOW64; Trident / 7.0; Touch; rv:11.0) like Gecko. iPad: |
| | | 636 | | /// Mozilla / 5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit / 537.51.1 |
| | | 637 | | /// (KHTML, like Gecko) Version / 7.0 Mobile / 11A465 Safari / 9537.53 |
| | | 638 | | /// </param> |
| | | 639 | | /// <param name='clientId'> |
| | | 640 | | /// Bing uses this header to provide users with consistent behavior across Bing |
| | | 641 | | /// API calls. Bing often flights new features and improvements, and it uses |
| | | 642 | | /// the client ID as a key for assigning traffic on different flights. If you |
| | | 643 | | /// do not use the same client ID for a user across multiple requests, then |
| | | 644 | | /// Bing may assign the user to multiple conflicting flights. Being assigned to |
| | | 645 | | /// multiple conflicting flights can lead to an inconsistent user experience. |
| | | 646 | | /// For example, if the second request has a different flight assignment than |
| | | 647 | | /// the first, the experience may be unexpected. Also, Bing can use the client |
| | | 648 | | /// ID to tailor web results to that client ID’s search history, providing a |
| | | 649 | | /// richer experience for the user. Bing also uses this header to help improve |
| | | 650 | | /// result rankings by analyzing the activity generated by a client ID. The |
| | | 651 | | /// relevance improvements help with better quality of results delivered by |
| | | 652 | | /// Bing APIs and in turn enables higher click-through rates for the API |
| | | 653 | | /// consumer. IMPORTANT: Although optional, you should consider this header |
| | | 654 | | /// required. Persisting the client ID across multiple requests for the same |
| | | 655 | | /// end user and device combination enables 1) the API consumer to receive a |
| | | 656 | | /// consistent user experience, and 2) higher click-through rates via better |
| | | 657 | | /// quality of results from the Bing APIs. Each user that uses your application |
| | | 658 | | /// on the device must have a unique, Bing generated client ID. If you do not |
| | | 659 | | /// include this header in the request, Bing generates an ID and returns it in |
| | | 660 | | /// the X-MSEdge-ClientID response header. The only time that you should NOT |
| | | 661 | | /// include this header in a request is the first time the user uses your app |
| | | 662 | | /// on that device. Use the client ID for each Bing API request that your app |
| | | 663 | | /// makes for this user on the device. Persist the client ID. To persist the ID |
| | | 664 | | /// in a browser app, use a persistent HTTP cookie to ensure the ID is used |
| | | 665 | | /// across all sessions. Do not use a session cookie. For other apps such as |
| | | 666 | | /// mobile apps, use the device's persistent storage to persist the ID. The |
| | | 667 | | /// next time the user uses your app on that device, get the client ID that you |
| | | 668 | | /// persisted. Bing responses may or may not include this header. If the |
| | | 669 | | /// response includes this header, capture the client ID and use it for all |
| | | 670 | | /// subsequent Bing requests for the user on that device. If you include the |
| | | 671 | | /// X-MSEdge-ClientID, you must not include cookies in the request. |
| | | 672 | | /// </param> |
| | | 673 | | /// <param name='clientIp'> |
| | | 674 | | /// The IPv4 or IPv6 address of the client device. The IP address is used to |
| | | 675 | | /// discover the user's location. Bing uses the location information to |
| | | 676 | | /// determine safe search behavior. Although optional, you are encouraged to |
| | | 677 | | /// always specify this header and the X-Search-Location header. Do not |
| | | 678 | | /// obfuscate the address (for example, by changing the last octet to 0). |
| | | 679 | | /// Obfuscating the address results in the location not being anywhere near the |
| | | 680 | | /// device's actual location, which may result in Bing serving erroneous |
| | | 681 | | /// results. |
| | | 682 | | /// </param> |
| | | 683 | | /// <param name='location'> |
| | | 684 | | /// A semicolon-delimited list of key/value pairs that describe the client's |
| | | 685 | | /// geographical location. Bing uses the location information to determine safe |
| | | 686 | | /// search behavior and to return relevant local content. Specify the key/value |
| | | 687 | | /// pair as <key>:<value>. The following are the keys that you use |
| | | 688 | | /// to specify the user's location. lat (required): The latitude of the |
| | | 689 | | /// client's location, in degrees. The latitude must be greater than or equal |
| | | 690 | | /// to -90.0 and less than or equal to +90.0. Negative values indicate southern |
| | | 691 | | /// latitudes and positive values indicate northern latitudes. long (required): |
| | | 692 | | /// The longitude of the client's location, in degrees. The longitude must be |
| | | 693 | | /// greater than or equal to -180.0 and less than or equal to +180.0. Negative |
| | | 694 | | /// values indicate western longitudes and positive values indicate eastern |
| | | 695 | | /// longitudes. re (required): The radius, in meters, which specifies the |
| | | 696 | | /// horizontal accuracy of the coordinates. Pass the value returned by the |
| | | 697 | | /// device's location service. Typical values might be 22m for GPS/Wi-Fi, 380m |
| | | 698 | | /// for cell tower triangulation, and 18,000m for reverse IP lookup. ts |
| | | 699 | | /// (optional): The UTC UNIX timestamp of when the client was at the location. |
| | | 700 | | /// (The UNIX timestamp is the number of seconds since January 1, 1970.) head |
| | | 701 | | /// (optional): The client's relative heading or direction of travel. Specify |
| | | 702 | | /// the direction of travel as degrees from 0 through 360, counting clockwise |
| | | 703 | | /// relative to true north. Specify this key only if the sp key is nonzero. sp |
| | | 704 | | /// (optional): The horizontal velocity (speed), in meters per second, that the |
| | | 705 | | /// client device is traveling. alt (optional): The altitude of the client |
| | | 706 | | /// device, in meters. are (optional): The radius, in meters, that specifies |
| | | 707 | | /// the vertical accuracy of the coordinates. Specify this key only if you |
| | | 708 | | /// specify the alt key. Although many of the keys are optional, the more |
| | | 709 | | /// information that you provide, the more accurate the location results are. |
| | | 710 | | /// Although optional, you are encouraged to always specify the user's |
| | | 711 | | /// geographical location. Providing the location is especially important if |
| | | 712 | | /// the client's IP address does not accurately reflect the user's physical |
| | | 713 | | /// location (for example, if the client uses VPN). For optimal results, you |
| | | 714 | | /// should include this header and the X-MSEdge-ClientIP header, but at a |
| | | 715 | | /// minimum, you should include this header. |
| | | 716 | | /// </param> |
| | | 717 | | /// <param name='countryCode'> |
| | | 718 | | /// A 2-character country code of the country where the results come from. This |
| | | 719 | | /// API supports only the United States market. If you specify this query |
| | | 720 | | /// parameter, it must be set to us. If you set this parameter, you must also |
| | | 721 | | /// specify the Accept-Language header. Bing uses the first supported language |
| | | 722 | | /// it finds from the languages list, and combine that language with the |
| | | 723 | | /// country code that you specify to determine the market to return results |
| | | 724 | | /// for. If the languages list does not include a supported language, Bing |
| | | 725 | | /// finds the closest language and market that supports the request, or it may |
| | | 726 | | /// use an aggregated or default market for the results instead of a specified |
| | | 727 | | /// one. You should use this query parameter and the Accept-Language query |
| | | 728 | | /// parameter only if you specify multiple languages; otherwise, you should use |
| | | 729 | | /// the mkt and setLang query parameters. This parameter and the mkt query |
| | | 730 | | /// parameter are mutually exclusive—do not specify both. |
| | | 731 | | /// </param> |
| | | 732 | | /// <param name='market'> |
| | | 733 | | /// The market where the results come from. Typically, mkt is the country where |
| | | 734 | | /// the user is making the request from. However, it could be a different |
| | | 735 | | /// country if the user is not located in a country where Bing delivers |
| | | 736 | | /// results. The market must be in the form <language code>-<country |
| | | 737 | | /// code>. For example, en-US. The string is case insensitive. For a list of |
| | | 738 | | /// possible market values, see [Market |
| | | 739 | | /// Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#market-co |
| | | 740 | | /// NOTE: If known, you are encouraged to always specify the market. Specifying |
| | | 741 | | /// the market helps Bing route the request and return an appropriate and |
| | | 742 | | /// optimal response. If you specify a market that is not listed in [Market |
| | | 743 | | /// Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#market-co |
| | | 744 | | /// Bing uses a best fit market code based on an internal mapping that is |
| | | 745 | | /// subject to change. This parameter and the |
| | | 746 | | /// [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#cc) |
| | | 747 | | /// query parameter are mutually exclusive—do not specify both. |
| | | 748 | | /// </param> |
| | | 749 | | /// <param name='safeSearch'> |
| | | 750 | | /// Filter videos for adult content. The following are the possible filter |
| | | 751 | | /// values. Off: If the request is through the Video Search API, the response |
| | | 752 | | /// includes adult videos and the thumbnail images of the videos are clear |
| | | 753 | | /// (non-fuzzy). If the request is through the Web Search API, the response |
| | | 754 | | /// includes adult videos but the thumbnail images of the videos are pixelated |
| | | 755 | | /// (fuzzy). Moderate: If the request is through the Video Search API, the |
| | | 756 | | /// response does not include videos with adult content. If the request is |
| | | 757 | | /// through the Web Search API, the response may include videos with adult |
| | | 758 | | /// content but the thumbnail images of the videos are pixelated (fuzzy). |
| | | 759 | | /// Strict: Does not return videos with adult content. The default is Moderate. |
| | | 760 | | /// If the request comes from a market that Bing's adult policy requires that |
| | | 761 | | /// safeSearch is set to Strict, Bing ignores the safeSearch value and uses |
| | | 762 | | /// Strict. If you use the site: query operator, there is the chance that the |
| | | 763 | | /// response may contain adult content regardless of what the safeSearch query |
| | | 764 | | /// parameter is set to. Use site: only if you are aware of the content on the |
| | | 765 | | /// site and your scenario supports the possibility of adult content. Possible |
| | | 766 | | /// values include: 'Off', 'Moderate', 'Strict' |
| | | 767 | | /// </param> |
| | | 768 | | /// <param name='setLang'> |
| | | 769 | | /// The language to use for user interface strings. Specify the language using |
| | | 770 | | /// the ISO 639-1 2-letter language code. For example, the language code for |
| | | 771 | | /// English is EN. The default is EN (English). Although optional, you should |
| | | 772 | | /// always specify the language. Typically, you set setLang to the same |
| | | 773 | | /// language specified by mkt unless the user wants the user interface strings |
| | | 774 | | /// displayed in a different language. This parameter and the |
| | | 775 | | /// [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-referenc |
| | | 776 | | /// header are mutually exclusive; do not specify both. A user interface string |
| | | 777 | | /// is a string that's used as a label in a user interface. There are few user |
| | | 778 | | /// interface strings in the JSON response objects. Also, any links to Bing.com |
| | | 779 | | /// properties in the response objects apply the specified language. |
| | | 780 | | /// </param> |
| | | 781 | | /// <param name='textDecorations'> |
| | | 782 | | /// A Boolean value that determines whether display strings contain decoration |
| | | 783 | | /// markers such as hit highlighting characters. If true, the strings may |
| | | 784 | | /// include markers. The default is false. To specify whether to use Unicode |
| | | 785 | | /// characters or HTML tags as the markers, see the |
| | | 786 | | /// [textFormat](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#tex |
| | | 787 | | /// query parameter. For information about hit highlighting, see [Hit |
| | | 788 | | /// Highlighting](https://docs.microsoft.com/azure/cognitive-services/bing-news-search/hit-highlighting). |
| | | 789 | | /// </param> |
| | | 790 | | /// <param name='textFormat'> |
| | | 791 | | /// The type of markers to use for text decorations (see the textDecorations |
| | | 792 | | /// query parameter). Possible values are Raw—Use Unicode characters to mark |
| | | 793 | | /// content that needs special formatting. The Unicode characters are in the |
| | | 794 | | /// range E000 through E019. For example, Bing uses E000 and E001 to mark the |
| | | 795 | | /// beginning and end of query terms for hit highlighting. HTML—Use HTML tags |
| | | 796 | | /// to mark content that needs special formatting. For example, use <b> |
| | | 797 | | /// tags to highlight query terms in display strings. The default is Raw. For |
| | | 798 | | /// display strings that contain escapable HTML characters such as <, >, |
| | | 799 | | /// and &, if textFormat is set to HTML, Bing escapes the characters as |
| | | 800 | | /// appropriate (for example, < is escaped to &lt;). Possible values |
| | | 801 | | /// include: 'Raw', 'Html' |
| | | 802 | | /// </param> |
| | | 803 | | /// <param name='cancellationToken'> |
| | | 804 | | /// The cancellation token. |
| | | 805 | | /// </param> |
| | | 806 | | public static async Task<TrendingVideos> TrendingAsync(this IVideosOperations operations, string acceptLangu |
| | | 807 | | { |
| | 2 | 808 | | using (var _result = await operations.TrendingWithHttpMessagesAsync(acceptLanguage, userAgent, clientId, |
| | | 809 | | { |
| | 2 | 810 | | return _result.Body; |
| | | 811 | | } |
| | 2 | 812 | | } |
| | | 813 | | |
| | | 814 | | } |
| | | 815 | | } |