Skip to content

Commit

Permalink
[AutoPR cognitiveservices/data-plane/SpellCheck] Fix SpellCheck Swagg…
Browse files Browse the repository at this point in the history
…er Specification (#7048)

* Generated from 33d64b558114a9a861b82dc17518e359758d1688

Fix SpellCheck Swagger Specification

* Packaging update of azure-cognitiveservices-language-spellcheck
  • Loading branch information
AutorestCI authored Sep 12, 2019
1 parent 58857ae commit 842d37f
Show file tree
Hide file tree
Showing 29 changed files with 922 additions and 1,046 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Azure SDK for Python

This is the Microsoft Azure Cognitive Services Spellcheck Client Library.

This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
This package has been tested with Python 2.7, 3.5, 3.6 and 3.7.

For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
# regenerated.
# --------------------------------------------------------------------------

from .spell_check_api import SpellCheckAPI
from .version import VERSION
from ._configuration import SpellCheckClientConfiguration
from ._spell_check_client import SpellCheckClient
__all__ = ['SpellCheckClient', 'SpellCheckClientConfiguration']

__all__ = ['SpellCheckAPI']
from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -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 SpellCheckClientConfiguration(Configuration):
"""Configuration for SpellCheckClient
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(SpellCheckClientConfiguration, 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-language-spellcheck/{}'.format(VERSION))

self.endpoint = endpoint
self.credentials = credentials
Original file line number Diff line number Diff line change
@@ -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 SpellCheckClientConfiguration
from .operations import SpellCheckClientOperationsMixin
from . import models


class SpellCheckClient(SpellCheckClientOperationsMixin, SDKClient):
"""The Spell Check API - V7 lets you check a text string for spelling and grammar errors.
:ivar config: Configuration for client.
:vartype config: SpellCheckClientConfiguration
: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 = SpellCheckClientConfiguration(endpoint, credentials)
super(SpellCheckClient, 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)

Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,46 @@
# --------------------------------------------------------------------------

try:
from .spelling_token_suggestion_py3 import SpellingTokenSuggestion
from .spelling_flagged_token_py3 import SpellingFlaggedToken
from .spell_check_py3 import SpellCheck
from .answer_py3 import Answer
from .response_py3 import Response
from .identifiable_py3 import Identifiable
from .error_py3 import Error
from .error_response_py3 import ErrorResponse, ErrorResponseException
from .response_base_py3 import ResponseBase
from ._models_py3 import Answer
from ._models_py3 import Error
from ._models_py3 import ErrorResponse, ErrorResponseException
from ._models_py3 import Identifiable
from ._models_py3 import Response
from ._models_py3 import ResponseBase
from ._models_py3 import SpellCheck
from ._models_py3 import SpellingFlaggedToken
from ._models_py3 import SpellingTokenSuggestion
except (SyntaxError, ImportError):
from .spelling_token_suggestion import SpellingTokenSuggestion
from .spelling_flagged_token import SpellingFlaggedToken
from .spell_check import SpellCheck
from .answer import Answer
from .response import Response
from .identifiable import Identifiable
from .error import Error
from .error_response import ErrorResponse, ErrorResponseException
from .response_base import ResponseBase
from .spell_check_api_enums import (
ErrorType,
from ._models import Answer
from ._models import Error
from ._models import ErrorResponse, ErrorResponseException
from ._models import Identifiable
from ._models import Response
from ._models import ResponseBase
from ._models import SpellCheck
from ._models import SpellingFlaggedToken
from ._models import SpellingTokenSuggestion
from ._spell_check_client_enums import (
ActionType,
ErrorCode,
ErrorSubCode,
ActionType,
ErrorType,
Mode,
)

__all__ = [
'SpellingTokenSuggestion',
'SpellingFlaggedToken',
'SpellCheck',
'Answer',
'Response',
'Identifiable',
'Error',
'ErrorResponse', 'ErrorResponseException',
'Identifiable',
'Response',
'ResponseBase',
'SpellCheck',
'SpellingFlaggedToken',
'SpellingTokenSuggestion',
'ErrorType',
'ErrorCode',
'ErrorSubCode',
'ActionType',
'Mode',
]
Loading

0 comments on commit 842d37f

Please sign in to comment.