swagger_aem 3.8.0 → 4.0.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.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +107 -34
  3. data/README.md +8 -12
  4. data/bin/byebug +16 -0
  5. data/bin/coderay +16 -0
  6. data/bin/htmldiff +16 -0
  7. data/bin/ldiff +16 -0
  8. data/bin/pry +16 -0
  9. data/bin/racc +16 -0
  10. data/bin/rake +16 -0
  11. data/bin/rspec +16 -0
  12. data/bin/rubocop +16 -0
  13. data/bin/ruby-parse +16 -0
  14. data/bin/ruby-rewrite +16 -0
  15. data/docs/BundleData.md +24 -23
  16. data/docs/BundleDataProp.md +10 -9
  17. data/docs/BundleInfo.md +12 -11
  18. data/docs/ConsoleApi.md +188 -79
  19. data/docs/CqApi.md +52 -16
  20. data/docs/CrxApi.md +192 -64
  21. data/docs/CustomApi.md +85 -32
  22. data/docs/GraniteApi.md +37 -20
  23. data/docs/InstallStatus.md +8 -7
  24. data/docs/InstallStatusStatus.md +10 -9
  25. data/docs/KeystoreChainItems.md +16 -15
  26. data/docs/KeystoreInfo.md +10 -9
  27. data/docs/KeystoreItems.md +16 -15
  28. data/docs/SamlConfigurationInfo.md +18 -17
  29. data/docs/SamlConfigurationProperties.md +54 -53
  30. data/docs/SamlConfigurationPropertyItemsArray.md +18 -17
  31. data/docs/SamlConfigurationPropertyItemsBoolean.md +18 -17
  32. data/docs/SamlConfigurationPropertyItemsLong.md +18 -17
  33. data/docs/SamlConfigurationPropertyItemsString.md +18 -17
  34. data/docs/SlingApi.md +1021 -496
  35. data/docs/TruststoreInfo.md +10 -9
  36. data/docs/TruststoreItems.md +20 -19
  37. data/git_push.sh +3 -4
  38. data/lib/swagger_aem/api/console_api.rb +33 -27
  39. data/lib/swagger_aem/api/cq_api.rb +11 -9
  40. data/lib/swagger_aem/api/crx_api.rb +42 -32
  41. data/lib/swagger_aem/api/custom_api.rb +15 -12
  42. data/lib/swagger_aem/api/granite_api.rb +11 -7
  43. data/lib/swagger_aem/api/sling_api.rb +342 -298
  44. data/lib/swagger_aem/api_client.rb +73 -64
  45. data/lib/swagger_aem/api_error.rb +3 -2
  46. data/lib/swagger_aem/api_model_base.rb +88 -0
  47. data/lib/swagger_aem/configuration.rb +75 -15
  48. data/lib/swagger_aem/models/bundle_data.rb +32 -91
  49. data/lib/swagger_aem/models/bundle_data_prop.rb +32 -91
  50. data/lib/swagger_aem/models/bundle_info.rb +32 -91
  51. data/lib/swagger_aem/models/install_status.rb +32 -91
  52. data/lib/swagger_aem/models/install_status_status.rb +32 -91
  53. data/lib/swagger_aem/models/keystore_chain_items.rb +32 -91
  54. data/lib/swagger_aem/models/keystore_info.rb +32 -91
  55. data/lib/swagger_aem/models/keystore_items.rb +32 -91
  56. data/lib/swagger_aem/models/saml_configuration_info.rb +32 -91
  57. data/lib/swagger_aem/models/saml_configuration_properties.rb +32 -91
  58. data/lib/swagger_aem/models/saml_configuration_property_items_array.rb +32 -91
  59. data/lib/swagger_aem/models/saml_configuration_property_items_boolean.rb +32 -91
  60. data/lib/swagger_aem/models/saml_configuration_property_items_long.rb +32 -91
  61. data/lib/swagger_aem/models/saml_configuration_property_items_string.rb +32 -91
  62. data/lib/swagger_aem/models/truststore_info.rb +32 -91
  63. data/lib/swagger_aem/models/truststore_items.rb +32 -91
  64. data/lib/swagger_aem/version.rb +3 -3
  65. data/lib/swagger_aem.rb +3 -8
  66. data/spec/api/console_api_spec.rb +8 -8
  67. data/spec/api/cq_api_spec.rb +4 -4
  68. data/spec/api/crx_api_spec.rb +9 -9
  69. data/spec/api/custom_api_spec.rb +5 -5
  70. data/spec/api/granite_api_spec.rb +3 -3
  71. data/spec/api/sling_api_spec.rb +89 -87
  72. data/spec/models/bundle_data_prop_spec.rb +8 -6
  73. data/spec/models/bundle_data_spec.rb +15 -13
  74. data/spec/models/bundle_info_spec.rb +9 -7
  75. data/spec/models/install_status_spec.rb +7 -5
  76. data/spec/models/install_status_status_spec.rb +8 -6
  77. data/spec/models/keystore_chain_items_spec.rb +11 -9
  78. data/spec/models/keystore_info_spec.rb +8 -6
  79. data/spec/models/keystore_items_spec.rb +11 -9
  80. data/spec/models/saml_configuration_info_spec.rb +12 -10
  81. data/spec/models/saml_configuration_properties_spec.rb +30 -28
  82. data/spec/models/saml_configuration_property_items_array_spec.rb +12 -10
  83. data/spec/models/saml_configuration_property_items_boolean_spec.rb +12 -10
  84. data/spec/models/saml_configuration_property_items_long_spec.rb +12 -10
  85. data/spec/models/saml_configuration_property_items_string_spec.rb +12 -10
  86. data/spec/models/truststore_info_spec.rb +8 -6
  87. data/spec/models/truststore_items_spec.rb +13 -11
  88. data/spec/spec_helper.rb +2 -2
  89. data/swagger_aem.gemspec +4 -4
  90. metadata +15 -54
  91. data/docs/InlineObject.md +0 -17
  92. data/docs/InlineObject1.md +0 -17
  93. data/docs/InlineObject2.md +0 -17
  94. data/docs/InlineObject3.md +0 -17
  95. data/docs/InlineObject4.md +0 -21
  96. data/docs/InlineObject5.md +0 -19
  97. data/lib/swagger_aem/models/inline_object.rb +0 -206
  98. data/lib/swagger_aem/models/inline_object1.rb +0 -206
  99. data/lib/swagger_aem/models/inline_object2.rb +0 -206
  100. data/lib/swagger_aem/models/inline_object3.rb +0 -206
  101. data/lib/swagger_aem/models/inline_object4.rb +0 -224
  102. data/lib/swagger_aem/models/inline_object5.rb +0 -215
  103. data/spec/api_client_spec.rb +0 -226
  104. data/spec/configuration_spec.rb +0 -42
  105. data/spec/models/inline_object1_spec.rb +0 -41
  106. data/spec/models/inline_object2_spec.rb +0 -41
  107. data/spec/models/inline_object3_spec.rb +0 -41
  108. data/spec/models/inline_object4_spec.rb +0 -53
  109. data/spec/models/inline_object5_spec.rb +0 -47
  110. data/spec/models/inline_object_spec.rb +0 -41
