purecloud 0.38.1 → 0.39.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/config-ruby.json +1 -1
  4. data/doc_out/AuthorizationApi.html.md +0 -57
  5. data/doc_out/AvailableLanguageList.html.md +13 -0
  6. data/doc_out/BillingContact.html.md +20 -0
  7. data/doc_out/{FlowHistoryResultItemEntityListing.html.md → BillingContactListing.html.md} +3 -3
  8. data/doc_out/CallRecord.html.md +2 -2
  9. data/doc_out/CallableContactsDiagnostic.html.md +3 -3
  10. data/doc_out/CallableTimeSet.html.md +3 -3
  11. data/doc_out/Campaign.html.md +3 -3
  12. data/doc_out/CampaignDiagnostics.html.md +3 -3
  13. data/doc_out/CampaignSchedule.html.md +6 -6
  14. data/doc_out/CampaignSequence.html.md +8 -8
  15. data/doc_out/CampaignStats.html.md +4 -4
  16. data/doc_out/Condition.html.md +7 -7
  17. data/doc_out/ConnectRate.html.md +3 -3
  18. data/doc_out/ContactCallbackRequest.html.md +5 -5
  19. data/doc_out/ContactList.html.md +9 -9
  20. data/doc_out/ContactPhoneNumberColumn.html.md +3 -3
  21. data/doc_out/CreateCallbackCommand.html.md +1 -0
  22. data/doc_out/CreateUser.html.md +1 -1
  23. data/doc_out/CustomerInteractionCenter.html.md +18 -0
  24. data/doc_out/DialerAction.html.md +4 -4
  25. data/doc_out/DialerContact.html.md +5 -5
  26. data/doc_out/DialerRule.html.md +6 -6
  27. data/doc_out/DncList.html.md +6 -7
  28. data/doc_out/ExternalContact.html.md +1 -0
  29. data/doc_out/ExternalDataSource.html.md +14 -0
  30. data/doc_out/ExternalOrganization.html.md +1 -0
  31. data/doc_out/IdentityProviderApi.html.md +1011 -0
  32. data/doc_out/ImportStatus.html.md +5 -5
  33. data/doc_out/InitiateScreenRecording.html.md +15 -0
  34. data/doc_out/JsonNode.html.md +3 -3
  35. data/doc_out/Keyword.html.md +19 -0
  36. data/doc_out/KeywordSet.html.md +21 -0
  37. data/doc_out/KeywordSetEntityListing.html.md +22 -0
  38. data/doc_out/OAuthApi.html.md +45 -886
  39. data/doc_out/OAuthClient.html.md +2 -2
  40. data/doc_out/Okta.html.md +1 -1
  41. data/doc_out/OneLogin.html.md +1 -1
  42. data/doc_out/OrgMediaUtilization.html.md +1 -0
  43. data/doc_out/OutboundApi.html.md +3 -3
  44. data/doc_out/PaymentMethod.html.md +3 -0
  45. data/doc_out/PhoneNumberStatus.html.md +1 -1
  46. data/doc_out/PolicyActions.html.md +1 -0
  47. data/doc_out/PresenceApi.html.md +68 -17
  48. data/doc_out/QualityApi.html.md +361 -0
  49. data/doc_out/QueueUtilizationDiagnostic.html.md +8 -8
  50. data/doc_out/ResponseSet.html.md +3 -3
  51. data/doc_out/RoutingApi.html.md +15 -12
  52. data/doc_out/RoutingSkill.html.md +1 -2
  53. data/doc_out/RuleSet.html.md +6 -6
  54. data/doc_out/Salesforce.html.md +1 -1
  55. data/doc_out/ScheduleInterval.html.md +14 -0
  56. data/doc_out/SequenceSchedule.html.md +6 -6
  57. data/doc_out/Station.html.md +1 -0
  58. data/doc_out/StationsApi.html.md +3 -1
  59. data/doc_out/SupportCredit.html.md +16 -0
  60. data/doc_out/SupportCreditListing.html.md +22 -0
  61. data/doc_out/SystemPresence.html.md +15 -0
  62. data/doc_out/TelephonyProvidersEdgeApi.html.md +112 -1
  63. data/doc_out/TrunkRecordingEnabledCount.html.md +14 -0
  64. data/doc_out/UserImage.html.md +1 -1
  65. data/doc_out/UserMe.html.md +5 -1
  66. data/doc_out/UserRoutingSkill.html.md +2 -2
  67. data/doc_out/UsersApi.html.md +182 -0
  68. data/doc_out/WrapUpCodeMapping.html.md +5 -5
  69. data/doc_out/index.html.md +3 -3
  70. data/lib/purecloud.rb +15 -3
  71. data/lib/purecloud/api/authorization_api.rb +0 -60
  72. data/lib/purecloud/api/identity_provider_api.rb +1072 -0
  73. data/lib/purecloud/api/o_auth_api.rb +26 -906
  74. data/lib/purecloud/api/outbound_api.rb +2 -2
  75. data/lib/purecloud/api/presence_api.rb +67 -12
  76. data/lib/purecloud/api/quality_api.rb +378 -0
  77. data/lib/purecloud/api/routing_api.rb +21 -16
  78. data/lib/purecloud/api/stations_api.rb +3 -0
  79. data/lib/purecloud/api/telephony_providers_edge_api.rb +120 -0
  80. data/lib/purecloud/api/users_api.rb +189 -0
  81. data/lib/purecloud/api_client.rb +1 -1
  82. data/lib/purecloud/models/analytics_session.rb +1 -1
  83. data/lib/purecloud/models/available_language_list.rb +167 -0
  84. data/lib/purecloud/models/billing_contact.rb +237 -0
  85. data/lib/purecloud/models/{flow_history_result_item_entity_listing.rb → billing_contact_listing.rb} +2 -2
  86. data/lib/purecloud/models/call_record.rb +2 -1
  87. data/lib/purecloud/models/callable_contacts_diagnostic.rb +3 -0
  88. data/lib/purecloud/models/callable_time_set.rb +3 -3
  89. data/lib/purecloud/models/campaign.rb +3 -3
  90. data/lib/purecloud/models/campaign_diagnostics.rb +3 -0
  91. data/lib/purecloud/models/campaign_schedule.rb +7 -4
  92. data/lib/purecloud/models/campaign_sequence.rb +8 -3
  93. data/lib/purecloud/models/campaign_stats.rb +4 -0
  94. data/lib/purecloud/models/condition.rb +16 -0
  95. data/lib/purecloud/models/connect_rate.rb +3 -0
  96. data/lib/purecloud/models/contact_callback_request.rb +5 -0
  97. data/lib/purecloud/models/contact_list.rb +9 -3
  98. data/lib/purecloud/models/contact_phone_number_column.rb +3 -0
  99. data/lib/purecloud/models/create_callback_command.rb +12 -1
  100. data/lib/purecloud/models/create_user.rb +1 -0
  101. data/lib/purecloud/models/customer_interaction_center.rb +217 -0
  102. data/lib/purecloud/models/dialer_action.rb +31 -0
  103. data/lib/purecloud/models/dialer_contact.rb +5 -0
  104. data/lib/purecloud/models/dialer_rule.rb +15 -0
  105. data/lib/purecloud/models/dnc_list.rb +7 -14
  106. data/lib/purecloud/models/external_contact.rb +14 -1
  107. data/lib/purecloud/models/external_data_source.rb +176 -0
  108. data/lib/purecloud/models/external_organization.rb +14 -1
  109. data/lib/purecloud/models/import_status.rb +5 -0
  110. data/lib/purecloud/models/initiate_screen_recording.rb +187 -0
  111. data/lib/purecloud/models/json_node.rb +37 -37
  112. data/lib/purecloud/models/keyword.rb +227 -0
  113. data/lib/purecloud/models/keyword_set.rb +253 -0
  114. data/lib/purecloud/models/keyword_set_entity_listing.rb +257 -0
  115. data/lib/purecloud/models/o_auth_client.rb +3 -3
  116. data/lib/purecloud/models/okta.rb +11 -11
  117. data/lib/purecloud/models/one_login.rb +11 -11
  118. data/lib/purecloud/models/org_media_utilization.rb +17 -4
  119. data/lib/purecloud/models/organization_presence.rb +0 -9
  120. data/lib/purecloud/models/payment_method.rb +42 -1
  121. data/lib/purecloud/models/phone_number_status.rb +1 -0
  122. data/lib/purecloud/models/policy_actions.rb +14 -4
  123. data/lib/purecloud/models/queue_utilization_diagnostic.rb +8 -0
  124. data/lib/purecloud/models/response_set.rb +3 -3
  125. data/lib/purecloud/models/routing_skill.rb +2 -12
  126. data/lib/purecloud/models/routing_status.rb +1 -1
  127. data/lib/purecloud/models/rule_set.rb +6 -3
  128. data/lib/purecloud/models/salesforce.rb +11 -11
  129. data/lib/purecloud/models/{campaign_schedule_intervals.rb → schedule_interval.rb} +5 -5
  130. data/lib/purecloud/models/sequence_schedule.rb +7 -4
  131. data/lib/purecloud/models/station.rb +11 -1
  132. data/lib/purecloud/models/support_credit.rb +197 -0
  133. data/lib/purecloud/models/support_credit_listing.rb +257 -0
  134. data/lib/purecloud/models/system_presence.rb +187 -0
  135. data/lib/purecloud/models/trunk_recording_enabled_count.rb +177 -0
  136. data/lib/purecloud/models/user_image.rb +1 -0
  137. data/lib/purecloud/models/user_me.rb +50 -2
  138. data/lib/purecloud/models/user_routing_skill.rb +18 -11
  139. data/lib/purecloud/models/wrap_up_code_mapping.rb +5 -3
  140. data/lib/purecloud/version.rb +1 -1
  141. data/newVersion.md +1 -1
  142. data/swagger.json +1 -1
  143. data/version.json +1 -1
  144. metadata +32 -8
  145. data/doc_out/CampaignScheduleIntervals.html.md +0 -14
  146. data/doc_out/ObjectsApi.html.md +0 -69
  147. data/lib/purecloud/api/objects_api.rb +0 -87
