Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,26 @@
# regenerated.
# --------------------------------------------------------------------------

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
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
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,
ErrorCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class Answer(Response):
Variables are only populated by the server, and will be ignored when
sending a request.

:param _type: Constant filled by server.
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
Expand All @@ -32,10 +34,15 @@ class Answer(Response):
'id': {'readonly': True},
}

_attribute_map = {
'_type': {'key': '_type', 'type': 'str'},
'id': {'key': 'id', 'type': 'str'},
}

_subtype_map = {
'_type': {'SpellCheck': 'SpellCheck'}
}

def __init__(self):
super(Answer, self).__init__()
def __init__(self, **kwargs):
super(Answer, self).__init__(**kwargs)
self._type = 'Answer'
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 .response import Response


class Answer(Response):
"""Answer.

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

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': {'SpellCheck': 'SpellCheck'}
}

def __init__(self, **kwargs) -> None:
super(Answer, self).__init__(**kwargs)
self._type = 'Answer'
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ class Error(Model):
Variables are only populated by the server, and will be ignored when
sending a request.

:param code: The error code that identifies the category of error.
Possible values include: 'None', 'ServerError', 'InvalidRequest',
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
Expand All @@ -31,7 +33,7 @@ class Error(Model):
'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired'
:vartype sub_code: str or
~azure.cognitiveservices.language.spellcheck.models.ErrorSubCode
:param message: A description of the error.
:param message: Required. A description of the error.
:type message: str
:ivar more_details: A description that provides additional information
about the error.
Expand Down Expand Up @@ -60,11 +62,11 @@ class Error(Model):
'value': {'key': 'value', 'type': 'str'},
}

def __init__(self, message, code="None"):
super(Error, self).__init__()
self.code = code
def __init__(self, **kwargs):
super(Error, self).__init__(**kwargs)
self.code = kwargs.get('code', "None")
self.sub_code = None
self.message = message
self.message = kwargs.get('message', None)
self.more_details = None
self.parameter = None
self.value = None
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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.language.spellcheck.models.ErrorCode
:ivar sub_code: The error code that further helps to identify the error.
Possible values include: 'UnexpectedError', 'ResourceError',
'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue',
'HttpNotAllowed', 'Blocked', 'AuthorizationMissing',
'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired'
:vartype sub_code: str or
~azure.cognitiveservices.language.spellcheck.models.ErrorSubCode
: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
"""

_validation = {
'code': {'required': True},
'sub_code': {'readonly': True},
'message': {'required': True},
'more_details': {'readonly': True},
'parameter': {'readonly': True},
'value': {'readonly': True},
}

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'sub_code': {'key': 'subCode', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'more_details': {'key': 'moreDetails', 'type': 'str'},
'parameter': {'key': 'parameter', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
}

def __init__(self, *, message: str, code="None", **kwargs) -> None:
super(Error, self).__init__(**kwargs)
self.code = code
self.sub_code = None
self.message = message
self.more_details = None
self.parameter = None
self.value = None
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ class ErrorResponse(Response):
Variables are only populated by the server, and will be ignored when
sending a request.

:param _type: Constant filled by server.
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
:param errors: A list of errors that describe the reasons why the request
failed.
:param errors: Required. A list of errors that describe the reasons why
the request failed.
:type errors:
list[~azure.cognitiveservices.language.spellcheck.models.Error]
"""
Expand All @@ -41,9 +43,9 @@ class ErrorResponse(Response):
'errors': {'key': 'errors', 'type': '[Error]'},
}

def __init__(self, errors):
super(ErrorResponse, self).__init__()
self.errors = errors
def __init__(self, **kwargs):
super(ErrorResponse, self).__init__(**kwargs)
self.errors = kwargs.get('errors', None)
self._type = 'ErrorResponse'


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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
:param errors: Required. A list of errors that describe the reasons why
the request failed.
:type errors:
list[~azure.cognitiveservices.language.spellcheck.models.Error]
"""

_validation = {
'_type': {'required': True},
'id': {'readonly': True},
'errors': {'required': True},
}

_attribute_map = {
'_type': {'key': '_type', 'type': 'str'},
'id': {'key': 'id', '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)
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ class Identifiable(ResponseBase):
Variables are only populated by the server, and will be ignored when
sending a request.

:param _type: Constant filled by server.
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
Expand All @@ -41,7 +43,7 @@ class Identifiable(ResponseBase):
'_type': {'Response': 'Response'}
}

def __init__(self):
super(Identifiable, self).__init__()
def __init__(self, **kwargs):
super(Identifiable, self).__init__(**kwargs)
self.id = None
self._type = 'Identifiable'
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .response_base import ResponseBase


class Identifiable(ResponseBase):
"""Defines the identity of a resource.

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

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

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

:param _type: Required. Constant filled by server.
:type _type: str
:ivar id: A String identifier.
:vartype id: str
"""

_validation = {
'_type': {'required': True},
'id': {'readonly': True},
}

_attribute_map = {
'_type': {'key': '_type', 'type': 'str'},
'id': {'key': 'id', 'type': 'str'},
}

_subtype_map = {
'_type': {'Response': 'Response'}
}

def __init__(self, **kwargs) -> None:
super(Identifiable, self).__init__(**kwargs)
self.id = None
self._type = 'Identifiable'
Loading