purecloudplatformclientv2 17.0.0 → 18.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 (120) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/docs/AnalyticsConversation.md +5 -5
  4. data/docs/AnalyticsConversationSegment.md +9 -9
  5. data/docs/AnalyticsEvaluation.md +10 -10
  6. data/docs/AnalyticsParticipant.md +7 -7
  7. data/docs/AnalyticsSession.md +27 -27
  8. data/docs/BillingApi.md +75 -0
  9. data/docs/BillingUsage.md +15 -0
  10. data/docs/BillingUsageReport.md +18 -0
  11. data/docs/BillingUsageResource.md +14 -0
  12. data/docs/CallCommand.md +1 -0
  13. data/docs/Conversation.md +1 -1
  14. data/docs/CreateQueueRequest.md +9 -9
  15. data/docs/DID.md +9 -9
  16. data/docs/DIDPool.md +9 -9
  17. data/docs/DirectoryUserDevicesListing.md +22 -0
  18. data/docs/DomainCertificateAuthority.md +9 -9
  19. data/docs/DomainLogicalInterface.md +9 -9
  20. data/docs/DomainOrganizationRole.md +1 -1
  21. data/docs/DomainOrganizationRoleCreate.md +1 -1
  22. data/docs/DomainOrganizationRoleUpdate.md +1 -1
  23. data/docs/DomainPhysicalInterface.md +9 -9
  24. data/docs/DomainSchemaReference.md +9 -9
  25. data/docs/Edge.md +10 -10
  26. data/docs/EdgeGroup.md +9 -9
  27. data/docs/EdgeLine.md +9 -9
  28. data/docs/EdgeLogsJob.md +9 -9
  29. data/docs/EdgeLogsJobFile.md +9 -9
  30. data/docs/EdgeLogsJobResponse.md +9 -9
  31. data/docs/EdgeTrunkBase.md +9 -9
  32. data/docs/Endpoint.md +9 -9
  33. data/docs/Extension.md +9 -9
  34. data/docs/ExtensionPool.md +9 -9
  35. data/docs/IVR.md +9 -9
  36. data/docs/JsonNode.md +4 -4
  37. data/docs/Line.md +9 -9
  38. data/docs/LineBase.md +9 -9
  39. data/docs/Metabase.md +8 -8
  40. data/docs/MobileDevicesApi.md +320 -0
  41. data/docs/NumberPlan.md +9 -9
  42. data/docs/OutboundApi.md +113 -0
  43. data/docs/OutboundRoute.md +9 -9
  44. data/docs/OutboundRouteBase.md +9 -9
  45. data/docs/OutboundSettings.md +20 -0
  46. data/docs/Phone.md +9 -9
  47. data/docs/PhoneBase.md +9 -9
  48. data/docs/Queue.md +9 -9
  49. data/docs/Schedule.md +10 -10
  50. data/docs/ScheduleGroup.md +10 -10
  51. data/docs/SchemaCategory.md +9 -9
  52. data/docs/Site.md +9 -9
  53. data/docs/Trunk.md +9 -9
  54. data/docs/TrunkBase.md +9 -9
  55. data/docs/UserDevice.md +22 -0
  56. data/docs/UserQueue.md +9 -9
  57. data/docs/UsersApi.md +1 -1
  58. data/lib/purecloudplatformclientv2.rb +8 -0
  59. data/lib/purecloudplatformclientv2/api/billing_api.rb +104 -0
  60. data/lib/purecloudplatformclientv2/api/mobile_devices_api.rb +380 -0
  61. data/lib/purecloudplatformclientv2/api/outbound_api.rb +119 -0
  62. data/lib/purecloudplatformclientv2/api/users_api.rb +2 -2
  63. data/lib/purecloudplatformclientv2/api_client.rb +1 -1
  64. data/lib/purecloudplatformclientv2/models/analytics_conversation.rb +5 -2
  65. data/lib/purecloudplatformclientv2/models/analytics_conversation_segment.rb +9 -2
  66. data/lib/purecloudplatformclientv2/models/analytics_evaluation.rb +10 -0
  67. data/lib/purecloudplatformclientv2/models/analytics_participant.rb +7 -0
  68. data/lib/purecloudplatformclientv2/models/analytics_session.rb +42 -2
  69. data/lib/purecloudplatformclientv2/models/billing_usage.rb +271 -0
  70. data/lib/purecloudplatformclientv2/models/billing_usage_report.rb +348 -0
  71. data/lib/purecloudplatformclientv2/models/billing_usage_resource.rb +238 -0
  72. data/lib/purecloudplatformclientv2/models/call_command.rb +30 -4
  73. data/lib/purecloudplatformclientv2/models/conversation.rb +1 -1
  74. data/lib/purecloudplatformclientv2/models/create_queue_request.rb +9 -2
  75. data/lib/purecloudplatformclientv2/models/did.rb +9 -2
  76. data/lib/purecloudplatformclientv2/models/did_pool.rb +9 -2
  77. data/lib/purecloudplatformclientv2/models/directory_user_devices_listing.rb +428 -0
  78. data/lib/purecloudplatformclientv2/models/domain_certificate_authority.rb +9 -2
  79. data/lib/purecloudplatformclientv2/models/domain_logical_interface.rb +9 -2
  80. data/lib/purecloudplatformclientv2/models/domain_organization_role.rb +12 -12
  81. data/lib/purecloudplatformclientv2/models/domain_organization_role_create.rb +12 -12
  82. data/lib/purecloudplatformclientv2/models/domain_organization_role_update.rb +12 -12
  83. data/lib/purecloudplatformclientv2/models/domain_physical_interface.rb +9 -2
  84. data/lib/purecloudplatformclientv2/models/domain_schema_reference.rb +9 -2
  85. data/lib/purecloudplatformclientv2/models/edge.rb +10 -2
  86. data/lib/purecloudplatformclientv2/models/edge_group.rb +9 -2
  87. data/lib/purecloudplatformclientv2/models/edge_line.rb +9 -2
  88. data/lib/purecloudplatformclientv2/models/edge_logs_job.rb +9 -2
  89. data/lib/purecloudplatformclientv2/models/edge_logs_job_file.rb +9 -2
  90. data/lib/purecloudplatformclientv2/models/edge_logs_job_response.rb +9 -2
  91. data/lib/purecloudplatformclientv2/models/edge_trunk_base.rb +9 -2
  92. data/lib/purecloudplatformclientv2/models/endpoint.rb +9 -2
  93. data/lib/purecloudplatformclientv2/models/extension.rb +9 -2
  94. data/lib/purecloudplatformclientv2/models/extension_pool.rb +9 -2
  95. data/lib/purecloudplatformclientv2/models/intraday_data_group.rb +2 -2
  96. data/lib/purecloudplatformclientv2/models/intraday_data_update_notification_intraday_data_group.rb +2 -2
  97. data/lib/purecloudplatformclientv2/models/intraday_data_update_notification_intraday_data_groupings.rb +2 -2
  98. data/lib/purecloudplatformclientv2/models/ivr.rb +9 -2
  99. data/lib/purecloudplatformclientv2/models/json_node.rb +72 -72
  100. data/lib/purecloudplatformclientv2/models/line.rb +9 -2
  101. data/lib/purecloudplatformclientv2/models/line_base.rb +9 -2
  102. data/lib/purecloudplatformclientv2/models/metabase.rb +8 -2
  103. data/lib/purecloudplatformclientv2/models/number_plan.rb +9 -2
  104. data/lib/purecloudplatformclientv2/models/outbound_route.rb +9 -2
  105. data/lib/purecloudplatformclientv2/models/outbound_route_base.rb +9 -2
  106. data/lib/purecloudplatformclientv2/models/outbound_settings.rb +383 -0
  107. data/lib/purecloudplatformclientv2/models/phone.rb +9 -2
  108. data/lib/purecloudplatformclientv2/models/phone_base.rb +9 -2
  109. data/lib/purecloudplatformclientv2/models/queue.rb +9 -2
  110. data/lib/purecloudplatformclientv2/models/recording.rb +2 -2
  111. data/lib/purecloudplatformclientv2/models/schedule.rb +15 -2
  112. data/lib/purecloudplatformclientv2/models/schedule_group.rb +15 -2
  113. data/lib/purecloudplatformclientv2/models/schema_category.rb +9 -2
  114. data/lib/purecloudplatformclientv2/models/site.rb +9 -2
  115. data/lib/purecloudplatformclientv2/models/trunk.rb +9 -2
  116. data/lib/purecloudplatformclientv2/models/trunk_base.rb +9 -2
  117. data/lib/purecloudplatformclientv2/models/user_device.rb +478 -0
  118. data/lib/purecloudplatformclientv2/models/user_queue.rb +9 -2
  119. data/lib/purecloudplatformclientv2/version.rb +1 -1
  120. metadata +19 -3
