swagger_aem 2.5.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/Gemfile.lock +47 -46
  4. data/README.md +20 -9
  5. data/Rakefile +2 -0
  6. data/docs/ConsoleApi.md +107 -58
  7. data/docs/CqApi.md +14 -13
  8. data/docs/CrxApi.md +60 -60
  9. data/docs/CustomApi.md +27 -24
  10. data/docs/GraniteApi.md +75 -0
  11. data/docs/InlineObject.md +17 -0
  12. data/docs/InlineObject1.md +17 -0
  13. data/docs/InlineObject2.md +17 -0
  14. data/docs/InlineObject3.md +17 -0
  15. data/docs/InlineObject4.md +21 -0
  16. data/docs/InlineObject5.md +19 -0
  17. data/docs/InstallStatus.md +9 -0
  18. data/docs/InstallStatusStatus.md +11 -1
  19. data/docs/KeystoreChainItems.md +13 -0
  20. data/docs/KeystoreInfo.md +11 -1
  21. data/docs/KeystoreItems.md +13 -0
  22. data/docs/SamlConfigurationInfo.md +15 -1
  23. data/docs/SamlConfigurationProperties.md +56 -24
  24. data/docs/SamlConfigurationPropertyItemsArray.md +16 -2
  25. data/docs/SamlConfigurationPropertyItemsBoolean.md +17 -3
  26. data/docs/SamlConfigurationPropertyItemsLong.md +17 -3
  27. data/docs/SamlConfigurationPropertyItemsString.md +17 -3
  28. data/docs/SlingApi.md +482 -445
  29. data/docs/TruststoreInfo.md +11 -1
  30. data/docs/TruststoreItems.md +15 -0
  31. data/git_push.sh +11 -8
  32. data/lib/swagger_aem.rb +10 -3
  33. data/lib/swagger_aem/api/console_api.rb +160 -91
  34. data/lib/swagger_aem/api/cq_api.rb +49 -41
  35. data/lib/swagger_aem/api/crx_api.rb +170 -135
  36. data/lib/swagger_aem/api/custom_api.rb +68 -56
  37. data/lib/swagger_aem/api/granite_api.rb +124 -0
  38. data/lib/swagger_aem/api/sling_api.rb +900 -720
  39. data/lib/swagger_aem/api_client.rb +53 -54
  40. data/lib/swagger_aem/api_error.rb +22 -3
  41. data/lib/swagger_aem/configuration.rb +49 -10
  42. data/lib/swagger_aem/models/inline_object.rb +206 -0
  43. data/lib/swagger_aem/models/inline_object1.rb +206 -0
  44. data/lib/swagger_aem/models/inline_object2.rb +206 -0
  45. data/lib/swagger_aem/models/inline_object3.rb +206 -0
  46. data/lib/swagger_aem/models/inline_object4.rb +224 -0
  47. data/lib/swagger_aem/models/inline_object5.rb +215 -0
  48. data/lib/swagger_aem/models/install_status.rb +43 -25
  49. data/lib/swagger_aem/models/install_status_status.rb +46 -28
  50. data/lib/swagger_aem/models/keystore_chain_items.rb +50 -32
  51. data/lib/swagger_aem/models/keystore_info.rb +45 -27
  52. data/lib/swagger_aem/models/keystore_items.rb +49 -31
  53. data/lib/swagger_aem/models/saml_configuration_info.rb +49 -31
  54. data/lib/swagger_aem/models/saml_configuration_properties.rb +114 -168
  55. data/lib/swagger_aem/models/saml_configuration_property_items_array.rb +50 -32
  56. data/lib/swagger_aem/models/saml_configuration_property_items_boolean.rb +56 -38
  57. data/lib/swagger_aem/models/saml_configuration_property_items_long.rb +56 -38
  58. data/lib/swagger_aem/models/saml_configuration_property_items_string.rb +56 -38
  59. data/lib/swagger_aem/models/truststore_info.rb +45 -27
  60. data/lib/swagger_aem/models/truststore_items.rb +54 -36
  61. data/lib/swagger_aem/version.rb +4 -4
  62. data/spec/api/console_api_spec.rb +17 -16
  63. data/spec/api/cq_api_spec.rb +6 -10
  64. data/spec/api/crx_api_spec.rb +11 -25
  65. data/spec/api/custom_api_spec.rb +7 -13
  66. data/spec/api/granite_api_spec.rb +52 -0
  67. data/spec/api/sling_api_spec.rb +32 -88
  68. data/spec/api_client_spec.rb +37 -37
  69. data/spec/configuration_spec.rb +11 -11
  70. data/spec/models/inline_object1_spec.rb +41 -0
  71. data/spec/models/inline_object2_spec.rb +41 -0
  72. data/spec/models/inline_object3_spec.rb +41 -0
  73. data/spec/models/inline_object4_spec.rb +53 -0
  74. data/spec/models/inline_object5_spec.rb +47 -0
  75. data/spec/models/inline_object_spec.rb +41 -0
  76. data/spec/models/install_status_spec.rb +5 -6
  77. data/spec/models/install_status_status_spec.rb +6 -7
  78. data/spec/models/keystore_chain_items_spec.rb +9 -10
  79. data/spec/models/keystore_info_spec.rb +6 -7
  80. data/spec/models/keystore_items_spec.rb +9 -10
  81. data/spec/models/saml_configuration_info_spec.rb +10 -11
  82. data/spec/models/saml_configuration_properties_spec.rb +28 -29
  83. data/spec/models/saml_configuration_property_items_array_spec.rb +10 -11
  84. data/spec/models/saml_configuration_property_items_boolean_spec.rb +11 -12
  85. data/spec/models/saml_configuration_property_items_long_spec.rb +11 -12
  86. data/spec/models/saml_configuration_property_items_string_spec.rb +11 -12
  87. data/spec/models/truststore_info_spec.rb +6 -7
  88. data/spec/models/truststore_items_spec.rb +11 -12
  89. data/spec/spec_helper.rb +3 -3
  90. data/swagger_aem.gemspec +8 -14
  91. metadata +36 -128
