Coverage for fingerprint_pro_server_api_sdk/models/tampering_result.py: 54%

56 statements  

« prev     ^ index     » next       coverage.py v7.4.4, created at 2024-03-27 22:39 +0000

1# coding: utf-8 

2 

3""" 

4 Fingerprint Pro Server API 

5 

6 Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. # noqa: E501 

7 

8 OpenAPI spec version: 3 

9 Contact: support@fingerprint.com 

10 Generated by: https://github.com/swagger-api/swagger-codegen.git 

11""" 

12 

13import pprint 

14import re # noqa: F401 

15 

16import six 

17 

18class TamperingResult(object): 

19 """NOTE: This class is auto generated by the swagger code generator program. 

20 

21 Do not edit the class manually. 

22 """ 

23 """ 

24 Attributes: 

25 swagger_types (dict): The key is attribute name 

26 and the value is attribute type. 

27 attribute_map (dict): The key is attribute name 

28 and the value is json key in definition. 

29 """ 

30 swagger_types = { 

31 'result': 'bool', 

32 'anomaly_score': 'float' 

33 } 

34 

35 attribute_map = { 

36 'result': 'result', 

37 'anomaly_score': 'anomalyScore' 

38 } 

39 

40 def __init__(self, result=None, anomaly_score=None): # noqa: E501 

41 """TamperingResult - a model defined in Swagger""" # noqa: E501 

42 self._result = None 

43 self._anomaly_score = None 

44 self.discriminator = None 

45 self.result = result 

46 self.anomaly_score = anomaly_score 

47 

48 @property 

49 def result(self): 

50 """Gets the result of this TamperingResult. # noqa: E501 

51 

52 Flag indicating whether browser tampering was detected according to our internal thresholds. # noqa: E501 

53 

54 :return: The result of this TamperingResult. # noqa: E501 

55 :rtype: bool 

56 """ 

57 return self._result 

58 

59 @result.setter 

60 def result(self, result): 

61 """Sets the result of this TamperingResult. 

62 

63 Flag indicating whether browser tampering was detected according to our internal thresholds. # noqa: E501 

64 

65 :param result: The result of this TamperingResult. # noqa: E501 

66 :type: bool 

67 """ 

68 if result is None: 

69 raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 

70 

71 self._result = result 

72 

73 @property 

74 def anomaly_score(self): 

75 """Gets the anomaly_score of this TamperingResult. # noqa: E501 

76 

77 Confidence score (`0.0 - 1.0`) for the tampering detection. Values above `0.5` suggest that we're reasonably sure there was a tampering attempt. Values below `0.5` are genuine browsers. # noqa: E501 

78 

79 :return: The anomaly_score of this TamperingResult. # noqa: E501 

80 :rtype: float 

81 """ 

82 return self._anomaly_score 

83 

84 @anomaly_score.setter 

85 def anomaly_score(self, anomaly_score): 

86 """Sets the anomaly_score of this TamperingResult. 

87 

88 Confidence score (`0.0 - 1.0`) for the tampering detection. Values above `0.5` suggest that we're reasonably sure there was a tampering attempt. Values below `0.5` are genuine browsers. # noqa: E501 

89 

90 :param anomaly_score: The anomaly_score of this TamperingResult. # noqa: E501 

91 :type: float 

92 """ 

93 if anomaly_score is None: 

94 raise ValueError("Invalid value for `anomaly_score`, must not be `None`") # noqa: E501 

95 

96 self._anomaly_score = anomaly_score 

97 

98 def to_dict(self): 

99 """Returns the model properties as a dict""" 

100 result = {} 

101 

102 for attr, _ in six.iteritems(self.swagger_types): 

103 value = getattr(self, attr) 

104 if isinstance(value, list): 

105 result[attr] = list(map( 

106 lambda x: x.to_dict() if hasattr(x, "to_dict") else x, 

107 value 

108 )) 

109 elif hasattr(value, "to_dict"): 

110 result[attr] = value.to_dict() 

111 elif isinstance(value, dict): 

112 result[attr] = dict(map( 

113 lambda item: (item[0], item[1].to_dict()) 

114 if hasattr(item[1], "to_dict") else item, 

115 value.items() 

116 )) 

117 else: 

118 result[attr] = value 

119 if issubclass(TamperingResult, dict): 

120 for key, value in self.items(): 

121 result[key] = value 

122 

123 return result 

124 

125 def to_str(self): 

126 """Returns the string representation of the model""" 

127 return pprint.pformat(self.to_dict()) 

128 

129 def __repr__(self): 

130 """For `print` and `pprint`""" 

131 return self.to_str() 

132 

133 def __eq__(self, other): 

134 """Returns true if both objects are equal""" 

135 if not isinstance(other, TamperingResult): 

136 return False 

137 

138 return self.to_dict() == other.to_dict() 

139 

140 def __ne__(self, other): 

141 """Returns true if both objects are not equal""" 

142 if not isinstance(other, TamperingResult): 

143 return True 

144 

145 return self.to_dict() != other.to_dict()