Coverage for fingerprint_pro_server_api_sdk/models/botd_detection_result.py: 55%

58 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 BotdDetectionResult(object): 

19 """ 

20 Stores bot detection result 

21 

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

23 

24 Do not edit the class manually. 

25 """ 

26 """ 

27 Attributes: 

28 swagger_types (dict): The key is attribute name 

29 and the value is attribute type. 

30 attribute_map (dict): The key is attribute name 

31 and the value is json key in definition. 

32 """ 

33 swagger_types = { 

34 'result': 'str', 

35 'type': 'str' 

36 } 

37 

38 attribute_map = { 

39 'result': 'result', 

40 'type': 'type' 

41 } 

42 

43 def __init__(self, result=None, type=None): # noqa: E501 

44 """BotdDetectionResult - a model defined in Swagger""" # noqa: E501 

45 self._result = None 

46 self._type = None 

47 self.discriminator = None 

48 self.result = result 

49 if type is not None: 

50 self.type = type 

51 

52 @property 

53 def result(self): 

54 """Gets the result of this BotdDetectionResult. # noqa: E501 

55 

56 Bot detection result: * `notDetected` - the visitor is not a bot * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on # noqa: E501 

57 

58 :return: The result of this BotdDetectionResult. # noqa: E501 

59 :rtype: str 

60 """ 

61 return self._result 

62 

63 @result.setter 

64 def result(self, result): 

65 """Sets the result of this BotdDetectionResult. 

66 

67 Bot detection result: * `notDetected` - the visitor is not a bot * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on # noqa: E501 

68 

69 :param result: The result of this BotdDetectionResult. # noqa: E501 

70 :type: str 

71 """ 

72 if result is None: 

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

74 allowed_values = ["notDetected", "good", "bad"] # noqa: E501 

75 if (result not in allowed_values): 

76 raise ValueError( 

77 "Invalid value for `result` ({0}), must be one of {1}" # noqa: E501 

78 .format(result, allowed_values) 

79 ) 

80 

81 self._result = result 

82 

83 @property 

84 def type(self): 

85 """Gets the type of this BotdDetectionResult. # noqa: E501 

86 

87 

88 :return: The type of this BotdDetectionResult. # noqa: E501 

89 :rtype: str 

90 """ 

91 return self._type 

92 

93 @type.setter 

94 def type(self, type): 

95 """Sets the type of this BotdDetectionResult. 

96 

97 

98 :param type: The type of this BotdDetectionResult. # noqa: E501 

99 :type: str 

100 """ 

101 

102 self._type = type 

103 

104 def to_dict(self): 

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

106 result = {} 

107 

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

109 value = getattr(self, attr) 

110 if isinstance(value, list): 

111 result[attr] = list(map( 

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

113 value 

114 )) 

115 elif hasattr(value, "to_dict"): 

116 result[attr] = value.to_dict() 

117 elif isinstance(value, dict): 

118 result[attr] = dict(map( 

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

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

121 value.items() 

122 )) 

123 else: 

124 result[attr] = value 

125 if issubclass(BotdDetectionResult, dict): 

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

127 result[key] = value 

128 

129 return result 

130 

131 def to_str(self): 

132 """Returns the string representation of the model""" 

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

134 

135 def __repr__(self): 

136 """For `print` and `pprint`""" 

137 return self.to_str() 

138 

139 def __eq__(self, other): 

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

141 if not isinstance(other, BotdDetectionResult): 

142 return False 

143 

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

145 

146 def __ne__(self, other): 

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

148 if not isinstance(other, BotdDetectionResult): 

149 return True 

150 

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