@@ -3,23 +3,21 @@
3
3
 
4
4
  #Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API
5
5
 
6
- OpenAPI spec version: 2.4.0
6
+ The version of the OpenAPI document: 3.4.0
7
7
  Contact: opensource@shinesolutions.com
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.0-SNAPSHOT
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module SwaggerAemClient
16
-
17
16
  class InstallStatusStatus
18
17
  attr_accessor :finished
19
18
 
20
19
  attr_accessor :item_count
21
20
 
22
-
23
21
  # Attribute mapping from ruby-style variable name to JSON key.
24
22
  def self.attribute_map
25
23
  {
@@ -29,42 +27,54 @@ module SwaggerAemClient
29
27
  end
30
28
 
31
29
  # Attribute type mapping.
32
- def self.swagger_types
30
+ def self.openapi_types
33
31
  {
34
- :'finished' => :'BOOLEAN',
32
+ :'finished' => :'Boolean',
35
33
  :'item_count' => :'Integer'
36
34
  }
37
35
  end
38
36
 
37
+ # List of attributes with nullable: true
38
+ def self.openapi_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
39
43
  # Initializes the object
40
44
  # @param [Hash] attributes Model attributes in the form of hash
41
45
  def initialize(attributes = {})
42
- return unless attributes.is_a?(Hash)
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SwaggerAemClient::InstallStatusStatus` initialize method"
48
+ end
43
49
 
44
- # convert string to symbol for hash key
45
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ 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
54
+ end
55
+ h[k.to_sym] = v
56
+ }
46
57
 
47
- if attributes.has_key?(:'finished')
58
+ if attributes.key?(:'finished')
48
59
  self.finished = attributes[:'finished']
49
60
  end
50
61
 
51
- if attributes.has_key?(:'itemCount')
52
- self.item_count = attributes[:'itemCount']
62
+ if attributes.key?(:'item_count')
63
+ self.item_count = attributes[:'item_count']
53
64
  end
54
-
55
65
  end
56
66
 
57
67
  # Show invalid properties with the reasons. Usually used together with valid?
58
- # @return Array for valid properies with the reasons
68
+ # @return Array for valid properties with the reasons
59
69
  def list_invalid_properties
60
70
  invalid_properties = Array.new
61
- return invalid_properties
71
+ invalid_properties
62
72
  end
63
73
 
64
74
  # Check to see if the all the properties in the model are valid
65
75
  # @return true if the model is valid
66
76
  def valid?
67
- return true
77
+ true
68
78
  end
69
79
 
70
80
  # Checks equality by comparing each attribute.
@@ -83,22 +93,29 @@ module SwaggerAemClient
83
93
  end
84
94
 
85
95
  # Calculates hash code according to all attributes.
86
- # @return [Fixnum] Hash code
96
+ # @return [Integer] Hash code
87
97
  def hash
88
98
  [finished, item_count].hash
89
99
  end
90
100
 
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
91
108
  # Builds the object from hash
92
109
  # @param [Hash] attributes Model attributes in the form of hash
93
110
  # @return [Object] Returns the model itself
94
111
  def build_from_hash(attributes)
95
112
  return nil unless attributes.is_a?(Hash)
96
- self.class.swagger_types.each_pair do |key, type|
113
+ self.class.openapi_types.each_pair do |key, type|
97
114
  if type =~ /\AArray<(.*)>/i
98
- # check to ensure the input is an array given that the the attribute
115
+ # check to ensure the input is an array given that the attribute
99
116
  # is documented as an array but the input is not
100
117
  if attributes[self.class.attribute_map[key]].is_a?(Array)
101
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
102
119
  end
103
120
  elsif !attributes[self.class.attribute_map[key]].nil?
104
121
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -124,7 +141,7 @@ module SwaggerAemClient
124
141
  value.to_i
125
142
  when :Float
126
143
  value.to_f
127
- when :BOOLEAN
144
+ when :Boolean
128
145
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
146
  true
130
147
  else
@@ -145,8 +162,7 @@ module SwaggerAemClient
145
162
  end
146
163
  end
147
164
  else # model
148
- temp_model = SwaggerAemClient.const_get(type).new
149
- temp_model.build_from_hash(value)
165
+ SwaggerAemClient.const_get(type).build_from_hash(value)
150
166
  end
151
167
  end
152
168
 
@@ -168,7 +184,11 @@ module SwaggerAemClient
168
184
  hash = {}
169
185
  self.class.attribute_map.each_pair do |attr, param|
170
186
  value = self.send(attr)
171
- next if value.nil?
187
+ if value.nil?
188
+ is_nullable = self.class.openapi_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
172
192
  hash[param] = _to_hash(value)
173
193
  end
174
194
  hash
@@ -180,7 +200,7 @@ module SwaggerAemClient
180
200
  # @return [Hash] Returns the value in the form of hash
181
201
  def _to_hash(value)
182
202
  if value.is_a?(Array)
183
- value.compact.map{ |v| _to_hash(v) }
203
+ value.compact.map { |v| _to_hash(v) }
184
204
  elsif value.is_a?(Hash)
185
205
  {}.tap do |hash|
186
206
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -191,7 +211,5 @@ module SwaggerAemClient
191
211
  value
192
212
  end
193
213
  end
194
-
195
214
  end
196
-
197
215
  end
@@ -3,17 +3,16 @@
3
3
 
4
4
  #Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API
5
5
 
6
- OpenAPI spec version: 2.4.0
6
+ The version of the OpenAPI document: 3.4.0
7
7
  Contact: opensource@shinesolutions.com
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.0-SNAPSHOT
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module SwaggerAemClient
16
-
17
16
  class KeystoreChainItems
18
17
  # e.g. \"CN=localhost\"
19
18
  attr_accessor :subject
@@ -30,7 +29,6 @@ module SwaggerAemClient
30
29
  # 18165099476682912368
31
30
  attr_accessor :serial_number
32
31
 
33
-
34
32
  # Attribute mapping from ruby-style variable name to JSON key.
35
33
  def self.attribute_map
36
34
  {
@@ -43,7 +41,7 @@ module SwaggerAemClient
43
41
  end
44
42
 
45
43
  # Attribute type mapping.
46
- def self.swagger_types
44
+ def self.openapi_types
47
45
  {
48
46
  :'subject' => :'String',
49
47
  :'issuer' => :'String',
@@ -53,47 +51,59 @@ module SwaggerAemClient
53
51
  }
54
52
  end
55
53
 
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
56
60
  # Initializes the object
57
61
  # @param [Hash] attributes Model attributes in the form of hash
58
62
  def initialize(attributes = {})
59
- return unless attributes.is_a?(Hash)
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SwaggerAemClient::KeystoreChainItems` initialize method"
65
+ end
60
66
 
61
- # convert string to symbol for hash key
62
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ 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
71
+ end
72
+ h[k.to_sym] = v
73
+ }
63
74
 
