diff --git a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/__init__.py index bf825994f24c..3136ad1741fe 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .auto_suggest_search_api import AutoSuggestSearchAPI -from .version import VERSION +from ._configuration import AutoSuggestClientConfiguration +from ._auto_suggest_client import AutoSuggestClient +__all__ = ['AutoSuggestClient', 'AutoSuggestClientConfiguration'] -__all__ = ['AutoSuggestSearchAPI'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/_auto_suggest_client.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/_auto_suggest_client.py new file mode 100644 index 000000000000..0465cde19803 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/_auto_suggest_client.py @@ -0,0 +1,45 @@ +# 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 Serializer, Deserializer + +from ._configuration import AutoSuggestClientConfiguration +from .operations import AutoSuggestClientOperationsMixin +from . import models + + +class AutoSuggestClient(AutoSuggestClientOperationsMixin, SDKClient): + """Autosuggest supplies search terms derived from a root text sent to the service. The terms Autosuggest supplies are related to the root text based on similarity and their frequency or ratings of usefulness in other searches. For examples that show how to use Autosuggest, see [Search using AutoSuggest](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference). + + :ivar config: Configuration for client. + :vartype config: AutoSuggestClientConfiguration + + :param endpoint: Supported Cognitive Services endpoints (protocol and + hostname, for example: "https://westus.api.cognitive.microsoft.com", + "https://api.cognitive.microsoft.com"). + :type endpoint: str + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + """ + + def __init__( + self, endpoint, credentials): + + self.config = AutoSuggestClientConfiguration(endpoint, credentials) + super(AutoSuggestClient, 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) + diff --git a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/_configuration.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/_configuration.py new file mode 100644 index 000000000000..ea3667ae3168 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/_configuration.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 import Configuration + +from .version import VERSION + + +class AutoSuggestClientConfiguration(Configuration): + """Configuration for AutoSuggestClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Supported Cognitive Services endpoints (protocol and + hostname, for example: "https://westus.api.cognitive.microsoft.com", + "https://api.cognitive.microsoft.com"). + :type endpoint: str + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + """ + + def __init__( + self, endpoint, credentials): + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + base_url = '{Endpoint}/bing/v7.0' + + super(AutoSuggestClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-cognitiveservices-search-autosuggest/{}'.format(VERSION)) + + self.endpoint = endpoint + self.credentials = credentials diff --git a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/__init__.py index b6aa4ecdb7b4..26b42a338cc8 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/__init__.py @@ -10,58 +10,58 @@ # -------------------------------------------------------------------------- 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 + from ._models_py3 import Action + from ._models_py3 import Answer + from ._models_py3 import CreativeWork + from ._models_py3 import Error + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import Identifiable + from ._models_py3 import QueryContext + from ._models_py3 import Response + from ._models_py3 import ResponseBase + from ._models_py3 import SearchAction + from ._models_py3 import SearchResultsAnswer + from ._models_py3 import Suggestions + from ._models_py3 import SuggestionsSuggestionGroup + from ._models_py3 import Thing 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, + from ._models import Action + from ._models import Answer + from ._models import CreativeWork + from ._models import Error + from ._models import ErrorResponse, ErrorResponseException + from ._models import Identifiable + from ._models import QueryContext + from ._models import Response + from ._models import ResponseBase + from ._models import SearchAction + from ._models import SearchResultsAnswer + from ._models import Suggestions + from ._models import SuggestionsSuggestionGroup + from ._models import Thing +from ._auto_suggest_client_enums import ( ErrorCode, - SafeSearch, ResponseFormat, + SafeSearch, + ScenarioType, + SearchKind, ) __all__ = [ - 'SearchAction', - 'SuggestionsSuggestionGroup', - 'Suggestions', - 'QueryContext', - 'SearchResultsAnswer', - 'Answer', - 'Thing', 'Action', - 'Response', - 'Identifiable', + 'Answer', + 'CreativeWork', 'Error', 'ErrorResponse', 'ErrorResponseException', - 'CreativeWork', + 'Identifiable', + 'QueryContext', + 'Response', 'ResponseBase', + 'SearchAction', + 'SearchResultsAnswer', + 'Suggestions', + 'SuggestionsSuggestionGroup', + 'Thing', 'ScenarioType', 'SearchKind', 'ErrorCode', diff --git a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/auto_suggest_search_api_enums.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/_auto_suggest_client_enums.py similarity index 100% rename from sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/auto_suggest_search_api_enums.py rename to sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/_auto_suggest_client_enums.py diff --git a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/_models.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/_models.py new file mode 100644 index 000000000000..47fcfd22b39f --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/_models.py @@ -0,0 +1,1126 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +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 + + +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' + + +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' + + +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' + + +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' + + +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' + + +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' + + +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 + + +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) + + +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 + + +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' + + +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' + + +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' + + +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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/_models_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/_models_py3.py new file mode 100644 index 000000000000..3f66ed1bd2c5 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/_models_py3.py @@ -0,0 +1,1126 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +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 + + +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' + + +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' + + +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' + + +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' + + +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' + + +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' + + +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 + + +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) + + +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 + + +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' + + +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' + + +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' + + +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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action.py deleted file mode 100644 index ff895bae7599..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action.py +++ /dev/null @@ -1,169 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action_py3.py deleted file mode 100644 index 217252dd7513..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/action_py3.py +++ /dev/null @@ -1,169 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer.py deleted file mode 100644 index 8ea9f385b0dd..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer.py +++ /dev/null @@ -1,74 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer_py3.py deleted file mode 100644 index 479f4082fe3f..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/answer_py3.py +++ /dev/null @@ -1,74 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work.py deleted file mode 100644 index 720507c6d940..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work.py +++ /dev/null @@ -1,165 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work_py3.py deleted file mode 100644 index 90e84e224456..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/creative_work_py3.py +++ /dev/null @@ -1,165 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error.py deleted file mode 100644 index f7a3df3f63c1..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_py3.py deleted file mode 100644 index c950e0357056..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_py3.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response.py deleted file mode 100644 index e982eecd378a..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response.py +++ /dev/null @@ -1,87 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response_py3.py deleted file mode 100644 index 31a373aed294..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/error_response_py3.py +++ /dev/null @@ -1,87 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable.py deleted file mode 100644 index 513e53d238bb..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable_py3.py deleted file mode 100644 index 2d24a2c45775..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/identifiable_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context.py deleted file mode 100644 index 4f2f4e1f65b2..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context.py +++ /dev/null @@ -1,87 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context_py3.py deleted file mode 100644 index c1060119e27e..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/query_context_py3.py +++ /dev/null @@ -1,87 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response.py deleted file mode 100644 index 100175130e1f..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response.py +++ /dev/null @@ -1,81 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base.py deleted file mode 100644 index fd44632cfc0a..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base_py3.py deleted file mode 100644 index 680e0fe98ab4..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_base_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_py3.py deleted file mode 100644 index 3f3a1c0299bc..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/response_py3.py +++ /dev/null @@ -1,81 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action.py deleted file mode 100644 index 6775acc5d793..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action.py +++ /dev/null @@ -1,176 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action_py3.py deleted file mode 100644 index 6de3ebb5f125..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_action_py3.py +++ /dev/null @@ -1,176 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer.py deleted file mode 100644 index 4b83efd28ee0..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer_py3.py deleted file mode 100644 index f6ac64f6175e..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/search_results_answer_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions.py deleted file mode 100644 index 70917bd93b66..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_py3.py deleted file mode 100644 index 6ba4b88d734e..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_py3.py +++ /dev/null @@ -1,78 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group.py deleted file mode 100644 index 53f6664e97bb..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group_py3.py deleted file mode 100644 index 2044b1205239..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/suggestions_suggestion_group_py3.py +++ /dev/null @@ -1,48 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing.py deleted file mode 100644 index b038cbd242be..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing_py3.py deleted file mode 100644 index 3afb326b9d15..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/models/thing_py3.py +++ /dev/null @@ -1,80 +0,0 @@ -# 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/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/operations/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/operations/__init__.py new file mode 100644 index 000000000000..dc581bd0facd --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/operations/__init__.py @@ -0,0 +1,16 @@ +# 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_client_operations import AutoSuggestClientOperationsMixin + +__all__ = [ + 'AutoSuggestClientOperationsMixin', +] diff --git a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/auto_suggest_search_api.py b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/operations/_auto_suggest_client_operations.py similarity index 86% rename from sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/auto_suggest_search_api.py rename to sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/operations/_auto_suggest_client_operations.py index db81c44776f8..4575a6d32630 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/auto_suggest_search_api.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-search-autosuggest/azure/cognitiveservices/search/autosuggest/operations/_auto_suggest_client_operations.py @@ -9,69 +9,18 @@ # 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 +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) - +class AutoSuggestClientOperationsMixin(object): 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. + list of query 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 @@ -270,6 +219,10 @@ def auto_suggest( # Construct URL url = self.auto_suggest.metadata['url'] + path_format_arguments = { + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} @@ -287,7 +240,7 @@ def auto_suggest( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' 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') @@ -305,14 +258,13 @@ def auto_suggest( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, 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)