whoisfreaks 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +229 -0
  5. data/Rakefile +10 -0
  6. data/docs/ASNWHOISApi.md +85 -0
  7. data/docs/AccountApi.md +213 -0
  8. data/docs/AccountUsageResponse.md +22 -0
  9. data/docs/AccountUsageResponseApiCredits.md +20 -0
  10. data/docs/AccountUsageResponseApiSubscription.md +26 -0
  11. data/docs/AsnWhoisResponse.md +28 -0
  12. data/docs/AsnWhoisResponseAutNumsInner.md +26 -0
  13. data/docs/AsnWhoisResponseOrganization.md +24 -0
  14. data/docs/BulkDomainAvailabilityRequest.md +20 -0
  15. data/docs/BulkDomainAvailabilityV2Item.md +22 -0
  16. data/docs/BulkDomainAvailabilityV2Response.md +18 -0
  17. data/docs/BulkGeolocationRequest.md +18 -0
  18. data/docs/BulkWhois200Response.md +18 -0
  19. data/docs/BulkWhoisRequest.md +18 -0
  20. data/docs/Contact.md +38 -0
  21. data/docs/DNSApi.md +335 -0
  22. data/docs/DatabaseFileStatus.md +24 -0
  23. data/docs/DatabaseFileStatusNewlyValue.md +20 -0
  24. data/docs/DatabasesASNWHOISApi.md +153 -0
  25. data/docs/DatabasesDNSApi.md +235 -0
  26. data/docs/DatabasesExpiringDroppedApi.md +395 -0
  27. data/docs/DatabasesIPGeolocationApi.md +299 -0
  28. data/docs/DatabasesIPSecurityApi.md +153 -0
  29. data/docs/DatabasesIPWHOISApi.md +153 -0
  30. data/docs/DatabasesNewlyRegisteredApi.md +551 -0
  31. data/docs/DatabasesSubdomainsApi.md +235 -0
  32. data/docs/DatabasesWHOISApi.md +235 -0
  33. data/docs/DnsBulk200Response.md +18 -0
  34. data/docs/DnsBulkRequest.md +20 -0
  35. data/docs/DnsRecord.md +34 -0
  36. data/docs/DnsResponse.md +26 -0
  37. data/docs/DomainAvailabilityApi.md +169 -0
  38. data/docs/DomainAvailabilityV2Item.md +20 -0
  39. data/docs/DomainAvailabilityV2Response.md +18 -0
  40. data/docs/DomainReputationApi.md +85 -0
  41. data/docs/DomainReputationDgaFeatures.md +30 -0
  42. data/docs/DomainReputationDgaScore.md +26 -0
  43. data/docs/DomainReputationEvidenceSummary.md +18 -0
  44. data/docs/DomainReputationIndicators.md +34 -0
  45. data/docs/DomainReputationInput.md +18 -0
  46. data/docs/DomainReputationIntelligence.md +32 -0
  47. data/docs/DomainReputationPivotMatch.md +24 -0
  48. data/docs/DomainReputationRelatedIoc.md +22 -0
  49. data/docs/DomainReputationResponse.md +36 -0
  50. data/docs/DomainReputationRiskCategory.md +30 -0
  51. data/docs/DomainReputationSignal.md +28 -0
  52. data/docs/DomainReputationSignals.md +22 -0
  53. data/docs/DomainReputationTrustSignals.md +24 -0
  54. data/docs/ErrorResponse.md +26 -0
  55. data/docs/GeolocationApi.md +155 -0
  56. data/docs/GeolocationAsn.md +26 -0
  57. data/docs/GeolocationLocation.md +38 -0
  58. data/docs/GeolocationResponse.md +24 -0
  59. data/docs/GeolocationResponseCurrency.md +22 -0
  60. data/docs/GeolocationResponseNetwork.md +18 -0
  61. data/docs/HistoricalDnsResponse.md +24 -0
  62. data/docs/IPReputationApi.md +155 -0
  63. data/docs/IPWHOISApi.md +85 -0
  64. data/docs/IpReputationResponse.md +24 -0
  65. data/docs/IpReputationSecurity.md +42 -0
  66. data/docs/IpWhoisResponse.md +30 -0
  67. data/docs/IpWhoisResponseAbuseContactsInner.md +22 -0
  68. data/docs/IpWhoisResponseInetNumsInner.md +28 -0
  69. data/docs/IpWhoisResponseOrganization.md +26 -0
  70. data/docs/Registrar.md +30 -0
  71. data/docs/ReverseDnsResponse.md +24 -0
  72. data/docs/ReverseWhoisResponse.md +24 -0
  73. data/docs/SSLApi.md +89 -0
  74. data/docs/SnapshotStatus.md +26 -0
  75. data/docs/SslCertificate.md +34 -0
  76. data/docs/SslResponse.md +22 -0
  77. data/docs/Subdomain.md +24 -0
  78. data/docs/SubdomainsApi.md +93 -0
  79. data/docs/SubdomainsResponse.md +30 -0
  80. data/docs/TyposquattingApi.md +87 -0
  81. data/docs/TyposquattingDomain.md +26 -0
  82. data/docs/TyposquattingResponse.md +30 -0
  83. data/docs/WHOISApi.md +257 -0
  84. data/docs/WhoisHistoricalOrReverse200Response.md +49 -0
  85. data/docs/WhoisHistoricalResponse.md +24 -0
  86. data/docs/WhoisResponse.md +50 -0
  87. data/git_push.sh +57 -0
  88. data/lib/whoisfreaks/api/account_api.rb +207 -0
  89. data/lib/whoisfreaks/api/asnwhois_api.rb +100 -0
  90. data/lib/whoisfreaks/api/databases_asnwhois_api.rb +157 -0
  91. data/lib/whoisfreaks/api/databases_dns_api.rb +223 -0
  92. data/lib/whoisfreaks/api/databases_expiring_dropped_api.rb +377 -0
  93. data/lib/whoisfreaks/api/databases_ip_geolocation_api.rb +292 -0
  94. data/lib/whoisfreaks/api/databases_ip_security_api.rb +157 -0
  95. data/lib/whoisfreaks/api/databases_ipwhois_api.rb +157 -0
  96. data/lib/whoisfreaks/api/databases_newly_registered_api.rb +517 -0
  97. data/lib/whoisfreaks/api/databases_subdomains_api.rb +223 -0
  98. data/lib/whoisfreaks/api/databases_whois_api.rb +223 -0
  99. data/lib/whoisfreaks/api/dns_api.rb +379 -0
  100. data/lib/whoisfreaks/api/domain_availability_api.rb +199 -0
  101. data/lib/whoisfreaks/api/domain_reputation_api.rb +100 -0
  102. data/lib/whoisfreaks/api/geolocation_api.rb +168 -0
  103. data/lib/whoisfreaks/api/ip_reputation_api.rb +168 -0
  104. data/lib/whoisfreaks/api/ipwhois_api.rb +100 -0
  105. data/lib/whoisfreaks/api/ssl_api.rb +106 -0
  106. data/lib/whoisfreaks/api/subdomains_api.rb +116 -0
  107. data/lib/whoisfreaks/api/typosquatting_api.rb +95 -0
  108. data/lib/whoisfreaks/api/whois_api.rb +293 -0
  109. data/lib/whoisfreaks/api_client.rb +437 -0
  110. data/lib/whoisfreaks/api_error.rb +58 -0
  111. data/lib/whoisfreaks/configuration.rb +588 -0
  112. data/lib/whoisfreaks/models/account_usage_response.rb +232 -0
  113. data/lib/whoisfreaks/models/account_usage_response_api_credits.rb +223 -0
  114. data/lib/whoisfreaks/models/account_usage_response_api_subscription.rb +250 -0
  115. data/lib/whoisfreaks/models/asn_whois_response.rb +261 -0
  116. data/lib/whoisfreaks/models/asn_whois_response_aut_nums_inner.rb +252 -0
  117. data/lib/whoisfreaks/models/asn_whois_response_organization.rb +243 -0
  118. data/lib/whoisfreaks/models/bulk_domain_availability_request.rb +268 -0
  119. data/lib/whoisfreaks/models/bulk_domain_availability_v2_item.rb +268 -0
  120. data/lib/whoisfreaks/models/bulk_domain_availability_v2_response.rb +217 -0
  121. data/lib/whoisfreaks/models/bulk_geolocation_request.rb +242 -0
  122. data/lib/whoisfreaks/models/bulk_whois200_response.rb +216 -0
  123. data/lib/whoisfreaks/models/bulk_whois_request.rb +242 -0
  124. data/lib/whoisfreaks/models/contact.rb +304 -0
  125. data/lib/whoisfreaks/models/database_file_status.rb +243 -0
  126. data/lib/whoisfreaks/models/database_file_status_newly_value.rb +223 -0
  127. data/lib/whoisfreaks/models/dns_bulk200_response.rb +216 -0
  128. data/lib/whoisfreaks/models/dns_bulk_request.rb +227 -0
  129. data/lib/whoisfreaks/models/dns_record.rb +286 -0
  130. data/lib/whoisfreaks/models/dns_response.rb +254 -0
  131. data/lib/whoisfreaks/models/domain_availability_v2_item.rb +260 -0
  132. data/lib/whoisfreaks/models/domain_availability_v2_response.rb +217 -0
  133. data/lib/whoisfreaks/models/domain_reputation_dga_features.rb +268 -0
  134. data/lib/whoisfreaks/models/domain_reputation_dga_score.rb +312 -0
  135. data/lib/whoisfreaks/models/domain_reputation_evidence_summary.rb +216 -0
  136. data/lib/whoisfreaks/models/domain_reputation_indicators.rb +286 -0
  137. data/lib/whoisfreaks/models/domain_reputation_input.rb +215 -0
  138. data/lib/whoisfreaks/models/domain_reputation_intelligence.rb +317 -0
  139. data/lib/whoisfreaks/models/domain_reputation_pivot_match.rb +304 -0
  140. data/lib/whoisfreaks/models/domain_reputation_related_ioc.rb +294 -0
  141. data/lib/whoisfreaks/models/domain_reputation_response.rb +297 -0
  142. data/lib/whoisfreaks/models/domain_reputation_risk_category.rb +349 -0
  143. data/lib/whoisfreaks/models/domain_reputation_signal.rb +333 -0
  144. data/lib/whoisfreaks/models/domain_reputation_signals.rb +238 -0
  145. data/lib/whoisfreaks/models/domain_reputation_trust_signals.rb +303 -0
  146. data/lib/whoisfreaks/models/error_response.rb +250 -0
  147. data/lib/whoisfreaks/models/geolocation_asn.rb +250 -0
  148. data/lib/whoisfreaks/models/geolocation_location.rb +304 -0
  149. data/lib/whoisfreaks/models/geolocation_response.rb +241 -0
  150. data/lib/whoisfreaks/models/geolocation_response_currency.rb +232 -0
  151. data/lib/whoisfreaks/models/geolocation_response_network.rb +214 -0
  152. data/lib/whoisfreaks/models/historical_dns_response.rb +243 -0
  153. data/lib/whoisfreaks/models/ip_reputation_response.rb +241 -0
  154. data/lib/whoisfreaks/models/ip_reputation_security.rb +322 -0
  155. data/lib/whoisfreaks/models/ip_whois_response.rb +272 -0
  156. data/lib/whoisfreaks/models/ip_whois_response_abuse_contacts_inner.rb +234 -0
  157. data/lib/whoisfreaks/models/ip_whois_response_inet_nums_inner.rb +261 -0
  158. data/lib/whoisfreaks/models/ip_whois_response_organization.rb +252 -0
  159. data/lib/whoisfreaks/models/registrar.rb +268 -0
  160. data/lib/whoisfreaks/models/reverse_dns_response.rb +243 -0
  161. data/lib/whoisfreaks/models/reverse_whois_response.rb +243 -0
  162. data/lib/whoisfreaks/models/snapshot_status.rb +250 -0
  163. data/lib/whoisfreaks/models/ssl_certificate.rb +320 -0
  164. data/lib/whoisfreaks/models/ssl_response.rb +234 -0
  165. data/lib/whoisfreaks/models/subdomain.rb +241 -0
  166. data/lib/whoisfreaks/models/subdomains_response.rb +270 -0
  167. data/lib/whoisfreaks/models/typosquatting_domain.rb +250 -0
  168. data/lib/whoisfreaks/models/typosquatting_response.rb +270 -0
  169. data/lib/whoisfreaks/models/whois_historical_or_reverse200_response.rb +105 -0
  170. data/lib/whoisfreaks/models/whois_historical_response.rb +277 -0
  171. data/lib/whoisfreaks/models/whois_response.rb +362 -0
  172. data/lib/whoisfreaks/version.rb +15 -0
  173. data/lib/whoisfreaks.rb +120 -0
  174. data/spec/api/account_api_spec.rb +70 -0
  175. data/spec/api/asnwhois_api_spec.rb +49 -0
  176. data/spec/api/databases_asnwhois_api_spec.rb +60 -0
  177. data/spec/api/databases_dns_api_spec.rb +74 -0
  178. data/spec/api/databases_expiring_dropped_api_spec.rb +104 -0
  179. data/spec/api/databases_ip_geolocation_api_spec.rb +85 -0
  180. data/spec/api/databases_ip_security_api_spec.rb +60 -0
  181. data/spec/api/databases_ipwhois_api_spec.rb +60 -0
  182. data/spec/api/databases_newly_registered_api_spec.rb +132 -0
  183. data/spec/api/databases_subdomains_api_spec.rb +74 -0
  184. data/spec/api/databases_whois_api_spec.rb +74 -0
  185. data/spec/api/dns_api_spec.rb +99 -0
  186. data/spec/api/domain_availability_api_spec.rb +66 -0
  187. data/spec/api/domain_reputation_api_spec.rb +49 -0
  188. data/spec/api/geolocation_api_spec.rb +61 -0
  189. data/spec/api/ip_reputation_api_spec.rb +61 -0
  190. data/spec/api/ipwhois_api_spec.rb +49 -0
  191. data/spec/api/ssl_api_spec.rb +51 -0
  192. data/spec/api/subdomains_api_spec.rb +53 -0
  193. data/spec/api/typosquatting_api_spec.rb +50 -0
  194. data/spec/api/whois_api_spec.rb +85 -0
  195. data/spec/models/account_usage_response_api_credits_spec.rb +42 -0
  196. data/spec/models/account_usage_response_api_subscription_spec.rb +60 -0
  197. data/spec/models/account_usage_response_spec.rb +48 -0
  198. data/spec/models/asn_whois_response_aut_nums_inner_spec.rb +60 -0
  199. data/spec/models/asn_whois_response_organization_spec.rb +54 -0
  200. data/spec/models/asn_whois_response_spec.rb +66 -0
  201. data/spec/models/bulk_domain_availability_request_spec.rb +42 -0
  202. data/spec/models/bulk_domain_availability_v2_item_spec.rb +52 -0
  203. data/spec/models/bulk_domain_availability_v2_response_spec.rb +36 -0
  204. data/spec/models/bulk_geolocation_request_spec.rb +36 -0
  205. data/spec/models/bulk_whois200_response_spec.rb +36 -0
  206. data/spec/models/bulk_whois_request_spec.rb +36 -0
  207. data/spec/models/contact_spec.rb +96 -0
  208. data/spec/models/database_file_status_newly_value_spec.rb +42 -0
  209. data/spec/models/database_file_status_spec.rb +54 -0
  210. data/spec/models/dns_bulk200_response_spec.rb +36 -0
  211. data/spec/models/dns_bulk_request_spec.rb +42 -0
  212. data/spec/models/dns_record_spec.rb +84 -0
  213. data/spec/models/dns_response_spec.rb +60 -0
  214. data/spec/models/domain_availability_v2_item_spec.rb +46 -0
  215. data/spec/models/domain_availability_v2_response_spec.rb +36 -0
  216. data/spec/models/domain_reputation_dga_features_spec.rb +72 -0
  217. data/spec/models/domain_reputation_dga_score_spec.rb +64 -0
  218. data/spec/models/domain_reputation_evidence_summary_spec.rb +36 -0
  219. data/spec/models/domain_reputation_indicators_spec.rb +84 -0
  220. data/spec/models/domain_reputation_input_spec.rb +36 -0
  221. data/spec/models/domain_reputation_intelligence_spec.rb +82 -0
  222. data/spec/models/domain_reputation_pivot_match_spec.rb +58 -0
  223. data/spec/models/domain_reputation_related_ioc_spec.rb +52 -0
  224. data/spec/models/domain_reputation_response_spec.rb +90 -0
  225. data/spec/models/domain_reputation_risk_category_spec.rb +80 -0
  226. data/spec/models/domain_reputation_signal_spec.rb +74 -0
  227. data/spec/models/domain_reputation_signals_spec.rb +48 -0
  228. data/spec/models/domain_reputation_trust_signals_spec.rb +58 -0
  229. data/spec/models/error_response_spec.rb +60 -0
  230. data/spec/models/geolocation_asn_spec.rb +60 -0
  231. data/spec/models/geolocation_location_spec.rb +96 -0
  232. data/spec/models/geolocation_response_currency_spec.rb +48 -0
  233. data/spec/models/geolocation_response_network_spec.rb +36 -0
  234. data/spec/models/geolocation_response_spec.rb +54 -0
  235. data/spec/models/historical_dns_response_spec.rb +54 -0
  236. data/spec/models/ip_reputation_response_spec.rb +54 -0
  237. data/spec/models/ip_reputation_security_spec.rb +108 -0
  238. data/spec/models/ip_whois_response_abuse_contacts_inner_spec.rb +48 -0
  239. data/spec/models/ip_whois_response_inet_nums_inner_spec.rb +66 -0
  240. data/spec/models/ip_whois_response_organization_spec.rb +60 -0
  241. data/spec/models/ip_whois_response_spec.rb +72 -0
  242. data/spec/models/registrar_spec.rb +72 -0
  243. data/spec/models/reverse_dns_response_spec.rb +54 -0
  244. data/spec/models/reverse_whois_response_spec.rb +54 -0
  245. data/spec/models/snapshot_status_spec.rb +60 -0
  246. data/spec/models/ssl_certificate_spec.rb +88 -0
  247. data/spec/models/ssl_response_spec.rb +48 -0
  248. data/spec/models/subdomain_spec.rb +54 -0
  249. data/spec/models/subdomains_response_spec.rb +72 -0
  250. data/spec/models/typosquatting_domain_spec.rb +60 -0
  251. data/spec/models/typosquatting_response_spec.rb +72 -0
  252. data/spec/models/whois_historical_or_reverse200_response_spec.rb +32 -0
  253. data/spec/models/whois_historical_response_spec.rb +58 -0
  254. data/spec/models/whois_response_spec.rb +132 -0
  255. data/spec/spec_helper.rb +111 -0
  256. data/whoisfreaks.gemspec +41 -0
  257. metadata +451 -0
