purecloudplatformclientv2 20.0.0 → 21.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 (113) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/docs/AdherenceSettings.md +18 -0
  4. data/docs/AgentManagementUnitReference.md +14 -0
  5. data/docs/AnalyticsSession.md +1 -0
  6. data/docs/AnalyticsView.md +1 -1
  7. data/docs/ArchitectApi.md +19 -15
  8. data/docs/CallForwarding.md +4 -2
  9. data/docs/CallMediaParticipant.md +1 -0
  10. data/docs/CallRoute.md +14 -0
  11. data/docs/CallTarget.md +14 -0
  12. data/docs/Contact.md +1 -1
  13. data/docs/ConversationNotificationMessage.md +3 -0
  14. data/docs/ConversationNotificationMessageDetails.md +2 -0
  15. data/docs/ConversationNotificationMessages.md +2 -0
  16. data/docs/ConversationNotificationMessages1.md +3 -0
  17. data/docs/ConversationsApi.md +196 -0
  18. data/docs/CreateEmailRequest.md +2 -0
  19. data/docs/CreateQueueRequest.md +2 -0
  20. data/docs/CreateSecureSession.md +16 -0
  21. data/docs/ExternalContact.md +1 -0
  22. data/docs/ImportScriptStatusResponse.md +15 -0
  23. data/docs/InboundRoute.md +1 -0
  24. data/docs/JsonNode.md +1 -1
  25. data/docs/ManagementUnit.md +5 -3
  26. data/docs/ManagementUnitReference.md +14 -0
  27. data/docs/ManagementUnitSettings.md +19 -0
  28. data/docs/Message.md +3 -0
  29. data/docs/MessageConversationNotificationMessageDetails.md +2 -0
  30. data/docs/MessageConversationNotificationMessageMediaParticipant.md +3 -0
  31. data/docs/MessageConversationNotificationMessages.md +2 -0
  32. data/docs/MessageConversationNotificationParticipants.md +3 -0
  33. data/docs/MessageDetails.md +2 -0
  34. data/docs/QualityApi.md +3 -1
  35. data/docs/Queue.md +2 -0
  36. data/docs/SchedulingSettings.md +14 -0
  37. data/docs/ScriptsApi.md +64 -0
  38. data/docs/SecureSession.md +19 -0
  39. data/docs/SecureSessionEntityListing.md +13 -0
  40. data/docs/ShortTermForecastingSettings.md +13 -0
  41. data/docs/SignedData.md +13 -0
  42. data/docs/SignedDataApi.md +73 -0
  43. data/docs/TimeOffRequestSettings.md +15 -0
  44. data/docs/UpdateUser.md +2 -2
  45. data/docs/UserConversationSummaryNotification.md +1 -0
  46. data/docs/UserQueue.md +2 -0
  47. data/docs/UserReference.md +14 -0
  48. data/docs/WorkforceManagementApi.md +61 -0
  49. data/lib/purecloudplatformclientv2.rb +16 -0
  50. data/lib/purecloudplatformclientv2/api/architect_api.rb +24 -6
  51. data/lib/purecloudplatformclientv2/api/conversations_api.rb +243 -0
  52. data/lib/purecloudplatformclientv2/api/quality_api.rb +9 -0
  53. data/lib/purecloudplatformclientv2/api/scripts_api.rb +74 -0
  54. data/lib/purecloudplatformclientv2/api/signed_data_api.rb +90 -0
  55. data/lib/purecloudplatformclientv2/api/workforce_management_api.rb +63 -0
  56. data/lib/purecloudplatformclientv2/api_client.rb +1 -1
  57. data/lib/purecloudplatformclientv2/models/adherence_settings.rb +335 -0
  58. data/lib/purecloudplatformclientv2/models/agent_management_unit_reference.rb +229 -0
  59. data/lib/purecloudplatformclientv2/models/aggregate_metric_data.rb +2 -2
  60. data/lib/purecloudplatformclientv2/models/analytics_conversation_segment.rb +2 -2
  61. data/lib/purecloudplatformclientv2/models/analytics_query_predicate.rb +4 -4
  62. data/lib/purecloudplatformclientv2/models/analytics_session.rb +41 -1
  63. data/lib/purecloudplatformclientv2/models/analytics_view.rb +1 -1
  64. data/lib/purecloudplatformclientv2/models/call_forwarding.rb +71 -1
  65. data/lib/purecloudplatformclientv2/models/call_media_participant.rb +30 -4
  66. data/lib/purecloudplatformclientv2/models/call_route.rb +230 -0
  67. data/lib/purecloudplatformclientv2/models/call_target.rb +242 -0
  68. data/lib/purecloudplatformclientv2/models/contact.rb +1 -1
  69. data/lib/purecloudplatformclientv2/models/conversation_notification_message.rb +90 -1
  70. data/lib/purecloudplatformclientv2/models/conversation_notification_message_details.rb +68 -4
  71. data/lib/purecloudplatformclientv2/models/conversation_notification_messages.rb +68 -4
  72. data/lib/purecloudplatformclientv2/models/conversation_notification_messages_1.rb +90 -1
  73. data/lib/purecloudplatformclientv2/models/create_email_request.rb +56 -4
  74. data/lib/purecloudplatformclientv2/models/create_queue_request.rb +53 -1
  75. data/lib/purecloudplatformclientv2/models/create_secure_session.rb +290 -0
  76. data/lib/purecloudplatformclientv2/models/dependency.rb +2 -2
  77. data/lib/purecloudplatformclientv2/models/dependency_object.rb +2 -2
  78. data/lib/purecloudplatformclientv2/models/event_message.rb +2 -2
  79. data/lib/purecloudplatformclientv2/models/external_contact.rb +26 -1
  80. data/lib/purecloudplatformclientv2/models/import_script_status_response.rb +251 -0
  81. data/lib/purecloudplatformclientv2/models/inbound_route.rb +27 -1
  82. data/lib/purecloudplatformclientv2/models/interaction_stat_alert_notification.rb +2 -2
  83. data/lib/purecloudplatformclientv2/models/interaction_stat_rule_notification.rb +2 -2
  84. data/lib/purecloudplatformclientv2/models/interaction_stats_alert.rb +2 -2
  85. data/lib/purecloudplatformclientv2/models/interaction_stats_rule.rb +2 -2
  86. data/lib/purecloudplatformclientv2/models/intraday_data_group.rb +2 -2
  87. data/lib/purecloudplatformclientv2/models/intraday_data_update_notification_intraday_data_group.rb +2 -2
  88. data/lib/purecloudplatformclientv2/models/intraday_data_update_notification_intraday_data_groupings.rb +2 -2
  89. data/lib/purecloudplatformclientv2/models/json_node.rb +17 -17
  90. data/lib/purecloudplatformclientv2/models/management_unit.rb +59 -7
  91. data/lib/purecloudplatformclientv2/models/management_unit_reference.rb +229 -0
  92. data/lib/purecloudplatformclientv2/models/management_unit_settings.rb +364 -0
  93. data/lib/purecloudplatformclientv2/models/message.rb +93 -1
  94. data/lib/purecloudplatformclientv2/models/message_conversation_notification_message_details.rb +68 -4
  95. data/lib/purecloudplatformclientv2/models/message_conversation_notification_message_media_participant.rb +93 -4
  96. data/lib/purecloudplatformclientv2/models/message_conversation_notification_messages.rb +68 -4
  97. data/lib/purecloudplatformclientv2/models/message_conversation_notification_participants.rb +93 -4
  98. data/lib/purecloudplatformclientv2/models/message_details.rb +67 -1
  99. data/lib/purecloudplatformclientv2/models/participant.rb +2 -2
  100. data/lib/purecloudplatformclientv2/models/participant_basic.rb +2 -2
  101. data/lib/purecloudplatformclientv2/models/queue.rb +53 -1
  102. data/lib/purecloudplatformclientv2/models/scheduling_settings.rb +229 -0
  103. data/lib/purecloudplatformclientv2/models/secure_session.rb +382 -0
  104. data/lib/purecloudplatformclientv2/models/secure_session_entity_listing.rb +203 -0
  105. data/lib/purecloudplatformclientv2/models/short_term_forecasting_settings.rb +203 -0
  106. data/lib/purecloudplatformclientv2/models/signed_data.rb +201 -0
  107. data/lib/purecloudplatformclientv2/models/time_off_request_settings.rb +255 -0
  108. data/lib/purecloudplatformclientv2/models/update_user.rb +2 -1
  109. data/lib/purecloudplatformclientv2/models/user_conversation_summary_notification.rb +26 -1
  110. data/lib/purecloudplatformclientv2/models/user_queue.rb +53 -1
  111. data/lib/purecloudplatformclientv2/models/user_reference.rb +228 -0
  112. data/lib/purecloudplatformclientv2/version.rb +1 -1
  113. metadata +34 -2
