purecloudplatformclientv2 87.0.0 → 92.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -5
  3. data/docs/AmazonLexRequest.md +14 -0
  4. data/docs/AnalyticsEvaluation.md +1 -1
  5. data/docs/ApiUsageQuery.md +16 -0
  6. data/docs/ApiUsageQueryResult.md +14 -0
  7. data/docs/ApiUsageRow.md +25 -0
  8. data/docs/ArchitectApi.md +132 -0
  9. data/docs/AuditApi.md +130 -0
  10. data/docs/AuditQueryEntity.md +14 -0
  11. data/docs/AuditQueryExecutionStatusResponse.md +1 -0
  12. data/docs/AuditQueryRequest.md +1 -0
  13. data/docs/AuditQueryService.md +14 -0
  14. data/docs/AuditQueryServiceMapping.md +13 -0
  15. data/docs/AuditQuerySort.md +14 -0
  16. data/docs/AuditRealtimeQueryRequest.md +18 -0
  17. data/docs/AuditRealtimeQueryResultsResponse.md +17 -0
  18. data/docs/BuAgentScheduleActivity.md +2 -0
  19. data/docs/BuRescheduleRequest.md +2 -2
  20. data/docs/ButtonComponent.md +16 -0
  21. data/docs/CoachingApi.md +1 -1
  22. data/docs/ContentActions.md +17 -0
  23. data/docs/ContentAttachment.md +19 -0
  24. data/docs/ContentGeneric.md +19 -0
  25. data/docs/ContentList.md +19 -0
  26. data/docs/ContentLocation.md +17 -0
  27. data/docs/ContentNotificationTemplate.md +17 -0
  28. data/docs/ContentQuickReply.md +16 -0
  29. data/docs/ConversationAggregationQuery.md +1 -1
  30. data/docs/CreateQueueRequest.md +1 -0
  31. data/docs/EdgeGroup.md +1 -0
  32. data/docs/EntityListing.md +1 -5
  33. data/docs/EvaluationAggregationQuery.md +1 -1
  34. data/docs/ExternalContact.md +2 -0
  35. data/docs/ExternalOrganization.md +2 -0
  36. data/docs/FlowAggregationQuery.md +1 -1
  37. data/docs/FlowExecutionLaunchRequest.md +16 -0
  38. data/docs/FlowExecutionLaunchResponse.md +16 -0
  39. data/docs/FlowRuntimeExecution.md +23 -0
  40. data/docs/GenericSAML.md +22 -0
  41. data/docs/GoogleDialogflowCustomSettings.md +13 -0
  42. data/docs/GroupsApi.md +4 -4
  43. data/docs/IdentityProviderApi.md +187 -0
  44. data/docs/IpAddressAuthentication.md +13 -0
  45. data/docs/KnowledgeSearchResponse.md +1 -1
  46. data/docs/LanguageUnderstandingApi.md +164 -30
  47. data/docs/ListItemComponent.md +19 -0
  48. data/docs/MessageContent.md +19 -0
  49. data/docs/NluDomainVersion.md +3 -1
  50. data/docs/NotificationTemplateBody.md +14 -0
  51. data/docs/NotificationTemplateFooter.md +13 -0
  52. data/docs/NotificationTemplateHeader.md +16 -0
  53. data/docs/NotificationTemplateParameter.md +14 -0
  54. data/docs/OAuthApi.md +208 -0
  55. data/docs/OrganizationApi.md +126 -0
  56. data/docs/PostTextMessage.md +15 -0
  57. data/docs/PostTextRequest.md +23 -0
  58. data/docs/PostTextResponse.md +20 -0
  59. data/docs/Prompt.md +2 -2
  60. data/docs/Queue.md +1 -0
  61. data/docs/QueueRequest.md +1 -0
  62. data/docs/RecordingApi.md +12 -0
  63. data/docs/ReportingDataExportTopicDataExportNotification.md +1 -0
  64. data/docs/ScimEmail.md +1 -1
  65. data/docs/SurveyAggregationQuery.md +1 -1
  66. data/docs/SurveyForm.md +0 -2
  67. data/docs/TextbotsApi.md +78 -0
  68. data/docs/UploadUrlRequest.md +1 -0
  69. data/docs/UsageApi.md +144 -0
  70. data/docs/UsageExecutionResult.md +14 -0
  71. data/docs/UserAggregationQuery.md +1 -1
  72. data/docs/UserQueue.md +1 -0
  73. data/docs/UsersApi.md +5 -5
  74. data/docs/ViewFilter.md +2 -0
  75. data/docs/VoicemailMessagesTopicOwner.md +13 -0
  76. data/docs/VoicemailMessagesTopicVoicemailCopyRecord.md +14 -0
  77. data/docs/VoicemailMessagesTopicVoicemailMessage.md +2 -0
  78. data/docs/WfmBuShortTermForecastImportCompleteTopicBuForecastModification.md +23 -0
  79. data/docs/WfmBuShortTermForecastImportCompleteTopicBuShortTermForecast.md +24 -0
  80. data/docs/WfmBuShortTermForecastImportCompleteTopicBuShortTermForecastNotification.md +15 -0
  81. data/docs/WfmBuShortTermForecastImportCompleteTopicForecastSourceDayPointer.md +17 -0
  82. data/docs/WfmBuShortTermForecastImportCompleteTopicModificationIntervalOffsetValue.md +14 -0
  83. data/docs/WfmBuShortTermForecastImportCompleteTopicUserReference.md +13 -0
  84. data/docs/WfmBuShortTermForecastImportCompleteTopicWfmVersionedEntityMetadata.md +15 -0
  85. data/docs/WorkforceManagementApi.md +3 -3
  86. data/lib/purecloudplatformclientv2.rb +45 -0
  87. data/lib/purecloudplatformclientv2/api/architect_api.rb +130 -0
  88. data/lib/purecloudplatformclientv2/api/audit_api.rb +129 -0
  89. data/lib/purecloudplatformclientv2/api/groups_api.rb +4 -4
  90. data/lib/purecloudplatformclientv2/api/identity_provider_api.rb +175 -0
  91. data/lib/purecloudplatformclientv2/api/language_understanding_api.rb +189 -30
  92. data/lib/purecloudplatformclientv2/api/o_auth_api.rb +224 -0
  93. data/lib/purecloudplatformclientv2/api/organization_api.rb +120 -0
  94. data/lib/purecloudplatformclientv2/api/recording_api.rb +78 -0
  95. data/lib/purecloudplatformclientv2/api/textbots_api.rb +92 -0
  96. data/lib/purecloudplatformclientv2/api/usage_api.rb +157 -0
  97. data/lib/purecloudplatformclientv2/api/users_api.rb +4 -4
  98. data/lib/purecloudplatformclientv2/api/workforce_management_api.rb +6 -6
  99. data/lib/purecloudplatformclientv2/api_client.rb +1 -1
  100. data/lib/purecloudplatformclientv2/models/amazon_lex_request.rb +232 -0
  101. data/lib/purecloudplatformclientv2/models/analytics_evaluation.rb +13 -13
  102. data/lib/purecloudplatformclientv2/models/api_usage_query.rb +303 -0
  103. data/lib/purecloudplatformclientv2/models/api_usage_query_result.rb +244 -0
  104. data/lib/purecloudplatformclientv2/models/api_usage_row.rb +514 -0
  105. data/lib/purecloudplatformclientv2/models/audit_log_message.rb +6 -6
  106. data/lib/purecloudplatformclientv2/models/audit_query_entity.rb +244 -0
  107. data/lib/purecloudplatformclientv2/models/audit_query_execution_status_response.rb +34 -6
  108. data/lib/purecloudplatformclientv2/models/audit_query_request.rb +34 -6
  109. data/lib/purecloudplatformclientv2/models/audit_query_service.rb +244 -0
  110. data/lib/purecloudplatformclientv2/models/audit_query_service_mapping.rb +204 -0
  111. data/lib/purecloudplatformclientv2/models/audit_query_sort.rb +266 -0
  112. data/lib/purecloudplatformclientv2/models/audit_realtime_query_request.rb +360 -0
  113. data/lib/purecloudplatformclientv2/models/audit_realtime_query_results_response.rb +303 -0
  114. data/lib/purecloudplatformclientv2/models/bu_agent_schedule_activity.rb +70 -4
  115. data/lib/purecloudplatformclientv2/models/bu_reschedule_request.rb +2 -12
  116. data/lib/purecloudplatformclientv2/models/button_component.rb +281 -0
  117. data/lib/purecloudplatformclientv2/models/coaching_appointment_response.rb +2 -2
  118. data/lib/purecloudplatformclientv2/models/coaching_notification.rb +2 -2
  119. data/lib/purecloudplatformclientv2/models/content_actions.rb +309 -0
  120. data/lib/purecloudplatformclientv2/models/content_attachment.rb +378 -0
  121. data/lib/purecloudplatformclientv2/models/content_generic.rb +361 -0
  122. data/lib/purecloudplatformclientv2/models/content_list.rb +375 -0
  123. data/lib/purecloudplatformclientv2/models/content_location.rb +307 -0
  124. data/lib/purecloudplatformclientv2/models/content_notification_template.rb +312 -0
  125. data/lib/purecloudplatformclientv2/models/content_quick_reply.rb +300 -0
  126. data/lib/purecloudplatformclientv2/models/conversation_aggregate_query_predicate.rb +2 -2
  127. data/lib/purecloudplatformclientv2/models/conversation_aggregation_query.rb +1 -1
  128. data/lib/purecloudplatformclientv2/models/create_queue_request.rb +29 -1
  129. data/lib/purecloudplatformclientv2/models/edge_group.rb +27 -1
  130. data/lib/purecloudplatformclientv2/models/entity_listing.rb +4 -104
  131. data/lib/purecloudplatformclientv2/models/evaluation_aggregation_query.rb +1 -1
  132. data/lib/purecloudplatformclientv2/models/event_message.rb +2 -2
  133. data/lib/purecloudplatformclientv2/models/external_contact.rb +55 -1
  134. data/lib/purecloudplatformclientv2/models/external_organization.rb +55 -1
  135. data/lib/purecloudplatformclientv2/models/flow_aggregate_query_predicate.rb +2 -2
  136. data/lib/purecloudplatformclientv2/models/flow_aggregation_query.rb +1 -1
  137. data/lib/purecloudplatformclientv2/models/flow_execution_launch_request.rb +288 -0
  138. data/lib/purecloudplatformclientv2/models/flow_execution_launch_response.rb +281 -0
  139. data/lib/purecloudplatformclientv2/models/flow_runtime_execution.rb +494 -0
  140. data/lib/purecloudplatformclientv2/models/generic_saml.rb +428 -0
  141. data/lib/purecloudplatformclientv2/models/google_dialogflow_custom_settings.rb +202 -0
  142. data/lib/purecloudplatformclientv2/models/ip_address_authentication.rb +203 -0
  143. data/lib/purecloudplatformclientv2/models/knowledge_search_response.rb +18 -18
  144. data/lib/purecloudplatformclientv2/models/list_item_component.rb +373 -0
  145. data/lib/purecloudplatformclientv2/models/message_content.rb +378 -0
  146. data/lib/purecloudplatformclientv2/models/nlu_domain_version.rb +72 -1
  147. data/lib/purecloudplatformclientv2/models/notification_template_body.rb +236 -0
  148. data/lib/purecloudplatformclientv2/models/notification_template_footer.rb +203 -0
  149. data/lib/purecloudplatformclientv2/models/notification_template_header.rb +302 -0
  150. data/lib/purecloudplatformclientv2/models/notification_template_parameter.rb +234 -0
  151. data/lib/purecloudplatformclientv2/models/post_text_message.rb +275 -0
  152. data/lib/purecloudplatformclientv2/models/post_text_request.rb +482 -0
  153. data/lib/purecloudplatformclientv2/models/post_text_response.rb +413 -0
  154. data/lib/purecloudplatformclientv2/models/prompt.rb +2 -0
  155. data/lib/purecloudplatformclientv2/models/prompt_asset.rb +15 -1
  156. data/lib/purecloudplatformclientv2/models/prompt_asset_create.rb +15 -1
  157. data/lib/purecloudplatformclientv2/models/queue.rb +29 -1
  158. data/lib/purecloudplatformclientv2/models/queue_request.rb +29 -1
  159. data/lib/purecloudplatformclientv2/models/reporting_data_export_topic_data_export_notification.rb +31 -4
  160. data/lib/purecloudplatformclientv2/models/scim_email.rb +1 -1
  161. data/lib/purecloudplatformclientv2/models/survey_aggregation_query.rb +1 -1
  162. data/lib/purecloudplatformclientv2/models/survey_form.rb +1 -53
  163. data/lib/purecloudplatformclientv2/models/upload_url_request.rb +43 -4
  164. data/lib/purecloudplatformclientv2/models/usage_execution_result.rb +228 -0
  165. data/lib/purecloudplatformclientv2/models/user_aggregation_query.rb +1 -1
  166. data/lib/purecloudplatformclientv2/models/user_queue.rb +29 -1
  167. data/lib/purecloudplatformclientv2/models/view_filter.rb +58 -4
  168. data/lib/purecloudplatformclientv2/models/voicemail_messages_topic_owner.rb +201 -0
  169. data/lib/purecloudplatformclientv2/models/voicemail_messages_topic_voicemail_copy_record.rb +226 -0
  170. data/lib/purecloudplatformclientv2/models/voicemail_messages_topic_voicemail_message.rb +56 -4
  171. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_bu_forecast_modification.rb +497 -0
  172. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_bu_short_term_forecast.rb +494 -0
  173. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_bu_short_term_forecast_notification.rb +265 -0
  174. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_forecast_source_day_pointer.rb +315 -0
  175. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_modification_interval_offset_value.rb +226 -0
  176. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_user_reference.rb +201 -0
  177. data/lib/purecloudplatformclientv2/models/wfm_bu_short_term_forecast_import_complete_topic_wfm_versioned_entity_metadata.rb +251 -0
  178. data/lib/purecloudplatformclientv2/version.rb +1 -1
  179. metadata +92 -2