@@ -0,0 +1,216 @@
1
+ =begin
2
+ #WhoisFreaks API
3
+
4
+ #Complete WhoisFreaks API — WHOIS, DNS, SSL, Geolocation, Typosquatting, IP Intelligence, Domain Reputation, and bulk database downloads. ## Authentication All requests require an `apiKey` query parameter. ## Resources - Docs: https://whoisfreaks.com/documentation - Billing: https://billing.whoisfreaks.com - Support: support@whoisfreaks.com
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@whoisfreaks.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module WhoisFreaks
17
+ class DomainReputationEvidenceSummary
18
+ attr_accessor :why_flagged
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'why_flagged' => :'why_flagged'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'why_flagged' => :'Array<String>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `WhoisFreaks::DomainReputationEvidenceSummary` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `WhoisFreaks::DomainReputationEvidenceSummary`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'why_flagged')
61
+ if (value = attributes[:'why_flagged']).is_a?(Array)
62
+ self.why_flagged = value
63
+ end
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ warn '[DEPRECATED] the `valid?` method is obsolete'
79
+ true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ why_flagged == o.why_flagged
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Integer] Hash code
98
+ def hash
99
+ [why_flagged].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def self.build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ attributes = attributes.transform_keys(&:to_sym)
108
+ transformed_hash = {}
109
+ openapi_types.each_pair do |key, type|
110
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
111
+ transformed_hash["#{key}"] = nil
112
+ elsif type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[attribute_map[key]].is_a?(Array)
116
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
117
+ end
118
+ elsif !attributes[attribute_map[key]].nil?
119
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
120
+ end
121
+ end
122
+ new(transformed_hash)
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def self._deserialize(type, value)
130
+ case type.to_sym
131
+ when :Time
132
+ Time.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :Boolean
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ # models (e.g. Pet) or oneOf
163
+ klass = WhoisFreaks.const_get(type)
164
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.openapi_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+
214
+ end
215
+
216
+ end
@@ -0,0 +1,286 @@
1
+ =begin
2
+ #WhoisFreaks API
3
+
4
+ #Complete WhoisFreaks API — WHOIS, DNS, SSL, Geolocation, Typosquatting, IP Intelligence, Domain Reputation, and bulk database downloads. ## Authentication All requests require an `apiKey` query parameter. ## Resources - Docs: https://whoisfreaks.com/documentation - Billing: https://billing.whoisfreaks.com - Support: support@whoisfreaks.com
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@whoisfreaks.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module WhoisFreaks
17
+ class DomainReputationIndicators
18
+ attr_accessor :is_newly_registered
19
+
20
+ attr_accessor :uses_free_extension
21
+
22
+ attr_accessor :uses_free_ssl
23
+
24
+ attr_accessor :has_privacy_whois
25
+
26
+ attr_accessor :ssl_age_days
27
+
28
+ attr_accessor :has_dmarc
29
+
30
+ attr_accessor :has_spf
31
+
32
+ attr_accessor :domain_age_days
33
+
34
+ attr_accessor :registrar
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'is_newly_registered' => :'is_newly_registered',
40
+ :'uses_free_extension' => :'uses_free_extension',
41
+ :'uses_free_ssl' => :'uses_free_ssl',
42
+ :'has_privacy_whois' => :'has_privacy_whois',
43
+ :'ssl_age_days' => :'ssl_age_days',
44
+ :'has_dmarc' => :'has_dmarc',
45
+ :'has_spf' => :'has_spf',
46
+ :'domain_age_days' => :'domain_age_days',
47
+ :'registrar' => :'registrar'
48
+ }
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'is_newly_registered' => :'Boolean',
60
+ :'uses_free_extension' => :'Boolean',
61
+ :'uses_free_ssl' => :'Boolean',
62
+ :'has_privacy_whois' => :'Boolean',
63
+ :'ssl_age_days' => :'Integer',
64
+ :'has_dmarc' => :'Boolean',
65
+ :'has_spf' => :'Boolean',
66
+ :'domain_age_days' => :'Integer',
67
+ :'registrar' => :'String'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `WhoisFreaks::DomainReputationIndicators` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `WhoisFreaks::DomainReputationIndicators`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'is_newly_registered')
93
+ self.is_newly_registered = attributes[:'is_newly_registered']
94
+ end
95
+
96
+ if attributes.key?(:'uses_free_extension')
97
+ self.uses_free_extension = attributes[:'uses_free_extension']
98
+ end
99
+
100
+ if attributes.key?(:'uses_free_ssl')
101
+ self.uses_free_ssl = attributes[:'uses_free_ssl']
102
+ end
103
+
104
+ if attributes.key?(:'has_privacy_whois')
105
+ self.has_privacy_whois = attributes[:'has_privacy_whois']
106
+ end
107
+
108
+ if attributes.key?(:'ssl_age_days')
109
+ self.ssl_age_days = attributes[:'ssl_age_days']
110
+ end
111
+
112
+ if attributes.key?(:'has_dmarc')
113
+ self.has_dmarc = attributes[:'has_dmarc']
114
+ end
115
+
116
+ if attributes.key?(:'has_spf')
117
+ self.has_spf = attributes[:'has_spf']
118
+ end
119
+
120
+ if attributes.key?(:'domain_age_days')
121
+ self.domain_age_days = attributes[:'domain_age_days']
122
+ end
123
+
124
+ if attributes.key?(:'registrar')
125
+ self.registrar = attributes[:'registrar']
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
+ invalid_properties = Array.new
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ true
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ is_newly_registered == o.is_newly_registered &&
150
+ uses_free_extension == o.uses_free_extension &&
151
+ uses_free_ssl == o.uses_free_ssl &&
152
+ has_privacy_whois == o.has_privacy_whois &&
153
+ ssl_age_days == o.ssl_age_days &&
154
+ has_dmarc == o.has_dmarc &&
155
+ has_spf == o.has_spf &&
156
+ domain_age_days == o.domain_age_days &&
157
+ registrar == o.registrar
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(o)
163
+ self == o
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Integer] Hash code
168
+ def hash
169
+ [is_newly_registered, uses_free_extension, uses_free_ssl, has_privacy_whois, ssl_age_days, has_dmarc, has_spf, domain_age_days, registrar].hash
170
+ end
171
+
172
+ # Builds the object from hash
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ # @return [Object] Returns the model itself
175
+ def self.build_from_hash(attributes)
176
+ return nil unless attributes.is_a?(Hash)
177
+ attributes = attributes.transform_keys(&:to_sym)
178
+ transformed_hash = {}
179
+ openapi_types.each_pair do |key, type|
180
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
181
+ transformed_hash["#{key}"] = nil
182
+ elsif type =~ /\AArray<(.*)>/i
183
+ # check to ensure the input is an array given that the attribute
184
+ # is documented as an array but the input is not
185
+ if attributes[attribute_map[key]].is_a?(Array)
186
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
187
+ end
188
+ elsif !attributes[attribute_map[key]].nil?
189
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
190
+ end
191
+ end
192
+ new(transformed_hash)
193
+ end
194
+
195
+ # Deserializes the data based on type
196
+ # @param string type Data type
197
+ # @param string value Value to be deserialized
198
+ # @return [Object] Deserialized data
199
+ def self._deserialize(type, value)
200
+ case type.to_sym
201
+ when :Time
202
+ Time.parse(value)
203
+ when :Date
204
+ Date.parse(value)
205
+ when :String
206
+ value.to_s
207
+ when :Integer
208
+ value.to_i
209
+ when :Float
210
+ value.to_f
211
+ when :Boolean
212
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
213
+ true
214
+ else
215
+ false
216
+ end
217
+ when :Object
218
+ # generic object (usually a Hash), return directly
219
+ value
220
+ when /\AArray<(?<inner_type>.+)>\z/
221
+ inner_type = Regexp.last_match[:inner_type]
222
+ value.map { |v| _deserialize(inner_type, v) }
223
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
224
+ k_type = Regexp.last_match[:k_type]
225
+ v_type = Regexp.last_match[:v_type]
226
+ {}.tap do |hash|
227
+ value.each do |k, v|
228
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
229
+ end
230
+ end
231
+ else # model
232
+ # models (e.g. Pet) or oneOf
233
+ klass = WhoisFreaks.const_get(type)
234
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
235
+ end
236
+ end
237
+
238
+ # Returns the string representation of the object
239
+ # @return [String] String presentation of the object
240
+ def to_s
241
+ to_hash.to_s
242
+ end
243
+
244
+ # to_body is an alias to to_hash (backward compatibility)
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_body
247
+ to_hash
248
+ end
249
+
250
+ # Returns the object in the form of hash
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_hash
253
+ hash = {}
254
+ self.class.attribute_map.each_pair do |attr, param|
255
+ value = self.send(attr)
256
+ if value.nil?
257
+ is_nullable = self.class.openapi_nullable.include?(attr)
258
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
+ end
260
+
261
+ hash[param] = _to_hash(value)
262
+ end
263
+ hash
264
+ end
265
+
266
+ # Outputs non-array value in the form of hash
267
+ # For object, use to_hash. Otherwise, just return the value
268
+ # @param [Object] value Any valid value
269
+ # @return [Hash] Returns the value in the form of hash
270
+ def _to_hash(value)
271
+ if value.is_a?(Array)
272
+ value.compact.map { |v| _to_hash(v) }
273
+ elsif value.is_a?(Hash)
274
+ {}.tap do |hash|
275
+ value.each { |k, v| hash[k] = _to_hash(v) }
276
+ end
277
+ elsif value.respond_to? :to_hash
278
+ value.to_hash
279
+ else
280
+ value
281
+ end
282
+ end
283
+
284
+ end
285
+
286
+ end