@@ -1556,8 +1556,8 @@ module PureCloud
1556
1556
 
1557
1557
 
1558
1558
 
1559
- if opts[:'state'] && !['active', 'deleted'].include?(opts[:'state'])
1560
- fail ArgumentError, 'invalid value for "state", must be one of active, deleted'
1559
+ if opts[:'state'] && !['active', 'inactive', 'deleted'].include?(opts[:'state'])
1560
+ fail ArgumentError, 'invalid value for "state", must be one of active, inactive, deleted'
1561
1561
  end
1562
1562
 
1563
1563
 
@@ -76,7 +76,7 @@ module PureCloud
76
76
  http_method = http_method.to_sym.downcase
77
77
 
78
78
  header_params = @default_headers.merge(opts[:header_params] || {})
79
- header_params['purecloud-sdk'] = '17.0.0'
79
+ header_params['purecloud-sdk'] = '18.0.0'
80
80
  query_params = opts[:query_params] || {}
81
81
  form_params = opts[:form_params] || {}
82
82
 
@@ -18,16 +18,19 @@ require 'date'
18
18
 
19
19
  module PureCloud
20
20
  class AnalyticsConversation
21
+ # Unique identifier for the conversation
21
22
  attr_accessor :conversation_id
22
23
 
23
- # Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
24
+ # Date/time the conversation started. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
24
25
  attr_accessor :conversation_start
