togglr-sdk 1.0.1 → 1.0.3

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 (54) hide show
  1. checksums.yaml +4 -4
  2. data/lib/togglr/client.rb +2 -9
  3. data/lib/togglr/version.rb +1 -1
  4. metadata +1 -51
  5. data/generated/Gemfile +0 -9
  6. data/generated/README.md +0 -121
  7. data/generated/Rakefile +0 -10
  8. data/generated/docs/DefaultApi.md +0 -282
  9. data/generated/docs/Error.md +0 -18
  10. data/generated/docs/ErrorBadRequest.md +0 -18
  11. data/generated/docs/ErrorError.md +0 -18
  12. data/generated/docs/ErrorInternalServerError.md +0 -18
  13. data/generated/docs/ErrorNotFound.md +0 -18
  14. data/generated/docs/ErrorPermissionDenied.md +0 -18
  15. data/generated/docs/ErrorTooManyRequests.md +0 -18
  16. data/generated/docs/ErrorUnauthorized.md +0 -18
  17. data/generated/docs/EvaluateResponse.md +0 -22
  18. data/generated/docs/FeatureErrorReport.md +0 -22
  19. data/generated/docs/FeatureHealth.md +0 -30
  20. data/generated/docs/HealthResponse.md +0 -20
  21. data/generated/git_push.sh +0 -57
  22. data/generated/lib/togglr-client/api/default_api.rb +0 -284
  23. data/generated/lib/togglr-client/api_client.rb +0 -437
  24. data/generated/lib/togglr-client/api_error.rb +0 -58
  25. data/generated/lib/togglr-client/configuration.rb +0 -392
  26. data/generated/lib/togglr-client/models/error.rb +0 -237
  27. data/generated/lib/togglr-client/models/error_bad_request.rb +0 -244
  28. data/generated/lib/togglr-client/models/error_error.rb +0 -220
  29. data/generated/lib/togglr-client/models/error_internal_server_error.rb +0 -244
  30. data/generated/lib/togglr-client/models/error_not_found.rb +0 -244
  31. data/generated/lib/togglr-client/models/error_permission_denied.rb +0 -244
  32. data/generated/lib/togglr-client/models/error_too_many_requests.rb +0 -244
  33. data/generated/lib/togglr-client/models/error_unauthorized.rb +0 -244
  34. data/generated/lib/togglr-client/models/evaluate_response.rb +0 -289
  35. data/generated/lib/togglr-client/models/feature_error_report.rb +0 -274
  36. data/generated/lib/togglr-client/models/feature_health.rb +0 -342
  37. data/generated/lib/togglr-client/models/health_response.rb +0 -287
  38. data/generated/lib/togglr-client/version.rb +0 -15
  39. data/generated/lib/togglr-client.rb +0 -52
  40. data/generated/spec/api/default_api_spec.rb +0 -81
  41. data/generated/spec/models/error_bad_request_spec.rb +0 -36
  42. data/generated/spec/models/error_error_spec.rb +0 -36
  43. data/generated/spec/models/error_internal_server_error_spec.rb +0 -36
  44. data/generated/spec/models/error_not_found_spec.rb +0 -36
  45. data/generated/spec/models/error_permission_denied_spec.rb +0 -36
  46. data/generated/spec/models/error_spec.rb +0 -36
  47. data/generated/spec/models/error_too_many_requests_spec.rb +0 -36
  48. data/generated/spec/models/error_unauthorized_spec.rb +0 -36
  49. data/generated/spec/models/evaluate_response_spec.rb +0 -48
  50. data/generated/spec/models/feature_error_report_spec.rb +0 -48
  51. data/generated/spec/models/feature_health_spec.rb +0 -72
  52. data/generated/spec/models/health_response_spec.rb +0 -46
  53. data/generated/spec/spec_helper.rb +0 -111
  54. data/generated/togglr-client.gemspec +0 -41