64
- if attributes.has_key?(:'subject')
75
+ if attributes.key?(:'subject')
65
76
  self.subject = attributes[:'subject']
66
77
  end
67
78
 
68
- if attributes.has_key?(:'issuer')
79
+ if attributes.key?(:'issuer')
69
80
  self.issuer = attributes[:'issuer']
70
81
  end
71
82
 
72
- if attributes.has_key?(:'notBefore')
73
- self.not_before = attributes[:'notBefore']
83
+ if attributes.key?(:'not_before')
84
+ self.not_before = attributes[:'not_before']
74
85
  end
75
86
 
76
- if attributes.has_key?(:'notAfter')
77
- self.not_after = attributes[:'notAfter']
87
+ if attributes.key?(:'not_after')
88
+ self.not_after = attributes[:'not_after']
78
89
  end
79
90
 
80
- if attributes.has_key?(:'serialNumber')
81
- self.serial_number = attributes[:'serialNumber']
91
+ if attributes.key?(:'serial_number')
92
+ self.serial_number = attributes[:'serial_number']
82
93
  end
83
-
84
94
  end
85
95
 
86
96
  # Show invalid properties with the reasons. Usually used together with valid?
87
- # @return Array for valid properies with the reasons
97
+ # @return Array for valid properties with the reasons
88
98
  def list_invalid_properties