25
26
 
26
- # Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
27
+ # Date/time the conversation ended. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
27
28
  attr_accessor :conversation_end
28
29
 
30
+ # Participants in the conversation
29
31
  attr_accessor :participants
30
32
 
33
+ # Evaluations tied to this conersation
31
34
  attr_accessor :evaluations
32
35
 
33
36
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -18,30 +18,36 @@ require 'date'
18
18
 
19
19
  module PureCloud
20
20
  class AnalyticsConversationSegment
21
- # Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
21
+ # The timestamp when this segment began. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
22
22
  attr_accessor :segment_start
23
23
 
24
- # Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
24
+ # The timestamp when this segment ended. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
25
25
  attr_accessor :segment_end
26
26
 
27
+ # Queue identifier
27
28
  attr_accessor :queue_id
28
29
 
30
+ # Wrapup Code id
29
31
  attr_accessor :wrap_up_code
30
32
 
33
+ # Note entered by an agent during after-call work
31
34
  attr_accessor :wrap_up_note
32
35
 
33
36
  attr_accessor :wrap_up_tags
34
37
 
35
38
  attr_accessor :error_code
36
39
 
40
+ # A description of the event that disconnected the segment
37
41
  attr_accessor :disconnect_type
38
42
 
43
+ # The activity taking place for the participant in the segment
39
44
  attr_accessor :segment_type
40
45
 
41
46
  attr_accessor :requested_routing_user_ids
42
47
 
43
48
  attr_accessor :requested_routing_skill_ids
44
49
 
50
+ # A unique identifier for the language requested for an interaction.
45
51
  attr_accessor :requested_language_id
46
52
 
47
53
  attr_accessor :properties
@@ -58,6 +64,7 @@ module PureCloud
58
64
 
59
65
  attr_accessor :q850_response_codes
