devme-sdk-ruby 1.0.2

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 (51) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +8 -0
  3. data/Gemfile +9 -0
  4. data/Gemfile.lock +71 -0
  5. data/LICENSE.md +25 -0
  6. data/README.md +97 -0
  7. data/Rakefile +10 -0
  8. data/devme-sdk-ruby.gemspec +38 -0
  9. data/examples/app/.gitignore +198 -0
  10. data/examples/app/Gemfile +6 -0
  11. data/examples/app/Gemfile.lock +23 -0
  12. data/examples/app/test-api.rb +20 -0
  13. data/lib/devme-sdk-ruby/api/country_api.rb +178 -0
  14. data/lib/devme-sdk-ruby/api/currency_api.rb +333 -0
  15. data/lib/devme-sdk-ruby/api/domain_api.rb +81 -0
  16. data/lib/devme-sdk-ruby/api/email_api.rb +91 -0
  17. data/lib/devme-sdk-ruby/api/ip_api.rb +81 -0
  18. data/lib/devme-sdk-ruby/api/phone_api.rb +85 -0
  19. data/lib/devme-sdk-ruby/api/utils_api.rb +78 -0
  20. data/lib/devme-sdk-ruby/api_client.rb +390 -0
  21. data/lib/devme-sdk-ruby/api_error.rb +57 -0
  22. data/lib/devme-sdk-ruby/configuration.rb +285 -0
  23. data/lib/devme-sdk-ruby/models/convert_currency_out.rb +280 -0
  24. data/lib/devme-sdk-ruby/models/error.rb +251 -0
  25. data/lib/devme-sdk-ruby/models/get_country_details_out.rb +230 -0
  26. data/lib/devme-sdk-ruby/models/get_currency_details_out.rb +230 -0
  27. data/lib/devme-sdk-ruby/models/get_currency_exchange_rate_out.rb +250 -0
  28. data/lib/devme-sdk-ruby/models/get_domain_whois_out.rb +230 -0
  29. data/lib/devme-sdk-ruby/models/get_email_details_out.rb +290 -0
  30. data/lib/devme-sdk-ruby/models/get_ip_details_city_out.rb +260 -0
  31. data/lib/devme-sdk-ruby/models/get_ip_details_out.rb +269 -0
  32. data/lib/devme-sdk-ruby/models/get_phone_details_out.rb +270 -0
  33. data/lib/devme-sdk-ruby/models/http_error_out.rb +252 -0
  34. data/lib/devme-sdk-ruby/models/list_countries_item.rb +230 -0
  35. data/lib/devme-sdk-ruby/models/list_countries_out.rb +242 -0
  36. data/lib/devme-sdk-ruby/models/list_currencies_item.rb +314 -0
  37. data/lib/devme-sdk-ruby/models/list_currencies_out.rb +242 -0
  38. data/lib/devme-sdk-ruby/models/who_am_i_out.rb +264 -0
  39. data/lib/devme-sdk-ruby/version.rb +15 -0
  40. data/lib/devme-sdk-ruby.rb +62 -0
  41. data/spec/api/country_api_spec.rb +66 -0
  42. data/spec/api/currency_api_spec.rb +101 -0
  43. data/spec/api/domain_api_spec.rb +46 -0
  44. data/spec/api/email_api_spec.rb +48 -0
  45. data/spec/api/ip_api_spec.rb +53 -0
  46. data/spec/api/phone_api_spec.rb +46 -0
  47. data/spec/api/utils_api_spec.rb +45 -0
  48. data/spec/api_client_spec.rb +226 -0
  49. data/spec/configuration_spec.rb +42 -0
  50. data/spec/spec_helper.rb +111 -0
  51. metadata +146 -0