89
99
  invalid_properties = Array.new
90
- return invalid_properties
100
+ invalid_properties
91
101
  end
92
102
 
93
103
  # Check to see if the all the properties in the model are valid
94
104
  # @return true if the model is valid
95
105
  def valid?
96
- return true
106
+ true
97
107
  end
98
108
 
99
109
  # Checks equality by comparing each attribute.
@@ -115,22 +125,29 @@ module SwaggerAemClient
115
125
  end
116
126
 
117
127
  # Calculates hash code according to all attributes.
118
- # @return [Fixnum] Hash code
128
+ # @return [Integer] Hash code
119
129
  def hash
120
130
  [subject, issuer, not_before, not_after, serial_number].hash
121
131
  end
122
132
 
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ new.build_from_hash(attributes)
138
+ end
139
+
123
140
  # Builds the object from hash
124
141
  # @param [Hash] attributes Model attributes in the form of hash
125
142
  # @return [Object] Returns the model itself
126
143
  def build_from_hash(attributes)
127
144
  return nil unless attributes.is_a?(Hash)
128
- self.class.swagger_types.each_pair do |key, type|
145
+ self.class.openapi_types.each_pair do |key, type|
129
146
  if type =~ /\AArray<(.*)>/i
130
- # check to ensure the input is an array given that the the attribute
147
+ # check to ensure the input is an array given that the attribute
131
148
  # is documented as an array but the input is not
