Coverage for fingerprint_pro_server_api_sdk/models/asn.py: 58%

65 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 ASN(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 'asn': 'str', 

32 'network': 'str', 

33 'name': 'str' 

34 } 

35 

36 attribute_map = { 

37 'asn': 'asn', 

38 'network': 'network', 

39 'name': 'name' 

40 } 

41 

42 def __init__(self, asn=None, network=None, name=None): # noqa: E501 

43 """ASN - a model defined in Swagger""" # noqa: E501 

44 self._asn = None 

45 self._network = None 

46 self._name = None 

47 self.discriminator = None 

48 self.asn = asn 

49 self.network = network 

50 if name is not None: 

51 self.name = name 

52 

53 @property 

54 def asn(self): 

55 """Gets the asn of this ASN. # noqa: E501 

56 

57 

58 :return: The asn of this ASN. # noqa: E501 

59 :rtype: str 

60 """ 

61 return self._asn 

62 

63 @asn.setter 

64 def asn(self, asn): 

65 """Sets the asn of this ASN. 

66 

67 

68 :param asn: The asn of this ASN. # noqa: E501 

69 :type: str 

70 """ 

71 if asn is None: 

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

73 

74 self._asn = asn 

75 

76 @property 

77 def network(self): 

78 """Gets the network of this ASN. # noqa: E501 

79 

80 

81 :return: The network of this ASN. # noqa: E501 

82 :rtype: str 

83 """ 

84 return self._network 

85 

86 @network.setter 

87 def network(self, network): 

88 """Sets the network of this ASN. 

89 

90 

91 :param network: The network of this ASN. # noqa: E501 

92 :type: str 

93 """ 

94 if network is None: 

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

96 

97 self._network = network 

98 

99 @property 

100 def name(self): 

101 """Gets the name of this ASN. # noqa: E501 

102 

103 

104 :return: The name of this ASN. # noqa: E501 

105 :rtype: str 

106 """ 

107 return self._name 

108 

109 @name.setter 

110 def name(self, name): 

111 """Sets the name of this ASN. 

112 

113 

114 :param name: The name of this ASN. # noqa: E501 

115 :type: str 

116 """ 

117 

118 self._name = name 

119 

120 def to_dict(self): 

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

122 result = {} 

123 

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

125 value = getattr(self, attr) 

126 if isinstance(value, list): 

127 result[attr] = list(map( 

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

129 value 

130 )) 

131 elif hasattr(value, "to_dict"): 

132 result[attr] = value.to_dict() 

133 elif isinstance(value, dict): 

134 result[attr] = dict(map( 

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

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

137 value.items() 

138 )) 

139 else: 

140 result[attr] = value 

141 if issubclass(ASN, dict): 

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

143 result[key] = value 

144 

145 return result 

146 

147 def to_str(self): 

148 """Returns the string representation of the model""" 

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

150 

151 def __repr__(self): 

152 """For `print` and `pprint`""" 

153 return self.to_str() 

154 

155 def __eq__(self, other): 

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

157 if not isinstance(other, ASN): 

158 return False 

159 

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

161 

162 def __ne__(self, other): 

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

164 if not isinstance(other, ASN): 

165 return True 

166 

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