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,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 SupportCreditListing
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<SupportCredit>',
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
@@ -0,0 +1,187 @@
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 SystemPresence
21
+ # The globally unique identifier for the object.
22
+ attr_accessor :id
23
+
24
+ attr_accessor :name
25
+
26
+ # The URI for this object
27
+ attr_accessor :self_uri
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+
33
+ :'id' => :'id',
34
+
35
+ :'name' => :'name',
36
+
37
+ :'self_uri' => :'selfUri'
38
+
39
+ }
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.swagger_types
44
+ {
45
+ :'id' => :'String',
46
+ :'name' => :'String',
47
+ :'self_uri' => :'String'
48
+
49
+ }
50
+ end
51
+
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
57
+
58
+
59
+ if attributes[:'id']
60
+ self.id = attributes[:'id']
61
+ end
62
+
63
+ if attributes[:'name']
64
+ self.name = attributes[:'name']
65
+ end
66
+
67
+ if attributes[:'selfUri']
68
+ self.self_uri = attributes[:'selfUri']
69
+ end
70
+
71
+ end
72
+
73
+ # Check equality by comparing each attribute.
74
+ def ==(o)
75
+ return true if self.equal?(o)
76
+ self.class == o.class &&
77
+ id == o.id &&
78
+ name == o.name &&
79
+ self_uri == o.self_uri
80
+ end
81
+
82
+ # @see the `==` method
83
+ def eql?(o)
84
+ self == o
85
+ end
86
+
87
+ # Calculate hash code according to all attributes.
88
+ def hash
89
+ [id, name, self_uri].hash
90
+ end
91
+
92
+ # build the object from hash
93
+ def build_from_hash(attributes)
94
+ return nil unless attributes.is_a?(Hash)
95
+ self.class.swagger_types.each_pair do |key, type|
96
+ if type =~ /^Array<(.*)>/i
97
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
98
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
99
+ else
100
+ #TODO show warning in debug mode
101
+ end
102
+ elsif !attributes[self.class.attribute_map[key]].nil?
103
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
+ else
105
+ # data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+ end
108
+
109
+ self
110
+ end
111
+
112
+ def _deserialize(type, value)
113
+ case type.to_sym
114
+ when :DateTime
115
+ DateTime.parse(value)
116
+ when :Date
117
+ Date.parse(value)
118
+ when :String
119
+ value.to_s
120
+ when :Integer
121
+ value.to_i
122
+ when :Float
123
+ value.to_f
124
+ when :BOOLEAN
125
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
126
+ true
127
+ else
128
+ false
129
+ end
130
+ when :Object
131
+ # generic object (usually a Hash), return directly
132
+ value
133
+ when /\AArray<(?<inner_type>.+)>\z/
134
+ inner_type = Regexp.last_match[:inner_type]
135
+ value.map { |v| _deserialize(inner_type, v) }
136
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
137
+ k_type = Regexp.last_match[:k_type]
138
+ v_type = Regexp.last_match[:v_type]
139
+ {}.tap do |hash|
140
+ value.each do |k, v|
141
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
+ end
143
+ end
144
+ else # model
145
+ _model = Object.const_get("PureCloud").const_get(type).new
146
+ _model.build_from_hash(value)
147
+ end
148
+ end
149
+
150
+ def to_s
151
+ to_hash.to_s
152
+ end
153
+
154
+ # to_body is an alias to to_body (backward compatibility))
155
+ def to_body
156
+ to_hash
157
+ end
158
+
159
+ # return the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ next if value.nil?
165
+ hash[param] = _to_hash(value)
166
+ end
167
+ hash
168
+ end
169
+
170
+ # Method to output non-array value in the form of hash
171
+ # For object, use to_hash. Otherwise, just return the value
172
+ def _to_hash(value)
173
+ if value.is_a?(Array)
174
+ value.compact.map{ |v| _to_hash(v) }
175
+ elsif value.is_a?(Hash)
176
+ {}.tap do |hash|
177
+ value.each { |k, v| hash[k] = _to_hash(v) }
178
+ end
179
+ elsif value.respond_to? :to_hash
180
+ value.to_hash
181
+ else
182
+ value
183
+ end
184
+ end
185
+
186
+ end
187
+ end
@@ -0,0 +1,177 @@
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 TrunkRecordingEnabledCount
21
+ # The amount of trunks that have recording enabled
22
+ attr_accessor :enabled_count
23
+
24
+ # The amount of trunks that do not have recording enabled
25
+ attr_accessor :disabled_count
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+
31
+ :'enabled_count' => :'enabledCount',
32
+
33
+ :'disabled_count' => :'disabledCount'
34
+
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ :'enabled_count' => :'Integer',
42
+ :'disabled_count' => :'Integer'
43
+
44
+ }
45
+ end
46
+
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
52
+
53
+
54
+ if attributes[:'enabledCount']
55
+ self.enabled_count = attributes[:'enabledCount']
56
+ end
57
+
58
+ if attributes[:'disabledCount']
59
+ self.disabled_count = attributes[:'disabledCount']
60
+ end
61
+
62
+ end
63
+
64
+ # Check equality by comparing each attribute.
65
+ def ==(o)
66
+ return true if self.equal?(o)
67
+ self.class == o.class &&
68
+ enabled_count == o.enabled_count &&
69
+ disabled_count == o.disabled_count
70
+ end
71
+
72
+ # @see the `==` method
73
+ def eql?(o)
74
+ self == o
75
+ end
76
+
77
+ # Calculate hash code according to all attributes.
78
+ def hash
79
+ [enabled_count, disabled_count].hash
80
+ end
81
+
82
+ # build the object from hash
83
+ def build_from_hash(attributes)
84
+ return nil unless attributes.is_a?(Hash)
85
+ self.class.swagger_types.each_pair do |key, type|
86
+ if type =~ /^Array<(.*)>/i
87
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
88
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
89
+ else
90
+ #TODO show warning in debug mode
91
+ end
92
+ elsif !attributes[self.class.attribute_map[key]].nil?
93
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
94
+ else
95
+ # data not found in attributes(hash), not an issue as the data can be optional
96
+ end
97
+ end
98
+
99
+ self
100
+ end
101
+
102
+ def _deserialize(type, value)
103
+ case type.to_sym
104
+ when :DateTime
105
+ DateTime.parse(value)
106
+ when :Date
107
+ Date.parse(value)
108
+ when :String
109
+ value.to_s
110
+ when :Integer
111
+ value.to_i
112
+ when :Float
113
+ value.to_f
114
+ when :BOOLEAN
115
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
116
+ true
117
+ else
118
+ false
119
+ end
120
+ when :Object
121
+ # generic object (usually a Hash), return directly
122
+ value
123
+ when /\AArray<(?<inner_type>.+)>\z/
124
+ inner_type = Regexp.last_match[:inner_type]
125
+ value.map { |v| _deserialize(inner_type, v) }
126
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
127
+ k_type = Regexp.last_match[:k_type]
128
+ v_type = Regexp.last_match[:v_type]
129
+ {}.tap do |hash|
130
+ value.each do |k, v|
131
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
132
+ end
133
+ end
134
+ else # model
135
+ _model = Object.const_get("PureCloud").const_get(type).new
136
+ _model.build_from_hash(value)
137
+ end
138
+ end
139
+
140
+ def to_s
141
+ to_hash.to_s
142
+ end
143
+
144
+ # to_body is an alias to to_body (backward compatibility))
145
+ def to_body
146
+ to_hash
147
+ end
148
+
149
+ # return the object in the form of hash
150
+ def to_hash
151
+ hash = {}
152
+ self.class.attribute_map.each_pair do |attr, param|
153
+ value = self.send(attr)
154
+ next if value.nil?
155
+ hash[param] = _to_hash(value)
156
+ end
157
+ hash
158
+ end
159
+
160
+ # Method to output non-array value in the form of hash
161
+ # For object, use to_hash. Otherwise, just return the value
162
+ def _to_hash(value)
163
+ if value.is_a?(Array)
164
+ value.compact.map{ |v| _to_hash(v) }
165
+ elsif value.is_a?(Hash)
166
+ {}.tap do |hash|
167
+ value.each { |k, v| hash[k] = _to_hash(v) }
168
+ end
169
+ elsif value.respond_to? :to_hash
170
+ value.to_hash
171
+ else
172
+ value
173
+ end
174
+ end
175
+
176
+ end
177
+ end