60
66
 
67
+ # Indicates whether the segment was a conference
61
68
  attr_accessor :conference
62
69
 
63
70
  attr_accessor :group_id
@@ -18,24 +18,34 @@ require 'date'
18
18
 
19
19
  module PureCloud
20
20
  class AnalyticsEvaluation
21
+ # Unique identifier for the evaluation
21
22
  attr_accessor :evaluation_id
22
23
 
24
+ # A unique identifier of the PureCloud user who evaluated the interaction
23
25
  attr_accessor :evaluator_id
24
26
 
27
+ # Unique identifier for the user being evaluated
25
28
  attr_accessor :user_id
26
29
 
30
+ # Specifies when an evaluation occurred
27
31
  attr_accessor :event_time
28
32
 
33
+ # Unique identifier for the queue the conversation was on
29
34
  attr_accessor :queue_id
30
35
 
36
+ # Unique identifier for the form used to evaluate the conversation/agent
31
37
  attr_accessor :form_id
32
38
 
39
+ # A unique identifier for an evaluation form, regardless of version
33
40
  attr_accessor :context_id
34
41
 
42
+ # Name of the evaluation form
35
43
  attr_accessor :form_name
36
44
 
45
+ # The total evaluation for interactions
37
46
  attr_accessor :geto_total_score
38
47
 
48
+ # The score for critical evaluation questions
39
49
  attr_accessor :geto_total_critical_score
40
50
 
41
51
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -18,18 +18,25 @@ require 'date'
18
18
 
19
19
  module PureCloud
20
20
  class AnalyticsParticipant
21
+ # Unique identifier for the participant
21
22
  attr_accessor :participant_id
22
23
 
24
+ # A human readable name identifying the participant
23
25
  attr_accessor :participant_name
24
26
 
27
+ # If a user, then this will be the unique identifier for the user
25
28
  attr_accessor :user_id
26
29
 
30
+ # The participant's purpose
27
31
  attr_accessor :purpose
28
32
 
33
+ # External Contact Identifier
29
34
  attr_accessor :external_contact_id
30
35
 
36
+ # External Organization Identifier
31
37
  attr_accessor :external_organization_id
32
38
 
39
+ # List of sessions associated to this participant
33
40
  attr_accessor :sessions
34
41
 
35
42
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -18,69 +18,95 @@ require 'date'
18
18
 
19
19
  module PureCloud
20
20
  class AnalyticsSession
21
+ # The session media type
21
22
  attr_accessor :media_type
22
23
 
24
+ # The unique identifier of this session
23
25
  attr_accessor :session_id
24
26
 
25
27
  attr_accessor :address_other
26
28
 
27
29
  attr_accessor :address_self
28
30
 
31
+ # Automatic Number Identification (caller's number)
29
32
  attr_accessor :ani
30
33
 
34
+ # Direction
31
35
  attr_accessor :direction
32
36
 
37
+ # Automatic Number Identification (caller's number)
33
38
  attr_accessor :dnis
34
39
 
40
+ # (Dialer) Unique identifier of the outbound campaign
35
41
  attr_accessor :outbound_campaign_id
36
42
 
43
+ # (Dialer) Unique identifier of the contact
37
44
  attr_accessor :outbound_contact_id
38
45
 
46
+ # (Dialer) Unique identifier of the contact list that this contact belongs to
39
47
  attr_accessor :outbound_contact_list_id
40
48
 
49
+ # (Dialer) Unique identifier of the contact list that this contact belongs to
41
50
  attr_accessor :disposition_analyzer
42
51
 
52
+ # (Dialer) Result of the analysis (for example disposition.classification.callable.machine) 
43
53
  attr_accessor :disposition_name
44
54
 
55
+ # Unique identifier of the edge device
45
56
  attr_accessor :edge_id
46
57
 
47
58
  attr_accessor :remote_name_displayable
48
59
 
60
+ # Unique identifier for the room
49
61
  attr_accessor :room_id
50
62
 
63
+ # The sessionID being monitored
51
64
  attr_accessor :monitored_session_id