@@ -0,0 +1,253 @@
1
+ =begin
2
+ PureCloud Platform API
3
+
4
+ With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
5
+
6
+ OpenAPI spec version: v2
7
+ Contact: DeveloperEvangelists@inin.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ License: ININ
11
+ http://www.inin.com
12
+
13
+ Terms of Service: https://developer.mypurecloud.com/tos
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ class KeywordSet
21
+ # The globally unique identifier for the object.
22
+ attr_accessor :id
23
+
24
+ attr_accessor :name
25
+
26
+ attr_accessor :description
27
+
28
+ attr_accessor :queue
29
+
30
+ attr_accessor :language
31
+
32
+ attr_accessor :agents
33
+
34
+ attr_accessor :keywords
35
+
36
+ attr_accessor :participant_purposes
37
+
38
+ # The URI for this object
39
+ attr_accessor :self_uri
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+
45
+ :'id' => :'id',
46
+
47
+ :'name' => :'name',
48
+
49
+ :'description' => :'description',
50
+
51
+ :'queue' => :'queue',
52
+
53
+ :'language' => :'language',
54
+
55
+ :'agents' => :'agents',
56
+
57
+ :'keywords' => :'keywords',
58
+
59
+ :'participant_purposes' => :'participantPurposes',
60
+
61
+ :'self_uri' => :'selfUri'
62
+
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.swagger_types
68
+ {
69
+ :'id' => :'String',
70
+ :'name' => :'String',
71
+ :'description' => :'String',
72
+ :'queue' => :'Queue',
73
+ :'language' => :'String',
74
+ :'agents' => :'Array<User>',
75
+ :'keywords' => :'Array<Keyword>',
76
+ :'participant_purposes' => :'Array<String>',
77
+ :'self_uri' => :'String'
78
+
79
+ }
80
+ end
81
+
82
+ def initialize(attributes = {})
83
+ return unless attributes.is_a?(Hash)
84
+
85
+ # convert string to symbol for hash key
86
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
87
+
88
+
89
+ if attributes[:'id']
90
+ self.id = attributes[:'id']
91
+ end
92
+
93
+ if attributes[:'name']
94
+ self.name = attributes[:'name']
95
+ end
96
+
97
+ if attributes[:'description']
98
+ self.description = attributes[:'description']
99
+ end
100
+
101
+ if attributes[:'queue']
102
+ self.queue = attributes[:'queue']
103
+ end
104
+
105
+ if attributes[:'language']
106
+ self.language = attributes[:'language']
107
+ end
108
+
109
+ if attributes[:'agents']
110
+ if (value = attributes[:'agents']).is_a?(Array)
111
+ self.agents = value
112
+ end
113
+ end
114
+
115
+ if attributes[:'keywords']
116
+ if (value = attributes[:'keywords']).is_a?(Array)
117
+ self.keywords = value
118
+ end
119
+ end
120
+
121
+ if attributes[:'participantPurposes']
122
+ if (value = attributes[:'participantPurposes']).is_a?(Array)
123
+ self.participant_purposes = value
124
+ end
125
+ end
126
+
127
+ if attributes[:'selfUri']
128
+ self.self_uri = attributes[:'selfUri']
129
+ end
130
+
131
+ end
132
+
133
+ # Check equality by comparing each attribute.
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ id == o.id &&
138
+ name == o.name &&
139
+ description == o.description &&
140
+ queue == o.queue &&
141
+ language == o.language &&
142
+ agents == o.agents &&
143
+ keywords == o.keywords &&
144
+ participant_purposes == o.participant_purposes &&
145
+ self_uri == o.self_uri
146
+ end
147
+
148
+ # @see the `==` method
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculate hash code according to all attributes.
154
+ def hash
155
+ [id, name, description, queue, language, agents, keywords, participant_purposes, self_uri].hash
156
+ end
157
+
158
+ # build the object from hash
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ self.class.swagger_types.each_pair do |key, type|
162
+ if type =~ /^Array<(.*)>/i
163
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
164
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
165
+ else
166
+ #TODO show warning in debug mode
167
+ end
168
+ elsif !attributes[self.class.attribute_map[key]].nil?
169
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
170
+ else
171
+ # data not found in attributes(hash), not an issue as the data can be optional
172
+ end
173
+ end
174
+
175
+ self
176
+ end
177
+
178
+ def _deserialize(type, value)
179
+ case type.to_sym
180
+ when :DateTime
181
+ DateTime.parse(value)
182
+ when :Date
183
+ Date.parse(value)
184
+ when :String
185
+ value.to_s
186
+ when :Integer
187
+ value.to_i
188
+ when :Float
189
+ value.to_f
190
+ when :BOOLEAN
191
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
192
+ true
193
+ else
194
+ false
195
+ end
196
+ when :Object
197
+ # generic object (usually a Hash), return directly
198
+ value
199
+ when /\AArray<(?<inner_type>.+)>\z/
200
+ inner_type = Regexp.last_match[:inner_type]
201
+ value.map { |v| _deserialize(inner_type, v) }
202
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
203
+ k_type = Regexp.last_match[:k_type]
204
+ v_type = Regexp.last_match[:v_type]
205
+ {}.tap do |hash|
206
+ value.each do |k, v|
207
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
208
+ end
209
+ end
210
+ else # model
211
+ _model = Object.const_get("PureCloud").const_get(type).new
212
+ _model.build_from_hash(value)
213
+ end
214
+ end
215
+
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_body (backward compatibility))
221
+ def to_body
222
+ to_hash
223
+ end
224
+
225
+ # return the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ next if value.nil?
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ # Method to output non-array value in the form of hash
237
+ # For object, use to_hash. Otherwise, just return the value
238
+ def _to_hash(value)
239
+ if value.is_a?(Array)
240
+ value.compact.map{ |v| _to_hash(v) }
241
+ elsif value.is_a?(Hash)
242
+ {}.tap do |hash|
243
+ value.each { |k, v| hash[k] = _to_hash(v) }
244
+ end
245
+ elsif value.respond_to? :to_hash
246
+ value.to_hash
247
+ else
248
+ value
249
+ end
250
+ end
251
+
252
+ end
253
+ end
@@ -0,0 +1,257 @@
1
+ =begin
2
+ PureCloud Platform API
3
+
4
+ With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
5
+
6
+ OpenAPI spec version: v2
7
+ Contact: DeveloperEvangelists@inin.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ License: ININ
11
+ http://www.inin.com
12
+
13
+ Terms of Service: https://developer.mypurecloud.com/tos
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ class KeywordSetEntityListing
21
+ attr_accessor :page_size
22
+
23
+ attr_accessor :page_number
24
+
25
+ attr_accessor :total
26
+
27
+ attr_accessor :entities
28
+
29
+ attr_accessor :self_uri
30
+
31
+ attr_accessor :first_uri
32
+
33
+ attr_accessor :previous_uri
34
+
35
+ attr_accessor :next_uri
36
+
37
+ attr_accessor :last_uri
38
+
39
+ attr_accessor :page_count
40
+
41
+ # Attribute mapping from ruby-style variable name to JSON key.
42
+ def self.attribute_map
43
+ {
44
+
45
+ :'page_size' => :'pageSize',
46
+
47
+ :'page_number' => :'pageNumber',
48
+
49
+ :'total' => :'total',
50
+
51
+ :'entities' => :'entities',
52
+
53
+ :'self_uri' => :'selfUri',
54
+
55
+ :'first_uri' => :'firstUri',
56
+
57
+ :'previous_uri' => :'previousUri',
58
+
59
+ :'next_uri' => :'nextUri',
60
+
61
+ :'last_uri' => :'lastUri',
62
+
63
+ :'page_count' => :'pageCount'
64
+
65
+ }
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.swagger_types
70
+ {
71
+ :'page_size' => :'Integer',
72
+ :'page_number' => :'Integer',
73
+ :'total' => :'Integer',
74
+ :'entities' => :'Array<KeywordSet>',
75
+ :'self_uri' => :'String',
76
+ :'first_uri' => :'String',
77
+ :'previous_uri' => :'String',
78
+ :'next_uri' => :'String',
79
+ :'last_uri' => :'String',
80
+ :'page_count' => :'Integer'
81
+
82
+ }
83
+ end
84
+
85
+ def initialize(attributes = {})
86
+ return unless attributes.is_a?(Hash)
87
+
88
+ # convert string to symbol for hash key
89
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
90
+
91
+
92
+ if attributes[:'pageSize']
93
+ self.page_size = attributes[:'pageSize']
94
+ end
95
+
96
+ if attributes[:'pageNumber']
97
+ self.page_number = attributes[:'pageNumber']
98
+ end
99
+
100
+ if attributes[:'total']
101
+ self.total = attributes[:'total']
102
+ end
103
+
104
+ if attributes[:'entities']
105
+ if (value = attributes[:'entities']).is_a?(Array)
106
+ self.entities = value
107
+ end
108
+ end
109
+
110
+ if attributes[:'selfUri']
111
+ self.self_uri = attributes[:'selfUri']
112
+ end
113
+
114
+ if attributes[:'firstUri']
115
+ self.first_uri = attributes[:'firstUri']
116
+ end
117
+
118
+ if attributes[:'previousUri']
119
+ self.previous_uri = attributes[:'previousUri']
120
+ end
121
+
122
+ if attributes[:'nextUri']
123
+ self.next_uri = attributes[:'nextUri']
124
+ end
125
+
126
+ if attributes[:'lastUri']
127
+ self.last_uri = attributes[:'lastUri']
128
+ end
129
+
130
+ if attributes[:'pageCount']
131
+ self.page_count = attributes[:'pageCount']
132
+ end
133
+
134
+ end
135
+
136
+ # Check equality by comparing each attribute.
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ page_size == o.page_size &&
141
+ page_number == o.page_number &&
142
+ total == o.total &&
143
+ entities == o.entities &&
144
+ self_uri == o.self_uri &&
145
+ first_uri == o.first_uri &&
146
+ previous_uri == o.previous_uri &&
147
+ next_uri == o.next_uri &&
148
+ last_uri == o.last_uri &&
149
+ page_count == o.page_count
150
+ end
151
+
152
+ # @see the `==` method
153
+ def eql?(o)
154
+ self == o
155
+ end
156
+
157
+ # Calculate hash code according to all attributes.
158
+ def hash
159
+ [page_size, page_number, total, entities, self_uri, first_uri, previous_uri, next_uri, last_uri, page_count].hash
160
+ end
161
+
162
+ # build the object from hash
163
+ def build_from_hash(attributes)
164
+ return nil unless attributes.is_a?(Hash)
165
+ self.class.swagger_types.each_pair do |key, type|
166
+ if type =~ /^Array<(.*)>/i
167
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
168
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
169
+ else
170
+ #TODO show warning in debug mode
171
+ end
172
+ elsif !attributes[self.class.attribute_map[key]].nil?
173
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
174
+ else
175
+ # data not found in attributes(hash), not an issue as the data can be optional
176
+ end
177
+ end
178
+
179
+ self
180
+ end
181
+
182
+ def _deserialize(type, value)
183
+ case type.to_sym
184
+ when :DateTime
185
+ DateTime.parse(value)
186
+ when :Date
187
+ Date.parse(value)
188
+ when :String
189
+ value.to_s
190
+ when :Integer
191
+ value.to_i
192
+ when :Float
193
+ value.to_f
194
+ when :BOOLEAN
195
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
196
+ true
197
+ else
198
+ false
199
+ end
200
+ when :Object
201
+ # generic object (usually a Hash), return directly
202
+ value
203
+ when /\AArray<(?<inner_type>.+)>\z/
204
+ inner_type = Regexp.last_match[:inner_type]
205
+ value.map { |v| _deserialize(inner_type, v) }
206
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
207
+ k_type = Regexp.last_match[:k_type]
208
+ v_type = Regexp.last_match[:v_type]
209
+ {}.tap do |hash|
210
+ value.each do |k, v|
211
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
212
+ end
213
+ end
214
+ else # model
215
+ _model = Object.const_get("PureCloud").const_get(type).new
216
+ _model.build_from_hash(value)
217
+ end
218
+ end
219
+
220
+ def to_s
221
+ to_hash.to_s
222
+ end
223
+
224
+ # to_body is an alias to to_body (backward compatibility))
225
+ def to_body
226
+ to_hash
227
+ end
228
+
229
+ # return the object in the form of hash
230
+ def to_hash
231
+ hash = {}
232
+ self.class.attribute_map.each_pair do |attr, param|
233
+ value = self.send(attr)
234
+ next if value.nil?
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ # Method to output non-array value in the form of hash
241
+ # For object, use to_hash. Otherwise, just return the value
242
+ def _to_hash(value)
243
+ if value.is_a?(Array)
244
+ value.compact.map{ |v| _to_hash(v) }
245
+ elsif value.is_a?(Hash)
246
+ {}.tap do |hash|
247
+ value.each { |k, v| hash[k] = _to_hash(v) }
248
+ end
249
+ elsif value.respond_to? :to_hash
250
+ value.to_hash
251
+ else
252
+ value
253
+ end
254
+ end
255
+
256
+ end
257
+ end