From 65f062d9f8bbc5bae1610fc894f43f6545b2314f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 8 Jun 2018 18:06:02 -0700 Subject: [PATCH] [AutoPR cognitiveservices/data-plane/AutoSuggest] Add bing AutoSuggest Spec (#2686) * Generated from 3c97f2f096db0a70f33aefeea74399963aecf84b update spec * Generated from 78b0ffab51e34bd623178af8fbae067f755aa447 add name in SuggestionGroup * Generated from 65c2b3d0a8d19d23482be01dec65f6618306470c update spec * Generated from 4a7c236ecccc70ae4476757aef255a56237d22ff update spec * Generated from 9c480eede855a9c96ace45a597f92e950c74c6ad update spec --- .../search/autosuggest/__init__.py | 18 + .../autosuggest/auto_suggest_search_api.py | 324 ++++++++++++++++++ .../search/autosuggest/models/__init__.py | 70 ++++ .../search/autosuggest/models/action.py | 169 +++++++++ .../search/autosuggest/models/action_py3.py | 169 +++++++++ .../search/autosuggest/models/answer.py | 74 ++++ .../search/autosuggest/models/answer_py3.py | 74 ++++ .../models/auto_suggest_search_api_enums.py | 56 +++ .../autosuggest/models/creative_work.py | 165 +++++++++ .../autosuggest/models/creative_work_py3.py | 165 +++++++++ .../search/autosuggest/models/error.py | 67 ++++ .../search/autosuggest/models/error_py3.py | 67 ++++ .../autosuggest/models/error_response.py | 87 +++++ .../autosuggest/models/error_response_py3.py | 87 +++++ .../search/autosuggest/models/identifiable.py | 49 +++ .../autosuggest/models/identifiable_py3.py | 49 +++ .../autosuggest/models/query_context.py | 87 +++++ .../autosuggest/models/query_context_py3.py | 87 +++++ .../search/autosuggest/models/response.py | 81 +++++ .../autosuggest/models/response_base.py | 41 +++ .../autosuggest/models/response_base_py3.py | 41 +++ .../search/autosuggest/models/response_py3.py | 81 +++++ .../autosuggest/models/search_action.py | 176 ++++++++++ .../autosuggest/models/search_action_py3.py | 176 ++++++++++ .../models/search_results_answer.py | 80 +++++ .../models/search_results_answer_py3.py | 80 +++++ .../search/autosuggest/models/suggestions.py | 78 +++++ .../autosuggest/models/suggestions_py3.py | 78 +++++ .../models/suggestions_suggestion_group.py | 48 +++ .../suggestions_suggestion_group_py3.py | 48 +++ .../search/autosuggest/models/thing.py | 80 +++++ .../search/autosuggest/models/thing_py3.py | 80 +++++ .../search/autosuggest/version.py | 13 + 33 files changed, 3045 insertions(+) create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/__init__.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/auto_suggest_search_api.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/__init__.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/auto_suggest_search_api_enums.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing_py3.py create mode 100644 azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/version.py diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/__init__.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/__init__.py new file mode 100644 index 000000000000..bf825994f24c --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .auto_suggest_search_api import AutoSuggestSearchAPI +from .version import VERSION + +__all__ = ['AutoSuggestSearchAPI'] + +__version__ = VERSION + diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/auto_suggest_search_api.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/auto_suggest_search_api.py new file mode 100644 index 000000000000..db81c44776f8 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/auto_suggest_search_api.py @@ -0,0 +1,324 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Configuration, Serializer, Deserializer +from .version import VERSION +from msrest.pipeline import ClientRawResponse +from . import models + + +class AutoSuggestSearchAPIConfiguration(Configuration): + """Configuration for AutoSuggestSearchAPI + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if not base_url: + base_url = 'https://api.cognitive.microsoft.com/bing/v7.0' + + super(AutoSuggestSearchAPIConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-cognitiveservices-search-autosuggest/{}'.format(VERSION)) + + self.credentials = credentials + + +class AutoSuggestSearchAPI(SDKClient): + """The AutoSuggest Search API lets you send a search query to Bing and get back a list of news that are relevant to the search query. This section provides technical details about the query parameters and headers that you use to request news and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the web for AutoSuggest](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference). + + :ivar config: Configuration for client. + :vartype config: AutoSuggestSearchAPIConfiguration + + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + :param str base_url: Service URL + """ + + def __init__( + self, credentials, base_url=None): + + self.config = AutoSuggestSearchAPIConfiguration(credentials, base_url) + super(AutoSuggestSearchAPI, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '1.0' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + + def auto_suggest( + self, query, accept_language=None, pragma=None, user_agent=None, client_id=None, client_ip=None, location=None, country_code=None, market="en-us", safe_search=None, set_lang=None, response_format=None, custom_headers=None, raw=False, **operation_config): + """The AutoSuggest API lets you send a search query to Bing and get back a + list of suggestions. This section provides technical details about the + query parameters and headers that you use to request suggestions and + the JSON response objects that contain them. + + :param query: The user's search term. + :type query: str + :param accept_language: A comma-delimited list of one or more + languages to use for user interface strings. The list is in decreasing + order of preference. For additional information, including expected + format, see + [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + This header and the setLang query parameter are mutually exclusive; do + not specify both. If you set this header, you must also specify the + [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#cc) + query parameter. To determine the market to return results for, Bing + uses the first supported language it finds from the list and combines + it with the cc parameter value. If the list does not include a + supported language, Bing finds the closest language and market that + supports the request or it uses an aggregated or default market for + the results. To determine the market that Bing used, see the + BingAPIs-Market header. Use this header and the cc query parameter + only if you specify multiple languages. Otherwise, use the + [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#mkt) + and + [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#setlang) + query parameters. A user interface string is a string that's used as a + label in a user interface. There are few user interface strings in the + JSON response objects. Any links to Bing.com properties in the + response objects apply the specified language. + :type accept_language: str + :param pragma: By default, Bing returns cached content, if available. + To prevent Bing from returning cached content, set the Pragma header + to no-cache (for example, Pragma: no-cache). + :type pragma: str + :param user_agent: The user agent originating the request. Bing uses + the user agent to provide mobile users with an optimized experience. + Although optional, you are encouraged to always specify this header. + The user-agent should be the same string that any commonly used + browser sends. For information about user agents, see [RFC + 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The + following are examples of user-agent strings. Windows Phone: + Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; + IEMobile/10.0; ARM; Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 + (Linux; U; Android 2.3.5; en - us; SCH - I500 Build / GINGERBREAD) + AppleWebKit / 533.1 (KHTML; like Gecko) Version / 4.0 Mobile Safari / + 533.1. iPhone: Mozilla / 5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) + AppleWebKit / 536.26 (KHTML; like Gecko) Mobile / 10B142 iPhone4; 1 + BingWeb / 3.03.1428.20120423. PC: Mozilla / 5.0 (Windows NT 6.3; + WOW64; Trident / 7.0; Touch; rv:11.0) like Gecko. iPad: Mozilla / 5.0 + (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit / 537.51.1 (KHTML, like + Gecko) Version / 7.0 Mobile / 11A465 Safari / 9537.53 + :type user_agent: str + :param client_id: Bing uses this header to provide users with + consistent behavior across Bing API calls. Bing often flights new + features and improvements, and it uses the client ID as a key for + assigning traffic on different flights. If you do not use the same + client ID for a user across multiple requests, then Bing may assign + the user to multiple conflicting flights. Being assigned to multiple + conflicting flights can lead to an inconsistent user experience. For + example, if the second request has a different flight assignment than + the first, the experience may be unexpected. Also, Bing can use the + client ID to tailor web results to that client ID’s search history, + providing a richer experience for the user. Bing also uses this header + to help improve result rankings by analyzing the activity generated by + a client ID. The relevance improvements help with better quality of + results delivered by Bing APIs and in turn enables higher + click-through rates for the API consumer. IMPORTANT: Although + optional, you should consider this header required. Persisting the + client ID across multiple requests for the same end user and device + combination enables 1) the API consumer to receive a consistent user + experience, and 2) higher click-through rates via better quality of + results from the Bing APIs. Each user that uses your application on + the device must have a unique, Bing generated client ID. If you do not + include this header in the request, Bing generates an ID and returns + it in the X-MSEdge-ClientID response header. The only time that you + should NOT include this header in a request is the first time the user + uses your app on that device. Use the client ID for each Bing API + request that your app makes for this user on the device. Persist the + client ID. To persist the ID in a browser app, use a persistent HTTP + cookie to ensure the ID is used across all sessions. Do not use a + session cookie. For other apps such as mobile apps, use the device's + persistent storage to persist the ID. The next time the user uses your + app on that device, get the client ID that you persisted. Bing + responses may or may not include this header. If the response includes + this header, capture the client ID and use it for all subsequent Bing + requests for the user on that device. If you include the + X-MSEdge-ClientID, you must not include cookies in the request. + :type client_id: str + :param client_ip: The IPv4 or IPv6 address of the client device. The + IP address is used to discover the user's location. Bing uses the + location information to determine safe search behavior. Although + optional, you are encouraged to always specify this header and the + X-Search-Location header. Do not obfuscate the address (for example, + by changing the last octet to 0). Obfuscating the address results in + the location not being anywhere near the device's actual location, + which may result in Bing serving erroneous results. + :type client_ip: str + :param location: A semicolon-delimited list of key/value pairs that + describe the client's geographical location. Bing uses the location + information to determine safe search behavior and to return relevant + local content. Specify the key/value pair as :. The + following are the keys that you use to specify the user's location. + lat (required): The latitude of the client's location, in degrees. The + latitude must be greater than or equal to -90.0 and less than or equal + to +90.0. Negative values indicate southern latitudes and positive + values indicate northern latitudes. long (required): The longitude of + the client's location, in degrees. The longitude must be greater than + or equal to -180.0 and less than or equal to +180.0. Negative values + indicate western longitudes and positive values indicate eastern + longitudes. re (required): The radius, in meters, which specifies the + horizontal accuracy of the coordinates. Pass the value returned by the + device's location service. Typical values might be 22m for GPS/Wi-Fi, + 380m for cell tower triangulation, and 18,000m for reverse IP lookup. + ts (optional): The UTC UNIX timestamp of when the client was at the + location. (The UNIX timestamp is the number of seconds since January + 1, 1970.) head (optional): The client's relative heading or direction + of travel. Specify the direction of travel as degrees from 0 through + 360, counting clockwise relative to true north. Specify this key only + if the sp key is nonzero. sp (optional): The horizontal velocity + (speed), in meters per second, that the client device is traveling. + alt (optional): The altitude of the client device, in meters. are + (optional): The radius, in meters, that specifies the vertical + accuracy of the coordinates. Specify this key only if you specify the + alt key. Although many of the keys are optional, the more information + that you provide, the more accurate the location results are. Although + optional, you are encouraged to always specify the user's geographical + location. Providing the location is especially important if the + client's IP address does not accurately reflect the user's physical + location (for example, if the client uses VPN). For optimal results, + you should include this header and the X-MSEdge-ClientIP header, but + at a minimum, you should include this header. + :type location: str + :param country_code: A 2-character country code of the country where + the results come from. This API supports only the United States + market. If you specify this query parameter, it must be set to us. If + you set this parameter, you must also specify the Accept-Language + header. Bing uses the first supported language it finds from the + languages list, and combine that language with the country code that + you specify to determine the market to return results for. If the + languages list does not include a supported language, Bing finds the + closest language and market that supports the request, or it may use + an aggregated or default market for the results instead of a specified + one. You should use this query parameter and the Accept-Language query + parameter only if you specify multiple languages; otherwise, you + should use the mkt and setLang query parameters. This parameter and + the mkt query parameter are mutually exclusive—do not specify both. + :type country_code: str + :param market: The market where the results come from. You are + strongly encouraged to always specify the market, if known. Specifying + the market helps Bing route the request and return an appropriate and + optimal response. This parameter and the cc query parameter are + mutually exclusive—do not specify both. + :type market: str + :param safe_search: Filter suggestions for adult content. The + following are the possible filter values. Off: Return suggestions with + adult text, images, or videos. Moderate: Return suggestion with adult + text but not adult images or videos. Strict: Do not return news + articles with adult text, images, or videos. If the request comes from + a market that Bing's adult policy requires that safeSearch is set to + Strict, Bing ignores the safeSearch value and uses Strict. If you use + the site: query operator, there is the chance that the response may + contain adult content regardless of what the safeSearch query + parameter is set to. Use site: only if you are aware of the content on + the site and your scenario supports the possibility of adult content. + Possible values include: 'Off', 'Moderate', 'Strict' + :type safe_search: str or + ~azure.cognitiveservices.search.autosuggest.models.SafeSearch + :param set_lang: The language to use for user interface strings. + Specify the language using the ISO 639-1 2-letter language code. For + example, the language code for English is EN. The default is EN + (English). Although optional, you should always specify the language. + Typically, you set setLang to the same language specified by mkt + unless the user wants the user interface strings displayed in a + different language. This parameter and the Accept-Language header are + mutually exclusive; do not specify both. A user interface string is a + string that's used as a label in a user interface. There are few user + interface strings in the JSON response objects. Also, any links to + Bing.com properties in the response objects apply the specified + language. + :type set_lang: str + :param response_format: The media type to use for the response. The + following are the possible case-insensitive values: JSON, JSONLD. The + default is JSON. If you specify JSONLD, the response body includes + JSON-LD objects that contain the search results. + :type response_format: list[str or + ~azure.cognitiveservices.search.autosuggest.models.ResponseFormat] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Suggestions or ClientRawResponse if raw=true + :rtype: ~azure.cognitiveservices.search.autosuggest.models.Suggestions + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + x_bing_apis_sdk = "true" + + # Construct URL + url = self.auto_suggest.metadata['url'] + + # Construct parameters + query_parameters = {} + if country_code is not None: + query_parameters['cc'] = self._serialize.query("country_code", country_code, 'str') + if market is not None: + query_parameters['mkt'] = self._serialize.query("market", market, 'str') + query_parameters['q'] = self._serialize.query("query", query, 'str') + if safe_search is not None: + query_parameters['safeSearch'] = self._serialize.query("safe_search", safe_search, 'str') + if set_lang is not None: + query_parameters['setLang'] = self._serialize.query("set_lang", set_lang, 'str') + if response_format is not None: + query_parameters['ResponseFormat'] = self._serialize.query("response_format", response_format, '[str]', div=',') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['X-BingApis-SDK'] = self._serialize.header("x_bing_apis_sdk", x_bing_apis_sdk, 'str') + if accept_language is not None: + header_parameters['Accept-Language'] = self._serialize.header("accept_language", accept_language, 'str') + if pragma is not None: + header_parameters['Pragma'] = self._serialize.header("pragma", pragma, 'str') + if user_agent is not None: + header_parameters['User-Agent'] = self._serialize.header("user_agent", user_agent, 'str') + if client_id is not None: + header_parameters['X-MSEdge-ClientID'] = self._serialize.header("client_id", client_id, 'str') + if client_ip is not None: + header_parameters['X-MSEdge-ClientIP'] = self._serialize.header("client_ip", client_ip, 'str') + if location is not None: + header_parameters['X-Search-Location'] = self._serialize.header("location", location, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Suggestions', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + auto_suggest.metadata = {'url': '/Suggestions'} diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/__init__.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/__init__.py new file mode 100644 index 000000000000..b6aa4ecdb7b4 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/__init__.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .search_action_py3 import SearchAction + from .suggestions_suggestion_group_py3 import SuggestionsSuggestionGroup + from .suggestions_py3 import Suggestions + from .query_context_py3 import QueryContext + from .search_results_answer_py3 import SearchResultsAnswer + from .answer_py3 import Answer + from .thing_py3 import Thing + from .action_py3 import Action + from .response_py3 import Response + from .identifiable_py3 import Identifiable + from .error_py3 import Error + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .creative_work_py3 import CreativeWork + from .response_base_py3 import ResponseBase +except (SyntaxError, ImportError): + from .search_action import SearchAction + from .suggestions_suggestion_group import SuggestionsSuggestionGroup + from .suggestions import Suggestions + from .query_context import QueryContext + from .search_results_answer import SearchResultsAnswer + from .answer import Answer + from .thing import Thing + from .action import Action + from .response import Response + from .identifiable import Identifiable + from .error import Error + from .error_response import ErrorResponse, ErrorResponseException + from .creative_work import CreativeWork + from .response_base import ResponseBase +from .auto_suggest_search_api_enums import ( + ScenarioType, + SearchKind, + ErrorCode, + SafeSearch, + ResponseFormat, +) + +__all__ = [ + 'SearchAction', + 'SuggestionsSuggestionGroup', + 'Suggestions', + 'QueryContext', + 'SearchResultsAnswer', + 'Answer', + 'Thing', + 'Action', + 'Response', + 'Identifiable', + 'Error', + 'ErrorResponse', 'ErrorResponseException', + 'CreativeWork', + 'ResponseBase', + 'ScenarioType', + 'SearchKind', + 'ErrorCode', + 'SafeSearch', + 'ResponseFormat', +] diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action.py new file mode 100644 index 000000000000..ff895bae7599 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action.py @@ -0,0 +1,169 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .creative_work import CreativeWork + + +class Action(CreativeWork): + """Action. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: SearchAction + + 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar about: For internal use only. + :vartype about: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar mentions: For internal use only. + :vartype mentions: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar creator: + :vartype creator: ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar text: Text content of this creative work + :vartype text: str + :ivar discussion_url: + :vartype discussion_url: str + :ivar comment_count: + :vartype comment_count: int + :ivar main_entity: + :vartype main_entity: + ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar head_line: + :vartype head_line: str + :ivar copyright_holder: + :vartype copyright_holder: + ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar copyright_year: + :vartype copyright_year: int + :ivar disclaimer: + :vartype disclaimer: str + :ivar is_accessible_for_free: + :vartype is_accessible_for_free: bool + :ivar genre: + :vartype genre: list[str] + :ivar is_family_friendly: + :vartype is_family_friendly: bool + :ivar result: + :vartype result: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar display_name: + :vartype display_name: str + :ivar is_top_action: + :vartype is_top_action: bool + :ivar service_url: + :vartype service_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'url': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'about': {'readonly': True}, + 'mentions': {'readonly': True}, + 'provider': {'readonly': True}, + 'creator': {'readonly': True}, + 'text': {'readonly': True}, + 'discussion_url': {'readonly': True}, + 'comment_count': {'readonly': True}, + 'main_entity': {'readonly': True}, + 'head_line': {'readonly': True}, + 'copyright_holder': {'readonly': True}, + 'copyright_year': {'readonly': True}, + 'disclaimer': {'readonly': True}, + 'is_accessible_for_free': {'readonly': True}, + 'genre': {'readonly': True}, + 'is_family_friendly': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'about': {'key': 'about', 'type': '[Thing]'}, + 'mentions': {'key': 'mentions', 'type': '[Thing]'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'creator': {'key': 'creator', 'type': 'Thing'}, + 'text': {'key': 'text', 'type': 'str'}, + 'discussion_url': {'key': 'discussionUrl', 'type': 'str'}, + 'comment_count': {'key': 'commentCount', 'type': 'int'}, + 'main_entity': {'key': 'mainEntity', 'type': 'Thing'}, + 'head_line': {'key': 'headLine', 'type': 'str'}, + 'copyright_holder': {'key': 'copyrightHolder', 'type': 'Thing'}, + 'copyright_year': {'key': 'copyrightYear', 'type': 'int'}, + 'disclaimer': {'key': 'disclaimer', 'type': 'str'}, + 'is_accessible_for_free': {'key': 'isAccessibleForFree', 'type': 'bool'}, + 'genre': {'key': 'genre', 'type': '[str]'}, + 'is_family_friendly': {'key': 'isFamilyFriendly', 'type': 'bool'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'SearchAction': 'SearchAction'} + } + + def __init__(self, **kwargs): + super(Action, self).__init__(**kwargs) + self.result = None + self.display_name = None + self.is_top_action = None + self.service_url = None + self._type = 'Action' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action_py3.py new file mode 100644 index 000000000000..217252dd7513 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action_py3.py @@ -0,0 +1,169 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .creative_work_py3 import CreativeWork + + +class Action(CreativeWork): + """Action. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: SearchAction + + 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar about: For internal use only. + :vartype about: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar mentions: For internal use only. + :vartype mentions: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar creator: + :vartype creator: ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar text: Text content of this creative work + :vartype text: str + :ivar discussion_url: + :vartype discussion_url: str + :ivar comment_count: + :vartype comment_count: int + :ivar main_entity: + :vartype main_entity: + ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar head_line: + :vartype head_line: str + :ivar copyright_holder: + :vartype copyright_holder: + ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar copyright_year: + :vartype copyright_year: int + :ivar disclaimer: + :vartype disclaimer: str + :ivar is_accessible_for_free: + :vartype is_accessible_for_free: bool + :ivar genre: + :vartype genre: list[str] + :ivar is_family_friendly: + :vartype is_family_friendly: bool + :ivar result: + :vartype result: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar display_name: + :vartype display_name: str + :ivar is_top_action: + :vartype is_top_action: bool + :ivar service_url: + :vartype service_url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'url': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'about': {'readonly': True}, + 'mentions': {'readonly': True}, + 'provider': {'readonly': True}, + 'creator': {'readonly': True}, + 'text': {'readonly': True}, + 'discussion_url': {'readonly': True}, + 'comment_count': {'readonly': True}, + 'main_entity': {'readonly': True}, + 'head_line': {'readonly': True}, + 'copyright_holder': {'readonly': True}, + 'copyright_year': {'readonly': True}, + 'disclaimer': {'readonly': True}, + 'is_accessible_for_free': {'readonly': True}, + 'genre': {'readonly': True}, + 'is_family_friendly': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'about': {'key': 'about', 'type': '[Thing]'}, + 'mentions': {'key': 'mentions', 'type': '[Thing]'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'creator': {'key': 'creator', 'type': 'Thing'}, + 'text': {'key': 'text', 'type': 'str'}, + 'discussion_url': {'key': 'discussionUrl', 'type': 'str'}, + 'comment_count': {'key': 'commentCount', 'type': 'int'}, + 'main_entity': {'key': 'mainEntity', 'type': 'Thing'}, + 'head_line': {'key': 'headLine', 'type': 'str'}, + 'copyright_holder': {'key': 'copyrightHolder', 'type': 'Thing'}, + 'copyright_year': {'key': 'copyrightYear', 'type': 'int'}, + 'disclaimer': {'key': 'disclaimer', 'type': 'str'}, + 'is_accessible_for_free': {'key': 'isAccessibleForFree', 'type': 'bool'}, + 'genre': {'key': 'genre', 'type': '[str]'}, + 'is_family_friendly': {'key': 'isFamilyFriendly', 'type': 'bool'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'SearchAction': 'SearchAction'} + } + + def __init__(self, **kwargs) -> None: + super(Action, self).__init__(**kwargs) + self.result = None + self.display_name = None + self.is_top_action = None + self.service_url = None + self._type = 'Action' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer.py new file mode 100644 index 000000000000..8ea9f385b0dd --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .response import Response + + +class Answer(Response): + """Defines an 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'SearchResultsAnswer': 'SearchResultsAnswer'} + } + + def __init__(self, **kwargs): + super(Answer, self).__init__(**kwargs) + self._type = 'Answer' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer_py3.py new file mode 100644 index 000000000000..479f4082fe3f --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer_py3.py @@ -0,0 +1,74 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .response_py3 import Response + + +class Answer(Response): + """Defines an 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'SearchResultsAnswer': 'SearchResultsAnswer'} + } + + def __init__(self, **kwargs) -> None: + super(Answer, self).__init__(**kwargs) + self._type = 'Answer' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/auto_suggest_search_api_enums.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/auto_suggest_search_api_enums.py new file mode 100644 index 000000000000..95f8c1264303 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/auto_suggest_search_api_enums.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class ScenarioType(str, Enum): + + unknown = "Unknown" + web = "Web" + store_apps = "StoreApps" + search_history = "SearchHistory" + personal_search_documents = "PersonalSearchDocuments" + personal_search_tags = "PersonalSearchTags" + custom = "Custom" + + +class SearchKind(str, Enum): + + web_search = "WebSearch" + history_search = "HistorySearch" + document_search = "DocumentSearch" + tag_search = "TagSearch" + location_search = "LocationSearch" + custom_search = "CustomSearch" + + +class ErrorCode(str, Enum): + + none = "None" + server_error = "ServerError" + invalid_request = "InvalidRequest" + rate_limit_exceeded = "RateLimitExceeded" + invalid_authorization = "InvalidAuthorization" + insufficient_authorization = "InsufficientAuthorization" + + +class SafeSearch(str, Enum): + + off = "Off" + moderate = "Moderate" + strict = "Strict" + + +class ResponseFormat(str, Enum): + + json = "Json" + json_ld = "JsonLd" diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work.py new file mode 100644 index 000000000000..720507c6d940 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work.py @@ -0,0 +1,165 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .thing import Thing + + +class CreativeWork(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: Action + + 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar about: For internal use only. + :vartype about: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar mentions: For internal use only. + :vartype mentions: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar creator: + :vartype creator: ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar text: Text content of this creative work + :vartype text: str + :ivar discussion_url: + :vartype discussion_url: str + :ivar comment_count: + :vartype comment_count: int + :ivar main_entity: + :vartype main_entity: + ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar head_line: + :vartype head_line: str + :ivar copyright_holder: + :vartype copyright_holder: + ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar copyright_year: + :vartype copyright_year: int + :ivar disclaimer: + :vartype disclaimer: str + :ivar is_accessible_for_free: + :vartype is_accessible_for_free: bool + :ivar genre: + :vartype genre: list[str] + :ivar is_family_friendly: + :vartype is_family_friendly: bool + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'url': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'about': {'readonly': True}, + 'mentions': {'readonly': True}, + 'provider': {'readonly': True}, + 'creator': {'readonly': True}, + 'text': {'readonly': True}, + 'discussion_url': {'readonly': True}, + 'comment_count': {'readonly': True}, + 'main_entity': {'readonly': True}, + 'head_line': {'readonly': True}, + 'copyright_holder': {'readonly': True}, + 'copyright_year': {'readonly': True}, + 'disclaimer': {'readonly': True}, + 'is_accessible_for_free': {'readonly': True}, + 'genre': {'readonly': True}, + 'is_family_friendly': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'about': {'key': 'about', 'type': '[Thing]'}, + 'mentions': {'key': 'mentions', 'type': '[Thing]'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'creator': {'key': 'creator', 'type': 'Thing'}, + 'text': {'key': 'text', 'type': 'str'}, + 'discussion_url': {'key': 'discussionUrl', 'type': 'str'}, + 'comment_count': {'key': 'commentCount', 'type': 'int'}, + 'main_entity': {'key': 'mainEntity', 'type': 'Thing'}, + 'head_line': {'key': 'headLine', 'type': 'str'}, + 'copyright_holder': {'key': 'copyrightHolder', 'type': 'Thing'}, + 'copyright_year': {'key': 'copyrightYear', 'type': 'int'}, + 'disclaimer': {'key': 'disclaimer', 'type': 'str'}, + 'is_accessible_for_free': {'key': 'isAccessibleForFree', 'type': 'bool'}, + 'genre': {'key': 'genre', 'type': '[str]'}, + 'is_family_friendly': {'key': 'isFamilyFriendly', 'type': 'bool'}, + } + + _subtype_map = { + '_type': {'Action': 'Action'} + } + + def __init__(self, **kwargs): + super(CreativeWork, self).__init__(**kwargs) + self.thumbnail_url = None + self.about = None + self.mentions = None + self.provider = None + self.creator = None + self.text = None + self.discussion_url = None + self.comment_count = None + self.main_entity = None + self.head_line = None + self.copyright_holder = None + self.copyright_year = None + self.disclaimer = None + self.is_accessible_for_free = None + self.genre = None + self.is_family_friendly = None + self._type = 'CreativeWork' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work_py3.py new file mode 100644 index 000000000000..90e84e224456 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work_py3.py @@ -0,0 +1,165 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .thing_py3 import Thing + + +class CreativeWork(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: Action + + 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar about: For internal use only. + :vartype about: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar mentions: For internal use only. + :vartype mentions: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar creator: + :vartype creator: ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar text: Text content of this creative work + :vartype text: str + :ivar discussion_url: + :vartype discussion_url: str + :ivar comment_count: + :vartype comment_count: int + :ivar main_entity: + :vartype main_entity: + ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar head_line: + :vartype head_line: str + :ivar copyright_holder: + :vartype copyright_holder: + ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar copyright_year: + :vartype copyright_year: int + :ivar disclaimer: + :vartype disclaimer: str + :ivar is_accessible_for_free: + :vartype is_accessible_for_free: bool + :ivar genre: + :vartype genre: list[str] + :ivar is_family_friendly: + :vartype is_family_friendly: bool + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'url': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'about': {'readonly': True}, + 'mentions': {'readonly': True}, + 'provider': {'readonly': True}, + 'creator': {'readonly': True}, + 'text': {'readonly': True}, + 'discussion_url': {'readonly': True}, + 'comment_count': {'readonly': True}, + 'main_entity': {'readonly': True}, + 'head_line': {'readonly': True}, + 'copyright_holder': {'readonly': True}, + 'copyright_year': {'readonly': True}, + 'disclaimer': {'readonly': True}, + 'is_accessible_for_free': {'readonly': True}, + 'genre': {'readonly': True}, + 'is_family_friendly': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'about': {'key': 'about', 'type': '[Thing]'}, + 'mentions': {'key': 'mentions', 'type': '[Thing]'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'creator': {'key': 'creator', 'type': 'Thing'}, + 'text': {'key': 'text', 'type': 'str'}, + 'discussion_url': {'key': 'discussionUrl', 'type': 'str'}, + 'comment_count': {'key': 'commentCount', 'type': 'int'}, + 'main_entity': {'key': 'mainEntity', 'type': 'Thing'}, + 'head_line': {'key': 'headLine', 'type': 'str'}, + 'copyright_holder': {'key': 'copyrightHolder', 'type': 'Thing'}, + 'copyright_year': {'key': 'copyrightYear', 'type': 'int'}, + 'disclaimer': {'key': 'disclaimer', 'type': 'str'}, + 'is_accessible_for_free': {'key': 'isAccessibleForFree', 'type': 'bool'}, + 'genre': {'key': 'genre', 'type': '[str]'}, + 'is_family_friendly': {'key': 'isFamilyFriendly', 'type': 'bool'}, + } + + _subtype_map = { + '_type': {'Action': 'Action'} + } + + def __init__(self, **kwargs) -> None: + super(CreativeWork, self).__init__(**kwargs) + self.thumbnail_url = None + self.about = None + self.mentions = None + self.provider = None + self.creator = None + self.text = None + self.discussion_url = None + self.comment_count = None + self.main_entity = None + self.head_line = None + self.copyright_holder = None + self.copyright_year = None + self.disclaimer = None + self.is_accessible_for_free = None + self.genre = None + self.is_family_friendly = None + self._type = 'CreativeWork' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error.py new file mode 100644 index 000000000000..f7a3df3f63c1 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(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. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', + 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. + Default value: "None" . + :type code: str or + ~azure.cognitiveservices.search.autosuggest.models.ErrorCode + :param message: Required. A description of the error. + :type message: str + :ivar more_details: A description that provides additional information + about the error. + :vartype more_details: str + :ivar parameter: The parameter in the request that caused the error. + :vartype parameter: str + :ivar value: The parameter's value in the request that was not valid. + :vartype value: str + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + 'more_details': {'readonly': True}, + 'parameter': {'readonly': True}, + 'value': {'readonly': True}, + '_type': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'more_details': {'key': 'moreDetails', 'type': 'str'}, + 'parameter': {'key': 'parameter', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', "None") + self.message = kwargs.get('message', None) + self.more_details = None + self.parameter = None + self.value = None + self._type = None diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_py3.py new file mode 100644 index 000000000000..c950e0357056 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_py3.py @@ -0,0 +1,67 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(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. + + :param code: Required. The error code that identifies the category of + error. Possible values include: 'None', 'ServerError', 'InvalidRequest', + 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. + Default value: "None" . + :type code: str or + ~azure.cognitiveservices.search.autosuggest.models.ErrorCode + :param message: Required. A description of the error. + :type message: str + :ivar more_details: A description that provides additional information + about the error. + :vartype more_details: str + :ivar parameter: The parameter in the request that caused the error. + :vartype parameter: str + :ivar value: The parameter's value in the request that was not valid. + :vartype value: str + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + 'more_details': {'readonly': True}, + 'parameter': {'readonly': True}, + 'value': {'readonly': True}, + '_type': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'more_details': {'key': 'moreDetails', 'type': 'str'}, + 'parameter': {'key': 'parameter', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + '_type': {'key': '_type', 'type': 'str'}, + } + + def __init__(self, *, message: str, code="None", **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + self.more_details = None + self.parameter = None + self.value = None + self._type = None diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response.py new file mode 100644 index 000000000000..e982eecd378a --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .response import Response +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :param errors: Required. A list of errors that describe the reasons why + the request failed. + :type errors: + list[~azure.cognitiveservices.search.autosuggest.models.Error] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'errors': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[Error]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.errors = kwargs.get('errors', None) + self._type = 'ErrorResponse' + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response_py3.py new file mode 100644 index 000000000000..31a373aed294 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response_py3.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .response_py3 import Response +from msrest.exceptions import HttpOperationError + + +class ErrorResponse(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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :param errors: Required. A list of errors that describe the reasons why + the request failed. + :type errors: + list[~azure.cognitiveservices.search.autosuggest.models.Error] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'errors': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': '[Error]'}, + } + + def __init__(self, *, errors, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.errors = errors + self._type = 'ErrorResponse' + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable.py new file mode 100644 index 000000000000..513e53d238bb --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .response_base import ResponseBase + + +class Identifiable(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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Response': 'Response'} + } + + def __init__(self, **kwargs): + super(Identifiable, self).__init__(**kwargs) + self.id = None + self._type = 'Identifiable' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable_py3.py new file mode 100644 index 000000000000..2d24a2c45775 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable_py3.py @@ -0,0 +1,49 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .response_base_py3 import ResponseBase + + +class Identifiable(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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Response': 'Response'} + } + + def __init__(self, **kwargs) -> None: + super(Identifiable, self).__init__(**kwargs) + self.id = None + self._type = 'Identifiable' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context.py new file mode 100644 index 000000000000..4f2f4e1f65b2 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryContext(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. + + :param original_query: Required. The query string as specified in the + request. + :type original_query: str + :ivar altered_query: 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. + :vartype altered_query: str + :ivar alteration_override_query: 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. + :vartype alteration_override_query: str + :ivar adult_intent: A Boolean value that indicates whether the specified + query has adult intent. The value is true if the query has adult intent; + otherwise, false. + :vartype adult_intent: bool + :ivar ask_user_for_location: A Boolean value that indicates whether Bing + requires the user's location to provide accurate results. If you specified + the user's location by using the X-MSEdge-ClientIP and X-Search-Location + headers, you can ignore this field. For location aware queries, such as + "today's weather" or "restaurants near me" that need the user's location + to provide accurate results, this field is set to true. For location aware + queries that include the location (for example, "Seattle weather"), this + field is set to false. This field is also set to false for queries that + are not location aware, such as "best sellers". + :vartype ask_user_for_location: bool + :ivar is_transactional: + :vartype is_transactional: bool + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + 'original_query': {'required': True}, + 'altered_query': {'readonly': True}, + 'alteration_override_query': {'readonly': True}, + 'adult_intent': {'readonly': True}, + 'ask_user_for_location': {'readonly': True}, + 'is_transactional': {'readonly': True}, + '_type': {'required': True}, + } + + _attribute_map = { + 'original_query': {'key': 'originalQuery', 'type': 'str'}, + 'altered_query': {'key': 'alteredQuery', 'type': 'str'}, + 'alteration_override_query': {'key': 'alterationOverrideQuery', 'type': 'str'}, + 'adult_intent': {'key': 'adultIntent', 'type': 'bool'}, + 'ask_user_for_location': {'key': 'askUserForLocation', 'type': 'bool'}, + 'is_transactional': {'key': 'isTransactional', 'type': 'bool'}, + '_type': {'key': '_type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(QueryContext, self).__init__(**kwargs) + self.original_query = kwargs.get('original_query', None) + self.altered_query = None + self.alteration_override_query = None + self.adult_intent = None + self.ask_user_for_location = None + self.is_transactional = None + self._type = None diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context_py3.py new file mode 100644 index 000000000000..c1060119e27e --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context_py3.py @@ -0,0 +1,87 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class QueryContext(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. + + :param original_query: Required. The query string as specified in the + request. + :type original_query: str + :ivar altered_query: 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. + :vartype altered_query: str + :ivar alteration_override_query: 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. + :vartype alteration_override_query: str + :ivar adult_intent: A Boolean value that indicates whether the specified + query has adult intent. The value is true if the query has adult intent; + otherwise, false. + :vartype adult_intent: bool + :ivar ask_user_for_location: A Boolean value that indicates whether Bing + requires the user's location to provide accurate results. If you specified + the user's location by using the X-MSEdge-ClientIP and X-Search-Location + headers, you can ignore this field. For location aware queries, such as + "today's weather" or "restaurants near me" that need the user's location + to provide accurate results, this field is set to true. For location aware + queries that include the location (for example, "Seattle weather"), this + field is set to false. This field is also set to false for queries that + are not location aware, such as "best sellers". + :vartype ask_user_for_location: bool + :ivar is_transactional: + :vartype is_transactional: bool + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + 'original_query': {'required': True}, + 'altered_query': {'readonly': True}, + 'alteration_override_query': {'readonly': True}, + 'adult_intent': {'readonly': True}, + 'ask_user_for_location': {'readonly': True}, + 'is_transactional': {'readonly': True}, + '_type': {'required': True}, + } + + _attribute_map = { + 'original_query': {'key': 'originalQuery', 'type': 'str'}, + 'altered_query': {'key': 'alteredQuery', 'type': 'str'}, + 'alteration_override_query': {'key': 'alterationOverrideQuery', 'type': 'str'}, + 'adult_intent': {'key': 'adultIntent', 'type': 'bool'}, + 'ask_user_for_location': {'key': 'askUserForLocation', 'type': 'bool'}, + 'is_transactional': {'key': 'isTransactional', 'type': 'bool'}, + '_type': {'key': '_type', 'type': 'str'}, + } + + def __init__(self, *, original_query: str, **kwargs) -> None: + super(QueryContext, self).__init__(**kwargs) + self.original_query = original_query + self.altered_query = None + self.alteration_override_query = None + self.adult_intent = None + self.ask_user_for_location = None + self.is_transactional = None + self._type = None diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response.py new file mode 100644 index 000000000000..100175130e1f --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .identifiable import Identifiable + + +class Response(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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Answer': 'Answer', 'Thing': 'Thing', 'ErrorResponse': 'ErrorResponse'} + } + + def __init__(self, **kwargs): + super(Response, self).__init__(**kwargs) + self.read_link = None + self.web_search_url = None + self.potential_action = None + self.immediate_action = None + self.preferred_clickthrough_url = None + self.adaptive_card = None + self._type = 'Response' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base.py new file mode 100644 index 000000000000..fd44632cfc0a --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResponseBase(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. + + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + '_type': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Identifiable': 'Identifiable'} + } + + def __init__(self, **kwargs): + super(ResponseBase, self).__init__(**kwargs) + self._type = None diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base_py3.py new file mode 100644 index 000000000000..680e0fe98ab4 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ResponseBase(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. + + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + '_type': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Identifiable': 'Identifiable'} + } + + def __init__(self, **kwargs) -> None: + super(ResponseBase, self).__init__(**kwargs) + self._type = None diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_py3.py new file mode 100644 index 000000000000..3f3a1c0299bc --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_py3.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .identifiable_py3 import Identifiable + + +class Response(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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'Answer': 'Answer', 'Thing': 'Thing', 'ErrorResponse': 'ErrorResponse'} + } + + def __init__(self, **kwargs) -> None: + super(Response, self).__init__(**kwargs) + self.read_link = None + self.web_search_url = None + self.potential_action = None + self.immediate_action = None + self.preferred_clickthrough_url = None + self.adaptive_card = None + self._type = 'Response' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action.py new file mode 100644 index 000000000000..6775acc5d793 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action.py @@ -0,0 +1,176 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .action import Action + + +class SearchAction(Action): + """SearchAction. + + 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar about: For internal use only. + :vartype about: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar mentions: For internal use only. + :vartype mentions: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar creator: + :vartype creator: ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar text: Text content of this creative work + :vartype text: str + :ivar discussion_url: + :vartype discussion_url: str + :ivar comment_count: + :vartype comment_count: int + :ivar main_entity: + :vartype main_entity: + ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar head_line: + :vartype head_line: str + :ivar copyright_holder: + :vartype copyright_holder: + ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar copyright_year: + :vartype copyright_year: int + :ivar disclaimer: + :vartype disclaimer: str + :ivar is_accessible_for_free: + :vartype is_accessible_for_free: bool + :ivar genre: + :vartype genre: list[str] + :ivar is_family_friendly: + :vartype is_family_friendly: bool + :ivar result: + :vartype result: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar display_name: + :vartype display_name: str + :ivar is_top_action: + :vartype is_top_action: bool + :ivar service_url: + :vartype service_url: str + :ivar display_text: + :vartype display_text: str + :ivar query: + :vartype query: str + :ivar search_kind: Possible values include: 'WebSearch', 'HistorySearch', + 'DocumentSearch', 'TagSearch', 'LocationSearch', 'CustomSearch'. Default + value: "WebSearch" . + :vartype search_kind: str or + ~azure.cognitiveservices.search.autosuggest.models.SearchKind + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'url': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'about': {'readonly': True}, + 'mentions': {'readonly': True}, + 'provider': {'readonly': True}, + 'creator': {'readonly': True}, + 'text': {'readonly': True}, + 'discussion_url': {'readonly': True}, + 'comment_count': {'readonly': True}, + 'main_entity': {'readonly': True}, + 'head_line': {'readonly': True}, + 'copyright_holder': {'readonly': True}, + 'copyright_year': {'readonly': True}, + 'disclaimer': {'readonly': True}, + 'is_accessible_for_free': {'readonly': True}, + 'genre': {'readonly': True}, + 'is_family_friendly': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'display_text': {'readonly': True}, + 'query': {'readonly': True}, + 'search_kind': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'about': {'key': 'about', 'type': '[Thing]'}, + 'mentions': {'key': 'mentions', 'type': '[Thing]'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'creator': {'key': 'creator', 'type': 'Thing'}, + 'text': {'key': 'text', 'type': 'str'}, + 'discussion_url': {'key': 'discussionUrl', 'type': 'str'}, + 'comment_count': {'key': 'commentCount', 'type': 'int'}, + 'main_entity': {'key': 'mainEntity', 'type': 'Thing'}, + 'head_line': {'key': 'headLine', 'type': 'str'}, + 'copyright_holder': {'key': 'copyrightHolder', 'type': 'Thing'}, + 'copyright_year': {'key': 'copyrightYear', 'type': 'int'}, + 'disclaimer': {'key': 'disclaimer', 'type': 'str'}, + 'is_accessible_for_free': {'key': 'isAccessibleForFree', 'type': 'bool'}, + 'genre': {'key': 'genre', 'type': '[str]'}, + 'is_family_friendly': {'key': 'isFamilyFriendly', 'type': 'bool'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'query': {'key': 'query', 'type': 'str'}, + 'search_kind': {'key': 'searchKind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SearchAction, self).__init__(**kwargs) + self.display_text = None + self.query = None + self.search_kind = None + self._type = 'SearchAction' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action_py3.py new file mode 100644 index 000000000000..6de3ebb5f125 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action_py3.py @@ -0,0 +1,176 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .action_py3 import Action + + +class SearchAction(Action): + """SearchAction. + + 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + :ivar thumbnail_url: The URL to a thumbnail of the item. + :vartype thumbnail_url: str + :ivar about: For internal use only. + :vartype about: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar mentions: For internal use only. + :vartype mentions: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar provider: The source of the creative work. + :vartype provider: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar creator: + :vartype creator: ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar text: Text content of this creative work + :vartype text: str + :ivar discussion_url: + :vartype discussion_url: str + :ivar comment_count: + :vartype comment_count: int + :ivar main_entity: + :vartype main_entity: + ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar head_line: + :vartype head_line: str + :ivar copyright_holder: + :vartype copyright_holder: + ~azure.cognitiveservices.search.autosuggest.models.Thing + :ivar copyright_year: + :vartype copyright_year: int + :ivar disclaimer: + :vartype disclaimer: str + :ivar is_accessible_for_free: + :vartype is_accessible_for_free: bool + :ivar genre: + :vartype genre: list[str] + :ivar is_family_friendly: + :vartype is_family_friendly: bool + :ivar result: + :vartype result: + list[~azure.cognitiveservices.search.autosuggest.models.Thing] + :ivar display_name: + :vartype display_name: str + :ivar is_top_action: + :vartype is_top_action: bool + :ivar service_url: + :vartype service_url: str + :ivar display_text: + :vartype display_text: str + :ivar query: + :vartype query: str + :ivar search_kind: Possible values include: 'WebSearch', 'HistorySearch', + 'DocumentSearch', 'TagSearch', 'LocationSearch', 'CustomSearch'. Default + value: "WebSearch" . + :vartype search_kind: str or + ~azure.cognitiveservices.search.autosuggest.models.SearchKind + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'url': {'readonly': True}, + 'thumbnail_url': {'readonly': True}, + 'about': {'readonly': True}, + 'mentions': {'readonly': True}, + 'provider': {'readonly': True}, + 'creator': {'readonly': True}, + 'text': {'readonly': True}, + 'discussion_url': {'readonly': True}, + 'comment_count': {'readonly': True}, + 'main_entity': {'readonly': True}, + 'head_line': {'readonly': True}, + 'copyright_holder': {'readonly': True}, + 'copyright_year': {'readonly': True}, + 'disclaimer': {'readonly': True}, + 'is_accessible_for_free': {'readonly': True}, + 'genre': {'readonly': True}, + 'is_family_friendly': {'readonly': True}, + 'result': {'readonly': True}, + 'display_name': {'readonly': True}, + 'is_top_action': {'readonly': True}, + 'service_url': {'readonly': True}, + 'display_text': {'readonly': True}, + 'query': {'readonly': True}, + 'search_kind': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + 'thumbnail_url': {'key': 'thumbnailUrl', 'type': 'str'}, + 'about': {'key': 'about', 'type': '[Thing]'}, + 'mentions': {'key': 'mentions', 'type': '[Thing]'}, + 'provider': {'key': 'provider', 'type': '[Thing]'}, + 'creator': {'key': 'creator', 'type': 'Thing'}, + 'text': {'key': 'text', 'type': 'str'}, + 'discussion_url': {'key': 'discussionUrl', 'type': 'str'}, + 'comment_count': {'key': 'commentCount', 'type': 'int'}, + 'main_entity': {'key': 'mainEntity', 'type': 'Thing'}, + 'head_line': {'key': 'headLine', 'type': 'str'}, + 'copyright_holder': {'key': 'copyrightHolder', 'type': 'Thing'}, + 'copyright_year': {'key': 'copyrightYear', 'type': 'int'}, + 'disclaimer': {'key': 'disclaimer', 'type': 'str'}, + 'is_accessible_for_free': {'key': 'isAccessibleForFree', 'type': 'bool'}, + 'genre': {'key': 'genre', 'type': '[str]'}, + 'is_family_friendly': {'key': 'isFamilyFriendly', 'type': 'bool'}, + 'result': {'key': 'result', 'type': '[Thing]'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'is_top_action': {'key': 'isTopAction', 'type': 'bool'}, + 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + 'display_text': {'key': 'displayText', 'type': 'str'}, + 'query': {'key': 'query', 'type': 'str'}, + 'search_kind': {'key': 'searchKind', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SearchAction, self).__init__(**kwargs) + self.display_text = None + self.query = None + self.search_kind = None + self._type = 'SearchAction' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer.py new file mode 100644 index 000000000000..4b83efd28ee0 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .answer import Answer + + +class SearchResultsAnswer(Answer): + """Defines a search result answer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Suggestions + + 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :ivar query_context: + :vartype query_context: + ~azure.cognitiveservices.search.autosuggest.models.QueryContext + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'query_context': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'query_context': {'key': 'queryContext', 'type': 'QueryContext'}, + } + + _subtype_map = { + '_type': {'Suggestions': 'Suggestions'} + } + + def __init__(self, **kwargs): + super(SearchResultsAnswer, self).__init__(**kwargs) + self.query_context = None + self._type = 'SearchResultsAnswer' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer_py3.py new file mode 100644 index 000000000000..f6ac64f6175e --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .answer_py3 import Answer + + +class SearchResultsAnswer(Answer): + """Defines a search result answer. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: Suggestions + + 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :ivar query_context: + :vartype query_context: + ~azure.cognitiveservices.search.autosuggest.models.QueryContext + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'query_context': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'query_context': {'key': 'queryContext', 'type': 'QueryContext'}, + } + + _subtype_map = { + '_type': {'Suggestions': 'Suggestions'} + } + + def __init__(self, **kwargs) -> None: + super(SearchResultsAnswer, self).__init__(**kwargs) + self.query_context = None + self._type = 'SearchResultsAnswer' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions.py new file mode 100644 index 000000000000..70917bd93b66 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .search_results_answer import SearchResultsAnswer + + +class Suggestions(SearchResultsAnswer): + """Suggestions. + + 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :ivar query_context: + :vartype query_context: + ~azure.cognitiveservices.search.autosuggest.models.QueryContext + :param suggestion_groups: Required. + :type suggestion_groups: + list[~azure.cognitiveservices.search.autosuggest.models.SuggestionsSuggestionGroup] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'query_context': {'readonly': True}, + 'suggestion_groups': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'query_context': {'key': 'queryContext', 'type': 'QueryContext'}, + 'suggestion_groups': {'key': 'suggestionGroups', 'type': '[SuggestionsSuggestionGroup]'}, + } + + def __init__(self, **kwargs): + super(Suggestions, self).__init__(**kwargs) + self.suggestion_groups = kwargs.get('suggestion_groups', None) + self._type = 'Suggestions' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_py3.py new file mode 100644 index 000000000000..6ba4b88d734e --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_py3.py @@ -0,0 +1,78 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .search_results_answer_py3 import SearchResultsAnswer + + +class Suggestions(SearchResultsAnswer): + """Suggestions. + + 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :ivar query_context: + :vartype query_context: + ~azure.cognitiveservices.search.autosuggest.models.QueryContext + :param suggestion_groups: Required. + :type suggestion_groups: + list[~azure.cognitiveservices.search.autosuggest.models.SuggestionsSuggestionGroup] + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'query_context': {'readonly': True}, + 'suggestion_groups': {'required': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'query_context': {'key': 'queryContext', 'type': 'QueryContext'}, + 'suggestion_groups': {'key': 'suggestionGroups', 'type': '[SuggestionsSuggestionGroup]'}, + } + + def __init__(self, *, suggestion_groups, **kwargs) -> None: + super(Suggestions, self).__init__(**kwargs) + self.suggestion_groups = suggestion_groups + self._type = 'Suggestions' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group.py new file mode 100644 index 000000000000..53f6664e97bb --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SuggestionsSuggestionGroup(Model): + """SuggestionsSuggestionGroup. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Possible values include: 'Unknown', 'Web', + 'StoreApps', 'SearchHistory', 'PersonalSearchDocuments', + 'PersonalSearchTags', 'Custom'. Default value: "Unknown" . + :type name: str or + ~azure.cognitiveservices.search.autosuggest.models.ScenarioType + :param search_suggestions: Required. + :type search_suggestions: + list[~azure.cognitiveservices.search.autosuggest.models.SearchAction] + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + 'name': {'required': True}, + 'search_suggestions': {'required': True}, + '_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'search_suggestions': {'key': 'searchSuggestions', 'type': '[SearchAction]'}, + '_type': {'key': '_type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SuggestionsSuggestionGroup, self).__init__(**kwargs) + self.name = kwargs.get('name', "Unknown") + self.search_suggestions = kwargs.get('search_suggestions', None) + self._type = None diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group_py3.py new file mode 100644 index 000000000000..2044b1205239 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group_py3.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SuggestionsSuggestionGroup(Model): + """SuggestionsSuggestionGroup. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Possible values include: 'Unknown', 'Web', + 'StoreApps', 'SearchHistory', 'PersonalSearchDocuments', + 'PersonalSearchTags', 'Custom'. Default value: "Unknown" . + :type name: str or + ~azure.cognitiveservices.search.autosuggest.models.ScenarioType + :param search_suggestions: Required. + :type search_suggestions: + list[~azure.cognitiveservices.search.autosuggest.models.SearchAction] + :param _type: Required. Constant filled by server. + :type _type: str + """ + + _validation = { + 'name': {'required': True}, + 'search_suggestions': {'required': True}, + '_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'search_suggestions': {'key': 'searchSuggestions', 'type': '[SearchAction]'}, + '_type': {'key': '_type', 'type': 'str'}, + } + + def __init__(self, *, search_suggestions, name="Unknown", **kwargs) -> None: + super(SuggestionsSuggestionGroup, self).__init__(**kwargs) + self.name = name + self.search_suggestions = search_suggestions + self._type = None diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing.py new file mode 100644 index 000000000000..b038cbd242be --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .response import Response + + +class Thing(Response): + """Defines a 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'CreativeWork': 'CreativeWork'} + } + + def __init__(self, **kwargs): + super(Thing, self).__init__(**kwargs) + self.url = None + self._type = 'Thing' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing_py3.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing_py3.py new file mode 100644 index 000000000000..3afb326b9d15 --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing_py3.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .response_py3 import Response + + +class Thing(Response): + """Defines a 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. + + :param _type: Required. Constant filled by server. + :type _type: str + :ivar id: A String identifier. + :vartype id: str + :ivar read_link: The URL that returns this resource. + :vartype read_link: str + :ivar web_search_url: The URL To Bing's search result for this item. + :vartype web_search_url: str + :ivar potential_action: + :vartype potential_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar immediate_action: + :vartype immediate_action: + list[~azure.cognitiveservices.search.autosuggest.models.Action] + :ivar preferred_clickthrough_url: + :vartype preferred_clickthrough_url: str + :ivar adaptive_card: + :vartype adaptive_card: str + :ivar url: The URL to get more information about the thing represented by + this object. + :vartype url: str + """ + + _validation = { + '_type': {'required': True}, + 'id': {'readonly': True}, + 'read_link': {'readonly': True}, + 'web_search_url': {'readonly': True}, + 'potential_action': {'readonly': True}, + 'immediate_action': {'readonly': True}, + 'preferred_clickthrough_url': {'readonly': True}, + 'adaptive_card': {'readonly': True}, + 'url': {'readonly': True}, + } + + _attribute_map = { + '_type': {'key': '_type', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'read_link': {'key': 'readLink', 'type': 'str'}, + 'web_search_url': {'key': 'webSearchUrl', 'type': 'str'}, + 'potential_action': {'key': 'potentialAction', 'type': '[Action]'}, + 'immediate_action': {'key': 'immediateAction', 'type': '[Action]'}, + 'preferred_clickthrough_url': {'key': 'preferredClickthroughUrl', 'type': 'str'}, + 'adaptive_card': {'key': 'adaptiveCard', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + _subtype_map = { + '_type': {'CreativeWork': 'CreativeWork'} + } + + def __init__(self, **kwargs) -> None: + super(Thing, self).__init__(**kwargs) + self.url = None + self._type = 'Thing' diff --git a/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/version.py b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/version.py new file mode 100644 index 000000000000..63d89bfb54fa --- /dev/null +++ b/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0" +