kleister 1.5.2 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +3 -3
- data/lib/kleister/api/auth_api.rb +55 -0
- data/lib/kleister/models/provider.rb +234 -0
- data/lib/kleister/models/providers.rb +220 -0
- data/lib/kleister/version.rb +1 -1
- data/lib/kleister.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ae43a0c9a782a982beda7f9c46eb464a778f3fa93588c571ba51a7f4c7819bf
|
4
|
+
data.tar.gz: bd6cf0d381b4ab7202b91bb92e77d1827bbb351f21a7086e8a5969178c4e922c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e05f6b4c4457109449e53b61e3149c8e7dfbf61aedb16bfda0611f0b178ccdc8c65e0ec31055854dc1f279a0e9f68e4e672699a7749b51f1ec2dba23ba597af
|
7
|
+
data.tar.gz: d432a03031f2dd129a285ab9fbeb632f33544777d164fa86a00b62ebb7add3edd81c7295bb7f60e1dd462747f00870302fada325172ef8352c9f8f0e058472a7
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.6.0](https://github.com/kleister/kleister-ruby/compare/v1.5.2...v1.6.0) (2024-10-21)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* automated openapi client update ([c86c7fd](https://github.com/kleister/kleister-ruby/commit/c86c7fd75e9e8734236f3706d91b90f02ec2028d))
|
9
|
+
* automated openapi client update ([0bcb784](https://github.com/kleister/kleister-ruby/commit/0bcb78482ec9118709b7c695186bf471b36cf4b2))
|
10
|
+
* **deps:** update dependency rubocop to '~> 1.67.0' ([01d00e5](https://github.com/kleister/kleister-ruby/commit/01d00e5e2e46770e5b8d92e53e7823949f83d463))
|
11
|
+
|
3
12
|
## [1.5.2](https://github.com/kleister/kleister-ruby/compare/v1.5.1...v1.5.2) (2024-09-30)
|
4
13
|
|
5
14
|
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ This repository provides a client SDK for Ruby. This SDK is automatically
|
|
6
6
|
generated by the [OpenAPI Generator][generator] project:
|
7
7
|
|
8
8
|
- API version: 1.0.0-alpha1
|
9
|
-
- Package version: 1.
|
9
|
+
- Package version: 1.6.0
|
10
10
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
11
11
|
|
12
12
|
For more information, please visit [https://kleister.eu](https://kleister.eu)
|
@@ -21,7 +21,7 @@ the built gem:
|
|
21
21
|
|
22
22
|
```console
|
23
23
|
gem build kleister.gemspec
|
24
|
-
gem install ./kleister-1.
|
24
|
+
gem install ./kleister-1.6.0.gem
|
25
25
|
```
|
26
26
|
|
27
27
|
### Install from Rubygems
|
@@ -30,7 +30,7 @@ If you want to use a a properly released version hosted Rubygems you just need
|
|
30
30
|
to add the following line to your Gemfile:
|
31
31
|
|
32
32
|
```ruby
|
33
|
-
gem 'kleister', '~> 1.
|
33
|
+
gem 'kleister', '~> 1.6.0'
|
34
34
|
```
|
35
35
|
|
36
36
|
### Install from Git
|
@@ -151,6 +151,61 @@ module Kleister
|
|
151
151
|
[data, status_code, headers]
|
152
152
|
end
|
153
153
|
|
154
|
+
# Fetch the available auth providers
|
155
|
+
# @param [Hash] opts the optional parameters
|
156
|
+
# @return [Providers]
|
157
|
+
def external_providers(opts = {})
|
158
|
+
data, _status_code, _headers = external_providers_with_http_info(opts)
|
159
|
+
data
|
160
|
+
end
|
161
|
+
|
162
|
+
# Fetch the available auth providers
|
163
|
+
# @param [Hash] opts the optional parameters
|
164
|
+
# @return [Array<(Providers, Integer, Hash)>] Providers data, response status code and response headers
|
165
|
+
def external_providers_with_http_info(opts = {})
|
166
|
+
if @api_client.config.debugging
|
167
|
+
@api_client.config.logger.debug 'Calling API: AuthApi.external_providers ...'
|
168
|
+
end
|
169
|
+
# resource path
|
170
|
+
local_var_path = '/auth/providers'
|
171
|
+
|
172
|
+
# query parameters
|
173
|
+
query_params = opts[:query_params] || {}
|
174
|
+
|
175
|
+
# header parameters
|
176
|
+
header_params = opts[:header_params] || {}
|
177
|
+
# HTTP header 'Accept' (if needed)
|
178
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
179
|
+
|
180
|
+
# form parameters
|
181
|
+
form_params = opts[:form_params] || {}
|
182
|
+
|
183
|
+
# http body (model)
|
184
|
+
post_body = opts[:debug_body]
|
185
|
+
|
186
|
+
# return_type
|
187
|
+
return_type = opts[:debug_return_type] || 'Providers'
|
188
|
+
|
189
|
+
# auth_names
|
190
|
+
auth_names = opts[:debug_auth_names] || []
|
191
|
+
|
192
|
+
new_options = opts.merge(
|
193
|
+
operation: :'AuthApi.external_providers',
|
194
|
+
header_params: header_params,
|
195
|
+
query_params: query_params,
|
196
|
+
form_params: form_params,
|
197
|
+
body: post_body,
|
198
|
+
auth_names: auth_names,
|
199
|
+
return_type: return_type
|
200
|
+
)
|
201
|
+
|
202
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
203
|
+
if @api_client.config.debugging
|
204
|
+
@api_client.config.logger.debug "API called: AuthApi#external_providers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
205
|
+
end
|
206
|
+
[data, status_code, headers]
|
207
|
+
end
|
208
|
+
|
154
209
|
# Authenticate an user by credentials
|
155
210
|
# @param auth_login [AuthLogin] The credentials to authenticate
|
156
211
|
# @param [Hash] opts the optional parameters
|
@@ -0,0 +1,234 @@
|
|
1
|
+
# Kleister OpenAPI
|
2
|
+
#
|
3
|
+
# API definition for Kleister, manage mod packs for Minecraft
|
4
|
+
#
|
5
|
+
# The version of the OpenAPI document: 1.0.0-alpha1
|
6
|
+
# Contact: kleister@webhippie.de
|
7
|
+
# Generated by: https://openapi-generator.tech
|
8
|
+
# Generator version: 7.6.0
|
9
|
+
#
|
10
|
+
|
11
|
+
require 'date'
|
12
|
+
require 'time'
|
13
|
+
|
14
|
+
module Kleister
|
15
|
+
# Model to represent auth provider
|
16
|
+
class Provider
|
17
|
+
attr_accessor :name, :driver, :display, :icon
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
name: :name,
|
23
|
+
driver: :driver,
|
24
|
+
display: :display,
|
25
|
+
icon: :icon
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns all the JSON keys this model knows about
|
30
|
+
def self.acceptable_attributes
|
31
|
+
attribute_map.values
|
32
|
+
end
|
33
|
+
|
34
|
+
# Attribute type mapping.
|
35
|
+
def self.openapi_types
|
36
|
+
{
|
37
|
+
name: :String,
|
38
|
+
driver: :String,
|
39
|
+
display: :String,
|
40
|
+
icon: :String
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# List of attributes with nullable: true
|
45
|
+
def self.openapi_nullable
|
46
|
+
Set.new([
|
47
|
+
])
|
48
|
+
end
|
49
|
+
|
50
|
+
# Initializes the object
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
52
|
+
def initialize(attributes = {})
|
53
|
+
unless attributes.is_a?(Hash)
|
54
|
+
raise ArgumentError, 'The input argument (attributes) must be a hash in `Kleister::Provider` initialize method'
|
55
|
+
end
|
56
|
+
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
58
|
+
attributes = attributes.each_with_object({}) do |(k, v), h|
|
59
|
+
unless self.class.attribute_map.key?(k.to_sym)
|
60
|
+
raise ArgumentError, "`#{k}` is not a valid attribute in `Kleister::Provider`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
61
|
+
end
|
62
|
+
|
63
|
+
h[k.to_sym] = v
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.key?(:name)
|
67
|
+
self.name = attributes[:name]
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes.key?(:driver)
|
71
|
+
self.driver = attributes[:driver]
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.key?(:display)
|
75
|
+
self.display = attributes[:display]
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:icon)
|
79
|
+
self.icon = attributes[:icon]
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
84
|
+
# @return Array for valid properties with the reasons
|
85
|
+
def list_invalid_properties
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
87
|
+
[]
|
88
|
+
end
|
89
|
+
|
90
|
+
# Check to see if the all the properties in the model are valid
|
91
|
+
# @return true if the model is valid
|
92
|
+
def valid?
|
93
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
94
|
+
true
|
95
|
+
end
|
96
|
+
|
97
|
+
# Checks equality by comparing each attribute.
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def ==(other)
|
100
|
+
return true if equal?(other)
|
101
|
+
|
102
|
+
self.class == other.class &&
|
103
|
+
name == other.name &&
|
104
|
+
driver == other.driver &&
|
105
|
+
display == other.display &&
|
106
|
+
icon == other.icon
|
107
|
+
end
|
108
|
+
|
109
|
+
# @see the `==` method
|
110
|
+
# @param [Object] Object to be compared
|
111
|
+
def eql?(other)
|
112
|
+
self == other
|
113
|
+
end
|
114
|
+
|
115
|
+
# Calculates hash code according to all attributes.
|
116
|
+
# @return [Integer] Hash code
|
117
|
+
def hash
|
118
|
+
[name, driver, display, icon].hash
|
119
|
+
end
|
120
|
+
|
121
|
+
# Builds the object from hash
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
# @return [Object] Returns the model itself
|
124
|
+
def self.build_from_hash(attributes)
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
126
|
+
|
127
|
+
attributes = attributes.transform_keys(&:to_sym)
|
128
|
+
transformed_hash = {}
|
129
|
+
openapi_types.each_pair do |key, type|
|
130
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
131
|
+
transformed_hash[key.to_s] = nil
|
132
|
+
elsif type =~ /\AArray<(.*)>/i
|
133
|
+
# check to ensure the input is an array given that the attribute
|
134
|
+
# is documented as an array but the input is not
|
135
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
136
|
+
transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
|
137
|
+
end
|
138
|
+
elsif !attributes[attribute_map[key]].nil?
|
139
|
+
transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
|
140
|
+
end
|
141
|
+
end
|
142
|
+
new(transformed_hash)
|
143
|
+
end
|
144
|
+
|
145
|
+
# Deserializes the data based on type
|
146
|
+
# @param string type Data type
|
147
|
+
# @param string value Value to be deserialized
|
148
|
+
# @return [Object] Deserialized data
|
149
|
+
def self._deserialize(type, value)
|
150
|
+
case type.to_sym
|
151
|
+
when :Time
|
152
|
+
Time.parse(value)
|
153
|
+
when :Date
|
154
|
+
Date.parse(value)
|
155
|
+
when :String
|
156
|
+
value.to_s
|
157
|
+
when :Integer
|
158
|
+
value.to_i
|
159
|
+
when :Float
|
160
|
+
value.to_f
|
161
|
+
when :Boolean
|
162
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
163
|
+
true
|
164
|
+
else
|
165
|
+
false
|
166
|
+
end
|
167
|
+
when :Object
|
168
|
+
# generic object (usually a Hash), return directly
|
169
|
+
value
|
170
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
171
|
+
inner_type = Regexp.last_match[:inner_type]
|
172
|
+
value.map { |v| _deserialize(inner_type, v) }
|
173
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
174
|
+
k_type = Regexp.last_match[:k_type]
|
175
|
+
v_type = Regexp.last_match[:v_type]
|
176
|
+
{}.tap do |hash|
|
177
|
+
value.each do |k, v|
|
178
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
else # model
|
182
|
+
# models (e.g. Pet) or oneOf
|
183
|
+
klass = Kleister.const_get(type)
|
184
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
# Returns the string representation of the object
|
189
|
+
# @return [String] String presentation of the object
|
190
|
+
def to_s
|
191
|
+
to_hash.to_s
|
192
|
+
end
|
193
|
+
|
194
|
+
# to_body is an alias to to_hash (backward compatibility)
|
195
|
+
# @return [Hash] Returns the object in the form of hash
|
196
|
+
def to_body
|
197
|
+
to_hash
|
198
|
+
end
|
199
|
+
|
200
|
+
# Returns the object in the form of hash
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
202
|
+
def to_hash
|
203
|
+
hash = {}
|
204
|
+
self.class.attribute_map.each_pair do |attr, param|
|
205
|
+
value = send(attr)
|
206
|
+
if value.nil?
|
207
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
208
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
209
|
+
end
|
210
|
+
|
211
|
+
hash[param] = _to_hash(value)
|
212
|
+
end
|
213
|
+
hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Outputs non-array value in the form of hash
|
217
|
+
# For object, use to_hash. Otherwise, just return the value
|
218
|
+
# @param [Object] value Any valid value
|
219
|
+
# @return [Hash] Returns the value in the form of hash
|
220
|
+
def _to_hash(value)
|
221
|
+
if value.is_a?(Array)
|
222
|
+
value.compact.map { |v| _to_hash(v) }
|
223
|
+
elsif value.is_a?(Hash)
|
224
|
+
{}.tap do |hash|
|
225
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
226
|
+
end
|
227
|
+
elsif value.respond_to? :to_hash
|
228
|
+
value.to_hash
|
229
|
+
else
|
230
|
+
value
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
@@ -0,0 +1,220 @@
|
|
1
|
+
# Kleister OpenAPI
|
2
|
+
#
|
3
|
+
# API definition for Kleister, manage mod packs for Minecraft
|
4
|
+
#
|
5
|
+
# The version of the OpenAPI document: 1.0.0-alpha1
|
6
|
+
# Contact: kleister@webhippie.de
|
7
|
+
# Generated by: https://openapi-generator.tech
|
8
|
+
# Generator version: 7.6.0
|
9
|
+
#
|
10
|
+
|
11
|
+
require 'date'
|
12
|
+
require 'time'
|
13
|
+
|
14
|
+
module Kleister
|
15
|
+
# Model to represent list of auth providers
|
16
|
+
class Providers
|
17
|
+
attr_accessor :total, :listing
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
total: :total,
|
23
|
+
listing: :listing
|
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
|
+
total: :Integer,
|
36
|
+
listing: :'Array<Provider>'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# List of attributes with nullable: true
|
41
|
+
def self.openapi_nullable
|
42
|
+
Set.new([
|
43
|
+
])
|
44
|
+
end
|
45
|
+
|
46
|
+
# Initializes the object
|
47
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
48
|
+
def initialize(attributes = {})
|
49
|
+
unless attributes.is_a?(Hash)
|
50
|
+
raise ArgumentError, 'The input argument (attributes) must be a hash in `Kleister::Providers` initialize method'
|
51
|
+
end
|
52
|
+
|
53
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) do |(k, v), h|
|
55
|
+
unless self.class.attribute_map.key?(k.to_sym)
|
56
|
+
raise ArgumentError, "`#{k}` is not a valid attribute in `Kleister::Providers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
57
|
+
end
|
58
|
+
|
59
|
+
h[k.to_sym] = v
|
60
|
+
end
|
61
|
+
|
62
|
+
if attributes.key?(:total)
|
63
|
+
self.total = attributes[:total]
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.key?(:listing) && (value = attributes[:listing]).is_a?(Array)
|
67
|
+
self.listing = value
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
72
|
+
# @return Array for valid properties with the reasons
|
73
|
+
def list_invalid_properties
|
74
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
75
|
+
[]
|
76
|
+
end
|
77
|
+
|
78
|
+
# Check to see if the all the properties in the model are valid
|
79
|
+
# @return true if the model is valid
|
80
|
+
def valid?
|
81
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
82
|
+
true
|
83
|
+
end
|
84
|
+
|
85
|
+
# Checks equality by comparing each attribute.
|
86
|
+
# @param [Object] Object to be compared
|
87
|
+
def ==(other)
|
88
|
+
return true if equal?(other)
|
89
|
+
|
90
|
+
self.class == other.class &&
|
91
|
+
total == other.total &&
|
92
|
+
listing == other.listing
|
93
|
+
end
|
94
|
+
|
95
|
+
# @see the `==` method
|
96
|
+
# @param [Object] Object to be compared
|
97
|
+
def eql?(other)
|
98
|
+
self == other
|
99
|
+
end
|
100
|
+
|
101
|
+
# Calculates hash code according to all attributes.
|
102
|
+
# @return [Integer] Hash code
|
103
|
+
def hash
|
104
|
+
[total, listing].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
|
+
|
113
|
+
attributes = attributes.transform_keys(&:to_sym)
|
114
|
+
transformed_hash = {}
|
115
|
+
openapi_types.each_pair do |key, type|
|
116
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
117
|
+
transformed_hash[key.to_s] = nil
|
118
|
+
elsif type =~ /\AArray<(.*)>/i
|
119
|
+
# check to ensure the input is an array given that the attribute
|
120
|
+
# is documented as an array but the input is not
|
121
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
122
|
+
transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }
|
123
|
+
end
|
124
|
+
elsif !attributes[attribute_map[key]].nil?
|
125
|
+
transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
|
126
|
+
end
|
127
|
+
end
|
128
|
+
new(transformed_hash)
|
129
|
+
end
|
130
|
+
|
131
|
+
# Deserializes the data based on type
|
132
|
+
# @param string type Data type
|
133
|
+
# @param string value Value to be deserialized
|
134
|
+
# @return [Object] Deserialized data
|
135
|
+
def self._deserialize(type, value)
|
136
|
+
case type.to_sym
|
137
|
+
when :Time
|
138
|
+
Time.parse(value)
|
139
|
+
when :Date
|
140
|
+
Date.parse(value)
|
141
|
+
when :String
|
142
|
+
value.to_s
|
143
|
+
when :Integer
|
144
|
+
value.to_i
|
145
|
+
when :Float
|
146
|
+
value.to_f
|
147
|
+
when :Boolean
|
148
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
149
|
+
true
|
150
|
+
else
|
151
|
+
false
|
152
|
+
end
|
153
|
+
when :Object
|
154
|
+
# generic object (usually a Hash), return directly
|
155
|
+
value
|
156
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
157
|
+
inner_type = Regexp.last_match[:inner_type]
|
158
|
+
value.map { |v| _deserialize(inner_type, v) }
|
159
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
160
|
+
k_type = Regexp.last_match[:k_type]
|
161
|
+
v_type = Regexp.last_match[:v_type]
|
162
|
+
{}.tap do |hash|
|
163
|
+
value.each do |k, v|
|
164
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
else # model
|
168
|
+
# models (e.g. Pet) or oneOf
|
169
|
+
klass = Kleister.const_get(type)
|
170
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# Returns the string representation of the object
|
175
|
+
# @return [String] String presentation of the object
|
176
|
+
def to_s
|
177
|
+
to_hash.to_s
|
178
|
+
end
|
179
|
+
|
180
|
+
# to_body is an alias to to_hash (backward compatibility)
|
181
|
+
# @return [Hash] Returns the object in the form of hash
|
182
|
+
def to_body
|
183
|
+
to_hash
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the object in the form of hash
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
188
|
+
def to_hash
|
189
|
+
hash = {}
|
190
|
+
self.class.attribute_map.each_pair do |attr, param|
|
191
|
+
value = send(attr)
|
192
|
+
if value.nil?
|
193
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
194
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
195
|
+
end
|
196
|
+
|
197
|
+
hash[param] = _to_hash(value)
|
198
|
+
end
|
199
|
+
hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Outputs non-array value in the form of hash
|
203
|
+
# For object, use to_hash. Otherwise, just return the value
|
204
|
+
# @param [Object] value Any valid value
|
205
|
+
# @return [Hash] Returns the value in the form of hash
|
206
|
+
def _to_hash(value)
|
207
|
+
if value.is_a?(Array)
|
208
|
+
value.compact.map { |v| _to_hash(v) }
|
209
|
+
elsif value.is_a?(Hash)
|
210
|
+
{}.tap do |hash|
|
211
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
212
|
+
end
|
213
|
+
elsif value.respond_to? :to_hash
|
214
|
+
value.to_hash
|
215
|
+
else
|
216
|
+
value
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
data/lib/kleister/version.rb
CHANGED
data/lib/kleister.rb
CHANGED
@@ -56,6 +56,8 @@ require 'kleister/models/pack_user_params'
|
|
56
56
|
require 'kleister/models/pack_users'
|
57
57
|
require 'kleister/models/packs'
|
58
58
|
require 'kleister/models/profile'
|
59
|
+
require 'kleister/models/provider'
|
60
|
+
require 'kleister/models/providers'
|
59
61
|
require 'kleister/models/quilt'
|
60
62
|
require 'kleister/models/quilt_build_params'
|
61
63
|
require 'kleister/models/quilt_builds'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kleister
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Boerger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -120,6 +120,8 @@ files:
|
|
120
120
|
- lib/kleister/models/pack_users.rb
|
121
121
|
- lib/kleister/models/packs.rb
|
122
122
|
- lib/kleister/models/profile.rb
|
123
|
+
- lib/kleister/models/provider.rb
|
124
|
+
- lib/kleister/models/providers.rb
|
123
125
|
- lib/kleister/models/quilt.rb
|
124
126
|
- lib/kleister/models/quilt_build_params.rb
|
125
127
|
- lib/kleister/models/quilt_builds.rb
|