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 InstallStatus
17
+ class InstallStatus < ApiModelBase
17
18
  attr_accessor :status
18
19
 
19
20
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -23,6 +24,16 @@ module SwaggerAemClient
23
24
  }
24
25
  end
25
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
+
26
37
  # Attribute type mapping.
27
38
  def self.openapi_types
28
39
  {
@@ -44,9 +55,10 @@ module SwaggerAemClient
44
55
  end
45
56
 
46
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
47
59
  attributes = attributes.each_with_object({}) { |(k, v), h|
48
- if (!self.class.attribute_map.key?(k.to_sym))
49
- fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerAemClient::InstallStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerAemClient::InstallStatus`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
50
62
  end
51
63
  h[k.to_sym] = v
52
64
  }
@@ -59,6 +71,7 @@ module SwaggerAemClient
59
71
  # Show invalid properties with the reasons. Usually used together with valid?
60
72
  # @return Array for valid properties with the reasons
61
73
  def list_invalid_properties
74
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
62
75
  invalid_properties = Array.new
63
76
  invalid_properties
64
77
  end
@@ -66,6 +79,7 @@ module SwaggerAemClient
66
79
  # Check to see if the all the properties in the model are valid
67
80
  # @return true if the model is valid
68
81
  def valid?
82
+ warn '[DEPRECATED] the `valid?` method is obsolete'
69
83
  true
70
84
  end
71
85
 
@@ -93,80 +107,23 @@ module SwaggerAemClient
93
107
  # @param [Hash] attributes Model attributes in the form of hash
94
108
  # @return [Object] Returns the model itself
95
109
  def self.build_from_hash(attributes)
96
- new.build_from_hash(attributes)
97
- end
98
-
99
- # Builds the object from hash
100
- # @param [Hash] attributes Model attributes in the form of hash
101
- # @return [Object] Returns the model itself
102
- def build_from_hash(attributes)
103
110
  return nil unless attributes.is_a?(Hash)
104
- self.class.openapi_types.each_pair do |key, type|
105
- if type =~ /\AArray<(.*)>/i
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
106
117
  # check to ensure the input is an array given that the attribute
107
118
  # is documented as an array but the input is not
108
- if attributes[self.class.attribute_map[key]].is_a?(Array)
109
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ if attributes[attribute_map[key]].is_a?(Array)
120
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
110
121
  end
111
- elsif !attributes[self.class.attribute_map[key]].nil?
112
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
113
- end # or else data not found in attributes(hash), not an issue as the data can be optional
114
- end
115
-
116
- self
117
- end
118
-
119
- # Deserializes the data based on type
120
- # @param string type Data type
121
- # @param string value Value to be deserialized
122
- # @return [Object] Deserialized data
123
- def _deserialize(type, value)
124
- case type.to_sym
125
- when :DateTime
126
- DateTime.parse(value)
127
- when :Date
128
- Date.parse(value)
129
- when :String
130
- value.to_s
131
- when :Integer
132
- value.to_i
133
- when :Float
134
- value.to_f
135
- when :Boolean
136
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
137
- true
138
- else
139
- false
122
+ elsif !attributes[attribute_map[key]].nil?
123
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
140
124
  end
141
- when :Object
142
- # generic object (usually a Hash), return directly
143
- value
144
- when /\AArray<(?<inner_type>.+)>\z/
145
- inner_type = Regexp.last_match[:inner_type]
146
- value.map { |v| _deserialize(inner_type, v) }
147
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
148
- k_type = Regexp.last_match[:k_type]
149
- v_type = Regexp.last_match[:v_type]
150
- {}.tap do |hash|
151
- value.each do |k, v|
152
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
- end
154
- end
155
- else # model
156
- SwaggerAemClient.const_get(type).build_from_hash(value)
157
125
  end
158
- end
159
-
160
- # Returns the string representation of the object
161
- # @return [String] String presentation of the object
162
- def to_s
163
- to_hash.to_s
164
- end
165
-
166
- # to_body is an alias to to_hash (backward compatibility)
167
- # @return [Hash] Returns the object in the form of hash
168
- def to_body
169
- to_hash
126
+ new(transformed_hash)
170
127
  end
171
128
 
172
129
  # Returns the object in the form of hash
@@ -179,28 +136,12 @@ module SwaggerAemClient
179
136
  is_nullable = self.class.openapi_nullable.include?(attr)
180
137
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
138
  end
182
-
139
+
183
140
  hash[param] = _to_hash(value)
184
141
  end
185
142
  hash
186
143
  end
187
144
 
188
- # Outputs non-array value in the form of hash
189
- # For object, use to_hash. Otherwise, just return the value
190
- # @param [Object] value Any valid value
191
- # @return [Hash] Returns the value in the form of hash
192
- def _to_hash(value)
193
- if value.is_a?(Array)
194
- value.compact.map { |v| _to_hash(v) }
195
- elsif value.is_a?(Hash)
196
- {}.tap do |hash|
197
- value.each { |k, v| hash[k] = _to_hash(v) }
198
- end
199
- elsif value.respond_to? :to_hash
200
- value.to_hash
201
- else
202
- value
203
- end
204
- end
205
145
  end
146
+
206
147
  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 InstallStatusStatus
17
+ class InstallStatusStatus < ApiModelBase
17
18
  attr_accessor :finished
18
19
 
19
20
  attr_accessor :item_count
@@ -26,6 +27,16 @@ module SwaggerAemClient
26
27
  }
27
28
  end
28
29
 
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
29
40
  # Attribute type mapping.
30
41
  def self.openapi_types
31
42
  {
@@ -48,9 +59,10 @@ module SwaggerAemClient
48
59
  end
49
60
 
50
61
  # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
51
63
  attributes = attributes.each_with_object({}) { |(k, v), h|
52
- if (!self.class.attribute_map.key?(k.to_sym))
53
- fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerAemClient::InstallStatusStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerAemClient::InstallStatusStatus`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
54
66
  end
55
67
  h[k.to_sym] = v
56
68
  }
@@ -67,6 +79,7 @@ module SwaggerAemClient
67
79
  # Show invalid properties with the reasons. Usually used together with valid?
68
80
  # @return Array for valid properties with the reasons
69
81
  def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
70
83
  invalid_properties = Array.new
71
84
  invalid_properties
72
85
  end
@@ -74,6 +87,7 @@ module SwaggerAemClient
74
87
  # Check to see if the all the properties in the model are valid
75
88
  # @return true if the model is valid
76
89
  def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
77
91
  true
78
92
  end
79
93
 
@@ -102,80 +116,23 @@ module SwaggerAemClient
102
116
  # @param [Hash] attributes Model attributes in the form of hash
103
117
  # @return [Object] Returns the model itself
104
118
  def self.build_from_hash(attributes)
105
- new.build_from_hash(attributes)
106
- end
107
-
108
- # Builds the object from hash
109
- # @param [Hash] attributes Model attributes in the form of hash
110
- # @return [Object] Returns the model itself
111
- def build_from_hash(attributes)
112
119
  return nil unless attributes.is_a?(Hash)
113
- self.class.openapi_types.each_pair do |key, type|
114
- if type =~ /\AArray<(.*)>/i
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
115
126
  # check to ensure the input is an array given that the attribute
116
127
  # is documented as an array but the input is not
117
- if attributes[self.class.attribute_map[key]].is_a?(Array)
118
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
119
130
  end
120
- elsif !attributes[self.class.attribute_map[key]].nil?
121
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
- end # or else data not found in attributes(hash), not an issue as the data can be optional
123
- end
124
-
125
- self
126
- end
127
-
128
- # Deserializes the data based on type
129
- # @param string type Data type
130
- # @param string value Value to be deserialized
131
- # @return [Object] Deserialized data
132
- def _deserialize(type, value)
133
- case type.to_sym
134
- when :DateTime
135
- DateTime.parse(value)
136
- when :Date
137
- Date.parse(value)
138
- when :String
139
- value.to_s
140
- when :Integer
141
- value.to_i
142
- when :Float
143
- value.to_f
144
- when :Boolean
145
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
- true
147
- else
148
- false
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
149
133
  end
150
- when :Object
151
- # generic object (usually a Hash), return directly
152
- value
153
- when /\AArray<(?<inner_type>.+)>\z/
154
- inner_type = Regexp.last_match[:inner_type]
155
- value.map { |v| _deserialize(inner_type, v) }
156
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
- k_type = Regexp.last_match[:k_type]
158
- v_type = Regexp.last_match[:v_type]
159
- {}.tap do |hash|
160
- value.each do |k, v|
161
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
- end
163
- end
164
- else # model
165
- SwaggerAemClient.const_get(type).build_from_hash(value)
166
134
  end
167
- end
168
-
169
- # Returns the string representation of the object
170
- # @return [String] String presentation of the object
171
- def to_s
172
- to_hash.to_s
173
- end
174
-
175
- # to_body is an alias to to_hash (backward compatibility)
176
- # @return [Hash] Returns the object in the form of hash
177
- def to_body
178
- to_hash
135
+ new(transformed_hash)
179
136
  end
180
137
 
181
138
  # Returns the object in the form of hash
@@ -188,28 +145,12 @@ module SwaggerAemClient
188
145
  is_nullable = self.class.openapi_nullable.include?(attr)
189
146
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
147
  end
191
-
148
+
192
149
  hash[param] = _to_hash(value)
193
150
  end
194
151
  hash
195
152
  end
196
153
 
197
- # Outputs non-array value in the form of hash
198
- # For object, use to_hash. Otherwise, just return the value
199
- # @param [Object] value Any valid value
200
- # @return [Hash] Returns the value in the form of hash
201
- def _to_hash(value)
202
- if value.is_a?(Array)
203
- value.compact.map { |v| _to_hash(v) }
204
- elsif value.is_a?(Hash)
205
- {}.tap do |hash|
206
- value.each { |k, v| hash[k] = _to_hash(v) }
207
- end
208
- elsif value.respond_to? :to_hash
209
- value.to_hash
210
- else
211
- value
212
- end
213
- end
214
154
  end
155
+
215
156
  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 KeystoreChainItems
17
+ class KeystoreChainItems < ApiModelBase
17
18
  # e.g. \"CN=localhost\"
18
19
  attr_accessor :subject
19
20
 
@@ -40,6 +41,16 @@ module SwaggerAemClient
40
41
  }
