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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from .personalizer_client import PersonalizerClient
from .version import VERSION

__all__ = ['PersonalizerClient']
__all__ = ["PersonalizerClient"]

__version__ = VERSION

Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@
)

__all__ = [
'InternalError',
'PersonalizerError',
'ErrorResponse', 'ErrorResponseException',
'RewardRequest',
'RankableAction',
'RankRequest',
'RankedAction',
'RankResponse',
'ErrorCode',
"InternalError",
"PersonalizerError",
"ErrorResponse",
"ErrorResponseException",
"RewardRequest",
"RankableAction",
"RankRequest",
"RankedAction",
"RankResponse",
"ErrorCode",
]
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ class ErrorResponse(Model):
"""

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

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

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


class ErrorResponseException(HttpOperationError):
Expand All @@ -45,4 +45,4 @@ class ErrorResponseException(HttpOperationError):

def __init__(self, deserialize, response, *args):

super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
super(ErrorResponseException, self).__init__(deserialize, response, "ErrorResponse", *args)
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class ErrorResponse(Model):
"""

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

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

def __init__(self, *, error, **kwargs) -> None:
Expand All @@ -45,4 +45,4 @@ class ErrorResponseException(HttpOperationError):

def __init__(self, deserialize, response, *args):

super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
super(ErrorResponseException, self).__init__(deserialize, response, "ErrorResponse", *args)
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class InternalError(Model):
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'innererror': {'key': 'innererror', 'type': 'InternalError'},
"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)
self.code = kwargs.get("code", None)
self.innererror = kwargs.get("innererror", None)
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class InternalError(Model):
"""

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

def __init__(self, *, code: str=None, innererror=None, **kwargs) -> None:
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
Expand Up @@ -35,22 +35,22 @@ class PersonalizerError(Model):
"""

_validation = {
'code': {'required': True},
'message': {'required': True},
"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'},
"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)
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)
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ class PersonalizerError(Model):
"""

_validation = {
'code': {'required': True},
'message': {'required': True},
"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'},
"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, *, code, message: str, target: str=None, details=None, inner_error=None, **kwargs) -> None:
def __init__(self, *, code, message: str, target: str = None, details=None, inner_error=None, **kwargs) -> None:
super(PersonalizerError, self).__init__(**kwargs)
self.code = code
self.message = message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ class RankRequest(Model):
"""

_validation = {
'actions': {'required': True},
'event_id': {'max_length': 256},
"actions": {"required": True},
"event_id": {"max_length": 256},
}

_attribute_map = {
'context_features': {'key': 'contextFeatures', 'type': '[object]'},
'actions': {'key': 'actions', 'type': '[RankableAction]'},
'excluded_actions': {'key': 'excludedActions', 'type': '[str]'},
'event_id': {'key': 'eventId', 'type': 'str'},
'defer_activation': {'key': 'deferActivation', 'type': 'bool'},
"context_features": {"key": "contextFeatures", "type": "[object]"},
"actions": {"key": "actions", "type": "[RankableAction]"},
"excluded_actions": {"key": "excludedActions", "type": "[str]"},
"event_id": {"key": "eventId", "type": "str"},
"defer_activation": {"key": "deferActivation", "type": "bool"},
}

def __init__(self, **kwargs):
super(RankRequest, self).__init__(**kwargs)
self.context_features = kwargs.get('context_features', None)
self.actions = kwargs.get('actions', None)
self.excluded_actions = kwargs.get('excluded_actions', None)
self.event_id = kwargs.get('event_id', None)
self.defer_activation = kwargs.get('defer_activation', False)
self.context_features = kwargs.get("context_features", None)
self.actions = kwargs.get("actions", None)
self.excluded_actions = kwargs.get("excluded_actions", None)
self.event_id = kwargs.get("event_id", None)
self.defer_activation = kwargs.get("defer_activation", False)
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,28 @@ class RankRequest(Model):
"""

_validation = {
'actions': {'required': True},
'event_id': {'max_length': 256},
"actions": {"required": True},
"event_id": {"max_length": 256},
}

_attribute_map = {
'context_features': {'key': 'contextFeatures', 'type': '[object]'},
'actions': {'key': 'actions', 'type': '[RankableAction]'},
'excluded_actions': {'key': 'excludedActions', 'type': '[str]'},
'event_id': {'key': 'eventId', 'type': 'str'},
'defer_activation': {'key': 'deferActivation', 'type': 'bool'},
"context_features": {"key": "contextFeatures", "type": "[object]"},
"actions": {"key": "actions", "type": "[RankableAction]"},
"excluded_actions": {"key": "excludedActions", "type": "[str]"},
"event_id": {"key": "eventId", "type": "str"},
"defer_activation": {"key": "deferActivation", "type": "bool"},
}

def __init__(self, *, actions, context_features=None, excluded_actions=None, event_id: str=None, defer_activation: bool=False, **kwargs) -> None:
def __init__(
self,
*,
actions,
context_features=None,
excluded_actions=None,
event_id: str = None,
defer_activation: bool = False,
**kwargs
) -> None:
super(RankRequest, self).__init__(**kwargs)
self.context_features = context_features
self.actions = actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ class RankResponse(Model):
"""