132
149
  if attributes[self.class.attribute_map[key]].is_a?(Array)
133
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
134
151
  end
135
152
  elsif !attributes[self.class.attribute_map[key]].nil?
136
153
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -156,7 +173,7 @@ module SwaggerAemClient
156
173
  value.to_i
157
174
  when :Float
158
175
  value.to_f
159
- when :BOOLEAN
176
+ when :Boolean
160
177
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
178
  true
162
179
  else
@@ -177,8 +194,7 @@ module SwaggerAemClient
177
194
  end
178
195
  end
179
196
  else # model
180
- temp_model = SwaggerAemClient.const_get(type).new
181
- temp_model.build_from_hash(value)
197
+ SwaggerAemClient.const_get(type).build_from_hash(value)
182
198
  end
183
199
  end
184
200
 
@@ -200,7 +216,11 @@ module SwaggerAemClient
200
216
  hash = {}
201
217
  self.class.attribute_map.each_pair do |attr, param|
202
218
  value = self.send(attr)
203
- next if value.nil?
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
204
224
  hash[param] = _to_hash(value)
205
225
  end
206
226
  hash
@@ -212,7 +232,7 @@ module SwaggerAemClient
212
232
  # @return [Hash] Returns the value in the form of hash
213
233
  def _to_hash(value)
214
234
  if value.is_a?(Array)
215
- value.compact.map{ |v| _to_hash(v) }
235
+ value.compact.map { |v| _to_hash(v) }
216
236
  elsif value.is_a?(Hash)
217
237
  {}.tap do |hash|
218
238
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -223,7 +243,5 @@ module SwaggerAemClient
223
243
  value
224
244
  end
225
245
  end
226
-
227
246
  end
228
-
229
247
  end
@@ -3,24 +3,22 @@
3
3
 
4
4
  #Swagger AEM is an OpenAPI specification for Adobe Experience Manager (AEM) API
5
5
 
6
- OpenAPI spec version: 2.4.0
6
+ The version of the OpenAPI document: 3.4.0
7
7
  Contact: opensource@shinesolutions.com
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.0-SNAPSHOT
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
 
15
15
  module SwaggerAemClient
16
-
17
16
  class KeystoreInfo
18
17
  attr_accessor :aliases
19
18
 
20
19
  # False if truststore don't exist
21
20
  attr_accessor :exists
22
21
 
23
-
24
22
  # Attribute mapping from ruby-style variable name to JSON key.
25
23
  def self.attribute_map