41
42
  end
42
43
 
44
+ # Returns attribute mapping this model knows about
45
+ def self.acceptable_attribute_map
46
+ attribute_map
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ acceptable_attribute_map.values
52
+ end
53
+
43
54
  # Attribute type mapping.
44
55
  def self.openapi_types
45
56
  {
@@ -65,9 +76,10 @@ module SwaggerAemClient
65
76
  end
66
77
 
67
78
  # check to see if the attribute exists and convert string to symbol for hash key
79
+ acceptable_attribute_map = self.class.acceptable_attribute_map
68
80
  attributes = attributes.each_with_object({}) { |(k, v), h|
69
- if (!self.class.attribute_map.key?(k.to_sym))
70
- fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerAemClient::KeystoreChainItems`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ if (!acceptable_attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerAemClient::KeystoreChainItems`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
83
  end
72
84
  h[k.to_sym] = v
73
85
  }
@@ -96,6 +108,7 @@ module SwaggerAemClient
96
108
  # Show invalid properties with the reasons. Usually used together with valid?
97
109
  # @return Array for valid properties with the reasons
98
110
  def list_invalid_properties
111
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
112
  invalid_properties = Array.new
100
113
  invalid_properties
101
114
  end
@@ -103,6 +116,7 @@ module SwaggerAemClient
103
116
  # Check to see if the all the properties in the model are valid
104
117
  # @return true if the model is valid
105
118
  def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
106
120
  true
107
121
  end
108
122
 
@@ -134,80 +148,23 @@ module SwaggerAemClient
134
148
  # @param [Hash] attributes Model attributes in the form of hash
135
149
  # @return [Object] Returns the model itself
136
150
  def self.build_from_hash(attributes)
137
- new.build_from_hash(attributes)
138
- end
139
-
140
- # Builds the object from hash
141
- # @param [Hash] attributes Model attributes in the form of hash
142
- # @return [Object] Returns the model itself
143
- def build_from_hash(attributes)
144
151
  return nil unless attributes.is_a?(Hash)
145
- self.class.openapi_types.each_pair do |key, type|
146
- if type =~ /\AArray<(.*)>/i
152
+ attributes = attributes.transform_keys(&:to_sym)
153
+ transformed_hash = {}
154
+ openapi_types.each_pair do |key, type|
155
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
156
+ transformed_hash["#{key}"] = nil
157
+ elsif type =~ /\AArray<(.*)>/i
147
158
  # check to ensure the input is an array given that the attribute
148
159
  # is documented as an array but the input is not
149
- if attributes[self.class.attribute_map[key]].is_a?(Array)
150
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
160
+ if attributes[attribute_map[key]].is_a?(Array)
161
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
162
  end
152
- elsif !attributes[self.class.attribute_map[key]].nil?
153
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
- end # or else data not found in attributes(hash), not an issue as the data can be optional
155
- end
156
-
157
- self
158
- end
159
-
160
- # Deserializes the data based on type
161
- # @param string type Data type
162
- # @param string value Value to be deserialized
163
- # @return [Object] Deserialized data
164
- def _deserialize(type, value)
165
- case type.to_sym
166
- when :DateTime
167
- DateTime.parse(value)
168
- when :Date
169
- Date.parse(value)
170
- when :String
171
- value.to_s
172
- when :Integer
173
- value.to_i
174
- when :Float
175
- value.to_f
176
- when :Boolean
177
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
- true
179
- else
180
- false
163
+ elsif !attributes[attribute_map[key]].nil?
164
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
181
165
  end
182
- when :Object
183
- # generic object (usually a Hash), return directly
184
- value
185
- when /\AArray<(?<inner_type>.+)>\z/
186
- inner_type = Regexp.last_match[:inner_type]
187
- value.map { |v| _deserialize(inner_type, v) }
188
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
- k_type = Regexp.last_match[:k_type]
190
- v_type = Regexp.last_match[:v_type]
191
- {}.tap do |hash|
192
- value.each do |k, v|
193
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
- end
195
- end
196
- else # model
197
- SwaggerAemClient.const_get(type).build_from_hash(value)
198
166
  end
199
- end
200
-
201
- # Returns the string representation of the object
202
- # @return [String] String presentation of the object
203
- def to_s
204
- to_hash.to_s
205
- end
206
-
207
- # to_body is an alias to to_hash (backward compatibility)
208
- # @return [Hash] Returns the object in the form of hash
209
- def to_body
210
- to_hash
167
+ new(transformed_hash)
211
168
  end
212
169
 
213
170
  # Returns the object in the form of hash
@@ -220,28 +177,12 @@ module SwaggerAemClient
220
177
  is_nullable = self.class.openapi_nullable.include?(attr)
221
178
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
179
  end
223
-
180
+
224
181
  hash[param] = _to_hash(value)
225
182
  end
226
183
  hash
227
184
  end
228
185
 
229
- # Outputs non-array value in the form of hash
230
- # For object, use to_hash. Otherwise, just return the value
231
- # @param [Object] value Any valid value
232
- # @return [Hash] Returns the value in the form of hash
233
- def _to_hash(value)
234
- if value.is_a?(Array)
235
- value.compact.map { |v| _to_hash(v) }
236
- elsif value.is_a?(Hash)
237
- {}.tap do |hash|
238
- value.each { |k, v| hash[k] = _to_hash(v) }
239
- end
240
- elsif value.respond_to? :to_hash
241
- value.to_hash
242
- else
243
- value
244
- end
245
- end
246
186
  end
187
+
247
188
  end