52
65
 
53
66
  attr_accessor :monitored_participant_id
54
67
 
68
+ # The name of the user requesting a call back
55
69
  attr_accessor :callback_user_name
56
70
 
71
+ # List of numbers to callback
57
72
  attr_accessor :callback_numbers
58
73
 
59
- # Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
74
+ # Scheduled callback date/time. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ
60
75
  attr_accessor :callback_scheduled_time
61
76
 
77
+ # Scheduled callback date/time, Date time is represented as an ISO-8601 string. 
62
78
  attr_accessor :script_id
63
79
 
80
+ # (Dialer) Whether the agent can skip the dialer contact
64
81
  attr_accessor :skip_enabled
65
82
 
83
+ # The number of seconds before PureCloud begins the call for a call back. 0 disables automatic calling
66
84
  attr_accessor :timeout_seconds
67
85
 
86
+ # Describe side of the cobrowse (sharer or viewer)
68
87
  attr_accessor :cobrowse_role
69
88
 
89
+ # A unique identifier for a PureCloud Cobrowse room.
70
90
  attr_accessor :cobrowse_room_id
71
91
 
72
92
  attr_accessor :media_bridge_id
73
93
 
94
+ # Direct ScreenShare address
74
95
  attr_accessor :screen_share_address_self
75
96
 
97
+ # Flag determining if screenShare is started or not (true/false)
76
98
  attr_accessor :sharing_screen
77
99
 
100
+ # A unique identifier for a PureCloud ScreenShare room.
78
101
  attr_accessor :screen_share_room_id
79
102
 
103
+ # A unique identifier for a PureCloud video room.
80
104
  attr_accessor :video_room_id
81
105
 
106
+ # Direct Video address
82
107
  attr_accessor :video_address_self
83
108
 
109
+ # List of segments for this session
84
110
  attr_accessor :segments
85
111
 
86
112
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -597,6 +623,11 @@ module PureCloud
597
623
 
598
624
 
599
625
 
626
+ allowed_values = ["disconnect", "person", "busy", "machine", "noanswer", "fax", "sit"]
627
+ if @disposition_name && !allowed_values.include?(@disposition_name)
628
+ return false
629
+ end
630
+
600
631
 
601
632
 
602
633
 
@@ -756,7 +787,16 @@ module PureCloud
756
787
 
757
788
 
758
789
 
759
-
790
+ # Custom attribute writer method checking allowed values (enum).
791
+ # @param [Object] disposition_name Object to be assigned
792
+ def disposition_name=(disposition_name)
793
+ allowed_values = ["disconnect", "person", "busy", "machine", "noanswer", "fax", "sit"]
794
+ if disposition_name && !allowed_values.include?(disposition_name)
795
+ fail ArgumentError, "invalid value for 'disposition_name', must be one of #{allowed_values}."
796
+ end
797
+ @disposition_name = disposition_name
798
+ end
799
+
760
800
 
761
801
 
762
802
 
