NewsOperations class

Class representing a NewsOperations.

Constructors

NewsOperations(NewsSearchClientContext)

Create a NewsOperations.

Methods

category(NewsCategoryOptionalParams)
category(NewsCategoryOptionalParams, ServiceCallback<News>)
category(ServiceCallback<News>)
search(string, NewsSearchOptionalParams)
search(string, NewsSearchOptionalParams, ServiceCallback<News>)
search(string, ServiceCallback<News>)
trending(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(NewsCategoryOptionalParams)

function category(options?: NewsCategoryOptionalParams): Promise<NewsCategoryResponse>

Parameters

options
NewsCategoryOptionalParams

The optional parameters

Returns

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

function search(query: string, options?: NewsSearchOptionalParams): Promise<NewsSearchResponse>

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

Returns

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?: NewsTrendingOptionalParams): Promise<NewsTrendingResponse>

Parameters

options
NewsTrendingOptionalParams

The optional parameters

Returns

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