@@ -3,17 +3,18 @@
3
3
 
4
4
  #Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API
5
5
 
6
- The version of the OpenAPI document: 3.7.1-pre.0
6
+ The version of the OpenAPI document: 4.0.0
7
7
  Contact: opensource@shinesolutions.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module SwaggerAemClient
16
- class SamlConfigurationPropertyItemsLong
17
+ class SamlConfigurationPropertyItemsLong < ApiModelBase
17
18
  # property name
18
19
  attr_accessor :name
19
20
 
@@ -44,6 +45,16 @@ module SwaggerAemClient
44
45
  }
45
46
  end
46
47
 
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
47
58
  # Attribute type mapping.
48
59
  def self.openapi_types
49
60
  {
@@ -70,9 +81,10 @@ module SwaggerAemClient
70
81
  end
71
82
 
72
83
  # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
73
85
  attributes = attributes.each_with_object({}) { |(k, v), h|
74
- if (!self.class.attribute_map.key?(k.to_sym))
75
- fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerAemClient::SamlConfigurationPropertyItemsLong`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerAemClient::SamlConfigurationPropertyItemsLong`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
76
88
  end
77
89
  h[k.to_sym] = v
78
90
  }
@@ -105,6 +117,7 @@ module SwaggerAemClient
105
117
  # Show invalid properties with the reasons. Usually used together with valid?
106
118
  # @return Array for valid properties with the reasons
107
119
  def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
108
121
  invalid_properties = Array.new
109
122
  invalid_properties
110
123
  end
@@ -112,6 +125,7 @@ module SwaggerAemClient
112
125
  # Check to see if the all the properties in the model are valid
113
126
  # @return true if the model is valid
114
127
  def valid?
128
+ warn '[DEPRECATED] the `valid?` method is obsolete'
115
129
  true
116
130
  end
117
131
 
@@ -144,80 +158,23 @@ module SwaggerAemClient
144
158
  # @param [Hash] attributes Model attributes in the form of hash
145
159
  # @return [Object] Returns the model itself
146
160
  def self.build_from_hash(attributes)
147
- new.build_from_hash(attributes)
148
- end
149
-
150
- # Builds the object from hash
151
- # @param [Hash] attributes Model attributes in the form of hash
152
- # @return [Object] Returns the model itself
153
- def build_from_hash(attributes)
154
161
  return nil unless attributes.is_a?(Hash)
155
- self.class.openapi_types.each_pair do |key, type|
156
- if type =~ /\AArray<(.*)>/i
162
+ attributes = attributes.transform_keys(&:to_sym)
163
+ transformed_hash = {}
164
+ openapi_types.each_pair do |key, type|
165
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = nil
167
+ elsif type =~ /\AArray<(.*)>/i
157
168
  # check to ensure the input is an array given that the attribute
158
169
  # is documented as an array but the input is not
159
- if attributes[self.class.attribute_map[key]].is_a?(Array)
160
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
170
+ if attributes[attribute_map[key]].is_a?(Array)
171
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
161
172
  end
162
- elsif !attributes[self.class.attribute_map[key]].nil?
163
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
164
- end # or else data not found in attributes(hash), not an issue as the data can be optional
165
- end
166
-
167
- self
168
- end
169
-
170
- # Deserializes the data based on type
171
- # @param string type Data type
172
- # @param string value Value to be deserialized
173
- # @return [Object] Deserialized data
174
- def _deserialize(type, value)
175
- case type.to_sym
176
- when :DateTime
177
- DateTime.parse(value)
178
- when :Date
179
- Date.parse(value)
180
- when :String
181
- value.to_s
182
- when :Integer
183
- value.to_i
184
- when :Float
185
- value.to_f
186
- when :Boolean
187
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
188
- true
189
- else
190
- false
173
+ elsif !attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
191
175
  end
192
- when :Object
193
- # generic object (usually a Hash), return directly
194
- value
195
- when /\AArray<(?<inner_type>.+)>\z/
196
- inner_type = Regexp.last_match[:inner_type]
197
- value.map { |v| _deserialize(inner_type, v) }
198
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
199
- k_type = Regexp.last_match[:k_type]
200
- v_type = Regexp.last_match[:v_type]
201
- {}.tap do |hash|
202
- value.each do |k, v|
203
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
204
- end
205
- end
206
- else # model
207
- SwaggerAemClient.const_get(type).build_from_hash(value)
208
176
  end
209
- end
210
-
211
- # Returns the string representation of the object
212
- # @return [String] String presentation of the object
213
- def to_s
214
- to_hash.to_s
215
- end
216
-
217
- # to_body is an alias to to_hash (backward compatibility)
218
- # @return [Hash] Returns the object in the form of hash
219
- def to_body
220
- to_hash
177
+ new(transformed_hash)
221
178
  end
222
179
 
223
180
  # Returns the object in the form of hash
@@ -230,28 +187,12 @@ module SwaggerAemClient
230
187
  is_nullable = self.class.openapi_nullable.include?(attr)
231
188
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
189
  end
233
-
190
+
234
191
  hash[param] = _to_hash(value)
235
192
  end
236
193
  hash
237
194
  end
238
195
 
239
- # Outputs non-array value in the form of hash
240
- # For object, use to_hash. Otherwise, just return the value
241
- # @param [Object] value Any valid value
242
- # @return [Hash] Returns the value in the form of hash
243
- def _to_hash(value)
244
- if value.is_a?(Array)
245
- value.compact.map { |v| _to_hash(v) }
246
- elsif value.is_a?(Hash)
247
- {}.tap do |hash|
248
- value.each { |k, v| hash[k] = _to_hash(v) }
249
- end
250
- elsif value.respond_to? :to_hash
251
- value.to_hash
252
- else
253
- value
254
- end
255
- end
256
196
  end
197
+
257
198
  end
@@ -3,17 +3,18 @@
3
3
 
4
4
  #Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API
5
5
 
6
- The version of the OpenAPI document: 3.7.1-pre.0
6
+ The version of the OpenAPI document: 4.0.0
7
7
  Contact: opensource@shinesolutions.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module SwaggerAemClient
16
- class SamlConfigurationPropertyItemsString
17
+ class SamlConfigurationPropertyItemsString < ApiModelBase
17
18
  # property name
18
19
  attr_accessor :name
19
20
 
@@ -44,6 +45,16 @@ module SwaggerAemClient
44
45
  }
