coinmarketcap_client 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -9
- data/docs/{Info.md → CryptocurrencyInfo.md} +2 -2
- data/docs/{InfoUrls.md → CryptocurrencyInfoUrls.md} +1 -1
- data/docs/{MarketData.md → CryptocurrencyListings.md} +1 -1
- data/docs/{Map.md → CryptocurrencyMap.md} +1 -1
- data/docs/DefaultApi.md +146 -22
- data/docs/GlobalMetricsHistoricalQuote.md +10 -0
- data/docs/GlobalMetricsQuote.md +10 -0
- data/docs/GlobalMetricsQuotesHistorical.md +10 -0
- data/docs/GlobalMetricsQuotesLatest.md +14 -0
- data/docs/InlineResponse200.md +1 -1
- data/docs/InlineResponse2001.md +1 -1
- data/docs/InlineResponse2002.md +1 -1
- data/docs/InlineResponse2003.md +1 -1
- data/docs/InlineResponse2004.md +1 -1
- data/docs/InlineResponse2004Data.md +8 -0
- data/docs/InlineResponse2005.md +1 -1
- data/docs/InlineResponse2006.md +9 -0
- data/docs/InlineResponse2007.md +9 -0
- data/docs/InlineResponse2008.md +9 -0
- data/docs/InlineResponse2009.md +9 -0
- data/docs/Quote.md +1 -1
- data/lib/coinmarketcap_client.rb +13 -4
- data/lib/coinmarketcap_client/api/default_api.rb +150 -26
- data/lib/coinmarketcap_client/models/{info.rb → cryptocurrency_info.rb} +2 -2
- data/lib/coinmarketcap_client/models/{info_urls.rb → cryptocurrency_info_urls.rb} +1 -1
- data/lib/coinmarketcap_client/models/{market_data.rb → cryptocurrency_listings.rb} +1 -1
- data/lib/coinmarketcap_client/models/{map.rb → cryptocurrency_map.rb} +1 -1
- data/lib/coinmarketcap_client/models/global_metrics_historical_quote.rb +202 -0
- data/lib/coinmarketcap_client/models/global_metrics_quote.rb +202 -0
- data/lib/{coinmarketcap_api/models/inline_response_200_3.rb → coinmarketcap_client/models/global_metrics_quotes_historical.rb} +30 -11
- data/lib/{coinmarketcap_api/models/map.rb → coinmarketcap_client/models/global_metrics_quotes_latest.rb} +49 -55
- data/lib/coinmarketcap_client/models/inline_response_200.rb +1 -1
- data/lib/coinmarketcap_client/models/inline_response_200_1.rb +1 -1
- data/lib/coinmarketcap_client/models/inline_response_200_2.rb +1 -1
- data/lib/coinmarketcap_client/models/inline_response_200_3.rb +2 -4
- data/lib/coinmarketcap_client/models/inline_response_200_4.rb +2 -4
- data/lib/{coinmarketcap_api/models/inline_response_200_1.rb → coinmarketcap_client/models/inline_response_200_4_data.rb} +11 -11
- data/lib/coinmarketcap_client/models/inline_response_200_5.rb +1 -1
- data/lib/{coinmarketcap_api/models/inline_response_200_2.rb → coinmarketcap_client/models/inline_response_200_6.rb} +5 -5
- data/lib/{coinmarketcap_api/models/inline_response_200.rb → coinmarketcap_client/models/inline_response_200_7.rb} +4 -4
- data/lib/{coinmarketcap_api/models/inline_response_default_1.rb → coinmarketcap_client/models/inline_response_200_8.rb} +13 -4
- data/lib/{coinmarketcap_api/models/inline_response_default.rb → coinmarketcap_client/models/inline_response_200_9.rb} +13 -4
- data/lib/coinmarketcap_client/models/quote.rb +1 -1
- data/lib/coinmarketcap_client/version.rb +1 -1
- data/spec/api/default_api_spec.rb +71 -6
- data/spec/api_client_spec.rb +29 -29
- data/spec/configuration_spec.rb +3 -3
- data/spec/models/{info_spec.rb → cryptocurrency_info_spec.rb} +6 -6
- data/spec/models/{info_urls_spec.rb → cryptocurrency_info_urls_spec.rb} +6 -6
- data/spec/models/{market_data_spec.rb → cryptocurrency_listings_spec.rb} +6 -6
- data/spec/models/{map_spec.rb → cryptocurrency_map_spec.rb} +6 -6
- data/spec/models/global_metrics_historical_quote_spec.rb +53 -0
- data/spec/models/global_metrics_quote_spec.rb +53 -0
- data/spec/models/global_metrics_quotes_historical_spec.rb +53 -0
- data/spec/models/global_metrics_quotes_latest_spec.rb +77 -0
- data/spec/models/inline_response_200_1_spec.rb +9 -3
- data/spec/models/inline_response_200_2_spec.rb +3 -3
- data/spec/models/inline_response_200_3_spec.rb +9 -3
- data/spec/models/inline_response_200_4_data_spec.rb +41 -0
- data/spec/models/inline_response_200_4_spec.rb +3 -3
- data/spec/models/inline_response_200_5_spec.rb +3 -3
- data/spec/models/inline_response_200_6_spec.rb +47 -0
- data/spec/models/inline_response_200_7_spec.rb +47 -0
- data/spec/models/inline_response_200_8_spec.rb +47 -0
- data/spec/models/inline_response_200_9_spec.rb +47 -0
- data/spec/models/inline_response_200_spec.rb +3 -3
- data/spec/models/inline_response_default_1_spec.rb +3 -3
- data/spec/models/inline_response_default_spec.rb +3 -3
- data/spec/models/platform_spec.rb +3 -3
- data/spec/models/quote_spec.rb +3 -3
- data/spec/models/status_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -1
- metadata +54 -34
- data/lib/coinmarketcap_api.rb +0 -50
- data/lib/coinmarketcap_api/api/default_api.rb +0 -145
- data/lib/coinmarketcap_api/api_client.rb +0 -389
- data/lib/coinmarketcap_api/api_error.rb +0 -38
- data/lib/coinmarketcap_api/configuration.rb +0 -209
- data/lib/coinmarketcap_api/models/info.rb +0 -276
- data/lib/coinmarketcap_api/models/info_urls.rb +0 -263
- data/lib/coinmarketcap_api/models/status.rb +0 -219
- data/lib/coinmarketcap_api/version.rb +0 -15
@@ -1,219 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Coinmarketcap API Swagger Implementation
|
3
|
-
|
4
|
-
#Define coinmarketcap's api in swagger 2.0 openapi standard
|
5
|
-
|
6
|
-
OpenAPI spec version: 1.0.0
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.4
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
|
15
|
-
module CoinmarketcapAPI
|
16
|
-
class Status
|
17
|
-
attr_accessor :timestamp
|
18
|
-
|
19
|
-
attr_accessor :error_code
|
20
|
-
|
21
|
-
attr_accessor :error_message
|
22
|
-
|
23
|
-
attr_accessor :elapsed
|
24
|
-
|
25
|
-
attr_accessor :credit_count
|
26
|
-
|
27
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
-
def self.attribute_map
|
29
|
-
{
|
30
|
-
:'timestamp' => :'timestamp',
|
31
|
-
:'error_code' => :'error_code',
|
32
|
-
:'error_message' => :'error_message',
|
33
|
-
:'elapsed' => :'elapsed',
|
34
|
-
:'credit_count' => :'credit_count'
|
35
|
-
}
|
36
|
-
end
|
37
|
-
|
38
|
-
# Attribute type mapping.
|
39
|
-
def self.swagger_types
|
40
|
-
{
|
41
|
-
:'timestamp' => :'String',
|
42
|
-
:'error_code' => :'Integer',
|
43
|
-
:'error_message' => :'String',
|
44
|
-
:'elapsed' => :'Integer',
|
45
|
-
:'credit_count' => :'Integer'
|
46
|
-
}
|
47
|
-
end
|
48
|
-
|
49
|
-
# Initializes the object
|
50
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
-
def initialize(attributes = {})
|
52
|
-
return unless attributes.is_a?(Hash)
|
53
|
-
|
54
|
-
# convert string to symbol for hash key
|
55
|
-
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
56
|
-
|
57
|
-
if attributes.has_key?(:'timestamp')
|
58
|
-
self.timestamp = attributes[:'timestamp']
|
59
|
-
end
|
60
|
-
|
61
|
-
if attributes.has_key?(:'error_code')
|
62
|
-
self.error_code = attributes[:'error_code']
|
63
|
-
end
|
64
|
-
|
65
|
-
if attributes.has_key?(:'error_message')
|
66
|
-
self.error_message = attributes[:'error_message']
|
67
|
-
end
|
68
|
-
|
69
|
-
if attributes.has_key?(:'elapsed')
|
70
|
-
self.elapsed = attributes[:'elapsed']
|
71
|
-
end
|
72
|
-
|
73
|
-
if attributes.has_key?(:'credit_count')
|
74
|
-
self.credit_count = attributes[:'credit_count']
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
79
|
-
# @return Array for valid properties with the reasons
|
80
|
-
def list_invalid_properties
|
81
|
-
invalid_properties = Array.new
|
82
|
-
invalid_properties
|
83
|
-
end
|
84
|
-
|
85
|
-
# Check to see if the all the properties in the model are valid
|
86
|
-
# @return true if the model is valid
|
87
|
-
def valid?
|
88
|
-
true
|
89
|
-
end
|
90
|
-
|
91
|
-
# Checks equality by comparing each attribute.
|
92
|
-
# @param [Object] Object to be compared
|
93
|
-
def ==(o)
|
94
|
-
return true if self.equal?(o)
|
95
|
-
self.class == o.class &&
|
96
|
-
timestamp == o.timestamp &&
|
97
|
-
error_code == o.error_code &&
|
98
|
-
error_message == o.error_message &&
|
99
|
-
elapsed == o.elapsed &&
|
100
|
-
credit_count == o.credit_count
|
101
|
-
end
|
102
|
-
|
103
|
-
# @see the `==` method
|
104
|
-
# @param [Object] Object to be compared
|
105
|
-
def eql?(o)
|
106
|
-
self == o
|
107
|
-
end
|
108
|
-
|
109
|
-
# Calculates hash code according to all attributes.
|
110
|
-
# @return [Fixnum] Hash code
|
111
|
-
def hash
|
112
|
-
[timestamp, error_code, error_message, elapsed, credit_count].hash
|
113
|
-
end
|
114
|
-
|
115
|
-
# Builds the object from hash
|
116
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
-
# @return [Object] Returns the model itself
|
118
|
-
def build_from_hash(attributes)
|
119
|
-
return nil unless attributes.is_a?(Hash)
|
120
|
-
self.class.swagger_types.each_pair do |key, type|
|
121
|
-
if type =~ /\AArray<(.*)>/i
|
122
|
-
# check to ensure the input is an array given that the the attribute
|
123
|
-
# is documented as an array but the input is not
|
124
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
125
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
126
|
-
end
|
127
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
128
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
129
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
130
|
-
end
|
131
|
-
|
132
|
-
self
|
133
|
-
end
|
134
|
-
|
135
|
-
# Deserializes the data based on type
|
136
|
-
# @param string type Data type
|
137
|
-
# @param string value Value to be deserialized
|
138
|
-
# @return [Object] Deserialized data
|
139
|
-
def _deserialize(type, value)
|
140
|
-
case type.to_sym
|
141
|
-
when :DateTime
|
142
|
-
DateTime.parse(value)
|
143
|
-
when :Date
|
144
|
-
Date.parse(value)
|
145
|
-
when :String
|
146
|
-
value.to_s
|
147
|
-
when :Integer
|
148
|
-
value.to_i
|
149
|
-
when :Float
|
150
|
-
value.to_f
|
151
|
-
when :BOOLEAN
|
152
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
153
|
-
true
|
154
|
-
else
|
155
|
-
false
|
156
|
-
end
|
157
|
-
when :Object
|
158
|
-
# generic object (usually a Hash), return directly
|
159
|
-
value
|
160
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
161
|
-
inner_type = Regexp.last_match[:inner_type]
|
162
|
-
value.map { |v| _deserialize(inner_type, v) }
|
163
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
164
|
-
k_type = Regexp.last_match[:k_type]
|
165
|
-
v_type = Regexp.last_match[:v_type]
|
166
|
-
{}.tap do |hash|
|
167
|
-
value.each do |k, v|
|
168
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
169
|
-
end
|
170
|
-
end
|
171
|
-
else # model
|
172
|
-
temp_model = CoinmarketcapAPI.const_get(type).new
|
173
|
-
temp_model.build_from_hash(value)
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
# Returns the string representation of the object
|
178
|
-
# @return [String] String presentation of the object
|
179
|
-
def to_s
|
180
|
-
to_hash.to_s
|
181
|
-
end
|
182
|
-
|
183
|
-
# to_body is an alias to to_hash (backward compatibility)
|
184
|
-
# @return [Hash] Returns the object in the form of hash
|
185
|
-
def to_body
|
186
|
-
to_hash
|
187
|
-
end
|
188
|
-
|
189
|
-
# Returns the object in the form of hash
|
190
|
-
# @return [Hash] Returns the object in the form of hash
|
191
|
-
def to_hash
|
192
|
-
hash = {}
|
193
|
-
self.class.attribute_map.each_pair do |attr, param|
|
194
|
-
value = self.send(attr)
|
195
|
-
next if value.nil?
|
196
|
-
hash[param] = _to_hash(value)
|
197
|
-
end
|
198
|
-
hash
|
199
|
-
end
|
200
|
-
|
201
|
-
# Outputs non-array value in the form of hash
|
202
|
-
# For object, use to_hash. Otherwise, just return the value
|
203
|
-
# @param [Object] value Any valid value
|
204
|
-
# @return [Hash] Returns the value in the form of hash
|
205
|
-
def _to_hash(value)
|
206
|
-
if value.is_a?(Array)
|
207
|
-
value.compact.map { |v| _to_hash(v) }
|
208
|
-
elsif value.is_a?(Hash)
|
209
|
-
{}.tap do |hash|
|
210
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
211
|
-
end
|
212
|
-
elsif value.respond_to? :to_hash
|
213
|
-
value.to_hash
|
214
|
-
else
|
215
|
-
value
|
216
|
-
end
|
217
|
-
end
|
218
|
-
end
|
219
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Coinmarketcap API Swagger Implementation
|
3
|
-
|
4
|
-
#Define coinmarketcap's api in swagger 2.0 openapi standard
|
5
|
-
|
6
|
-
OpenAPI spec version: 1.0.0
|
7
|
-
|
8
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.4
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
module CoinmarketcapAPI
|
14
|
-
VERSION = '1.0.0'
|
15
|
-
end
|