@@ -0,0 +1,271 @@
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 BillingUsage
21
+ # Identifies the billable usage.
22
+ attr_accessor :name
23
+
24
+ # The total amount of usage, expressed as a decimal number in string format.
25
+ attr_accessor :total_usage
26
+
27
+ # The resources for which usage was observed (e.g. license users, devices).
28
+ attr_accessor :resources
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+
34
+ :'name' => :'name',
35
+
36
+ :'total_usage' => :'totalUsage',
37
+
38
+ :'resources' => :'resources'
39
+
40
+ }
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.swagger_types
45
+ {
46
+
47
+ :'name' => :'String',
48
+
49
+ :'total_usage' => :'String',
50
+
51
+ :'resources' => :'Array<BillingUsageResource>'
52
+
53
+ }
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ return unless attributes.is_a?(Hash)
60
+
61
+ # convert string to symbol for hash key
62
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
63
+
64
+
65
+ if attributes.has_key?(:'name')
66
+
67
+
68
+ self.name = attributes[:'name']
69
+
70
+
71
+ end
72
+
73
+
74
+ if attributes.has_key?(:'totalUsage')
75
+
76
+
77
+ self.total_usage = attributes[:'totalUsage']
78
+
79
+
80
+ end
81
+
82
+
83
+ if attributes.has_key?(:'resources')
84
+
85
+ if (value = attributes[:'resources']).is_a?(Array)
86
+ self.resources = value
87
+ end
88
+
89
+
90
+
91
+ end
92
+
93
+
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properies with the reasons
98
+ def list_invalid_properties
99
+ invalid_properties = Array.new
100
+
101
+
102
+ return invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+
109
+
110
+ if @name.nil?
111
+ return false
112
+ end
113
+
114
+
115
+
116
+
117
+
118
+
119
+ if @total_usage.nil?
120
+ return false
121
+ end
122
+
123
+
124
+
125
+
126
+
127
+
128
+ if @resources.nil?
129
+ return false
130
+ end
131
+
132
+
133
+
134
+
135
+
136
+ end
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+ # Checks equality by comparing each attribute.
155
+ # @param [Object] Object to be compared
156
+ def ==(o)
157
+ return true if self.equal?(o)
158
+ self.class == o.class &&
159
+ name == o.name &&
160
+ total_usage == o.total_usage &&
161
+ resources == o.resources
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Fixnum] Hash code
172
+ def hash
173
+ [name, total_usage, resources].hash
174
+ end
175
+
176
+ # build the object from hash
177
+ def build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ self.class.swagger_types.each_pair do |key, type|
180
+ if type =~ /^Array<(.*)>/i
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
183
+ else
184
+ #TODO show warning in debug mode
185
+ end
186
+ elsif !attributes[self.class.attribute_map[key]].nil?
187
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
188
+ else
189
+ # data not found in attributes(hash), not an issue as the data can be optional
190
+ end
191
+ end
192
+
193
+ self
194
+ end
195
+
196
+ def _deserialize(type, value)
197
+ case type.to_sym
198
+ when :DateTime
199
+ DateTime.parse(value)
200
+ when :Date
201
+ Date.parse(value)
202
+ when :String
203
+ value.to_s
204
+ when :Integer
205
+ value.to_i
206
+ when :Float
207
+ value.to_f
208
+ when :BOOLEAN
209
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
210
+ true
211
+ else
212
+ false
213
+ end
214
+ when :Object
215
+ # generic object (usually a Hash), return directly
216
+ value
217
+ when /\AArray<(?<inner_type>.+)>\z/
218
+ inner_type = Regexp.last_match[:inner_type]
219
+ value.map { |v| _deserialize(inner_type, v) }
220
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
221
+ k_type = Regexp.last_match[:k_type]
222
+ v_type = Regexp.last_match[:v_type]
223
+ {}.tap do |hash|
224
+ value.each do |k, v|
225
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
+ end
227
+ end
228
+ else # model
229
+ _model = Object.const_get("PureCloud").const_get(type).new
230
+ _model.build_from_hash(value)
231
+ end
232
+ end
233
+
234
+ def to_s
235
+ to_hash.to_s
236
+ end
237
+
238
+ # to_body is an alias to to_body (backward compatibility))
239
+ def to_body
240
+ to_hash
241
+ end
242
+
243
+ # return the object in the form of hash
244
+ def to_hash
245
+ hash = {}
246
+ self.class.attribute_map.each_pair do |attr, param|
247
+ value = self.send(attr)
248
+ next if value.nil?
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ # Method to output non-array value in the form of hash
255
+ # For object, use to_hash. Otherwise, just return the value
256
+ def _to_hash(value)
257
+ if value.is_a?(Array)
258
+ value.compact.map{ |v| _to_hash(v) }
259
+ elsif value.is_a?(Hash)
260
+ {}.tap do |hash|
261
+ value.each { |k, v| hash[k] = _to_hash(v) }
262
+ end
263
+ elsif value.respond_to? :to_hash
264
+ value.to_hash
265
+ else
266
+ value
267
+ end
268
+ end
269
+
270
+ end
271
+ end