@@ -1,244 +0,0 @@
1
- =begin
2
- #SDK API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.15.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module TogglrClient
17
- class ErrorBadRequest
18
- attr_accessor :error
19
-
20
- # Attribute mapping from ruby-style variable name to JSON key.
21
- def self.attribute_map
22
- {
23
- :'error' => :'error'
24
- }
25
- end
26
-
27
- # Returns attribute mapping this model knows about
28
- def self.acceptable_attribute_map
29
- attribute_map
30
- end
31
-
32
- # Returns all the JSON keys this model knows about
33
- def self.acceptable_attributes
34
- acceptable_attribute_map.values
35
- end
36
-
37
- # Attribute type mapping.
38
- def self.openapi_types
39
- {
40
- :'error' => :'ErrorError'
41
- }
42
- end
43
-
44
- # List of attributes with nullable: true
45
- def self.openapi_nullable
46
- Set.new([
47
- ])
48
- end
49
-
50
- # List of class defined in allOf (OpenAPI v3)
51
- def self.openapi_all_of
52
- [
53
- :'Error'
54
- ]
55
- end
56
-
57
- # Initializes the object
58
- # @param [Hash] attributes Model attributes in the form of hash
59
- def initialize(attributes = {})
60
- if (!attributes.is_a?(Hash))
61
- fail ArgumentError, "The input argument (attributes) must be a hash in `TogglrClient::ErrorBadRequest` initialize method"
62
- end
63
-
64
- # check to see if the attribute exists and convert string to symbol for hash key
65
- acceptable_attribute_map = self.class.acceptable_attribute_map
66
- attributes = attributes.each_with_object({}) { |(k, v), h|
67
- if (!acceptable_attribute_map.key?(k.to_sym))
68
- fail ArgumentError, "`#{k}` is not a valid attribute in `TogglrClient::ErrorBadRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
- end
70
- h[k.to_sym] = v
71
- }
72
-
73
- if attributes.key?(:'error')
74
- self.error = attributes[:'error']
75
- else
76
- self.error = nil
77
- end
78
- end
79
-
80
- # Show invalid properties with the reasons. Usually used together with valid?
81
- # @return Array for valid properties with the reasons
82
- def list_invalid_properties
83
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
- invalid_properties = Array.new
85
- if @error.nil?
86
- invalid_properties.push('invalid value for "error", error cannot be nil.')
87
- end
88
-
89
- invalid_properties
90
- end
91
-
92
- # Check to see if the all the properties in the model are valid
93
- # @return true if the model is valid
94
- def valid?
95
- warn '[DEPRECATED] the `valid?` method is obsolete'
96
- return false if @error.nil?
97
- true
98
- end
99
-
100
- # Custom attribute writer method with validation
101
- # @param [Object] error Value to be assigned
102
- def error=(error)
103
- if error.nil?
104
- fail ArgumentError, 'error cannot be nil'
105
- end
106
-
107
- @error = error
108
- end
109
-
110
- # Checks equality by comparing each attribute.
111
- # @param [Object] Object to be compared
112
- def ==(o)
113
- return true if self.equal?(o)
114
- self.class == o.class &&
115
- error == o.error
116
- end
117
-
118
- # @see the `==` method
119
- # @param [Object] Object to be compared
120
- def eql?(o)
121
- self == o
122
- end
123
-
124
- # Calculates hash code according to all attributes.
125
- # @return [Integer] Hash code
126
- def hash
127
- [error].hash
128
- end
129
-
130
- # Builds the object from hash
131
- # @param [Hash] attributes Model attributes in the form of hash
132
- # @return [Object] Returns the model itself
133
- def self.build_from_hash(attributes)
134
- return nil unless attributes.is_a?(Hash)
135
- attributes = attributes.transform_keys(&:to_sym)
136
- transformed_hash = {}
137
- openapi_types.each_pair do |key, type|
138
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
139
- transformed_hash["#{key}"] = nil
140
- elsif type =~ /\AArray<(.*)>/i
141
- # check to ensure the input is an array given that the attribute
142
- # is documented as an array but the input is not
143
- if attributes[attribute_map[key]].is_a?(Array)
144
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
145
- end
146
- elsif !attributes[attribute_map[key]].nil?
147
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
148
- end
149
- end
150
- new(transformed_hash)
151
- end
152
-
153
- # Deserializes the data based on type
154
- # @param string type Data type
155
- # @param string value Value to be deserialized
156
- # @return [Object] Deserialized data
157
- def self._deserialize(type, value)
158
- case type.to_sym
159
- when :Time
160
- Time.parse(value)
161
- when :Date
162
- Date.parse(value)
163
- when :String
164
- value.to_s
165
- when :Integer
166
- value.to_i
167
- when :Float
168
- value.to_f
169
- when :Boolean
170
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
- true
172
- else
173
- false
174
- end
175
- when :Object
176
- # generic object (usually a Hash), return directly
177
- value
178
- when /\AArray<(?<inner_type>.+)>\z/
179
- inner_type = Regexp.last_match[:inner_type]
180
- value.map { |v| _deserialize(inner_type, v) }
181
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
- k_type = Regexp.last_match[:k_type]
183
- v_type = Regexp.last_match[:v_type]
184
- {}.tap do |hash|
185
- value.each do |k, v|
186
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
- end
188
- end
189
- else # model
190
- # models (e.g. Pet) or oneOf
191
- klass = TogglrClient.const_get(type)
192
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
193
- end
194
- end
195
-
196
- # Returns the string representation of the object
197
- # @return [String] String presentation of the object
198
- def to_s
199
- to_hash.to_s
200
- end
201
-
202
- # to_body is an alias to to_hash (backward compatibility)
203
- # @return [Hash] Returns the object in the form of hash
204
- def to_body
205
- to_hash
206
- end
207
-
208
- # Returns the object in the form of hash
209
- # @return [Hash] Returns the object in the form of hash
210
- def to_hash
211
- hash = {}
212
- self.class.attribute_map.each_pair do |attr, param|
213
- value = self.send(attr)
214
- if value.nil?
215
- is_nullable = self.class.openapi_nullable.include?(attr)
216
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
- end
218
-
219
- hash[param] = _to_hash(value)
220
- end
221
- hash
222
- end
223
-
224
- # Outputs non-array value in the form of hash
225
- # For object, use to_hash. Otherwise, just return the value
226
- # @param [Object] value Any valid value
227
- # @return [Hash] Returns the value in the form of hash
228
- def _to_hash(value)
229
- if value.is_a?(Array)
230
- value.compact.map { |v| _to_hash(v) }
231
- elsif value.is_a?(Hash)
232
- {}.tap do |hash|
233
- value.each { |k, v| hash[k] = _to_hash(v) }
234
- end
235
- elsif value.respond_to? :to_hash
236
- value.to_hash
237
- else
238
- value
239
- end
240
- end
241
-
242
- end
243
-
244
- end
@@ -1,220 +0,0 @@
1
- =begin
2
- #SDK API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.15.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module TogglrClient
17
- class ErrorError
18
- attr_accessor :message
19
-
20
- # Attribute mapping from ruby-style variable name to JSON key.
21
- def self.attribute_map
22
- {
23
- :'message' => :'message'
24
- }
25
- end
26
-
27
- # Returns attribute mapping this model knows about
28
- def self.acceptable_attribute_map
29
- attribute_map
30
- end
31
-
32
- # Returns all the JSON keys this model knows about
33
- def self.acceptable_attributes
34
- acceptable_attribute_map.values
35
- end
36
-
37
- # Attribute type mapping.
38
- def self.openapi_types
39
- {
40
- :'message' => :'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
- if (!attributes.is_a?(Hash))
54
- fail ArgumentError, "The input argument (attributes) must be a hash in `TogglrClient::ErrorError` initialize method"
55
- end
56
-
57
- # check to see if the attribute exists and convert string to symbol for hash key
58
- acceptable_attribute_map = self.class.acceptable_attribute_map
59
- attributes = attributes.each_with_object({}) { |(k, v), h|
60
- if (!acceptable_attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `TogglrClient::ErrorError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
- end
63
- h[k.to_sym] = v
64
- }
65
-
66
- if attributes.key?(:'message')
67
- self.message = attributes[:'message']
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
- invalid_properties = Array.new
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
- true
84
- end
85
-
86
- # Checks equality by comparing each attribute.
87
- # @param [Object] Object to be compared
88
- def ==(o)
89
- return true if self.equal?(o)
90
- self.class == o.class &&
91
- message == o.message
92
- end
93
-
94
- # @see the `==` method
95
- # @param [Object] Object to be compared
96
- def eql?(o)
97
- self == o
98
- end
99
-
100
- # Calculates hash code according to all attributes.
101
- # @return [Integer] Hash code
102
- def hash
103
- [message].hash
104
- end
105
-
106
- # Builds the object from hash
107
- # @param [Hash] attributes Model attributes in the form of hash
108
- # @return [Object] Returns the model itself
109
- def self.build_from_hash(attributes)
110
- return nil unless attributes.is_a?(Hash)
111
- attributes = attributes.transform_keys(&:to_sym)
112
- transformed_hash = {}
113
- openapi_types.each_pair do |key, type|
114
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
115
- transformed_hash["#{key}"] = nil
116
- elsif type =~ /\AArray<(.*)>/i
117
- # check to ensure the input is an array given that the attribute
118
- # is documented as an array but the input is not
119
- if attributes[attribute_map[key]].is_a?(Array)
120
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
121
- end
122
- elsif !attributes[attribute_map[key]].nil?
123
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
124
- end
125
- end
126
- new(transformed_hash)
127
- end
128
-
129
- # Deserializes the data based on type
130
- # @param string type Data type
131
- # @param string value Value to be deserialized
132
- # @return [Object] Deserialized data
133
- def self._deserialize(type, value)
134
- case type.to_sym
135
- when :Time
136
- Time.parse(value)
137
- when :Date
138
- Date.parse(value)
139
- when :String
140
- value.to_s
141
- when :Integer
142
- value.to_i
143
- when :Float
144
- value.to_f
145
- when :Boolean
146
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
- true
148
- else
149
- false
150
- end
151
- when :Object
152
- # generic object (usually a Hash), return directly
153
- value
154
- when /\AArray<(?<inner_type>.+)>\z/
155
- inner_type = Regexp.last_match[:inner_type]
156
- value.map { |v| _deserialize(inner_type, v) }
157
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
- k_type = Regexp.last_match[:k_type]
159
- v_type = Regexp.last_match[:v_type]
160
- {}.tap do |hash|
161
- value.each do |k, v|
162
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
- end
164
- end
165
- else # model
166
- # models (e.g. Pet) or oneOf
167
- klass = TogglrClient.const_get(type)
168
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
- end
170
- end
171
-
172
- # Returns the string representation of the object
173
- # @return [String] String presentation of the object
174
- def to_s
175
- to_hash.to_s
176
- end
177
-
178
- # to_body is an alias to to_hash (backward compatibility)
179
- # @return [Hash] Returns the object in the form of hash
180
- def to_body
181
- to_hash
182
- end
183
-
184
- # Returns the object in the form of hash
185
- # @return [Hash] Returns the object in the form of hash
186
- def to_hash
187
- hash = {}
188
- self.class.attribute_map.each_pair do |attr, param|
189
- value = self.send(attr)
190
- if value.nil?
191
- is_nullable = self.class.openapi_nullable.include?(attr)
192
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
- end
194
-
195
- hash[param] = _to_hash(value)
196
- end
197
- hash
198
- end
199
-
200
- # Outputs non-array value in the form of hash
201
- # For object, use to_hash. Otherwise, just return the value
202
- # @param [Object] value Any valid value
203
- # @return [Hash] Returns the value in the form of hash
204
- def _to_hash(value)
205
- if value.is_a?(Array)
206
- value.compact.map { |v| _to_hash(v) }
207
- elsif value.is_a?(Hash)
208
- {}.tap do |hash|
209
- value.each { |k, v| hash[k] = _to_hash(v) }
210
- end
211
- elsif value.respond_to? :to_hash
212
- value.to_hash
213
- else
214
- value
215
- end
216
- end
217
-
218
- end
219
-
220
- end
@@ -1,244 +0,0 @@
1
- =begin
2
- #SDK API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: 1.0.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.15.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module TogglrClient
17
- class ErrorInternalServerError
18
- attr_accessor :error
19
-
20
- # Attribute mapping from ruby-style variable name to JSON key.
21
- def self.attribute_map
22
- {
23
- :'error' => :'error'
24
- }
25
- end
26
-
27
- # Returns attribute mapping this model knows about
28
- def self.acceptable_attribute_map
29
- attribute_map
30
- end
31
-
32
- # Returns all the JSON keys this model knows about
33
- def self.acceptable_attributes
34
- acceptable_attribute_map.values
35
- end
36
-
37
- # Attribute type mapping.
38
- def self.openapi_types
39
- {
40
- :'error' => :'ErrorError'
41
- }
42
- end
43
-
44
- # List of attributes with nullable: true
45
- def self.openapi_nullable
46
- Set.new([
47
- ])
48
- end
49
-
50
- # List of class defined in allOf (OpenAPI v3)
51
- def self.openapi_all_of
52
- [
53
- :'Error'
54
- ]
55
- end
56
-
57
- # Initializes the object
58
- # @param [Hash] attributes Model attributes in the form of hash
59
- def initialize(attributes = {})
60
- if (!attributes.is_a?(Hash))
61
- fail ArgumentError, "The input argument (attributes) must be a hash in `TogglrClient::ErrorInternalServerError` initialize method"
62
- end
63
-
64
- # check to see if the attribute exists and convert string to symbol for hash key
65
- acceptable_attribute_map = self.class.acceptable_attribute_map
66
- attributes = attributes.each_with_object({}) { |(k, v), h|
67
- if (!acceptable_attribute_map.key?(k.to_sym))
68
- fail ArgumentError, "`#{k}` is not a valid attribute in `TogglrClient::ErrorInternalServerError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
- end
70
- h[k.to_sym] = v
71
- }
72
-
73
- if attributes.key?(:'error')
74
- self.error = attributes[:'error']
75
- else
76
- self.error = nil
77
- end
78
- end
79
-
80
- # Show invalid properties with the reasons. Usually used together with valid?
81
- # @return Array for valid properties with the reasons
82
- def list_invalid_properties
83
- warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
- invalid_properties = Array.new
85
- if @error.nil?
86
- invalid_properties.push('invalid value for "error", error cannot be nil.')
87
- end
88
-
89
- invalid_properties
90
- end
91
-
92
- # Check to see if the all the properties in the model are valid
93
- # @return true if the model is valid
94
- def valid?
95
- warn '[DEPRECATED] the `valid?` method is obsolete'
96
- return false if @error.nil?
97
- true
98
- end
99
-
100
- # Custom attribute writer method with validation
101
- # @param [Object] error Value to be assigned
102
- def error=(error)
103
- if error.nil?
104
- fail ArgumentError, 'error cannot be nil'
105
- end
106
-
107
- @error = error
108
- end
109
-
110
- # Checks equality by comparing each attribute.
111
- # @param [Object] Object to be compared
112
- def ==(o)
113
- return true if self.equal?(o)
114
- self.class == o.class &&
115
- error == o.error
116
- end
117
-
118
- # @see the `==` method
119
- # @param [Object] Object to be compared
120
- def eql?(o)
121
- self == o
122
- end
123
-
124
- # Calculates hash code according to all attributes.
125
- # @return [Integer] Hash code
126
- def hash
127
- [error].hash
128
- end
129
-
130
- # Builds the object from hash
131
- # @param [Hash] attributes Model attributes in the form of hash
132
- # @return [Object] Returns the model itself
133
- def self.build_from_hash(attributes)
134
- return nil unless attributes.is_a?(Hash)
135
- attributes = attributes.transform_keys(&:to_sym)
136
- transformed_hash = {}
137
- openapi_types.each_pair do |key, type|
138
- if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
139
- transformed_hash["#{key}"] = nil
140
- elsif type =~ /\AArray<(.*)>/i
141
- # check to ensure the input is an array given that the attribute
142
- # is documented as an array but the input is not
143
- if attributes[attribute_map[key]].is_a?(Array)
144
- transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
145
- end
146
- elsif !attributes[attribute_map[key]].nil?
147
- transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
148
- end
149
- end
150
- new(transformed_hash)
151
- end
152
-
153
- # Deserializes the data based on type
154
- # @param string type Data type
155
- # @param string value Value to be deserialized
156
- # @return [Object] Deserialized data
157
- def self._deserialize(type, value)
158
- case type.to_sym
159
- when :Time
160
- Time.parse(value)
161
- when :Date
162
- Date.parse(value)
163
- when :String
164
- value.to_s
165
- when :Integer
166
- value.to_i
167
- when :Float
168
- value.to_f
169
- when :Boolean
170
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
- true
172
- else
173
- false
174
- end
175
- when :Object
176
- # generic object (usually a Hash), return directly
177
- value
178
- when /\AArray<(?<inner_type>.+)>\z/
179
- inner_type = Regexp.last_match[:inner_type]
180
- value.map { |v| _deserialize(inner_type, v) }
181
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
- k_type = Regexp.last_match[:k_type]
183
- v_type = Regexp.last_match[:v_type]
184
- {}.tap do |hash|
185
- value.each do |k, v|
186
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
- end
188
- end
189
- else # model
190
- # models (e.g. Pet) or oneOf
191
- klass = TogglrClient.const_get(type)
192
- klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
193
- end
194
- end
195
-
196
- # Returns the string representation of the object
197
- # @return [String] String presentation of the object
198
- def to_s
199
- to_hash.to_s
200
- end
201
-
202
- # to_body is an alias to to_hash (backward compatibility)
203
- # @return [Hash] Returns the object in the form of hash
204
- def to_body
205
- to_hash
206
- end
207
-
208
- # Returns the object in the form of hash
209
- # @return [Hash] Returns the object in the form of hash
210
- def to_hash
211
- hash = {}
212
- self.class.attribute_map.each_pair do |attr, param|
213
- value = self.send(attr)
214
- if value.nil?
215
- is_nullable = self.class.openapi_nullable.include?(attr)
216
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
- end
218
-
219
- hash[param] = _to_hash(value)
220
- end
221
- hash
222
- end
223
-
224
- # Outputs non-array value in the form of hash
225
- # For object, use to_hash. Otherwise, just return the value
226
- # @param [Object] value Any valid value
227
- # @return [Hash] Returns the value in the form of hash
228
- def _to_hash(value)
229
- if value.is_a?(Array)
230
- value.compact.map { |v| _to_hash(v) }
231
- elsif value.is_a?(Hash)
232
- {}.tap do |hash|
233
- value.each { |k, v| hash[k] = _to_hash(v) }
234
- end
235
- elsif value.respond_to? :to_hash
236
- value.to_hash
237
- else
238
- value
239
- end
240
- end
241
-
242
- end
243
-
244
- end