@@ -0,0 +1,236 @@
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: UNLICENSED
11
+ https://help.mypurecloud.com/articles/terms-and-conditions/
12
+
13
+ Terms of Service: https://help.mypurecloud.com/articles/terms-and-conditions/
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ # Template body object
21
+ class NotificationTemplateBody
22
+ # Body text. For WhatsApp, ignored
23
+ attr_accessor :text
24
+
25
+ # Template parameters for placeholders in template
26
+ attr_accessor :parameters
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+
32
+ :'text' => :'text',
33
+
34
+ :'parameters' => :'parameters'
35
+
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+
43
+ :'text' => :'String',
44
+
45
+ :'parameters' => :'Array<NotificationTemplateParameter>'
46
+
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
57
+
58
+
59
+ if attributes.has_key?(:'text')
60
+
61
+
62
+ self.text = attributes[:'text']
63
+
64
+
65
+ end
66
+
67
+
68
+ if attributes.has_key?(:'parameters')
69
+
70
+ if (value = attributes[:'parameters']).is_a?(Array)
71
+ self.parameters = value
72
+ end
73
+
74
+
75
+
76
+ end
77
+
78
+
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properies with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+
86
+
87
+ return invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+
94
+
95
+
96
+
97
+
98
+
99
+ if @parameters.nil?
100
+ return false
101
+ end
102
+
103
+
104
+
105
+
106
+
107
+ end
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ text == o.text &&
126
+ parameters == o.parameters
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Fixnum] Hash code
137
+ def hash
138
+ [text, parameters].hash
139
+ end
140
+
141
+ # build the object from hash
142
+ def build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ self.class.swagger_types.each_pair do |key, type|
145
+ if type =~ /^Array<(.*)>/i
146
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
147
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
148
+ else
149
+ #TODO show warning in debug mode
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ else
154
+ # data not found in attributes(hash), not an issue as the data can be optional
155
+ end
156
+ end
157
+
158
+ self
159
+ end
160
+
161
+ def _deserialize(type, value)
162
+ case type.to_sym
163
+ when :DateTime
164
+ DateTime.parse(value)
165
+ when :Date
166
+ Date.parse(value)
167
+ when :String
168
+ value.to_s
169
+ when :Integer
170
+ value.to_i
171
+ when :Float
172
+ value.to_f
173
+ when :BOOLEAN
174
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
175
+ true
176
+ else
177
+ false
178
+ end
179
+ when :Object
180
+ # generic object (usually a Hash), return directly
181
+ value
182
+ when /\AArray<(?<inner_type>.+)>\z/
183
+ inner_type = Regexp.last_match[:inner_type]
184
+ value.map { |v| _deserialize(inner_type, v) }
185
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
186
+ k_type = Regexp.last_match[:k_type]
187
+ v_type = Regexp.last_match[:v_type]
188
+ {}.tap do |hash|
189
+ value.each do |k, v|
190
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
191
+ end
192
+ end
193
+ else # model
194
+ _model = Object.const_get("PureCloud").const_get(type).new
195
+ _model.build_from_hash(value)
196
+ end
197
+ end
198
+
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_body (backward compatibility))
204
+ def to_body
205
+ to_hash
206
+ end
207
+
208
+ # return the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ next if value.nil?
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Method to output non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map{ |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+
235
+ end
236
+ end
@@ -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: UNLICENSED
11
+ https://help.mypurecloud.com/articles/terms-and-conditions/
12
+
13
+ Terms of Service: https://help.mypurecloud.com/articles/terms-and-conditions/
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ # Template footer object
21
+ class NotificationTemplateFooter
22
+ # Footer text. For WhatsApp, ignored
23
+ attr_accessor :text
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+
29
+ :'text' => :'text'
30
+
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+
38
+ :'text' => :'String'
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?(:'text')
53
+
54
+
55
+ self.text = attributes[:'text']
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
+ text == o.text
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
+ [text].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,302 @@
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: UNLICENSED
11
+ https://help.mypurecloud.com/articles/terms-and-conditions/
12
+
13
+ Terms of Service: https://help.mypurecloud.com/articles/terms-and-conditions/
14
+
15
+ =end
16
+
17
+ require 'date'
18
+
19
+ module PureCloud
20
+ # Template header object
21
+ class NotificationTemplateHeader
22
+ # Template header type
23
+ attr_accessor :type
24
+
25
+ # Header text. For WhatsApp, ignored
26
+ attr_accessor :text
27
+
28
+ # Attachment object
29
+ attr_accessor :media
30
+
31
+ # Template parameters for placeholders in template
32
+ attr_accessor :parameters
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+
38
+ :'type' => :'type',
39
+
40
+ :'text' => :'text',
41
+
42
+ :'media' => :'media',
43
+
44
+ :'parameters' => :'parameters'
45
+
46
+ }
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.swagger_types
51
+ {
52
+
53
+ :'type' => :'String',
54
+
55
+ :'text' => :'String',
56
+
57
+ :'media' => :'ContentAttachment',
58
+
59
+ :'parameters' => :'Array<NotificationTemplateParameter>'
60
+
61
+ }
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ return unless attributes.is_a?(Hash)
68
+
69
+ # convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
71
+
72
+
73
+ if attributes.has_key?(:'type')
74
+
75
+
76
+ self.type = attributes[:'type']
77
+
78
+
79
+ end
80
+
81
+
82
+ if attributes.has_key?(:'text')
83
+
84
+
85
+ self.text = attributes[:'text']
86
+
87
+
88
+ end
89
+
90
+
91
+ if attributes.has_key?(:'media')
92
+
93
+
94
+ self.media = attributes[:'media']
95
+
96
+
97
+ end
98
+
99
+
100
+ if attributes.has_key?(:'parameters')
101
+
102
+ if (value = attributes[:'parameters']).is_a?(Array)
103
+ self.parameters = value
104
+ end
105
+
106
+
107
+
108
+ end
109
+
110
+
111
+ end
112
+
113
+ # Show invalid properties with the reasons. Usually used together with valid?
114
+ # @return Array for valid properies with the reasons
115
+ def list_invalid_properties
116
+ invalid_properties = Array.new
117
+
118
+
119
+ return invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+
126
+
127
+ if @type.nil?
128
+ return false
129
+ end
130
+
131
+
132
+
133
+ allowed_values = ["Text", "Media"]
134
+ if @type && !allowed_values.include?(@type)
135
+ return false
136
+ end
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+ end
153
+
154
+
155
+
156
+ # Custom attribute writer method checking allowed values (enum).
157
+ # @param [Object] type Object to be assigned
158
+ def type=(type)
159
+ allowed_values = ["Text", "Media"]
160
+ if type && !allowed_values.include?(type)
161
+ fail ArgumentError, "invalid value for 'type', must be one of #{allowed_values}."
162
+ end
163
+ @type = type
164
+ end
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+ # Checks equality by comparing each attribute.
185
+ # @param [Object] Object to be compared
186
+ def ==(o)
187
+ return true if self.equal?(o)
188
+ self.class == o.class &&
189
+ type == o.type &&
190
+ text == o.text &&
191
+ media == o.media &&
192
+ parameters == o.parameters
193
+ end
194
+
195
+ # @see the `==` method
196
+ # @param [Object] Object to be compared
197
+ def eql?(o)
198
+ self == o
199
+ end
200
+
201
+ # Calculates hash code according to all attributes.
202
+ # @return [Fixnum] Hash code
203
+ def hash
204
+ [type, text, media, parameters].hash
205
+ end
206
+
207
+ # build the object from hash
208
+ def build_from_hash(attributes)
209
+ return nil unless attributes.is_a?(Hash)
210
+ self.class.swagger_types.each_pair do |key, type|
211
+ if type =~ /^Array<(.*)>/i
212
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
213
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
214
+ else
215
+ #TODO show warning in debug mode
216
+ end
217
+ elsif !attributes[self.class.attribute_map[key]].nil?
218
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
219
+ else
220
+ # data not found in attributes(hash), not an issue as the data can be optional
221
+ end
222
+ end
223
+
224
+ self
225
+ end
226
+
227
+ def _deserialize(type, value)
228
+ case type.to_sym
229
+ when :DateTime
230
+ DateTime.parse(value)
231
+ when :Date
232
+ Date.parse(value)
233
+ when :String
234
+ value.to_s
235
+ when :Integer
236
+ value.to_i
237
+ when :Float
238
+ value.to_f
239
+ when :BOOLEAN
240
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
241
+ true
242
+ else
243
+ false
244
+ end
245
+ when :Object
246
+ # generic object (usually a Hash), return directly
247
+ value
248
+ when /\AArray<(?<inner_type>.+)>\z/
249
+ inner_type = Regexp.last_match[:inner_type]
250
+ value.map { |v| _deserialize(inner_type, v) }
251
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
252
+ k_type = Regexp.last_match[:k_type]
253
+ v_type = Regexp.last_match[:v_type]
254
+ {}.tap do |hash|
255
+ value.each do |k, v|
256
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
257
+ end
258
+ end
259
+ else # model
260
+ _model = Object.const_get("PureCloud").const_get(type).new
261
+ _model.build_from_hash(value)
262
+ end
263
+ end
264
+
265
+ def to_s
266
+ to_hash.to_s
267
+ end
268
+
269
+ # to_body is an alias to to_body (backward compatibility))
270
+ def to_body
271
+ to_hash
272
+ end
273
+
274
+ # return the object in the form of hash
275
+ def to_hash
276
+ hash = {}
277
+ self.class.attribute_map.each_pair do |attr, param|
278
+ value = self.send(attr)
279
+ next if value.nil?
280
+ hash[param] = _to_hash(value)
281
+ end
282
+ hash
283
+ end
284
+
285
+ # Method to output non-array value in the form of hash
286
+ # For object, use to_hash. Otherwise, just return the value
287
+ def _to_hash(value)
288
+ if value.is_a?(Array)
289
+ value.compact.map{ |v| _to_hash(v) }
290
+ elsif value.is_a?(Hash)
291
+ {}.tap do |hash|
292
+ value.each { |k, v| hash[k] = _to_hash(v) }
293
+ end
294
+ elsif value.respond_to? :to_hash
295
+ value.to_hash
296
+ else
297
+ value
298
+ end
299
+ end
300
+
301
+ end
302
+ end