45
46
  end
46
47
 
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
47
58
  # Attribute type mapping.
48
59
  def self.openapi_types
49
60
  {
@@ -70,9 +81,10 @@ module SwaggerAemClient
70
81
  end
71
82
 
72
83
  # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
73
85
  attributes = attributes.each_with_object({}) { |(k, v), h|
74
- if (!self.class.attribute_map.key?(k.to_sym))
75
- fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerAemClient::SamlConfigurationPropertyItemsString`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerAemClient::SamlConfigurationPropertyItemsString`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
76
88
  end
77
89
  h[k.to_sym] = v
78
90
  }
@@ -105,6 +117,7 @@ module SwaggerAemClient
105
117
  # Show invalid properties with the reasons. Usually used together with valid?
106
118
  # @return Array for valid properties with the reasons
107
119
  def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
108
121
  invalid_properties = Array.new
109
122
  invalid_properties
110
123
  end
@@ -112,6 +125,7 @@ module SwaggerAemClient
112
125
  # Check to see if the all the properties in the model are valid
113
126
  # @return true if the model is valid
114
127
  def valid?
128
+ warn '[DEPRECATED] the `valid?` method is obsolete'
115
129
  true
116
130
  end
117
131
 
@@ -144,80 +158,23 @@ module SwaggerAemClient
144
158
  # @param [Hash] attributes Model attributes in the form of hash
145
159
  # @return [Object] Returns the model itself
146
160
  def self.build_from_hash(attributes)
147
- new.build_from_hash(attributes)
148
- end
149
-
150
- # Builds the object from hash
151
- # @param [Hash] attributes Model attributes in the form of hash
152
- # @return [Object] Returns the model itself
153
- def build_from_hash(attributes)
154
161
  return nil unless attributes.is_a?(Hash)
155
- self.class.openapi_types.each_pair do |key, type|
156
- if type =~ /\AArray<(.*)>/i
162
+ attributes = attributes.transform_keys(&:to_sym)
163
+ transformed_hash = {}
164
+ openapi_types.each_pair do |key, type|
165
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = nil
167
+ elsif type =~ /\AArray<(.*)>/i
157
168
  # check to ensure the input is an array given that the attribute
158
169
  # is documented as an array but the input is not
159
- if attributes[self.class.attribute_map[key]].is_a?(Array)
160
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
170
+ if attributes[attribute_map[key]].is_a?(Array)
171
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
161
172
  end
162
- elsif !attributes[self.class.attribute_map[key]].nil?
163
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
164
- end # or else data not found in attributes(hash), not an issue as the data can be optional
165
- end
166
-
167
- self
168
- end
169
-
170
- # Deserializes the data based on type
171
- # @param string type Data type
172
- # @param string value Value to be deserialized
173
- # @return [Object] Deserialized data
174
- def _deserialize(type, value)
175
- case type.to_sym
176
- when :DateTime
177
- DateTime.parse(value)
178
- when :Date
179
- Date.parse(value)
180
- when :String
181
- value.to_s
182
- when :Integer
183
- value.to_i
184
- when :Float
185
- value.to_f
186
- when :Boolean
187
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
188
- true
189
- else
190
- false
173
+ elsif !attributes[attribute_map[key]].nil?
174
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
191
175
  end
192
- when :Object
193
- # generic object (usually a Hash), return directly
194
- value
195
- when /\AArray<(?<inner_type>.+)>\z/
196
- inner_type = Regexp.last_match[:inner_type]
197
- value.map { |v| _deserialize(inner_type, v) }
198
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
199
- k_type = Regexp.last_match[:k_type]
200
- v_type = Regexp.last_match[:v_type]
201
- {}.tap do |hash|
202
- value.each do |k, v|
203
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
204
- end
205
- end
206
- else # model
207
- SwaggerAemClient.const_get(type).build_from_hash(value)
208
176
  end
209
- end
210
-
211
- # Returns the string representation of the object
212
- # @return [String] String presentation of the object
213
- def to_s
214
- to_hash.to_s
215
- end
216
-
217
- # to_body is an alias to to_hash (backward compatibility)
218
- # @return [Hash] Returns the object in the form of hash
219
- def to_body
220
- to_hash
177
+ new(transformed_hash)
221
178
  end
222
179
 
223
180
  # Returns the object in the form of hash
@@ -230,28 +187,12 @@ module SwaggerAemClient
230
187
  is_nullable = self.class.openapi_nullable.include?(attr)
231
188
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
232
189
  end
233
-
190
+
234
191
  hash[param] = _to_hash(value)
235
192
  end
236
193
  hash
237
194
  end
238
195
 
239
- # Outputs non-array value in the form of hash
240
- # For object, use to_hash. Otherwise, just return the value
241
- # @param [Object] value Any valid value
242
- # @return [Hash] Returns the value in the form of hash
243
- def _to_hash(value)
244
- if value.is_a?(Array)
245
- value.compact.map { |v| _to_hash(v) }
246
- elsif value.is_a?(Hash)
247
- {}.tap do |hash|
248
- value.each { |k, v| hash[k] = _to_hash(v) }
249
- end
250
- elsif value.respond_to? :to_hash
251
- value.to_hash
252
- else
253
- value
254
- end
255
- end
256
196
  end
197
+
257
198
  end
@@ -3,17 +3,18 @@
3
3
 
4
4
  #Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API
5
5
 
6
- The version of the OpenAPI document: 3.7.1-pre.0
6
+ The version of the OpenAPI document: 4.0.0
7
7
  Contact: opensource@shinesolutions.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.1
9
+ Generator version: 7.24.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
+ require 'time'
14
15
 
15
16
  module SwaggerAemClient
16
- class TruststoreInfo
17
+ class TruststoreInfo < ApiModelBase
17
18
  attr_accessor :aliases
18
19
 
19
20
  # False if truststore don't exist
@@ -27,6 +28,16 @@ module SwaggerAemClient
27
28
  }
