openapi_ipify 5.2.0 → 5.3.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +9 -9
- data/README.md +6 -7
- data/docs/DefaultApi.md +5 -5
- data/lib/openapi_ipify/api/default_api.rb +6 -6
- data/lib/openapi_ipify/api_client.rb +4 -4
- data/lib/openapi_ipify/api_error.rb +2 -2
- data/lib/openapi_ipify/configuration.rb +2 -2
- data/lib/openapi_ipify/version.rb +3 -3
- data/lib/openapi_ipify.rb +2 -3
- data/openapi_ipify.gemspec +2 -2
- data/spec/api/default_api_spec.rb +3 -3
- data/spec/spec_helper.rb +2 -2
- metadata +2 -6
- data/docs/Ip.md +0 -18
- data/lib/openapi_ipify/models/ip.rb +0 -221
- data/spec/models/ip_spec.rb +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f99a544d791133a7746bcb1a81ccaf14c6dd472b5aa2bce2881bb4800ccefc9
|
4
|
+
data.tar.gz: bc19294094a0681e04f1d981de07b44a43388dd9114554826d24968d65f267c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eccf63c178df4b56f3a0098033d0f222e96b213b6ac9b8ffd5f94cb900be748e188821dec2610010846cc85d3eda2452a7b9145cf2dd62cdc6ea65fb6adbdb4
|
7
|
+
data.tar.gz: 74792a8c3fa8036a198501e35fb94af1e2a3c45febe94c96e4ae8ced6fb8f41d7289a2b5998c8eb1406a1e95c6a862d0e55447ab56886cbc4bc390d8fc97b3e6
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
openapi_ipify (5.
|
4
|
+
openapi_ipify (5.3.0)
|
5
5
|
typhoeus (~> 1.0, >= 1.0.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -13,11 +13,11 @@ GEM
|
|
13
13
|
diff-lcs (1.5.1)
|
14
14
|
ethon (0.16.0)
|
15
15
|
ffi (>= 1.15.0)
|
16
|
-
ffi (1.
|
16
|
+
ffi (1.17.0)
|
17
17
|
jaro_winkler (1.5.6)
|
18
|
-
method_source (1.
|
19
|
-
parallel (1.
|
20
|
-
parser (3.3.0
|
18
|
+
method_source (1.1.0)
|
19
|
+
parallel (1.25.1)
|
20
|
+
parser (3.3.3.0)
|
21
21
|
ast (~> 2.4.1)
|
22
22
|
racc
|
23
23
|
pry (0.14.2)
|
@@ -28,7 +28,7 @@ GEM
|
|
28
28
|
pry (>= 0.13, < 0.15)
|
29
29
|
psych (5.1.2)
|
30
30
|
stringio
|
31
|
-
racc (1.
|
31
|
+
racc (1.8.0)
|
32
32
|
rainbow (3.1.1)
|
33
33
|
rake (13.0.6)
|
34
34
|
rspec (3.13.0)
|
@@ -37,10 +37,10 @@ GEM
|
|
37
37
|
rspec-mocks (~> 3.13.0)
|
38
38
|
rspec-core (3.13.0)
|
39
39
|
rspec-support (~> 3.13.0)
|
40
|
-
rspec-expectations (3.13.
|
40
|
+
rspec-expectations (3.13.1)
|
41
41
|
diff-lcs (>= 1.2.0, < 2.0)
|
42
42
|
rspec-support (~> 3.13.0)
|
43
|
-
rspec-mocks (3.13.
|
43
|
+
rspec-mocks (3.13.1)
|
44
44
|
diff-lcs (>= 1.2.0, < 2.0)
|
45
45
|
rspec-support (~> 3.13.0)
|
46
46
|
rspec-support (3.13.1)
|
@@ -53,7 +53,7 @@ GEM
|
|
53
53
|
ruby-progressbar (~> 1.7)
|
54
54
|
unicode-display_width (>= 1.4.0, < 1.6)
|
55
55
|
ruby-progressbar (1.13.0)
|
56
|
-
stringio (3.1.
|
56
|
+
stringio (3.1.1)
|
57
57
|
typhoeus (1.4.1)
|
58
58
|
ethon (>= 0.9.0)
|
59
59
|
unicode-display_width (1.5.0)
|
data/README.md
CHANGED
@@ -6,9 +6,9 @@ OpenAPI client for ipify, a simple public IP address API
|
|
6
6
|
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
|
-
- API version: 5.
|
10
|
-
- Package version: 5.
|
11
|
-
- Generator version: 7.
|
9
|
+
- API version: 5.3.0
|
10
|
+
- Package version: 5.3.0
|
11
|
+
- Generator version: 7.6.0
|
12
12
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
13
13
|
For more information, please visit [https://github.com/oapicf/openapi-ipify](https://github.com/oapicf/openapi-ipify)
|
14
14
|
|
@@ -25,16 +25,16 @@ gem build openapi_ipify.gemspec
|
|
25
25
|
Then either install the gem locally:
|
26
26
|
|
27
27
|
```shell
|
28
|
-
gem install ./openapi_ipify-5.
|
28
|
+
gem install ./openapi_ipify-5.3.0.gem
|
29
29
|
```
|
30
30
|
|
31
|
-
(for development, run `gem install --dev ./openapi_ipify-5.
|
31
|
+
(for development, run `gem install --dev ./openapi_ipify-5.3.0.gem` to install the development dependencies)
|
32
32
|
|
33
33
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
34
34
|
|
35
35
|
Finally add this to the Gemfile:
|
36
36
|
|
37
|
-
gem 'openapi_ipify', '~> 5.
|
37
|
+
gem 'openapi_ipify', '~> 5.3.0'
|
38
38
|
|
39
39
|
### Install from Git
|
40
40
|
|
@@ -85,7 +85,6 @@ Class | Method | HTTP request | Description
|
|
85
85
|
|
86
86
|
## Documentation for Models
|
87
87
|
|
88
|
-
- [OpenApiIpifyClient::Ip](docs/Ip.md)
|
89
88
|
|
90
89
|
|
91
90
|
## Documentation for Authorization
|
data/docs/DefaultApi.md
CHANGED
@@ -9,7 +9,7 @@ All URIs are relative to *https://api.ipify.org*
|
|
9
9
|
|
10
10
|
## get_ip
|
11
11
|
|
12
|
-
>
|
12
|
+
> String get_ip(opts)
|
13
13
|
|
14
14
|
Get your public IP address
|
15
15
|
|
@@ -38,7 +38,7 @@ end
|
|
38
38
|
|
39
39
|
This returns an Array which contains the response data, status code and headers.
|
40
40
|
|
41
|
-
> <Array(
|
41
|
+
> <Array(String, Integer, Hash)> get_ip_with_http_info(opts)
|
42
42
|
|
43
43
|
```ruby
|
44
44
|
begin
|
@@ -46,7 +46,7 @@ begin
|
|
46
46
|
data, status_code, headers = api_instance.get_ip_with_http_info(opts)
|
47
47
|
p status_code # => 2xx
|
48
48
|
p headers # => { ... }
|
49
|
-
p data # =>
|
49
|
+
p data # => String
|
50
50
|
rescue OpenApiIpifyClient::ApiError => e
|
51
51
|
puts "Error when calling DefaultApi->get_ip_with_http_info: #{e}"
|
52
52
|
end
|
@@ -61,7 +61,7 @@ end
|
|
61
61
|
|
62
62
|
### Return type
|
63
63
|
|
64
|
-
|
64
|
+
**String**
|
65
65
|
|
66
66
|
### Authorization
|
67
67
|
|
@@ -70,5 +70,5 @@ No authorization required
|
|
70
70
|
### HTTP request headers
|
71
71
|
|
72
72
|
- **Content-Type**: Not defined
|
73
|
-
- **Accept**:
|
73
|
+
- **Accept**: text/plain, application/javascript, application/json
|
74
74
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#OpenAPI client for ipify, a simple public IP address API
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 5.
|
6
|
+
The version of the OpenAPI document: 5.3.0
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -23,7 +23,7 @@ module OpenApiIpifyClient
|
|
23
23
|
# @param [Hash] opts the optional parameters
|
24
24
|
# @option opts [String] :format Response format
|
25
25
|
# @option opts [String] :callback JSONP callback function name
|
26
|
-
# @return [
|
26
|
+
# @return [String]
|
27
27
|
def get_ip(opts = {})
|
28
28
|
data, _status_code, _headers = get_ip_with_http_info(opts)
|
29
29
|
data
|
@@ -33,7 +33,7 @@ module OpenApiIpifyClient
|
|
33
33
|
# @param [Hash] opts the optional parameters
|
34
34
|
# @option opts [String] :format Response format
|
35
35
|
# @option opts [String] :callback JSONP callback function name
|
36
|
-
# @return [Array<(
|
36
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
37
37
|
def get_ip_with_http_info(opts = {})
|
38
38
|
if @api_client.config.debugging
|
39
39
|
@api_client.config.logger.debug 'Calling API: DefaultApi.get_ip ...'
|
@@ -53,7 +53,7 @@ module OpenApiIpifyClient
|
|
53
53
|
# header parameters
|
54
54
|
header_params = opts[:header_params] || {}
|
55
55
|
# HTTP header 'Accept' (if needed)
|
56
|
-
header_params['Accept'] = @api_client.select_header_accept(['
|
56
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/javascript', 'application/json'])
|
57
57
|
|
58
58
|
# form parameters
|
59
59
|
form_params = opts[:form_params] || {}
|
@@ -62,7 +62,7 @@ module OpenApiIpifyClient
|
|
62
62
|
post_body = opts[:debug_body]
|
63
63
|
|
64
64
|
# return_type
|
65
|
-
return_type = opts[:debug_return_type] || '
|
65
|
+
return_type = opts[:debug_return_type] || 'String'
|
66
66
|
|
67
67
|
# auth_names
|
68
68
|
auth_names = opts[:debug_auth_names] || []
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#OpenAPI client for ipify, a simple public IP address API
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 5.
|
6
|
+
The version of the OpenAPI document: 5.3.0
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -211,7 +211,7 @@ module OpenApiIpifyClient
|
|
211
211
|
# @param [String] mime MIME
|
212
212
|
# @return [Boolean] True if the MIME is application/json
|
213
213
|
def json_mime?(mime)
|
214
|
-
(mime == '*/*') || !(mime =~
|
214
|
+
(mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
|
215
215
|
end
|
216
216
|
|
217
217
|
# Deserialize the response to the given return type.
|
@@ -290,7 +290,7 @@ module OpenApiIpifyClient
|
|
290
290
|
# @param [String] filename the filename to be sanitized
|
291
291
|
# @return [String] the sanitized filename
|
292
292
|
def sanitize_filename(filename)
|
293
|
-
filename.
|
293
|
+
filename.split(/[\/\\]/).last
|
294
294
|
end
|
295
295
|
|
296
296
|
def build_request_url(path, opts = {})
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#OpenAPI client for ipify, a simple public IP address API
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 5.
|
6
|
+
The version of the OpenAPI document: 5.3.0
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#OpenAPI client for ipify, a simple public IP address API
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 5.
|
6
|
+
The version of the OpenAPI document: 5.3.0
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -3,13 +3,13 @@
|
|
3
3
|
|
4
4
|
#OpenAPI client for ipify, a simple public IP address API
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 5.
|
6
|
+
The version of the OpenAPI document: 5.3.0
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
module OpenApiIpifyClient
|
14
|
-
VERSION = '5.
|
14
|
+
VERSION = '5.3.0'
|
15
15
|
end
|
data/lib/openapi_ipify.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#OpenAPI client for ipify, a simple public IP address API
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 5.
|
6
|
+
The version of the OpenAPI document: 5.3.0
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -17,7 +17,6 @@ require 'openapi_ipify/version'
|
|
17
17
|
require 'openapi_ipify/configuration'
|
18
18
|
|
19
19
|
# Models
|
20
|
-
require 'openapi_ipify/models/ip'
|
21
20
|
|
22
21
|
# APIs
|
23
22
|
require 'openapi_ipify/api/default_api'
|
data/openapi_ipify.gemspec
CHANGED
@@ -5,10 +5,10 @@
|
|
5
5
|
|
6
6
|
#OpenAPI client for ipify, a simple public IP address API
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 5.
|
8
|
+
The version of the OpenAPI document: 5.3.0
|
9
9
|
Contact: blah+oapicf@cliffano.com
|
10
10
|
Generated by: https://openapi-generator.tech
|
11
|
-
Generator version: 7.
|
11
|
+
Generator version: 7.6.0
|
12
12
|
|
13
13
|
=end
|
14
14
|
|
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#OpenAPI client for ipify, a simple public IP address API
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 5.
|
6
|
+
The version of the OpenAPI document: 5.3.0
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -37,7 +37,7 @@ describe 'DefaultApi' do
|
|
37
37
|
# @param [Hash] opts the optional parameters
|
38
38
|
# @option opts [String] :format Response format
|
39
39
|
# @option opts [String] :callback JSONP callback function name
|
40
|
-
# @return [
|
40
|
+
# @return [String]
|
41
41
|
describe 'get_ip test' do
|
42
42
|
it 'should work' do
|
43
43
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
data/spec/spec_helper.rb
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
|
4
4
|
#OpenAPI client for ipify, a simple public IP address API
|
5
5
|
|
6
|
-
The version of the OpenAPI document: 5.
|
6
|
+
The version of the OpenAPI document: 5.3.0
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.6.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openapi_ipify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenAPI Clients Factory
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -74,18 +74,15 @@ files:
|
|
74
74
|
- bin/ruby-parse
|
75
75
|
- bin/ruby-rewrite
|
76
76
|
- docs/DefaultApi.md
|
77
|
-
- docs/Ip.md
|
78
77
|
- git_push.sh
|
79
78
|
- lib/openapi_ipify.rb
|
80
79
|
- lib/openapi_ipify/api/default_api.rb
|
81
80
|
- lib/openapi_ipify/api_client.rb
|
82
81
|
- lib/openapi_ipify/api_error.rb
|
83
82
|
- lib/openapi_ipify/configuration.rb
|
84
|
-
- lib/openapi_ipify/models/ip.rb
|
85
83
|
- lib/openapi_ipify/version.rb
|
86
84
|
- openapi_ipify.gemspec
|
87
85
|
- spec/api/default_api_spec.rb
|
88
|
-
- spec/models/ip_spec.rb
|
89
86
|
- spec/spec_helper.rb
|
90
87
|
homepage: https://github.com/oapicf/openapi-ipify
|
91
88
|
licenses:
|
@@ -112,5 +109,4 @@ specification_version: 4
|
|
112
109
|
summary: openapi-ipify Ruby Gem
|
113
110
|
test_files:
|
114
111
|
- spec/api/default_api_spec.rb
|
115
|
-
- spec/models/ip_spec.rb
|
116
112
|
- spec/spec_helper.rb
|
data/docs/Ip.md
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# OpenApiIpifyClient::Ip
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
|
5
|
-
| Name | Type | Description | Notes |
|
6
|
-
| ---- | ---- | ----------- | ----- |
|
7
|
-
| **ip** | **String** | | |
|
8
|
-
|
9
|
-
## Example
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
require 'openapi_ipify'
|
13
|
-
|
14
|
-
instance = OpenApiIpifyClient::Ip.new(
|
15
|
-
ip: null
|
16
|
-
)
|
17
|
-
```
|
18
|
-
|
@@ -1,221 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#openapi-ipify
|
3
|
-
|
4
|
-
#OpenAPI client for ipify, a simple public IP address API
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 5.2.0
|
7
|
-
Contact: blah+oapicf@cliffano.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.4.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module OpenApiIpifyClient
|
17
|
-
class Ip
|
18
|
-
attr_accessor :ip
|
19
|
-
|
20
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
-
def self.attribute_map
|
22
|
-
{
|
23
|
-
:'ip' => :'ip'
|
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
|
-
:'ip' => :'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 `OpenApiIpifyClient::Ip` 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 `OpenApiIpifyClient::Ip`. 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?(:'ip')
|
61
|
-
self.ip = attributes[:'ip']
|
62
|
-
else
|
63
|
-
self.ip = nil
|
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
|
-
if @ip.nil?
|
73
|
-
invalid_properties.push('invalid value for "ip", ip cannot be nil.')
|
74
|
-
end
|
75
|
-
|
76
|
-
invalid_properties
|
77
|
-
end
|
78
|
-
|
79
|
-
# Check to see if the all the properties in the model are valid
|
80
|
-
# @return true if the model is valid
|
81
|
-
def valid?
|
82
|
-
warn '[DEPRECATED] the `valid?` method is obsolete'
|
83
|
-
return false if @ip.nil?
|
84
|
-
true
|
85
|
-
end
|
86
|
-
|
87
|
-
# Checks equality by comparing each attribute.
|
88
|
-
# @param [Object] Object to be compared
|
89
|
-
def ==(o)
|
90
|
-
return true if self.equal?(o)
|
91
|
-
self.class == o.class &&
|
92
|
-
ip == o.ip
|
93
|
-
end
|
94
|
-
|
95
|
-
# @see the `==` method
|
96
|
-
# @param [Object] Object to be compared
|
97
|
-
def eql?(o)
|
98
|
-
self == o
|
99
|
-
end
|
100
|
-
|
101
|
-
# Calculates hash code according to all attributes.
|
102
|
-
# @return [Integer] Hash code
|
103
|
-
def hash
|
104
|
-
[ip].hash
|
105
|
-
end
|
106
|
-
|
107
|
-
# Builds the object from hash
|
108
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
109
|
-
# @return [Object] Returns the model itself
|
110
|
-
def self.build_from_hash(attributes)
|
111
|
-
return nil unless attributes.is_a?(Hash)
|
112
|
-
attributes = attributes.transform_keys(&:to_sym)
|
113
|
-
transformed_hash = {}
|
114
|
-
openapi_types.each_pair do |key, type|
|
115
|
-
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
116
|
-
transformed_hash["#{key}"] = nil
|
117
|
-
elsif type =~ /\AArray<(.*)>/i
|
118
|
-
# check to ensure the input is an array given that the attribute
|
119
|
-
# is documented as an array but the input is not
|
120
|
-
if attributes[attribute_map[key]].is_a?(Array)
|
121
|
-
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
122
|
-
end
|
123
|
-
elsif !attributes[attribute_map[key]].nil?
|
124
|
-
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
125
|
-
end
|
126
|
-
end
|
127
|
-
new(transformed_hash)
|
128
|
-
end
|
129
|
-
|
130
|
-
# Deserializes the data based on type
|
131
|
-
# @param string type Data type
|
132
|
-
# @param string value Value to be deserialized
|
133
|
-
# @return [Object] Deserialized data
|
134
|
-
def self._deserialize(type, value)
|
135
|
-
case type.to_sym
|
136
|
-
when :Time
|
137
|
-
Time.parse(value)
|
138
|
-
when :Date
|
139
|
-
Date.parse(value)
|
140
|
-
when :String
|
141
|
-
value.to_s
|
142
|
-
when :Integer
|
143
|
-
value.to_i
|
144
|
-
when :Float
|
145
|
-
value.to_f
|
146
|
-
when :Boolean
|
147
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
148
|
-
true
|
149
|
-
else
|
150
|
-
false
|
151
|
-
end
|
152
|
-
when :Object
|
153
|
-
# generic object (usually a Hash), return directly
|
154
|
-
value
|
155
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
156
|
-
inner_type = Regexp.last_match[:inner_type]
|
157
|
-
value.map { |v| _deserialize(inner_type, v) }
|
158
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
159
|
-
k_type = Regexp.last_match[:k_type]
|
160
|
-
v_type = Regexp.last_match[:v_type]
|
161
|
-
{}.tap do |hash|
|
162
|
-
value.each do |k, v|
|
163
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
164
|
-
end
|
165
|
-
end
|
166
|
-
else # model
|
167
|
-
# models (e.g. Pet) or oneOf
|
168
|
-
klass = OpenApiIpifyClient.const_get(type)
|
169
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
170
|
-
end
|
171
|
-
end
|
172
|
-
|
173
|
-
# Returns the string representation of the object
|
174
|
-
# @return [String] String presentation of the object
|
175
|
-
def to_s
|
176
|
-
to_hash.to_s
|
177
|
-
end
|
178
|
-
|
179
|
-
# to_body is an alias to to_hash (backward compatibility)
|
180
|
-
# @return [Hash] Returns the object in the form of hash
|
181
|
-
def to_body
|
182
|
-
to_hash
|
183
|
-
end
|
184
|
-
|
185
|
-
# Returns the object in the form of hash
|
186
|
-
# @return [Hash] Returns the object in the form of hash
|
187
|
-
def to_hash
|
188
|
-
hash = {}
|
189
|
-
self.class.attribute_map.each_pair do |attr, param|
|
190
|
-
value = self.send(attr)
|
191
|
-
if value.nil?
|
192
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
193
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
194
|
-
end
|
195
|
-
|
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
|
-
|
219
|
-
end
|
220
|
-
|
221
|
-
end
|
data/spec/models/ip_spec.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#openapi-ipify
|
3
|
-
|
4
|
-
#OpenAPI client for ipify, a simple public IP address API
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 5.2.0
|
7
|
-
Contact: blah+oapicf@cliffano.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.4.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'spec_helper'
|
14
|
-
require 'json'
|
15
|
-
require 'date'
|
16
|
-
|
17
|
-
# Unit tests for OpenApiIpifyClient::Ip
|
18
|
-
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
-
# Please update as you see appropriate
|
20
|
-
describe OpenApiIpifyClient::Ip do
|
21
|
-
let(:instance) { OpenApiIpifyClient::Ip.new }
|
22
|
-
|
23
|
-
describe 'test an instance of Ip' do
|
24
|
-
it 'should create an instance of Ip' do
|
25
|
-
# uncomment below to test the instance creation
|
26
|
-
#expect(instance).to be_instance_of(OpenApiIpifyClient::Ip)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
describe 'test attribute "ip"' do
|
31
|
-
it 'should work' do
|
32
|
-
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|