azure.cognitiveservices.search.newssearch.models module

exception azure.cognitiveservices.search.newssearch.models.ErrorResponseException(deserialize, response, *args)[source]

Bases: msrest.exceptions.HttpOperationError

Server responsed with exception of type: ‘ErrorResponse’.

Parameters
  • deserialize – A deserializer

  • response – Server response to be deserialized.

class azure.cognitiveservices.search.newssearch.models.Answer(**kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.Response

Defines an answer.

You probably want to use the sub-classes and not this class directly. Known sub-classes are: SearchResultsAnswer, TrendingTopics

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

  • follow_up_queries (list[Query]) –

class azure.cognitiveservices.search.newssearch.models.Article(**kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.CreativeWork

Article.

You probably want to use the sub-classes and not this class directly. Known sub-classes are: NewsArticle

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

  • name (str) – The name of the thing represented by this object.

  • url (str) – The URL to get more information about the thing represented by this object.

  • image (ImageObject) – An image of the item.

  • description (str) – A short description of the item.

  • alternate_name (str) – An alias for the item

  • bing_id (str) – An ID that uniquely identifies this item.

  • thumbnail_url (str) – The URL to a thumbnail of the item.

  • provider (list[Thing]) – The source of the creative work.

  • date_published (str) – The date on which the CreativeWork was published.

  • video (VideoObject) – A video of the item.

  • word_count (int) – The number of words in the text of the Article.

class azure.cognitiveservices.search.newssearch.models.CreativeWork(**kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.Thing

The most generic kind of creative work, including books, movies, photographs, software programs, etc.

You probably want to use the sub-classes and not this class directly. Known sub-classes are: Article, MediaObject

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

  • name (str) – The name of the thing represented by this object.

  • url (str) – The URL to get more information about the thing represented by this object.

  • image (ImageObject) – An image of the item.

  • description (str) – A short description of the item.

  • alternate_name (str) – An alias for the item

  • bing_id (str) – An ID that uniquely identifies this item.

  • thumbnail_url (str) – The URL to a thumbnail of the item.

  • provider (list[Thing]) – The source of the creative work.

  • date_published (str) – The date on which the CreativeWork was published.

  • video (VideoObject) – A video of the item.

class azure.cognitiveservices.search.newssearch.models.Error(*, message: str, code='None', **kwargs)[source]

Bases: msrest.serialization.Model

Defines the error that occurred.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters
  • code (str or ErrorCode) – Required. The error code that identifies the category of error. Possible values include: ‘None’, ‘ServerError’, ‘InvalidRequest’, ‘RateLimitExceeded’, ‘InvalidAuthorization’, ‘InsufficientAuthorization’. Default value: “None” .

  • message (str) – Required. A description of the error.

Variables
  • sub_code (str or ErrorSubCode) – The error code that further helps to identify the error. Possible values include: ‘UnexpectedError’, ‘ResourceError’, ‘NotImplemented’, ‘ParameterMissing’, ‘ParameterInvalidValue’, ‘HttpNotAllowed’, ‘Blocked’, ‘AuthorizationMissing’, ‘AuthorizationRedundancy’, ‘AuthorizationDisabled’, ‘AuthorizationExpired’

  • more_details (str) – A description that provides additional information about the error.

  • parameter (str) – The parameter in the request that caused the error.

  • value (str) – The parameter’s value in the request that was not valid.

class azure.cognitiveservices.search.newssearch.models.ErrorResponse(*, errors, **kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.Response

The top-level response that represents a failed request.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters
  • _type (str) – Required. Constant filled by server.

  • errors (list[Error]) – Required. A list of errors that describe the reasons why the request failed.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

class azure.cognitiveservices.search.newssearch.models.Identifiable(**kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.ResponseBase

Defines the identity of a resource.

You probably want to use the sub-classes and not this class directly. Known sub-classes are: Response

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

Variables

id (str) – A String identifier.

class azure.cognitiveservices.search.newssearch.models.ImageObject(**kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.MediaObject

Defines an image.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

  • name (str) – The name of the thing represented by this object.

  • url (str) – The URL to get more information about the thing represented by this object.

  • image (ImageObject) – An image of the item.

  • description (str) – A short description of the item.

  • alternate_name (str) – An alias for the item

  • bing_id (str) – An ID that uniquely identifies this item.

  • thumbnail_url (str) – The URL to a thumbnail of the item.

  • provider (list[Thing]) – The source of the creative work.

  • date_published (str) – The date on which the CreativeWork was published.

  • video (VideoObject) – A video of the item.

  • content_url (str) – Original URL to retrieve the source (file) for the media object (e.g the source URL for the image).

  • width (int) – The width of the source media object, in pixels.

  • height (int) – The height of the source media object, in pixels.

  • thumbnail (ImageObject) – The URL to a thumbnail of the image

class azure.cognitiveservices.search.newssearch.models.MediaObject(**kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.CreativeWork

Defines a media object.

You probably want to use the sub-classes and not this class directly. Known sub-classes are: ImageObject, VideoObject

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

  • name (str) – The name of the thing represented by this object.

  • url (str) – The URL to get more information about the thing represented by this object.

  • image (ImageObject) – An image of the item.

  • description (str) – A short description of the item.

  • alternate_name (str) – An alias for the item

  • bing_id (str) – An ID that uniquely identifies this item.

  • thumbnail_url (str) – The URL to a thumbnail of the item.

  • provider (list[Thing]) – The source of the creative work.

  • date_published (str) – The date on which the CreativeWork was published.

  • video (VideoObject) – A video of the item.

  • content_url (str) – Original URL to retrieve the source (file) for the media object (e.g the source URL for the image).

  • width (int) – The width of the source media object, in pixels.

  • height (int) – The height of the source media object, in pixels.

class azure.cognitiveservices.search.newssearch.models.News(*, value, **kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.SearchResultsAnswer

Defines a news answer.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters
  • _type (str) – Required. Constant filled by server.

  • value (list[NewsArticle]) – Required. An array of NewsArticle objects that contain information about news articles that are relevant to the query. If there are no results to return for the request, the array is empty.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

  • follow_up_queries (list[Query]) –

  • total_estimated_matches (long) – 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.

  • location (str) – Location of local news

class azure.cognitiveservices.search.newssearch.models.NewsArticle(**kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.Article

Defines a news article.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

  • name (str) – The name of the thing represented by this object.

  • url (str) – The URL to get more information about the thing represented by this object.

  • image (ImageObject) – An image of the item.

  • description (str) – A short description of the item.

  • alternate_name (str) – An alias for the item

  • bing_id (str) – An ID that uniquely identifies this item.

  • thumbnail_url (str) – The URL to a thumbnail of the item.

  • provider (list[Thing]) – The source of the creative work.

  • date_published (str) – The date on which the CreativeWork was published.

  • video (VideoObject) – A video of the item.

  • word_count (int) – The number of words in the text of the Article.

  • category (str) – The news category that the article belongs to. For example, Sports. If the news category cannot be determined, the article does not include this field.

  • headline (bool) – A Boolean value that indicates whether the news article is a headline. If true, the article is a headline. The article includes this field only for news categories requests that do not specify the category query parameter.

  • clustered_articles (list[NewsArticle]) – A list of related news articles.

class azure.cognitiveservices.search.newssearch.models.NewsTopic(**kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.Thing

NewsTopic.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

  • name (str) – The name of the thing represented by this object.

  • url (str) – The URL to get more information about the thing represented by this object.

  • image (ImageObject) – An image of the item.

  • description (str) – A short description of the item.

  • alternate_name (str) – An alias for the item

  • bing_id (str) – An ID that uniquely identifies this item.

  • is_breaking_news (bool) – A Boolean value that indicates whether the topic is considered breaking news. If the topic is considered breaking news, the value is true.

  • query (Query) – A search query term that returns this trending topic.

  • news_search_url (str) – The URL to the Bing News search results for the search query term

class azure.cognitiveservices.search.newssearch.models.Organization(**kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.Thing

Defines an organization.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

  • name (str) – The name of the thing represented by this object.

  • url (str) – The URL to get more information about the thing represented by this object.

  • image (ImageObject) – An image of the item.

  • description (str) – A short description of the item.

  • alternate_name (str) – An alias for the item

  • bing_id (str) – An ID that uniquely identifies this item.

class azure.cognitiveservices.search.newssearch.models.Query(*, text: str, **kwargs)[source]

Bases: msrest.serialization.Model

Defines a search query.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

text (str) – Required. The query string. Use this string as the query term in a new search request.

Variables
  • display_text (str) – 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

  • web_search_url (str) – The URL that takes the user to the Bing search results page for the query.Only related search results include this field.

  • search_link (str) – The URL that you use to get the results of the related search. Before using the URL, you must append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. Use this URL if you’re displaying the results in your own user interface. Otherwise, use the webSearchUrl URL.

  • thumbnail (ImageObject) – The URL to a thumbnail of a related image.

class azure.cognitiveservices.search.newssearch.models.Response(**kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.Identifiable

Defines a response. All schemas that could be returned at the root of a response should inherit from this.

You probably want to use the sub-classes and not this class directly. Known sub-classes are: Answer, Thing, ErrorResponse

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

class azure.cognitiveservices.search.newssearch.models.ResponseBase(**kwargs)[source]

Bases: msrest.serialization.Model

Response base.

You probably want to use the sub-classes and not this class directly. Known sub-classes are: Identifiable

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

class azure.cognitiveservices.search.newssearch.models.SearchResultsAnswer(**kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.Answer

Defines a search result answer.

You probably want to use the sub-classes and not this class directly. Known sub-classes are: News

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

  • follow_up_queries (list[Query]) –

  • total_estimated_matches (long) – 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.

class azure.cognitiveservices.search.newssearch.models.Thing(**kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.Response

Defines a thing.

You probably want to use the sub-classes and not this class directly. Known sub-classes are: NewsTopic, CreativeWork, Organization

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

  • name (str) – The name of the thing represented by this object.

  • url (str) – The URL to get more information about the thing represented by this object.

  • image (ImageObject) – An image of the item.

  • description (str) – A short description of the item.

  • alternate_name (str) – An alias for the item

  • bing_id (str) – An ID that uniquely identifies this item.

class azure.cognitiveservices.search.newssearch.models.TrendingTopics(*, value, **kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.Answer

TrendingTopics.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters
  • _type (str) – Required. Constant filled by server.

  • value (list[NewsTopic]) – Required. A list of trending news topics on Bing

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

  • follow_up_queries (list[Query]) –

class azure.cognitiveservices.search.newssearch.models.VideoObject(**kwargs)[source]

Bases: azure.cognitiveservices.search.newssearch.models._models_py3.MediaObject

Defines a video object that is relevant to the query.

Variables are only populated by the server, and will be ignored when sending a request.

All required parameters must be populated in order to send to Azure.

Parameters

_type (str) – Required. Constant filled by server.

Variables
  • id (str) – A String identifier.

  • web_search_url (str) – The URL To Bing’s search result for this item.

  • name (str) – The name of the thing represented by this object.

  • url (str) – The URL to get more information about the thing represented by this object.

  • image (ImageObject) – An image of the item.

  • description (str) – A short description of the item.

  • alternate_name (str) – An alias for the item

  • bing_id (str) – An ID that uniquely identifies this item.

  • thumbnail_url (str) – The URL to a thumbnail of the item.

  • provider (list[Thing]) – The source of the creative work.

  • date_published (str) – The date on which the CreativeWork was published.

  • video (VideoObject) – A video of the item.

  • content_url (str) – Original URL to retrieve the source (file) for the media object (e.g the source URL for the image).

  • width (int) – The width of the source media object, in pixels.

  • height (int) – The height of the source media object, in pixels.

  • motion_thumbnail_url (str) –

  • motion_thumbnail_id (str) –

  • embed_html (str) –

  • allow_https_embed (bool) –

  • view_count (int) –

  • thumbnail (ImageObject) –

  • video_id (str) –

  • allow_mobile_embed (bool) –

  • is_superfresh (bool) –

class azure.cognitiveservices.search.newssearch.models.ErrorCode[source]

Bases: str, enum.Enum

An enumeration.

insufficient_authorization = 'InsufficientAuthorization'
invalid_authorization = 'InvalidAuthorization'
invalid_request = 'InvalidRequest'
none = 'None'
rate_limit_exceeded = 'RateLimitExceeded'
server_error = 'ServerError'
class azure.cognitiveservices.search.newssearch.models.ErrorSubCode[source]

Bases: str, enum.Enum

An enumeration.

authorization_disabled = 'AuthorizationDisabled'
authorization_expired = 'AuthorizationExpired'
authorization_missing = 'AuthorizationMissing'
authorization_redundancy = 'AuthorizationRedundancy'
blocked = 'Blocked'
http_not_allowed = 'HttpNotAllowed'
not_implemented = 'NotImplemented'
parameter_invalid_value = 'ParameterInvalidValue'
parameter_missing = 'ParameterMissing'
resource_error = 'ResourceError'
unexpected_error = 'UnexpectedError'
class azure.cognitiveservices.search.newssearch.models.Freshness[source]

Bases: str, enum.Enum

An enumeration.

day = 'Day'
month = 'Month'
week = 'Week'
class azure.cognitiveservices.search.newssearch.models.SafeSearch[source]

Bases: str, enum.Enum

An enumeration.

moderate = 'Moderate'
off = 'Off'
strict = 'Strict'
class azure.cognitiveservices.search.newssearch.models.TextFormat[source]

Bases: str, enum.Enum

An enumeration.

html = 'Html'
raw = 'Raw'