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,232 @@
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 AccountUsageResponse
18
+ attr_accessor :api_key
19
+
20
+ attr_accessor :api_credits
21
+
22
+ attr_accessor :api_subscription
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'api_key' => :'apiKey',
28
+ :'api_credits' => :'apiCredits',
29
+ :'api_subscription' => :'apiSubscription'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'api_key' => :'String',
42
+ :'api_credits' => :'AccountUsageResponseApiCredits',
43
+ :'api_subscription' => :'AccountUsageResponseApiSubscription'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `WhoisFreaks::AccountUsageResponse` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `WhoisFreaks::AccountUsageResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'api_key')
69
+ self.api_key = attributes[:'api_key']
70
+ end
71
+
72
+ if attributes.key?(:'api_credits')
73
+ self.api_credits = attributes[:'api_credits']
74
+ end
75
+
76
+ if attributes.key?(:'api_subscription')
77
+ self.api_subscription = attributes[:'api_subscription']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ api_key == o.api_key &&
102
+ api_credits == o.api_credits &&
103
+ api_subscription == o.api_subscription
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [api_key, api_credits, api_subscription].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ transformed_hash = {}
125
+ openapi_types.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = nil
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
133
+ end
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
136
+ end
137
+ end
138
+ new(transformed_hash)
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def self._deserialize(type, value)
146
+ case type.to_sym
147
+ when :Time
148
+ Time.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ # models (e.g. Pet) or oneOf
179
+ klass = WhoisFreaks.const_get(type)
180
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+
232
+ end
@@ -0,0 +1,223 @@
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 AccountUsageResponseApiCredits
18
+ attr_accessor :total_credits
19
+
20
+ attr_accessor :served_request
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'total_credits' => :'totalCredits',
26
+ :'served_request' => :'servedRequest'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'total_credits' => :'Integer',
39
+ :'served_request' => :'Integer'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `WhoisFreaks::AccountUsageResponseApiCredits` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `WhoisFreaks::AccountUsageResponseApiCredits`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'total_credits')
65
+ self.total_credits = attributes[:'total_credits']
66
+ end
67
+
68
+ if attributes.key?(:'served_request')
69
+ self.served_request = attributes[:'served_request']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ total_credits == o.total_credits &&
94
+ served_request == o.served_request
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [total_credits, served_request].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ attributes = attributes.transform_keys(&:to_sym)
115
+ transformed_hash = {}
116
+ openapi_types.each_pair do |key, type|
117
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
118
+ transformed_hash["#{key}"] = nil
119
+ elsif type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
+ end
125
+ elsif !attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
+ end
128
+ end
129
+ new(transformed_hash)
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def self._deserialize(type, value)
137
+ case type.to_sym
138
+ when :Time
139
+ Time.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ # models (e.g. Pet) or oneOf
170
+ klass = WhoisFreaks.const_get(type)
171
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+
223
+ end
@@ -0,0 +1,250 @@
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 AccountUsageResponseApiSubscription
18
+ attr_accessor :subscription_status
19
+
20
+ attr_accessor :request_limit
21
+
22
+ attr_accessor :served_requests
23
+
24
+ attr_accessor :surcharge_request_limit
25
+
26
+ attr_accessor :served_surcharge_requests
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'subscription_status' => :'subscriptionStatus',
32
+ :'request_limit' => :'requestLimit',
33
+ :'served_requests' => :'servedRequests',
34
+ :'surcharge_request_limit' => :'surchargeRequestLimit',
35
+ :'served_surcharge_requests' => :'servedSurchargeRequests'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'subscription_status' => :'String',
48
+ :'request_limit' => :'Integer',
49
+ :'served_requests' => :'Integer',
50
+ :'surcharge_request_limit' => :'Integer',
51
+ :'served_surcharge_requests' => :'Integer'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `WhoisFreaks::AccountUsageResponseApiSubscription` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `WhoisFreaks::AccountUsageResponseApiSubscription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'subscription_status')
77
+ self.subscription_status = attributes[:'subscription_status']
78
+ end
79
+
80
+ if attributes.key?(:'request_limit')
81
+ self.request_limit = attributes[:'request_limit']
82
+ end
83
+
84
+ if attributes.key?(:'served_requests')
85
+ self.served_requests = attributes[:'served_requests']
86
+ end
87
+
88
+ if attributes.key?(:'surcharge_request_limit')
89
+ self.surcharge_request_limit = attributes[:'surcharge_request_limit']
90
+ end
91
+
92
+ if attributes.key?(:'served_surcharge_requests')
93
+ self.served_surcharge_requests = attributes[:'served_surcharge_requests']
94
+ end
95
+ end
96
+
97
+ # Show invalid properties with the reasons. Usually used together with valid?
98
+ # @return Array for valid properties with the reasons
99
+ def list_invalid_properties
100
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
101
+ invalid_properties = Array.new
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ warn '[DEPRECATED] the `valid?` method is obsolete'
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ subscription_status == o.subscription_status &&
118
+ request_limit == o.request_limit &&
119
+ served_requests == o.served_requests &&
120
+ surcharge_request_limit == o.surcharge_request_limit &&
121
+ served_surcharge_requests == o.served_surcharge_requests
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [subscription_status, request_limit, served_requests, surcharge_request_limit, served_surcharge_requests].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ transformed_hash = {}
143
+ openapi_types.each_pair do |key, type|
144
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[attribute_map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
+ end
152
+ elsif !attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
154
+ end
155
+ end
156
+ new(transformed_hash)
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def self._deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = WhoisFreaks.const_get(type)
198
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end