Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ known_content_issues:
- ['sdk/servicebus/azure-servicebus/README.rst', '#4554']
- ['sdk/applicationinsights/azure-applicationinsights/README.rst', '#4554']
- ['sdk/batch/azure-batch/README.rst', '#4554']
- ['sdk/cognitiveservices/azure-cognitiveservices-personalizer/README.rst', '#4554']
- ['sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/README.rst', '#4554']
- ['sdk/cognitiveservices/azure-cognitiveservices-formrecognizer/README.rst', '#4554']
- ['sdk/cognitiveservices/azure-cognitiveservices-knowledge-qnamaker/README.rst', '#4554']
- ['sdk/cognitiveservices/azure-cognitiveservices-language-luis/README.rst', '#4554']
Expand All @@ -45,7 +47,6 @@ known_content_issues:
- ['sdk/loganalytics/azure-loganalytics/README.rst', '#4554']
- ['sdk/servicefabric/azure-servicefabric/README.rst', '#4554']
- ['sdk/core/azure-servicemanagement-legacy/README.rst', '#4554']
- ['sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/README.rst', '#4554']

# nspckg and common.
- ['sdk/cognitiveservices/azure-cognitiveservices-nspkg/README.rst', 'nspkg and common']
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:

Release History
===============

0.1.0 (2019-05-29)
++++++++++++++++++

* Initial Release
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
recursive-include tests *.py *.yaml
include *.rst
include azure/__init__.py
include azure/cognitiveservices/__init__.py

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure Personalizer Client Library.

This package has been tested with Python 2.7, 3.4, 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.


Usage
=====

For code examples, see `Personalizer
<https://docs.microsoft.com/python/api/overview/azure/>`__
on docs.microsoft.com.


Provide Feedback
================

If you encounter any bugs or have suggestions, please file an issue in the
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
section of the project.


.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-personalizer%2FREADME.png
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .personalizer_client import PersonalizerClient
from .version import VERSION

__all__ = ['PersonalizerClient']

__version__ = VERSION

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

try:
from .internal_error_py3 import InternalError
from .personalizer_error_py3 import PersonalizerError
from .error_response_py3 import ErrorResponse, ErrorResponseException
from .reward_request_py3 import RewardRequest
from .rankable_action_py3 import RankableAction
from .rank_request_py3 import RankRequest
from .ranked_action_py3 import RankedAction
from .rank_response_py3 import RankResponse
except (SyntaxError, ImportError):
from .internal_error import InternalError
from .personalizer_error import PersonalizerError
from .error_response import ErrorResponse, ErrorResponseException
from .reward_request import RewardRequest
from .rankable_action import RankableAction
from .rank_request import RankRequest
from .ranked_action import RankedAction
from .rank_response import RankResponse
from .personalizer_client_enums import (
ErrorCode,
)

__all__ = [
'InternalError',
'PersonalizerError',
'ErrorResponse', 'ErrorResponseException',
'RewardRequest',
'RankableAction',
'RankRequest',
'RankedAction',
'RankResponse',
'ErrorCode',
]
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.serialization import Model
from msrest.exceptions import HttpOperationError


class ErrorResponse(Model):
"""Used to return an error to the client.

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

:param error: Required. The error object.
:type error:
~azure.cognitiveservices.personalizer.models.PersonalizerError
"""

_validation = {
'error': {'required': True},
}

_attribute_map = {
'error': {'key': 'error', 'type': 'PersonalizerError'},
}

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


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
@@ -0,0 +1,48 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model
from msrest.exceptions import HttpOperationError


class ErrorResponse(Model):
"""Used to return an error to the client.

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

:param error: Required. The error object.
:type error:
~azure.cognitiveservices.personalizer.models.PersonalizerError
"""

_validation = {
'error': {'required': True},
}

_attribute_map = {
'error': {'key': 'error', 'type': 'PersonalizerError'},
}

def __init__(self, *, error, **kwargs) -> None:
super(ErrorResponse, self).__init__(**kwargs)
self.error = error


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
@@ -0,0 +1,34 @@
# 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 InternalError(Model):
"""An object containing more specific information than the parent object about
the error.

:param code: Detailed error code.
:type code: str
:param innererror: The error object.
:type innererror:
~azure.cognitiveservices.personalizer.models.InternalError
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'innererror': {'key': 'innererror', 'type': 'InternalError'},
}

def __init__(self, **kwargs):
super(InternalError, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.innererror = kwargs.get('innererror', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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 InternalError(Model):
"""An object containing more specific information than the parent object about
the error.

:param code: Detailed error code.
:type code: str
:param innererror: The error object.
:type innererror:
~azure.cognitiveservices.personalizer.models.InternalError
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'innererror': {'key': 'innererror', 'type': 'InternalError'},
}

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

from enum import Enum


class ErrorCode(str, Enum):

bad_request = "BadRequest" #: Request could not be understood by the server.
resource_not_found = "ResourceNotFound" #: Requested resource does not exist on the server.
internal_server_error = "InternalServerError" #: A generic error has occurred on the server.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class PersonalizerError(Model):
"""The error object.

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

:param code: Required. High level error code. Possible values include:
'BadRequest', 'ResourceNotFound', 'InternalServerError'
:type code: str or ~azure.cognitiveservices.personalizer.models.ErrorCode
:param message: Required. A message explaining the error reported by the
service.
:type message: str
:param target: Error source element.
:type target: str
:param details: An array of details about specific errors that led to this
reported error.
:type details:
list[~azure.cognitiveservices.personalizer.models.PersonalizerError]
:param inner_error: Finer error details.
:type inner_error:
~azure.cognitiveservices.personalizer.models.InternalError
"""

_validation = {
'code': {'required': True},
'message': {'required': True},
}

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
'details': {'key': 'details', 'type': '[PersonalizerError]'},
'inner_error': {'key': 'innerError', 'type': 'InternalError'},
}

def __init__(self, **kwargs):
super(PersonalizerError, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)
self.target = kwargs.get('target', None)
self.details = kwargs.get('details', None)
self.inner_error = kwargs.get('inner_error', None)
Loading