@@ -0,0 +1,203 @@
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@genesys.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
+ # Short Term Forecasting Settings
21
+ class ShortTermForecastingSettings
22
+ # The number of weeks to consider by default when generating a volume forecast
23
+ attr_accessor :default_history_weeks
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+
29
+ :'default_history_weeks' => :'defaultHistoryWeeks'
30
+
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+
38
+ :'default_history_weeks' => :'Integer'
39
+
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
50
+
51
+
52
+ if attributes.has_key?(:'defaultHistoryWeeks')
53
+
54
+
55
+ self.default_history_weeks = attributes[:'defaultHistoryWeeks']
56
+
57
+
58
+ end
59
+
60
+
61
+ end
62
+
63
+ # Show invalid properties with the reasons. Usually used together with valid?
64
+ # @return Array for valid properies with the reasons
65
+ def list_invalid_properties
66
+ invalid_properties = Array.new
67
+
68
+
69
+ return invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+
76
+
77
+
78
+
79
+
80
+ end
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ default_history_weeks == o.default_history_weeks
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Fixnum] Hash code
104
+ def hash
105
+ [default_history_weeks].hash
106
+ end
107
+
108
+ # build the object from hash
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.swagger_types.each_pair do |key, type|
112
+ if type =~ /^Array<(.*)>/i
113
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
114
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
115
+ else
116
+ #TODO show warning in debug mode
117
+ end
118
+ elsif !attributes[self.class.attribute_map[key]].nil?
119
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ else
121
+ # data not found in attributes(hash), not an issue as the data can be optional
122
+ end
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ def _deserialize(type, value)
129
+ case type.to_sym
130
+ when :DateTime
131
+ DateTime.parse(value)
132
+ when :Date
133
+ Date.parse(value)
134
+ when :String
135
+ value.to_s
136
+ when :Integer
137
+ value.to_i
138
+ when :Float
139
+ value.to_f
140
+ when :BOOLEAN
141
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
142
+ true
143
+ else
144
+ false
145
+ end
146
+ when :Object
147
+ # generic object (usually a Hash), return directly
148
+ value
149
+ when /\AArray<(?<inner_type>.+)>\z/
150
+ inner_type = Regexp.last_match[:inner_type]
151
+ value.map { |v| _deserialize(inner_type, v) }
152
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
153
+ k_type = Regexp.last_match[:k_type]
154
+ v_type = Regexp.last_match[:v_type]
155
+ {}.tap do |hash|
156
+ value.each do |k, v|
157
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
158
+ end
159
+ end
160
+ else # model
161
+ _model = Object.const_get("PureCloud").const_get(type).new
162
+ _model.build_from_hash(value)
163
+ end
164
+ end
165
+
166
+ def to_s
167
+ to_hash.to_s
168
+ end
169
+
170
+ # to_body is an alias to to_body (backward compatibility))
171
+ def to_body
172
+ to_hash
173
+ end
174
+
175
+ # return the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ next if value.nil?
181
+ hash[param] = _to_hash(value)
182
+ end
183
+ hash
184
+ end
185
+
186
+ # Method to output non-array value in the form of hash
187
+ # For object, use to_hash. Otherwise, just return the value
188
+ def _to_hash(value)
189
+ if value.is_a?(Array)
190
+ value.compact.map{ |v| _to_hash(v) }
191
+ elsif value.is_a?(Hash)
192
+ {}.tap do |hash|
193
+ value.each { |k, v| hash[k] = _to_hash(v) }
194
+ end
195
+ elsif value.respond_to? :to_hash
196
+ value.to_hash
197
+ else
198
+ value
199
+ end
200
+ end
201
+
202
+ end
203
+ end
@@ -0,0 +1,201 @@
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@genesys.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 SignedData
21
+ attr_accessor :jwt
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+
27
+ :'jwt' => :'jwt'
28
+
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+
36
+ :'jwt' => :'String'
37
+
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
48
+
49
+
50
+ if attributes.has_key?(:'jwt')
51
+
52
+
53
+ self.jwt = attributes[:'jwt']
54
+
55
+
56
+ end
57
+
58
+
59
+ end
60
+
61
+ # Show invalid properties with the reasons. Usually used together with valid?
62
+ # @return Array for valid properies with the reasons
63
+ def list_invalid_properties
64
+ invalid_properties = Array.new
65
+
66
+
67
+ return invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+
74
+
75
+
76
+
77
+
78
+ end
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ jwt == o.jwt
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Fixnum] Hash code
102
+ def hash
103
+ [jwt].hash
104
+ end
105
+
106
+ # build the object from hash
107
+ def build_from_hash(attributes)
108
+ return nil unless attributes.is_a?(Hash)
109
+ self.class.swagger_types.each_pair do |key, type|
110
+ if type =~ /^Array<(.*)>/i
111
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
112
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
113
+ else
114
+ #TODO show warning in debug mode
115
+ end
116
+ elsif !attributes[self.class.attribute_map[key]].nil?
117
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
118
+ else
119
+ # data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+ end
122
+
123
+ self
124
+ end
125
+
126
+ def _deserialize(type, value)
127
+ case type.to_sym
128
+ when :DateTime
129
+ DateTime.parse(value)
130
+ when :Date
131
+ Date.parse(value)
132
+ when :String
133
+ value.to_s
134
+ when :Integer
135
+ value.to_i
136
+ when :Float
137
+ value.to_f
138
+ when :BOOLEAN
139
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
140
+ true
141
+ else
142
+ false
143
+ end
144
+ when :Object
145
+ # generic object (usually a Hash), return directly
146
+ value
147
+ when /\AArray<(?<inner_type>.+)>\z/
148
+ inner_type = Regexp.last_match[:inner_type]
149
+ value.map { |v| _deserialize(inner_type, v) }
150
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
151
+ k_type = Regexp.last_match[:k_type]
152
+ v_type = Regexp.last_match[:v_type]
153
+ {}.tap do |hash|
154
+ value.each do |k, v|
155
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
156
+ end
157
+ end
158
+ else # model
159
+ _model = Object.const_get("PureCloud").const_get(type).new
160
+ _model.build_from_hash(value)
161
+ end
162
+ end
163
+
164
+ def to_s
165
+ to_hash.to_s
166
+ end
167
+
168
+ # to_body is an alias to to_body (backward compatibility))
169
+ def to_body
170
+ to_hash
171
+ end
172
+
173
+ # return the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ next if value.nil?
179
+ hash[param] = _to_hash(value)
180
+ end
181
+ hash
182
+ end
183
+
184
+ # Method to output non-array value in the form of hash
185
+ # For object, use to_hash. Otherwise, just return the value
186
+ def _to_hash(value)
187
+ if value.is_a?(Array)
188
+ value.compact.map{ |v| _to_hash(v) }
189
+ elsif value.is_a?(Hash)
190
+ {}.tap do |hash|
191
+ value.each { |k, v| hash[k] = _to_hash(v) }
192
+ end
193
+ elsif value.respond_to? :to_hash
194
+ value.to_hash
195
+ else
196
+ value
197
+ end
198
+ end
199
+
200
+ end
201
+ end
@@ -0,0 +1,255 @@
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@genesys.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
+ # Time Off Request Settings
21
+ class TimeOffRequestSettings
22
+ # Whether to enforce a submission range for agent time off requests
23
+ attr_accessor :submission_range_enforced
24
+
25
+ # The earliest number of days from now for which an agent can submit a time off request. Use negative numbers to indicate days in the past
26
+ attr_accessor :submission_earliest_days_from_now
27
+
28
+ # The latest number of days from now for which an agent can submit a time off request
29
+ attr_accessor :submission_latest_days_from_now
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+
35
+ :'submission_range_enforced' => :'submissionRangeEnforced',
36
+
37
+ :'submission_earliest_days_from_now' => :'submissionEarliestDaysFromNow',
38
+
39
+ :'submission_latest_days_from_now' => :'submissionLatestDaysFromNow'
40
+
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+
48
+ :'submission_range_enforced' => :'BOOLEAN',
49
+
50
+ :'submission_earliest_days_from_now' => :'Integer',
51
+
52
+ :'submission_latest_days_from_now' => :'Integer'
53
+
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
64
+
65
+
66
+ if attributes.has_key?(:'submissionRangeEnforced')
67
+
68
+
69
+ self.submission_range_enforced = attributes[:'submissionRangeEnforced']
70
+
71
+
72
+ end
73
+
74
+
75
+ if attributes.has_key?(:'submissionEarliestDaysFromNow')
76
+
77
+
78
+ self.submission_earliest_days_from_now = attributes[:'submissionEarliestDaysFromNow']
79
+
80
+
81
+ end
82
+
83
+
84
+ if attributes.has_key?(:'submissionLatestDaysFromNow')
85
+
86
+
87
+ self.submission_latest_days_from_now = attributes[:'submissionLatestDaysFromNow']
88
+
89
+
90
+ end
91
+
92
+
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properies with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+
100
+
101
+ return invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+ end
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ submission_range_enforced == o.submission_range_enforced &&
144
+ submission_earliest_days_from_now == o.submission_earliest_days_from_now &&
145
+ submission_latest_days_from_now == o.submission_latest_days_from_now
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Fixnum] Hash code
156
+ def hash
157
+ [submission_range_enforced, submission_earliest_days_from_now, submission_latest_days_from_now].hash
158
+ end
159
+
160
+ # build the object from hash
161
+ def build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ self.class.swagger_types.each_pair do |key, type|
164
+ if type =~ /^Array<(.*)>/i
165
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
166
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
167
+ else
168
+ #TODO show warning in debug mode
169
+ end
170
+ elsif !attributes[self.class.attribute_map[key]].nil?
171
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
172
+ else
173
+ # data not found in attributes(hash), not an issue as the data can be optional
174
+ end
175
+ end
176
+
177
+ self
178
+ end
179
+
180
+ def _deserialize(type, value)
181
+ case type.to_sym
182
+ when :DateTime
183
+ DateTime.parse(value)
184
+ when :Date
185
+ Date.parse(value)
186
+ when :String
187
+ value.to_s
188
+ when :Integer
189
+ value.to_i
190
+ when :Float
191
+ value.to_f
192
+ when :BOOLEAN
193
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
194
+ true
195
+ else
196
+ false
197
+ end
198
+ when :Object
199
+ # generic object (usually a Hash), return directly
200
+ value
201
+ when /\AArray<(?<inner_type>.+)>\z/
202
+ inner_type = Regexp.last_match[:inner_type]
203
+ value.map { |v| _deserialize(inner_type, v) }
204
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
205
+ k_type = Regexp.last_match[:k_type]
206
+ v_type = Regexp.last_match[:v_type]
207
+ {}.tap do |hash|
208
+ value.each do |k, v|
209
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
210
+ end
211
+ end
212
+ else # model
213
+ _model = Object.const_get("PureCloud").const_get(type).new
214
+ _model.build_from_hash(value)
215
+ end
216
+ end
217
+
218
+ def to_s
219
+ to_hash.to_s
220
+ end
221
+
222
+ # to_body is an alias to to_body (backward compatibility))
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # return the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ next if value.nil?
233
+ hash[param] = _to_hash(value)
234
+ end
235
+ hash
236
+ end
237
+
238
+ # Method to output non-array value in the form of hash
239
+ # For object, use to_hash. Otherwise, just return the value
240
+ def _to_hash(value)
241
+ if value.is_a?(Array)
242
+ value.compact.map{ |v| _to_hash(v) }
243
+ elsif value.is_a?(Hash)
244
+ {}.tap do |hash|
245
+ value.each { |k, v| hash[k] = _to_hash(v) }
246
+ end
247
+ elsif value.respond_to? :to_hash
248
+ value.to_hash
249
+ else
250
+ value
251
+ end
252
+ end
253
+
254
+ end
255
+ end