28
29
  end
29
30
 
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
30
41
  # Attribute type mapping.
31
42
  def self.openapi_types
32
43
  {
@@ -49,9 +60,10 @@ module SwaggerAemClient
49
60
  end
50
61
 
51
62
  # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
52
64
  attributes = attributes.each_with_object({}) { |(k, v), h|
53
- if (!self.class.attribute_map.key?(k.to_sym))
54
- fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerAemClient::TruststoreInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerAemClient::TruststoreInfo`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
55
67
  end
56
68
  h[k.to_sym] = v
57
69
  }
@@ -70,6 +82,7 @@ module SwaggerAemClient
70
82
  # Show invalid properties with the reasons. Usually used together with valid?
71
83
  # @return Array for valid properties with the reasons
72
84
  def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
73
86
  invalid_properties = Array.new
74
87
  invalid_properties
75
88
  end
@@ -77,6 +90,7 @@ module SwaggerAemClient
77
90
  # Check to see if the all the properties in the model are valid
78
91
  # @return true if the model is valid
79
92
  def valid?
93
+ warn '[DEPRECATED] the `valid?` method is obsolete'
80
94
  true
81
95
  end
82
96
 
@@ -105,80 +119,23 @@ module SwaggerAemClient
105
119
  # @param [Hash] attributes Model attributes in the form of hash
106
120
  # @return [Object] Returns the model itself
107
121
  def self.build_from_hash(attributes)
108
- new.build_from_hash(attributes)
109
- end
110
-
111
- # Builds the object from hash
112
- # @param [Hash] attributes Model attributes in the form of hash
113
- # @return [Object] Returns the model itself
114
- def build_from_hash(attributes)
115
122
  return nil unless attributes.is_a?(Hash)
116
- self.class.openapi_types.each_pair do |key, type|
117
- if type =~ /\AArray<(.*)>/i
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ transformed_hash = {}
125
+ openapi_types.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = nil
128
+ elsif type =~ /\AArray<(.*)>/i
118
129
  # check to ensure the input is an array given that the attribute
119
130
  # is documented as an array but the input is not
120
- if attributes[self.class.attribute_map[key]].is_a?(Array)
121
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
133
  end
123
- elsif !attributes[self.class.attribute_map[key]].nil?
124
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
125
- end # or else data not found in attributes(hash), not an issue as the data can be optional
126
- end
127
-
128
- self
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 _deserialize(type, value)
136
- case type.to_sym
137
- when :DateTime
138
- DateTime.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
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
152
136
  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
- SwaggerAemClient.const_get(type).build_from_hash(value)
169
137
  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
138
+ new(transformed_hash)
182
139
  end
183
140
 
184
141
  # Returns the object in the form of hash
@@ -191,28 +148,12 @@ module SwaggerAemClient
191
148
  is_nullable = self.class.openapi_nullable.include?(attr)
192
149
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
150
  end
194
-
151
+
195
152
  hash[param] = _to_hash(value)
196
153
  end
197
154
  hash
198
155
  end
199
156
 
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
157
  end
158
+
218
159
  end