_validation = {
'ranking': {'readonly': True},
'event_id': {'readonly': True, 'max_length': 256},
'reward_action_id': {'readonly': True, 'max_length': 256},
"ranking": {"readonly": True},
"event_id": {"readonly": True, "max_length": 256},
"reward_action_id": {"readonly": True, "max_length": 256},
}

_attribute_map = {
'ranking': {'key': 'ranking', 'type': '[RankedAction]'},
'event_id': {'key': 'eventId', 'type': 'str'},
'reward_action_id': {'key': 'rewardActionId', 'type': 'str'},
"ranking": {"key": "ranking", "type": "[RankedAction]"},
"event_id": {"key": "eventId", "type": "str"},
"reward_action_id": {"key": "rewardActionId", "type": "str"},
}

def __init__(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ class RankResponse(Model):
"""

_validation = {
'ranking': {'readonly': True},
'event_id': {'readonly': True, 'max_length': 256},
'reward_action_id': {'readonly': True, 'max_length': 256},
"ranking": {"readonly": True},
"event_id": {"readonly": True, "max_length": 256},
"reward_action_id": {"readonly": True, "max_length": 256},
}

_attribute_map = {
'ranking': {'key': 'ranking', 'type': '[RankedAction]'},
'event_id': {'key': 'eventId', 'type': 'str'},
'reward_action_id': {'key': 'rewardActionId', 'type': 'str'},
"ranking": {"key": "ranking", "type": "[RankedAction]"},
"event_id": {"key": "eventId", "type": "str"},
"reward_action_id": {"key": "rewardActionId", "type": "str"},
}

def __init__(self, **kwargs) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ class RankableAction(Model):
"""

_validation = {
'id': {'required': True, 'max_length': 256},
'features': {'required': True},
"id": {"required": True, "max_length": 256},
"features": {"required": True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'features': {'key': 'features', 'type': '[object]'},
"id": {"key": "id", "type": "str"},
"features": {"key": "features", "type": "[object]"},
}

def __init__(self, **kwargs):
super(RankableAction, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.features = kwargs.get('features', None)
self.id = kwargs.get("id", None)
self.features = kwargs.get("features", None)
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ class RankableAction(Model):
"""

_validation = {
'id': {'required': True, 'max_length': 256},
'features': {'required': True},
"id": {"required": True, "max_length": 256},
"features": {"required": True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'features': {'key': 'features', 'type': '[object]'},
"id": {"key": "id", "type": "str"},
"features": {"key": "features", "type": "[object]"},
}

def __init__(self, *, id: str, features, **kwargs) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ class RankedAction(Model):
"""

_validation = {
'id': {'readonly': True, 'max_length': 256},
'probability': {'readonly': True, 'maximum': 1, 'minimum': 0},
"id": {"readonly": True, "max_length": 256},
"probability": {"readonly": True, "maximum": 1, "minimum": 0},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'probability': {'key': 'probability', 'type': 'float'},
"id": {"key": "id", "type": "str"},
"probability": {"key": "probability", "type": "float"},
}

def __init__(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ class RankedAction(Model):
"""

_validation = {
'id': {'readonly': True, 'max_length': 256},
'probability': {'readonly': True, 'maximum': 1, 'minimum': 0},
"id": {"readonly": True, "max_length": 256},
"probability": {"readonly": True, "maximum": 1, "minimum": 0},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'probability': {'key': 'probability', 'type': 'float'},
"id": {"key": "id", "type": "str"},
"probability": {"key": "probability", "type": "float"},
}

def __init__(self, **kwargs) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ class RewardRequest(Model):
"""

_validation = {
'value': {'required': True},
"value": {"required": True},
}

_attribute_map = {
'value': {'key': 'value', 'type': 'float'},
"value": {"key": "value", "type": "float"},
}

def __init__(self, **kwargs):
super(RewardRequest, self).__init__(**kwargs)
self.value = kwargs.get('value', None)
self.value = kwargs.get("value", None)
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class RewardRequest(Model):
"""

_validation = {
'value': {'required': True},
"value": {"required": True},
}

_attribute_map = {
'value': {'key': 'value', 'type': 'float'},
"value": {"key": "value", "type": "float"},
}

def __init__(self, *, value: float, **kwargs) -> None:
Expand Down
Loading