NewsOperations class

Class representing a NewsOperations.

Constructors

NewsOperations(NewsSearchClientContext)

Create a NewsOperations.

Methods

category(Models.NewsCategoryOptionalParams)
category(NewsCategoryOptionalParams, ServiceCallback<News>)
category(ServiceCallback<News>)
search(string, Models.NewsSearchOptionalParams)
search(string, NewsSearchOptionalParams, ServiceCallback<News>)
search(string, ServiceCallback<News>)
trending(Models.NewsTrendingOptionalParams)
trending(NewsTrendingOptionalParams, ServiceCallback<TrendingTopics>)
trending(ServiceCallback<TrendingTopics>)

Constructor Details

NewsOperations(NewsSearchClientContext)

Create a NewsOperations.

new NewsOperations(client: NewsSearchClientContext)

Parameters

client
NewsSearchClientContext

Reference to the service client.

Method Details

category(Models.NewsCategoryOptionalParams)

function category(options?: Models.NewsCategoryOptionalParams)

Parameters

options
Models.NewsCategoryOptionalParams

Returns

Promise<Models.NewsCategoryResponse>

Promise<Models.NewsCategoryResponse>

category(NewsCategoryOptionalParams, ServiceCallback<News>)

function category(options: NewsCategoryOptionalParams, callback: ServiceCallback<News>)

Parameters

options
NewsCategoryOptionalParams

The optional parameters

callback
ServiceCallback<News>

The callback

category(ServiceCallback<News>)

function category(callback: ServiceCallback<News>)

Parameters

callback
ServiceCallback<News>

The callback

search(string, Models.NewsSearchOptionalParams)

function search(query: string, options?: Models.NewsSearchOptionalParams)

Parameters

query
string

The user's search query string. The query string cannot be empty. The query string may contain Bing Advanced Operators. For example, to limit news to a specific domain, use the site: operator. Use this parameter only with the News Search API. Do not specify this parameter when calling the Trending Topics API or News Category API.

options
Models.NewsSearchOptionalParams

Returns

Promise<Models.NewsSearchResponse>

Promise<Models.NewsSearchResponse>

search(string, NewsSearchOptionalParams, ServiceCallback<News>)

function search(query: string, options: NewsSearchOptionalParams, callback: ServiceCallback<News>)

Parameters

query
string

The user's search query string. The query string cannot be empty. The query string may contain Bing Advanced Operators. For example, to limit news to a specific domain, use the site: operator. Use this parameter only with the News Search API. Do not specify this parameter when calling the Trending Topics API or News Category API.

options
NewsSearchOptionalParams

The optional parameters

callback
ServiceCallback<News>

The callback

search(string, ServiceCallback<News>)

function search(query: string, callback: ServiceCallback<News>)

Parameters

query
string

The user's search query string. The query string cannot be empty. The query string may contain Bing Advanced Operators. For example, to limit news to a specific domain, use the site: operator. Use this parameter only with the News Search API. Do not specify this parameter when calling the Trending Topics API or News Category API.

callback
ServiceCallback<News>

The callback

function trending(options?: Models.NewsTrendingOptionalParams)

Parameters

options
Models.NewsTrendingOptionalParams

Returns

Promise<Models.NewsTrendingResponse>

Promise<Models.NewsTrendingResponse>

function trending(options: NewsTrendingOptionalParams, callback: ServiceCallback<TrendingTopics>)

Parameters

options
NewsTrendingOptionalParams

The optional parameters

callback
ServiceCallback<TrendingTopics>

The callback

function trending(callback: ServiceCallback<TrendingTopics>)

Parameters

callback
ServiceCallback<TrendingTopics>

The callback