@@ -0,0 +1,178 @@
1
+ =begin
2
+ #DEV.ME API Documentation
3
+
4
+ #DEV.ME API Documentation [Currency Conversion and Exchange Rates API](https://dev.me/products/currency) - [IP2Location, IP Country, IP Information API](https://dev.me/products/ip) - [Email Validation, Mailbox Verification](https://dev.me/products/email) - [Phone Number Validation](https://dev.me/products/phone). You can learn more at [dev.me](https://dev.me). For this example you can use api key `demo-key` to test the APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@dev.me
8
+
9
+
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module DevmeSdk
16
+ class CountryApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Get country facts and information
24
+ # @param code [String] code - country code ISO 4217
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Array<String>] :expand expand - expand properties
27
+ # @option opts [Array<String>] :exclude exclude - exclude properties
28
+ # @option opts [String] :language language - localisation language
29
+ # @return [GetCountryDetailsOut]
30
+ def v1_get_country_details(code, opts = {})
31
+ data, _status_code, _headers = v1_get_country_details_with_http_info(code, opts)
32
+ data
33
+ end
34
+
35
+ # Get country facts and information
36
+ # @param code [String] code - country code ISO 4217
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [Array<String>] :expand expand - expand properties
39
+ # @option opts [Array<String>] :exclude exclude - exclude properties
40
+ # @option opts [String] :language language - localisation language
41
+ # @return [Array<(GetCountryDetailsOut, Integer, Hash)>] GetCountryDetailsOut data, response status code and response headers
42
+ def v1_get_country_details_with_http_info(code, opts = {})
43
+ if @api_client.config.debugging
44
+ @api_client.config.logger.debug 'Calling API: CountryApi.v1_get_country_details ...'
45
+ end
46
+ # verify the required parameter 'code' is set
47
+ if @api_client.config.client_side_validation && code.nil?
48
+ fail ArgumentError, "Missing the required parameter 'code' when calling CountryApi.v1_get_country_details"
49
+ end
50
+ allowable_values = ["en", "ar", "de", "es", "fr", "ja", "ko", "pt", "ru"]
51
+ if @api_client.config.client_side_validation && opts[:'language'] && !allowable_values.include?(opts[:'language'])
52
+ fail ArgumentError, "invalid value for \"language\", must be one of #{allowable_values}"
53
+ end
54
+ # resource path
55
+ local_var_path = '/v1-get-country-details'
56
+
57
+ # query parameters
58
+ query_params = opts[:query_params] || {}
59
+ query_params[:'code'] = code
60
+ query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?
61
+ query_params[:'exclude'] = @api_client.build_collection_param(opts[:'exclude'], :multi) if !opts[:'exclude'].nil?
62
+ query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
63
+
64
+ # header parameters
65
+ header_params = opts[:header_params] || {}
66
+ # HTTP header 'Accept' (if needed)
67
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
68
+
69
+ # form parameters
70
+ form_params = opts[:form_params] || {}
71
+
72
+ # http body (model)
73
+ post_body = opts[:debug_body]
74
+
75
+ # return_type
76
+ return_type = opts[:debug_return_type] || 'GetCountryDetailsOut'
77
+
78
+ # auth_names
79
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQueryParam']
80
+
81
+ new_options = opts.merge(
82
+ :operation => :"CountryApi.v1_get_country_details",
83
+ :header_params => header_params,
84
+ :query_params => query_params,
85
+ :form_params => form_params,
86
+ :body => post_body,
87
+ :auth_names => auth_names,
88
+ :return_type => return_type
89
+ )
90
+
91
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
92
+ if @api_client.config.debugging
93
+ @api_client.config.logger.debug "API called: CountryApi#v1_get_country_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
94
+ end
95
+ return data, status_code, headers
96
+ end
97
+
98
+ # Get list of all countries
99
+ # @param [Hash] opts the optional parameters
100
+ # @option opts [Array<String>] :code code - country code ISO 4217
101
+ # @option opts [Array<String>] :expand expand - expand properties
102
+ # @option opts [Array<String>] :exclude exclude - exclude properties
103
+ # @option opts [String] :language language - localisation language
104
+ # @option opts [Array<String>] :sort sort - sort properties
105
+ # @option opts [String] :page page - page number
106
+ # @option opts [String] :page_size pageSize - page size
107
+ # @return [ListCountriesOut]
108
+ def v1_list_countries(opts = {})
109
+ data, _status_code, _headers = v1_list_countries_with_http_info(opts)
110
+ data
111
+ end
112
+
113
+ # Get list of all countries
114
+ # @param [Hash] opts the optional parameters
115
+ # @option opts [Array<String>] :code code - country code ISO 4217
116
+ # @option opts [Array<String>] :expand expand - expand properties
117
+ # @option opts [Array<String>] :exclude exclude - exclude properties
118
+ # @option opts [String] :language language - localisation language
119
+ # @option opts [Array<String>] :sort sort - sort properties
120
+ # @option opts [String] :page page - page number
121
+ # @option opts [String] :page_size pageSize - page size
122
+ # @return [Array<(ListCountriesOut, Integer, Hash)>] ListCountriesOut data, response status code and response headers
123
+ def v1_list_countries_with_http_info(opts = {})
124
+ if @api_client.config.debugging
125
+ @api_client.config.logger.debug 'Calling API: CountryApi.v1_list_countries ...'
126
+ end
127
+ allowable_values = ["en", "ar", "de", "es", "fr", "ja", "ko", "pt", "ru"]
128
+ if @api_client.config.client_side_validation && opts[:'language'] && !allowable_values.include?(opts[:'language'])
129
+ fail ArgumentError, "invalid value for \"language\", must be one of #{allowable_values}"
130
+ end
131
+ # resource path
132
+ local_var_path = '/v1-list-countries'
133
+
134
+ # query parameters
135
+ query_params = opts[:query_params] || {}
136
+ query_params[:'code'] = @api_client.build_collection_param(opts[:'code'], :multi) if !opts[:'code'].nil?
137
+ query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?
138
+ query_params[:'exclude'] = @api_client.build_collection_param(opts[:'exclude'], :multi) if !opts[:'exclude'].nil?
139
+ query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
140
+ query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
141
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
142
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
143
+
144
+ # header parameters
145
+ header_params = opts[:header_params] || {}
146
+ # HTTP header 'Accept' (if needed)
147
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
148
+
149
+ # form parameters
150
+ form_params = opts[:form_params] || {}
151
+
152
+ # http body (model)
153
+ post_body = opts[:debug_body]
154
+
155
+ # return_type
156
+ return_type = opts[:debug_return_type] || 'ListCountriesOut'
157
+
158
+ # auth_names
159
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQueryParam']
160
+
161
+ new_options = opts.merge(
162
+ :operation => :"CountryApi.v1_list_countries",
163
+ :header_params => header_params,
164
+ :query_params => query_params,
165
+ :form_params => form_params,
166
+ :body => post_body,
167
+ :auth_names => auth_names,
168
+ :return_type => return_type
169
+ )
170
+
171
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
172
+ if @api_client.config.debugging
173
+ @api_client.config.logger.debug "API called: CountryApi#v1_list_countries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
174
+ end
175
+ return data, status_code, headers
176
+ end
177
+ end
178
+ end
@@ -0,0 +1,333 @@
1
+ =begin
2
+ #DEV.ME API Documentation
3
+
4
+ #DEV.ME API Documentation [Currency Conversion and Exchange Rates API](https://dev.me/products/currency) - [IP2Location, IP Country, IP Information API](https://dev.me/products/ip) - [Email Validation, Mailbox Verification](https://dev.me/products/email) - [Phone Number Validation](https://dev.me/products/phone). You can learn more at [dev.me](https://dev.me). For this example you can use api key `demo-key` to test the APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@dev.me
8
+
9
+
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module DevmeSdk
16
+ class CurrencyApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Convert currency to another currency
24
+ # @param from [String] from - currency to convert from
25
+ # @param to [String] to - currency to convert to
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [Float] :amount amount - amount to convert
28
+ # @return [ConvertCurrencyOut]
29
+ def v1_convert_currency(from, to, opts = {})
30
+ data, _status_code, _headers = v1_convert_currency_with_http_info(from, to, opts)
31
+ data
32
+ end
33
+
34
+ # Convert currency to another currency
35
+ # @param from [String] from - currency to convert from
36
+ # @param to [String] to - currency to convert to
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [Float] :amount amount - amount to convert
39
+ # @return [Array<(ConvertCurrencyOut, Integer, Hash)>] ConvertCurrencyOut data, response status code and response headers
40
+ def v1_convert_currency_with_http_info(from, to, opts = {})
41
+ if @api_client.config.debugging
42
+ @api_client.config.logger.debug 'Calling API: CurrencyApi.v1_convert_currency ...'
43
+ end
44
+ # verify the required parameter 'from' is set
45
+ if @api_client.config.client_side_validation && from.nil?
46
+ fail ArgumentError, "Missing the required parameter 'from' when calling CurrencyApi.v1_convert_currency"
47
+ end
48
+ # verify the required parameter 'to' is set
49
+ if @api_client.config.client_side_validation && to.nil?
50
+ fail ArgumentError, "Missing the required parameter 'to' when calling CurrencyApi.v1_convert_currency"
51
+ end
52
+ # resource path
53
+ local_var_path = '/v1-convert-currency'
54
+
55
+ # query parameters
56
+ query_params = opts[:query_params] || {}
57
+ query_params[:'from'] = from
58
+ query_params[:'to'] = to
59
+ query_params[:'amount'] = opts[:'amount'] if !opts[:'amount'].nil?
60
+
61
+ # header parameters
62
+ header_params = opts[:header_params] || {}
63
+ # HTTP header 'Accept' (if needed)
64
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
65
+
66
+ # form parameters
67
+ form_params = opts[:form_params] || {}
68
+
69
+ # http body (model)
70
+ post_body = opts[:debug_body]
71
+
72
+ # return_type
73
+ return_type = opts[:debug_return_type] || 'ConvertCurrencyOut'
74
+
75
+ # auth_names
76
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQueryParam']
77
+
78
+ new_options = opts.merge(
79
+ :operation => :"CurrencyApi.v1_convert_currency",
80
+ :header_params => header_params,
81
+ :query_params => query_params,
82
+ :form_params => form_params,
83
+ :body => post_body,
84
+ :auth_names => auth_names,
85
+ :return_type => return_type
86
+ )
87
+
88
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
89
+ if @api_client.config.debugging
90
+ @api_client.config.logger.debug "API called: CurrencyApi#v1_convert_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
91
+ end
92
+ return data, status_code, headers
93
+ end
94
+
95
+ # Get currency facts and information
96
+ # @param code [String] code - currency code ISO 4217
97
+ # @param [Hash] opts the optional parameters
98
+ # @option opts [Array<String>] :expand expand - expand properties
99
+ # @option opts [Array<String>] :exclude exclude - exclude properties
100
+ # @option opts [String] :language language - localisation language
101
+ # @option opts [String] :type type - type of currency
102
+ # @return [GetCurrencyDetailsOut]
103
+ def v1_get_currency_details(code, opts = {})
104
+ data, _status_code, _headers = v1_get_currency_details_with_http_info(code, opts)
105
+ data
106
+ end
107
+
108
+ # Get currency facts and information
109
+ # @param code [String] code - currency code ISO 4217
110
+ # @param [Hash] opts the optional parameters
111
+ # @option opts [Array<String>] :expand expand - expand properties
112
+ # @option opts [Array<String>] :exclude exclude - exclude properties
113
+ # @option opts [String] :language language - localisation language
114
+ # @option opts [String] :type type - type of currency
115
+ # @return [Array<(GetCurrencyDetailsOut, Integer, Hash)>] GetCurrencyDetailsOut data, response status code and response headers
116
+ def v1_get_currency_details_with_http_info(code, opts = {})
117
+ if @api_client.config.debugging
118
+ @api_client.config.logger.debug 'Calling API: CurrencyApi.v1_get_currency_details ...'
119
+ end
120
+ # verify the required parameter 'code' is set
121
+ if @api_client.config.client_side_validation && code.nil?
122
+ fail ArgumentError, "Missing the required parameter 'code' when calling CurrencyApi.v1_get_currency_details"
123
+ end
124
+ allowable_values = ["en", "ar", "de", "es", "fr", "ja", "ko", "pt", "ru"]
125
+ if @api_client.config.client_side_validation && opts[:'language'] && !allowable_values.include?(opts[:'language'])
126
+ fail ArgumentError, "invalid value for \"language\", must be one of #{allowable_values}"
127
+ end
128
+ allowable_values = ["fiat", "crypto"]
129
+ if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
130
+ fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
131
+ end
132
+ # resource path
133
+ local_var_path = '/v1-get-currency-details'
134
+
135
+ # query parameters
136
+ query_params = opts[:query_params] || {}
137
+ query_params[:'code'] = code
138
+ query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?
139
+ query_params[:'exclude'] = @api_client.build_collection_param(opts[:'exclude'], :multi) if !opts[:'exclude'].nil?
140
+ query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
141
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
142
+
143
+ # header parameters
144
+ header_params = opts[:header_params] || {}
145
+ # HTTP header 'Accept' (if needed)
146
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
147
+
148
+ # form parameters
149
+ form_params = opts[:form_params] || {}
150
+
151
+ # http body (model)
152
+ post_body = opts[:debug_body]
153
+
154
+ # return_type
155
+ return_type = opts[:debug_return_type] || 'GetCurrencyDetailsOut'
156
+
157
+ # auth_names
158
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQueryParam']
159
+
160
+ new_options = opts.merge(
161
+ :operation => :"CurrencyApi.v1_get_currency_details",
162
+ :header_params => header_params,
163
+ :query_params => query_params,
164
+ :form_params => form_params,
165
+ :body => post_body,
166
+ :auth_names => auth_names,
167
+ :return_type => return_type
168
+ )
169
+
170
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
171
+ if @api_client.config.debugging
172
+ @api_client.config.logger.debug "API called: CurrencyApi#v1_get_currency_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
173
+ end
174
+ return data, status_code, headers
175
+ end
176
+
177
+ # Get exchange rate for a currency
178
+ # @param from [String] from - currency to get exchange rate from
179
+ # @param to [String] to - currency to get exchange rate to
180
+ # @param [Hash] opts the optional parameters
181
+ # @return [GetCurrencyExchangeRateOut]
182
+ def v1_get_currency_exchange_rate(from, to, opts = {})
183
+ data, _status_code, _headers = v1_get_currency_exchange_rate_with_http_info(from, to, opts)
184
+ data
185
+ end
186
+
187
+ # Get exchange rate for a currency
188
+ # @param from [String] from - currency to get exchange rate from
189
+ # @param to [String] to - currency to get exchange rate to
190
+ # @param [Hash] opts the optional parameters
191
+ # @return [Array<(GetCurrencyExchangeRateOut, Integer, Hash)>] GetCurrencyExchangeRateOut data, response status code and response headers
192
+ def v1_get_currency_exchange_rate_with_http_info(from, to, opts = {})
193
+ if @api_client.config.debugging
194
+ @api_client.config.logger.debug 'Calling API: CurrencyApi.v1_get_currency_exchange_rate ...'
195
+ end
196
+ # verify the required parameter 'from' is set
197
+ if @api_client.config.client_side_validation && from.nil?
198
+ fail ArgumentError, "Missing the required parameter 'from' when calling CurrencyApi.v1_get_currency_exchange_rate"
199
+ end
200
+ # verify the required parameter 'to' is set
201
+ if @api_client.config.client_side_validation && to.nil?
202
+ fail ArgumentError, "Missing the required parameter 'to' when calling CurrencyApi.v1_get_currency_exchange_rate"
203
+ end
204
+ # resource path
205
+ local_var_path = '/v1-get-currency-exchange-rate'
206
+
207
+ # query parameters
208
+ query_params = opts[:query_params] || {}
209
+ query_params[:'from'] = from
210
+ query_params[:'to'] = to
211
+
212
+ # header parameters
213
+ header_params = opts[:header_params] || {}
214
+ # HTTP header 'Accept' (if needed)
215
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
216
+
217
+ # form parameters
218
+ form_params = opts[:form_params] || {}
219
+
220
+ # http body (model)
221
+ post_body = opts[:debug_body]
222
+
223
+ # return_type
224
+ return_type = opts[:debug_return_type] || 'GetCurrencyExchangeRateOut'
225
+
226
+ # auth_names
227
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQueryParam']
228
+
229
+ new_options = opts.merge(
230
+ :operation => :"CurrencyApi.v1_get_currency_exchange_rate",
231
+ :header_params => header_params,
232
+ :query_params => query_params,
233
+ :form_params => form_params,
234
+ :body => post_body,
235
+ :auth_names => auth_names,
236
+ :return_type => return_type
237
+ )
238
+
239
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
240
+ if @api_client.config.debugging
241
+ @api_client.config.logger.debug "API called: CurrencyApi#v1_get_currency_exchange_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
242
+ end
243
+ return data, status_code, headers
244
+ end
245
+
246
+ # Get list of all currencies
247
+ # @param [Hash] opts the optional parameters
248
+ # @option opts [Array<String>] :code code - currency code ISO 4217
249
+ # @option opts [Array<String>] :expand expand - expand properties
250
+ # @option opts [Array<String>] :exclude exclude - exclude properties
251
+ # @option opts [String] :language language - localisation language
252
+ # @option opts [String] :type type - type of currency
253
+ # @option opts [Array<String>] :sort sort - sort properties
254
+ # @option opts [String] :page page - page number
255
+ # @option opts [String] :page_size pageSize - page size
256
+ # @return [ListCurrenciesOut]
257
+ def v1_list_currencies(opts = {})
258
+ data, _status_code, _headers = v1_list_currencies_with_http_info(opts)
259
+ data
260
+ end
261
+
262
+ # Get list of all currencies
263
+ # @param [Hash] opts the optional parameters
264
+ # @option opts [Array<String>] :code code - currency code ISO 4217
265
+ # @option opts [Array<String>] :expand expand - expand properties
266
+ # @option opts [Array<String>] :exclude exclude - exclude properties
267
+ # @option opts [String] :language language - localisation language
268
+ # @option opts [String] :type type - type of currency
269
+ # @option opts [Array<String>] :sort sort - sort properties
270
+ # @option opts [String] :page page - page number
271
+ # @option opts [String] :page_size pageSize - page size
272
+ # @return [Array<(ListCurrenciesOut, Integer, Hash)>] ListCurrenciesOut data, response status code and response headers
273
+ def v1_list_currencies_with_http_info(opts = {})
274
+ if @api_client.config.debugging
275
+ @api_client.config.logger.debug 'Calling API: CurrencyApi.v1_list_currencies ...'
276
+ end
277
+ allowable_values = ["en", "ar", "de", "es", "fr", "ja", "ko", "pt", "ru"]
278
+ if @api_client.config.client_side_validation && opts[:'language'] && !allowable_values.include?(opts[:'language'])
279
+ fail ArgumentError, "invalid value for \"language\", must be one of #{allowable_values}"
280
+ end
281
+ allowable_values = ["fiat", "crypto"]
282
+ if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
283
+ fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
284
+ end
285
+ # resource path
286
+ local_var_path = '/v1-list-currencies'
287
+
288
+ # query parameters
289
+ query_params = opts[:query_params] || {}
290
+ query_params[:'code'] = @api_client.build_collection_param(opts[:'code'], :multi) if !opts[:'code'].nil?
291
+ query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?
292
+ query_params[:'exclude'] = @api_client.build_collection_param(opts[:'exclude'], :multi) if !opts[:'exclude'].nil?
293
+ query_params[:'language'] = opts[:'language'] if !opts[:'language'].nil?
294
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
295
+ query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
296
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
297
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
298
+
299
+ # header parameters
300
+ header_params = opts[:header_params] || {}
301
+ # HTTP header 'Accept' (if needed)
302
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
303
+
304
+ # form parameters
305
+ form_params = opts[:form_params] || {}
306
+
307
+ # http body (model)
308
+ post_body = opts[:debug_body]
309
+
310
+ # return_type
311
+ return_type = opts[:debug_return_type] || 'ListCurrenciesOut'
312
+
313
+ # auth_names
314
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQueryParam']
315
+
316
+ new_options = opts.merge(
317
+ :operation => :"CurrencyApi.v1_list_currencies",
318
+ :header_params => header_params,
319
+ :query_params => query_params,
320
+ :form_params => form_params,
321
+ :body => post_body,
322
+ :auth_names => auth_names,
323
+ :return_type => return_type
324
+ )
325
+
326
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
327
+ if @api_client.config.debugging
328
+ @api_client.config.logger.debug "API called: CurrencyApi#v1_list_currencies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
329
+ end
330
+ return data, status_code, headers
331
+ end
332
+ end
333
+ end
@@ -0,0 +1,81 @@
1
+ =begin
2
+ #DEV.ME API Documentation
3
+
4
+ #DEV.ME API Documentation [Currency Conversion and Exchange Rates API](https://dev.me/products/currency) - [IP2Location, IP Country, IP Information API](https://dev.me/products/ip) - [Email Validation, Mailbox Verification](https://dev.me/products/email) - [Phone Number Validation](https://dev.me/products/phone). You can learn more at [dev.me](https://dev.me). For this example you can use api key `demo-key` to test the APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@dev.me
8
+
9
+
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module DevmeSdk
16
+ class DomainApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Get domain WHOIS details and registration information
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [String] :domain domain - Domain name to get details for
26
+ # @return [GetDomainWhoisOut]
27
+ def v1_get_domain_whois(opts = {})
28
+ data, _status_code, _headers = v1_get_domain_whois_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # Get domain WHOIS details and registration information
33
+ # @param [Hash] opts the optional parameters
34
+ # @option opts [String] :domain domain - Domain name to get details for
35
+ # @return [Array<(GetDomainWhoisOut, Integer, Hash)>] GetDomainWhoisOut data, response status code and response headers
36
+ def v1_get_domain_whois_with_http_info(opts = {})
37
+ if @api_client.config.debugging
38
+ @api_client.config.logger.debug 'Calling API: DomainApi.v1_get_domain_whois ...'
39
+ end
40
+ # resource path
41
+ local_var_path = '/v1-get-domain-whois'
42
+
43
+ # query parameters
44
+ query_params = opts[:query_params] || {}
45
+ query_params[:'domain'] = opts[:'domain'] if !opts[:'domain'].nil?
46
+
47
+ # header parameters
48
+ header_params = opts[:header_params] || {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
51
+
52
+ # form parameters
53
+ form_params = opts[:form_params] || {}
54
+
55
+ # http body (model)
56
+ post_body = opts[:debug_body]
57
+
58
+ # return_type
59
+ return_type = opts[:debug_return_type] || 'GetDomainWhoisOut'
60
+
61
+ # auth_names
62
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQueryParam']
63
+
64
+ new_options = opts.merge(
65
+ :operation => :"DomainApi.v1_get_domain_whois",
66
+ :header_params => header_params,
67
+ :query_params => query_params,
68
+ :form_params => form_params,
69
+ :body => post_body,
70
+ :auth_names => auth_names,
71
+ :return_type => return_type
72
+ )
73
+
74
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
75
+ if @api_client.config.debugging
76
+ @api_client.config.logger.debug "API called: DomainApi#v1_get_domain_whois\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
77
+ end
78
+ return data, status_code, headers
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,91 @@
1
+ =begin
2
+ #DEV.ME API Documentation
3
+
4
+ #DEV.ME API Documentation [Currency Conversion and Exchange Rates API](https://dev.me/products/currency) - [IP2Location, IP Country, IP Information API](https://dev.me/products/ip) - [Email Validation, Mailbox Verification](https://dev.me/products/email) - [Phone Number Validation](https://dev.me/products/phone). You can learn more at [dev.me](https://dev.me). For this example you can use api key `demo-key` to test the APIs
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@dev.me
8
+
9
+
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module DevmeSdk
16
+ class EmailApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Get email validation details
24
+ # @param email [String] email - email address
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Boolean] :verify_mx verifyMx - verify domain dns for MX record
27
+ # @option opts [Boolean] :verify_smtp verifySmtp - verify mailbox with SMTP Connect and Reply
28
+ # @return [GetEmailDetailsOut]
29
+ def v1_get_email_details(email, opts = {})
30
+ data, _status_code, _headers = v1_get_email_details_with_http_info(email, opts)
31
+ data
32
+ end
33
+
34
+ # Get email validation details
35
+ # @param email [String] email - email address
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [Boolean] :verify_mx verifyMx - verify domain dns for MX record
38
+ # @option opts [Boolean] :verify_smtp verifySmtp - verify mailbox with SMTP Connect and Reply
39
+ # @return [Array<(GetEmailDetailsOut, Integer, Hash)>] GetEmailDetailsOut data, response status code and response headers
40
+ def v1_get_email_details_with_http_info(email, opts = {})
41
+ if @api_client.config.debugging
42
+ @api_client.config.logger.debug 'Calling API: EmailApi.v1_get_email_details ...'
43
+ end
44
+ # verify the required parameter 'email' is set
45
+ if @api_client.config.client_side_validation && email.nil?
46
+ fail ArgumentError, "Missing the required parameter 'email' when calling EmailApi.v1_get_email_details"
47
+ end
48
+ # resource path
49
+ local_var_path = '/v1-get-email-details'
50
+
51
+ # query parameters
52
+ query_params = opts[:query_params] || {}
53
+ query_params[:'email'] = email
54
+ query_params[:'verifyMx'] = opts[:'verify_mx'] if !opts[:'verify_mx'].nil?
55
+ query_params[:'verifySmtp'] = opts[:'verify_smtp'] if !opts[:'verify_smtp'].nil?
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
+
62
+ # form parameters
63
+ form_params = opts[:form_params] || {}
64
+
65
+ # http body (model)
66
+ post_body = opts[:debug_body]
67
+
68
+ # return_type
69
+ return_type = opts[:debug_return_type] || 'GetEmailDetailsOut'
70
+
71
+ # auth_names
72
+ auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'APIKeyQueryParam']
73
+
74
+ new_options = opts.merge(
75
+ :operation => :"EmailApi.v1_get_email_details",
76
+ :header_params => header_params,
77
+ :query_params => query_params,
78
+ :form_params => form_params,
79
+ :body => post_body,
80
+ :auth_names => auth_names,
81
+ :return_type => return_type
82
+ )
83
+
84
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
85
+ if @api_client.config.debugging
86
+ @api_client.config.logger.debug "API called: EmailApi#v1_get_email_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
87
+ end
88
+ return data, status_code, headers
89
+ end
90
+ end
91
+ end