azure.cognitiveservices.search.customsearch.models module

exception azure.cognitiveservices.search.customsearch.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.customsearch.models.Answer(**kwargs)[source]

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

Answer.

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

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.customsearch.models.CreativeWork(**kwargs)[source]

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

CreativeWork.

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

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.

  • description (str) – A short description of 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.

  • text (str) –

class azure.cognitiveservices.search.customsearch.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.customsearch.models.ErrorResponse(*, errors, **kwargs)[source]

Bases: azure.cognitiveservices.search.customsearch.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.customsearch.models.Identifiable(**kwargs)[source]

Bases: azure.cognitiveservices.search.customsearch.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.customsearch.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) –

class azure.cognitiveservices.search.customsearch.models.QueryContext(*, original_query: str, **kwargs)[source]

Bases: msrest.serialization.Model

Defines the query context that Bing used for the 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

original_query (str) – Required. The query string as specified in the request.

Variables
  • altered_query (str) – The query string used by Bing to perform the query. Bing uses the altered query string if the original query string contained spelling mistakes. For example, if the query string is “saling downwind”, the altered query string will be “sailing downwind”. This field is included only if the original query string contains a spelling mistake.

  • alteration_override_query (str) – The query string to use to force Bing to use the original string. For example, if the query string is “saling downwind”, the override query string will be “+saling downwind”. Remember to encode the query string which results in “%2Bsaling+downwind”. This field is included only if the original query string contains a spelling mistake.

  • adult_intent (bool) – A Boolean value that indicates whether the specified query has adult intent. The value is true if the query has adult intent; otherwise, false.

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

Bases: azure.cognitiveservices.search.customsearch.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: SearchResponse, ErrorResponse, Answer, Thing

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.customsearch.models.ResponseBase(**kwargs)[source]

Bases: msrest.serialization.Model

ResponseBase.

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.customsearch.models.SearchResponse(**kwargs)[source]

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

Defines the top-level object that the response includes when the request succeeds.

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.

  • query_context (QueryContext) – An object that contains the query string that Bing used for the request. This object contains the query string as entered by the user. It may also contain an altered query string that Bing used for the query if the query string contained a spelling mistake.

  • web_pages (WebWebAnswer) – A list of webpages that are relevant to the search query.

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

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

SearchResultsAnswer.

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

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]) –

  • query_context (QueryContext) –

  • 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.

  • is_family_friendly (bool) –

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

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

Thing.

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

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.

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

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

class azure.cognitiveservices.search.customsearch.models.WebMetaTag(**kwargs)[source]

Bases: msrest.serialization.Model

Defines a webpage’s metadata.

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

Variables
  • name (str) – The metadata.

  • content (str) – The name of the metadata.

class azure.cognitiveservices.search.customsearch.models.WebPage(**kwargs)[source]

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

Defines a webpage 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.

  • description (str) – A short description of 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.

  • text (str) –

  • display_url (str) – The display URL of the webpage. The URL is meant for display purposes only and is not well formed.

  • snippet (str) – A snippet of text from the webpage that describes its contents.

  • deep_links (list[WebPage]) – A list of links to related content that Bing found in the website that contains this webpage. The Webpage object in this context includes only the name, url, urlPingSuffix, and snippet fields.

  • date_last_crawled (str) – The last time that Bing crawled the webpage. The date is in the form, YYYY-MM-DDTHH:MM:SS. For example, 2015-04-13T05:23:39.

  • search_tags (list[WebMetaTag]) – A list of search tags that the webpage owner specified on the webpage. The API returns only indexed search tags. The name field of the MetaTag object contains the indexed search tag. Search tags begin with search.* (for example, search.assetId). The content field contains the tag’s value.

class azure.cognitiveservices.search.customsearch.models.WebWebAnswer(*, value, **kwargs)[source]

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

Defines a list of relevant webpage links.

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[WebPage]) – Required. A list of webpages that are relevant to the query.

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]) –

  • query_context (QueryContext) –

  • 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.

  • is_family_friendly (bool) –

  • some_results_removed (bool) – A Boolean value that indicates whether the response excluded some results from the answer. If Bing excluded some results, the value is true.

class azure.cognitiveservices.search.customsearch.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.customsearch.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.customsearch.models.SafeSearch[source]

Bases: str, enum.Enum

An enumeration.

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

Bases: str, enum.Enum

An enumeration.

html = 'Html'
raw = 'Raw'