26
24
  {
@@ -30,44 +28,56 @@ module SwaggerAemClient
30
28
  end
31
29
 
32
30
  # Attribute type mapping.
33
- def self.swagger_types
31
+ def self.openapi_types
34
32
  {
35
33
  :'aliases' => :'Array<KeystoreItems>',
36
- :'exists' => :'BOOLEAN'
34
+ :'exists' => :'Boolean'
37
35
  }
38
36
  end
39
37
 
38
+ # List of attributes with nullable: true
39
+ def self.openapi_nullable
40
+ Set.new([
41
+ ])
42
+ end
43
+
40
44
  # Initializes the object
41
45
  # @param [Hash] attributes Model attributes in the form of hash
42
46
  def initialize(attributes = {})
43
- return unless attributes.is_a?(Hash)
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SwaggerAemClient::KeystoreInfo` initialize method"
49
+ end
44
50
 
45
- # convert string to symbol for hash key
46
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ 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::KeystoreInfo`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
47
58
 
48
- if attributes.has_key?(:'aliases')
59
+ if attributes.key?(:'aliases')
49
60
  if (value = attributes[:'aliases']).is_a?(Array)
50
61
  self.aliases = value
51
62
  end
52
63
  end
53
64
 
54
- if attributes.has_key?(:'exists')
65
+ if attributes.key?(:'exists')
55
66
  self.exists = attributes[:'exists']
56
67
  end
57
-
58
68
  end
59
69
 
60
70
  # Show invalid properties with the reasons. Usually used together with valid?
61
- # @return Array for valid properies with the reasons
71
+ # @return Array for valid properties with the reasons
62
72
  def list_invalid_properties
63
73
  invalid_properties = Array.new
64
- return invalid_properties
74
+ invalid_properties
65
75
  end
66
76
 
67
77
  # Check to see if the all the properties in the model are valid
68
78
  # @return true if the model is valid
69
79
  def valid?
70
- return true
80
+ true
71
81
  end
72
82
 
73
83
  # Checks equality by comparing each attribute.
@@ -86,22 +96,29 @@ module SwaggerAemClient
86
96
  end
87
97
 
88
98
  # Calculates hash code according to all attributes.
89
- # @return [Fixnum] Hash code
99
+ # @return [Integer] Hash code
90
100
  def hash
91
101
  [aliases, exists].hash
92
102
  end
93
103
 
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def self.build_from_hash(attributes)
108
+ new.build_from_hash(attributes)
109
+ end
110
+
94
111
  # Builds the object from hash
95
112
  # @param [Hash] attributes Model attributes in the form of hash
96
113
  # @return [Object] Returns the model itself
97
114
  def build_from_hash(attributes)
98
115
  return nil unless attributes.is_a?(Hash)
99
- self.class.swagger_types.each_pair do |key, type|
116
+ self.class.openapi_types.each_pair do |key, type|
100
117
  if type =~ /\AArray<(.*)>/i
101
- # check to ensure the input is an array given that the the attribute
118
+ # check to ensure the input is an array given that the attribute
102
119
  # is documented as an array but the input is not
103
120
  if attributes[self.class.attribute_map[key]].is_a?(Array)
104
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
121
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
105
122
  end
106
123
  elsif !attributes[self.class.attribute_map[key]].nil?
107
124
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
@@ -127,7 +144,7 @@ module SwaggerAemClient
127
144
  value.to_i
128
145
  when :Float
129
146
  value.to_f
130
- when :BOOLEAN
147
+ when :Boolean
131
148
  if value.to_s =~ /\A(true|t|yes|y|1)\z/i
132
149
  true
133
150
  else
@@ -148,8 +165,7 @@ module SwaggerAemClient
148
165
  end
149
166
  end
150
167
  else # model
151
- temp_model = SwaggerAemClient.const_get(type).new
152
- temp_model.build_from_hash(value)
168
+ SwaggerAemClient.const_get(type).build_from_hash(value)
153
169
  end
154
170
  end
155
171
 
@@ -171,7 +187,11 @@ module SwaggerAemClient
171
187
  hash = {}
172
188
  self.class.attribute_map.each_pair do |attr, param|
173
189
  value = self.send(attr)
174
- next if value.nil?
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
+
175
195
  hash[param] = _to_hash(value)
176
196
  end
177
197
  hash
@@ -183,7 +203,7 @@ module SwaggerAemClient
183
203
  # @return [Hash] Returns the value in the form of hash
184
204
  def _to_hash(value)
185
205
  if value.is_a?(Array)
186
- value.compact.map{ |v| _to_hash(v) }
206
+ value.compact.map { |v| _to_hash(v) }
187
207
  elsif value.is_a?(Hash)
188
208
  {}.tap do |hash|
189
209
  value.each { |k, v| hash[k] = _to_hash(v) }
@@ -194,7 +214,5 @@ module SwaggerAemClient
194
214
  value
195
215
  end
196
216
  end
197
-
198
217
  end
199
-
200
218
  end