purecloudplatformclientv2 85.0.1 → 86.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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/docs/AnalyticsEvaluation.md +1 -1
- data/docs/Call.md +1 -0
- data/docs/CallBasic.md +1 -0
- data/docs/Callback.md +1 -0
- data/docs/CallbackBasic.md +1 -0
- data/docs/Cobrowsesession.md +1 -0
- data/docs/{PartialUploadResponse.md → ContextEntity.md} +3 -3
- data/docs/ContextIntent.md +13 -0
- data/docs/ConversationCallbackEventTopicCallbackMediaParticipant.md +1 -0
- data/docs/ConversationChat.md +1 -0
- data/docs/ConversationEventTopicCallback.md +1 -0
- data/docs/Coretype.md +23 -0
- data/docs/CoretypeListing.md +15 -0
- data/docs/DataExtensionsApi.md +198 -0
- data/docs/DataSchemaListing.md +15 -0
- data/docs/DetectedDialogAct.md +14 -0
- data/docs/DetectedIntent.md +15 -0
- data/docs/DetectedNamedEntity.md +16 -0
- data/docs/DetectedNamedEntityValue.md +14 -0
- data/docs/DialogflowAgent.md +3 -2
- data/docs/Edge.md +1 -1
- data/docs/Email.md +1 -0
- data/docs/EntityListing.md +1 -5
- data/docs/ExternalContactsApi.md +1001 -144
- data/docs/FlowDivisionView.md +2 -0
- data/docs/IntentDefinition.md +15 -0
- data/docs/IntentFeedback.md +16 -0
- data/docs/ItemValidationLimits.md +14 -0
- data/docs/Items.md +14 -0
- data/docs/LanguageUnderstandingApi.md +1160 -0
- data/docs/MaxLength.md +14 -0
- data/docs/Message.md +1 -0
- data/docs/MinLength.md +14 -0
- data/docs/NamedEntityAnnotation.md +13 -0
- data/docs/NamedEntityTypeBinding.md +14 -0
- data/docs/NamedEntityTypeDefinition.md +15 -0
- data/docs/NamedEntityTypeItem.md +14 -0
- data/docs/NamedEntityTypeMechanism.md +15 -0
- data/docs/NluConfusionMatrixColumn.md +14 -0
- data/docs/NluConfusionMatrixRow.md +14 -0
- data/docs/NluDetectionContext.md +14 -0
- data/docs/NluDetectionInput.md +13 -0
- data/docs/NluDetectionOutput.md +14 -0
- data/docs/NluDetectionRequest.md +14 -0
- data/docs/NluDetectionResponse.md +15 -0
- data/docs/NluDomain.md +19 -0
- data/docs/NluDomainListing.md +22 -0
- data/docs/NluDomainVersion.md +24 -0
- data/docs/NluDomainVersionListing.md +22 -0
- data/docs/NluDomainVersionQualityReport.md +15 -0
- data/docs/NluDomainVersionTrainingResponse.md +14 -0
- data/docs/NluFeedbackListing.md +22 -0
- data/docs/NluFeedbackRequest.md +15 -0
- data/docs/NluFeedbackResponse.md +18 -0
- data/docs/NluQualityReportSummary.md +13 -0
- data/docs/NluQualityReportSummaryMetric.md +14 -0
- data/docs/NluUtterance.md +13 -0
- data/docs/NluUtteranceSegment.md +14 -0
- data/docs/QueueConversationCallbackEventTopicCallbackMediaParticipant.md +1 -0
- data/docs/QueueConversationEventTopicCallback.md +1 -0
- data/docs/QueueConversationSocialExpressionEventTopicCallback.md +1 -0
- data/docs/QueueConversationVideoEventTopicCallback.md +1 -0
- data/docs/ReportingExportJobRequest.md +1 -0
- data/docs/ReportingExportJobResponse.md +2 -0
- data/docs/RoutingApi.md +65 -0
- data/docs/SCIMApi.md +12 -12
- data/docs/Schema.md +17 -0
- data/docs/SchemaQuantityLimits.md +26 -0
- data/docs/ScimV2EnterpriseUser.md +1 -0
- data/docs/Screenshare.md +1 -0
- data/docs/SocialExpression.md +1 -0
- data/docs/{TimeOffRequestLookup.md → TimeOffRequest.md} +2 -2
- data/docs/TimeOffRequestListing.md +13 -0
- data/docs/UploadUrlRequest.md +15 -0
- data/docs/UploadUrlResponse.md +14 -0
- data/docs/UploadsApi.md +78 -0
- data/docs/ValidationLimits.md +18 -0
- data/docs/Video.md +1 -0
- data/docs/WorkforceManagementApi.md +297 -448
- data/lib/purecloudplatformclientv2.rb +50 -57
- data/lib/purecloudplatformclientv2/api/data_extensions_api.rb +207 -0
- data/lib/purecloudplatformclientv2/api/external_contacts_api.rb +868 -4
- data/lib/purecloudplatformclientv2/api/language_understanding_api.rb +1304 -0
- data/lib/purecloudplatformclientv2/api/routing_api.rb +64 -0
- data/lib/purecloudplatformclientv2/api/scim_api.rb +8 -8
- data/lib/purecloudplatformclientv2/api/uploads_api.rb +92 -0
- data/lib/purecloudplatformclientv2/api/workforce_management_api.rb +314 -571
- data/lib/purecloudplatformclientv2/api_client.rb +1 -1
- data/lib/purecloudplatformclientv2/models/analytics_evaluation.rb +13 -13
- data/lib/purecloudplatformclientv2/models/bulk_update_shift_trade_state_result_item.rb +2 -2
- data/lib/purecloudplatformclientv2/models/call.rb +30 -4
- data/lib/purecloudplatformclientv2/models/call_basic.rb +30 -4
- data/lib/purecloudplatformclientv2/models/callback.rb +30 -4
- data/lib/purecloudplatformclientv2/models/callback_basic.rb +30 -4
- data/lib/purecloudplatformclientv2/models/cobrowsesession.rb +30 -4
- data/lib/purecloudplatformclientv2/models/{partial_upload_response.rb → context_entity.rb} +14 -9
- data/lib/purecloudplatformclientv2/models/{list_wrapper_wfm_forecast_modification.rb → context_intent.rb} +14 -10
- data/lib/purecloudplatformclientv2/models/conversation_callback_event_topic_callback_media_participant.rb +26 -1
- data/lib/purecloudplatformclientv2/models/conversation_chat.rb +30 -4
- data/lib/purecloudplatformclientv2/models/conversation_event_topic_callback.rb +26 -1
- data/lib/purecloudplatformclientv2/models/{rescheduling_options_response.rb → coretype.rb} +97 -102
- data/lib/purecloudplatformclientv2/models/{service_goal_group_list.rb → coretype_listing.rb} +34 -11
- data/lib/purecloudplatformclientv2/models/data_schema_listing.rb +253 -0
- data/lib/purecloudplatformclientv2/models/{forecast_result_response.rb → detected_dialog_act.rb} +16 -16
- data/lib/purecloudplatformclientv2/models/{intraday_queue.rb → detected_intent.rb} +23 -23
- data/lib/purecloudplatformclientv2/models/detected_named_entity.rb +280 -0
- data/lib/purecloudplatformclientv2/models/detected_named_entity_value.rb +228 -0
- data/lib/purecloudplatformclientv2/models/dialogflow_agent.rb +31 -3
- data/lib/purecloudplatformclientv2/models/edge.rb +1 -0
- data/lib/purecloudplatformclientv2/models/email.rb +30 -4
- data/lib/purecloudplatformclientv2/models/entity_listing.rb +4 -104
- data/lib/purecloudplatformclientv2/models/flow_division_view.rb +53 -1
- data/lib/purecloudplatformclientv2/models/{create_service_goal_group_request.rb → intent_definition.rb} +30 -19
- data/lib/purecloudplatformclientv2/models/{wfm_intraday_queue_listing.rb → intent_feedback.rb} +71 -18
- data/lib/purecloudplatformclientv2/models/{service_goal_group_goals.rb → item_validation_limits.rb} +18 -45
- data/lib/purecloudplatformclientv2/models/{short_term_forecast_list_response.rb → items.rb} +33 -10
- data/lib/purecloudplatformclientv2/models/max_length.rb +238 -0
- data/lib/purecloudplatformclientv2/models/message.rb +30 -4
- data/lib/purecloudplatformclientv2/models/{forecast_generation_route_group_result.rb → min_length.rb} +26 -18
- data/lib/purecloudplatformclientv2/models/{list_wrapper_forecast_source_day_pointer.rb → named_entity_annotation.rb} +14 -10
- data/lib/purecloudplatformclientv2/models/{copy_short_term_forecast_request.rb → named_entity_type_binding.rb} +18 -19
- data/lib/purecloudplatformclientv2/models/{generate_week_schedule_request.rb → named_entity_type_definition.rb} +38 -13
- data/lib/purecloudplatformclientv2/models/{wfm_abandon_rate.rb → named_entity_type_item.rb} +19 -18
- data/lib/purecloudplatformclientv2/models/{short_term_forecast_response.rb → named_entity_type_mechanism.rb} +48 -36
- data/lib/purecloudplatformclientv2/models/{copy_week_schedule_request.rb → nlu_confusion_matrix_column.rb} +18 -18
- data/lib/purecloudplatformclientv2/models/{wfm_average_speed_of_answer.rb → nlu_confusion_matrix_row.rb} +24 -18
- data/lib/purecloudplatformclientv2/models/nlu_detection_context.rb +228 -0
- data/lib/purecloudplatformclientv2/models/{scheduling_run_list_response.rb → nlu_detection_input.rb} +14 -10
- data/lib/purecloudplatformclientv2/models/nlu_detection_output.rb +232 -0
- data/lib/purecloudplatformclientv2/models/nlu_detection_request.rb +233 -0
- data/lib/purecloudplatformclientv2/models/{route_group_list.rb → nlu_detection_response.rb} +39 -22
- data/lib/purecloudplatformclientv2/models/{short_term_forecast_list_item_response.rb → nlu_domain.rb} +66 -60
- data/lib/purecloudplatformclientv2/models/{intraday_query_data_command.rb → nlu_domain_listing.rb} +156 -53
- data/lib/purecloudplatformclientv2/models/{short_term_forecast.rb → nlu_domain_version.rb} +132 -87
- data/lib/purecloudplatformclientv2/models/nlu_domain_version_listing.rb +428 -0
- data/lib/purecloudplatformclientv2/models/{intraday_metric.rb → nlu_domain_version_quality_report.rb} +57 -28
- data/lib/purecloudplatformclientv2/models/{user_schedules_partial_upload_request.rb → nlu_domain_version_training_response.rb} +33 -16
- data/lib/purecloudplatformclientv2/models/{import_week_schedule_request.rb → nlu_feedback_listing.rb} +158 -46
- data/lib/purecloudplatformclientv2/models/{wfm_service_level.rb → nlu_feedback_request.rb} +36 -25
- data/lib/purecloudplatformclientv2/models/{service_goal_group.rb → nlu_feedback_response.rb} +32 -37
- data/lib/purecloudplatformclientv2/models/{generate_short_term_forecast_request.rb → nlu_quality_report_summary.rb} +12 -10
- data/lib/purecloudplatformclientv2/models/nlu_quality_report_summary_metric.rb +238 -0
- data/lib/purecloudplatformclientv2/models/nlu_utterance.rb +209 -0
- data/lib/purecloudplatformclientv2/models/nlu_utterance_segment.rb +233 -0
- data/lib/purecloudplatformclientv2/models/queue_conversation_callback_event_topic_callback_media_participant.rb +26 -1
- data/lib/purecloudplatformclientv2/models/queue_conversation_event_topic_callback.rb +26 -1
- data/lib/purecloudplatformclientv2/models/queue_conversation_social_expression_event_topic_callback.rb +26 -1
- data/lib/purecloudplatformclientv2/models/queue_conversation_video_event_topic_callback.rb +26 -1
- data/lib/purecloudplatformclientv2/models/reporting_export_job_request.rb +32 -4
- data/lib/purecloudplatformclientv2/models/reporting_export_job_response.rb +57 -1
- data/lib/purecloudplatformclientv2/models/{import_short_term_forecast_request.rb → schema.rb} +50 -35
- data/lib/purecloudplatformclientv2/models/schema_quantity_limits.rb +539 -0
- data/lib/purecloudplatformclientv2/models/scim_v2_enterprise_user.rb +30 -4
- data/lib/purecloudplatformclientv2/models/screenshare.rb +30 -4
- data/lib/purecloudplatformclientv2/models/shift_trade_match_violation.rb +2 -2
- data/lib/purecloudplatformclientv2/models/social_expression.rb +30 -4
- data/lib/purecloudplatformclientv2/models/{time_off_request_lookup.rb → time_off_request.rb} +1 -1
- data/lib/purecloudplatformclientv2/models/{time_off_request_lookup_list.rb → time_off_request_listing.rb} +2 -2
- data/lib/purecloudplatformclientv2/models/{create_queue_media_association_request.rb → upload_url_request.rb} +23 -26
- data/lib/purecloudplatformclientv2/models/upload_url_response.rb +230 -0
- data/lib/purecloudplatformclientv2/models/{wfm_forecast_modification_attributes.rb → validation_limits.rb} +76 -38
- data/lib/purecloudplatformclientv2/models/video.rb +30 -4
- data/lib/purecloudplatformclientv2/version.rb +1 -1
- metadata +102 -116
- data/docs/AsyncWeekScheduleResponse.md +0 -16
- data/docs/CopyShortTermForecastRequest.md +0 -14
- data/docs/CopyWeekScheduleRequest.md +0 -14
- data/docs/CreateQueueMediaAssociationRequest.md +0 -15
- data/docs/CreateServiceGoalGroupRequest.md +0 -15
- data/docs/ForecastGenerationResult.md +0 -13
- data/docs/ForecastGenerationRouteGroupResult.md +0 -14
- data/docs/ForecastResultResponse.md +0 -14
- data/docs/ForecastTimeSeriesResult.md +0 -14
- data/docs/GenerateShortTermForecastRequest.md +0 -13
- data/docs/GenerateShortTermForecastResponse.md +0 -16
- data/docs/GenerateWeekScheduleRequest.md +0 -14
- data/docs/GenerateWeekScheduleResponse.md +0 -15
- data/docs/ImportShortTermForecastRequest.md +0 -16
- data/docs/ImportWeekScheduleRequest.md +0 -17
- data/docs/IntradayDataGroup.md +0 -19
- data/docs/IntradayForecastData.md +0 -15
- data/docs/IntradayHistoricalAgentData.md +0 -14
- data/docs/IntradayHistoricalQueueData.md +0 -20
- data/docs/IntradayMetric.md +0 -14
- data/docs/IntradayPerformancePredictionAgentData.md +0 -13
- data/docs/IntradayPerformancePredictionQueueData.md +0 -15
- data/docs/IntradayQueryDataCommand.md +0 -17
- data/docs/IntradayQueue.md +0 -15
- data/docs/IntradayResponse.md +0 -20
- data/docs/IntradayScheduleData.md +0 -14
- data/docs/ListWrapperForecastSourceDayPointer.md +0 -13
- data/docs/ListWrapperWfmForecastModification.md +0 -13
- data/docs/QueueMediaAssociation.md +0 -16
- data/docs/RescheduleRequest.md +0 -20
- data/docs/RescheduleResult.md +0 -13
- data/docs/ReschedulingOptionsResponse.md +0 -22
- data/docs/RouteGroup.md +0 -18
- data/docs/RouteGroupAttributes.md +0 -16
- data/docs/RouteGroupList.md +0 -14
- data/docs/SchedulingRunListResponse.md +0 -13
- data/docs/SchedulingRunResponse.md +0 -28
- data/docs/ServiceGoalGroup.md +0 -18
- data/docs/ServiceGoalGroupGoals.md +0 -15
- data/docs/ServiceGoalGroupList.md +0 -14
- data/docs/ShortTermForecast.md +0 -22
- data/docs/ShortTermForecastListItemResponse.md +0 -18
- data/docs/ShortTermForecastListResponse.md +0 -13
- data/docs/ShortTermForecastResponse.md +0 -15
- data/docs/TimeOffRequestEntityList.md +0 -13
- data/docs/TimeOffRequestLookupList.md +0 -13
- data/docs/UnscheduledAgentWarning.md +0 -14
- data/docs/UpdateWeekScheduleRequest.md +0 -21
- data/docs/UserSchedulesPartialUploadRequest.md +0 -13
- data/docs/WfmAbandonRate.md +0 -14
- data/docs/WfmAverageSpeedOfAnswer.md +0 -14
- data/docs/WfmForecastModification.md +0 -20
- data/docs/WfmForecastModificationAttributes.md +0 -16
- data/docs/WfmIntradayQueueListing.md +0 -14
- data/docs/WfmServiceLevel.md +0 -15
- data/lib/purecloudplatformclientv2/models/async_week_schedule_response.rb +0 -295
- data/lib/purecloudplatformclientv2/models/forecast_generation_result.rb +0 -204
- data/lib/purecloudplatformclientv2/models/forecast_time_series_result.rb +0 -256
- data/lib/purecloudplatformclientv2/models/generate_short_term_forecast_response.rb +0 -294
- data/lib/purecloudplatformclientv2/models/generate_week_schedule_response.rb +0 -269
- data/lib/purecloudplatformclientv2/models/intraday_data_group.rb +0 -384
- data/lib/purecloudplatformclientv2/models/intraday_forecast_data.rb +0 -254
- data/lib/purecloudplatformclientv2/models/intraday_historical_agent_data.rb +0 -228
- data/lib/purecloudplatformclientv2/models/intraday_historical_queue_data.rb +0 -384
- data/lib/purecloudplatformclientv2/models/intraday_performance_prediction_agent_data.rb +0 -202
- data/lib/purecloudplatformclientv2/models/intraday_performance_prediction_queue_data.rb +0 -254
- data/lib/purecloudplatformclientv2/models/intraday_response.rb +0 -404
- data/lib/purecloudplatformclientv2/models/intraday_schedule_data.rb +0 -228
- data/lib/purecloudplatformclientv2/models/queue_media_association.rb +0 -283
- data/lib/purecloudplatformclientv2/models/reschedule_request.rb +0 -418
- data/lib/purecloudplatformclientv2/models/reschedule_result.rb +0 -202
- data/lib/purecloudplatformclientv2/models/route_group.rb +0 -363
- data/lib/purecloudplatformclientv2/models/route_group_attributes.rb +0 -307
- data/lib/purecloudplatformclientv2/models/scheduling_run_response.rb +0 -609
- data/lib/purecloudplatformclientv2/models/time_off_request_entity_list.rb +0 -203
- data/lib/purecloudplatformclientv2/models/unscheduled_agent_warning.rb +0 -242
- data/lib/purecloudplatformclientv2/models/update_week_schedule_request.rb +0 -438
- data/lib/purecloudplatformclientv2/models/wfm_forecast_modification.rb +0 -435
@@ -1,203 +0,0 @@
|
|
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
|
-
class TimeOffRequestEntityList
|
21
|
-
attr_accessor :entities
|
22
|
-
|
23
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
-
def self.attribute_map
|
25
|
-
{
|
26
|
-
|
27
|
-
:'entities' => :'entities'
|
28
|
-
|
29
|
-
}
|
30
|
-
end
|
31
|
-
|
32
|
-
# Attribute type mapping.
|
33
|
-
def self.swagger_types
|
34
|
-
{
|
35
|
-
|
36
|
-
:'entities' => :'Array<TimeOffRequestResponse>'
|
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?(:'entities')
|
51
|
-
|
52
|
-
if (value = attributes[:'entities']).is_a?(Array)
|
53
|
-
self.entities = value
|
54
|
-
end
|
55
|
-
|
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
|
-
entities == o.entities
|
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
|
-
[entities].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
|
@@ -1,242 +0,0 @@
|
|
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
|
-
class UnscheduledAgentWarning
|
21
|
-
# The agent for which this warning applies
|
22
|
-
attr_accessor :agent
|
23
|
-
|
24
|
-
# The reason this agent was not scheduled
|
25
|
-
attr_accessor :unscheduled_reason
|
26
|
-
|
27
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
-
def self.attribute_map
|
29
|
-
{
|
30
|
-
|
31
|
-
:'agent' => :'agent',
|
32
|
-
|
33
|
-
:'unscheduled_reason' => :'unscheduledReason'
|
34
|
-
|
35
|
-
}
|
36
|
-
end
|
37
|
-
|
38
|
-
# Attribute type mapping.
|
39
|
-
def self.swagger_types
|
40
|
-
{
|
41
|
-
|
42
|
-
:'agent' => :'UserReference',
|
43
|
-
|
44
|
-
:'unscheduled_reason' => :'String'
|
45
|
-
|
46
|
-
}
|
47
|
-
end
|
48
|
-
|
49
|
-
# Initializes the object
|
50
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
-
def initialize(attributes = {})
|
52
|
-
return unless attributes.is_a?(Hash)
|
53
|
-
|
54
|
-
# convert string to symbol for hash key
|
55
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
56
|
-
|
57
|
-
|
58
|
-
if attributes.has_key?(:'agent')
|
59
|
-
|
60
|
-
|
61
|
-
self.agent = attributes[:'agent']
|
62
|
-
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
|
67
|
-
if attributes.has_key?(:'unscheduledReason')
|
68
|
-
|
69
|
-
|
70
|
-
self.unscheduled_reason = attributes[:'unscheduledReason']
|
71
|
-
|
72
|
-
|
73
|
-
end
|
74
|
-
|
75
|
-
|
76
|
-
end
|
77
|
-
|
78
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
79
|
-
# @return Array for valid properies with the reasons
|
80
|
-
def list_invalid_properties
|
81
|
-
invalid_properties = Array.new
|
82
|
-
|
83
|
-
|
84
|
-
return invalid_properties
|
85
|
-
end
|
86
|
-
|
87
|
-
# Check to see if the all the properties in the model are valid
|
88
|
-
# @return true if the model is valid
|
89
|
-
def valid?
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
allowed_values = ["NoWorkPlan", "WorkPlanNotFound", "UnableToProduceSchedule"]
|
98
|
-
if @unscheduled_reason && !allowed_values.include?(@unscheduled_reason)
|
99
|
-
return false
|
100
|
-
end
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
end
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
# Custom attribute writer method checking allowed values (enum).
|
114
|
-
# @param [Object] unscheduled_reason Object to be assigned
|
115
|
-
def unscheduled_reason=(unscheduled_reason)
|
116
|
-
allowed_values = ["NoWorkPlan", "WorkPlanNotFound", "UnableToProduceSchedule"]
|
117
|
-
if unscheduled_reason && !allowed_values.include?(unscheduled_reason)
|
118
|
-
fail ArgumentError, "invalid value for 'unscheduled_reason', must be one of #{allowed_values}."
|
119
|
-
end
|
120
|
-
@unscheduled_reason = unscheduled_reason
|
121
|
-
end
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
# Checks equality by comparing each attribute.
|
127
|
-
# @param [Object] Object to be compared
|
128
|
-
def ==(o)
|
129
|
-
return true if self.equal?(o)
|
130
|
-
self.class == o.class &&
|
131
|
-
agent == o.agent &&
|
132
|
-
unscheduled_reason == o.unscheduled_reason
|
133
|
-
end
|
134
|
-
|
135
|
-
# @see the `==` method
|
136
|
-
# @param [Object] Object to be compared
|
137
|
-
def eql?(o)
|
138
|
-
self == o
|
139
|
-
end
|
140
|
-
|
141
|
-
# Calculates hash code according to all attributes.
|
142
|
-
# @return [Fixnum] Hash code
|
143
|
-
def hash
|
144
|
-
[agent, unscheduled_reason].hash
|
145
|
-
end
|
146
|
-
|
147
|
-
# build the object from hash
|
148
|
-
def build_from_hash(attributes)
|
149
|
-
return nil unless attributes.is_a?(Hash)
|
150
|
-
self.class.swagger_types.each_pair do |key, type|
|
151
|
-
if type =~ /^Array<(.*)>/i
|
152
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
153
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
154
|
-
else
|
155
|
-
#TODO show warning in debug mode
|
156
|
-
end
|
157
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
158
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
159
|
-
else
|
160
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
self
|
165
|
-
end
|
166
|
-
|
167
|
-
def _deserialize(type, value)
|
168
|
-
case type.to_sym
|
169
|
-
when :DateTime
|
170
|
-
DateTime.parse(value)
|
171
|
-
when :Date
|
172
|
-
Date.parse(value)
|
173
|
-
when :String
|
174
|
-
value.to_s
|
175
|
-
when :Integer
|
176
|
-
value.to_i
|
177
|
-
when :Float
|
178
|
-
value.to_f
|
179
|
-
when :BOOLEAN
|
180
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
181
|
-
true
|
182
|
-
else
|
183
|
-
false
|
184
|
-
end
|
185
|
-
when :Object
|
186
|
-
# generic object (usually a Hash), return directly
|
187
|
-
value
|
188
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
189
|
-
inner_type = Regexp.last_match[:inner_type]
|
190
|
-
value.map { |v| _deserialize(inner_type, v) }
|
191
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
192
|
-
k_type = Regexp.last_match[:k_type]
|
193
|
-
v_type = Regexp.last_match[:v_type]
|
194
|
-
{}.tap do |hash|
|
195
|
-
value.each do |k, v|
|
196
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
197
|
-
end
|
198
|
-
end
|
199
|
-
else # model
|
200
|
-
_model = Object.const_get("PureCloud").const_get(type).new
|
201
|
-
_model.build_from_hash(value)
|
202
|
-
end
|
203
|
-
end
|
204
|
-
|
205
|
-
def to_s
|
206
|
-
to_hash.to_s
|
207
|
-
end
|
208
|
-
|
209
|
-
# to_body is an alias to to_body (backward compatibility))
|
210
|
-
def to_body
|
211
|
-
to_hash
|
212
|
-
end
|
213
|
-
|
214
|
-
# return the object in the form of hash
|
215
|
-
def to_hash
|
216
|
-
hash = {}
|
217
|
-
self.class.attribute_map.each_pair do |attr, param|
|
218
|
-
value = self.send(attr)
|
219
|
-
next if value.nil?
|
220
|
-
hash[param] = _to_hash(value)
|
221
|
-
end
|
222
|
-
hash
|
223
|
-
end
|
224
|
-
|
225
|
-
# Method to output non-array value in the form of hash
|
226
|
-
# For object, use to_hash. Otherwise, just return the value
|
227
|
-
def _to_hash(value)
|
228
|
-
if value.is_a?(Array)
|
229
|
-
value.compact.map{ |v| _to_hash(v) }
|
230
|
-
elsif value.is_a?(Hash)
|
231
|
-
{}.tap do |hash|
|
232
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
233
|
-
end
|
234
|
-
elsif value.respond_to? :to_hash
|
235
|
-
value.to_hash
|
236
|
-
else
|
237
|
-
value
|
238
|
-
end
|
239
|
-
end
|
240
|
-
|
241
|
-
end
|
242
|
-
end
|
@@ -1,438 +0,0 @@
|
|
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
|
-
class UpdateWeekScheduleRequest
|
21
|
-
# Description of the week schedule
|
22
|
-
attr_accessor :description
|
23
|
-
|
24
|
-
# Whether the week schedule is published
|
25
|
-
attr_accessor :published
|
26
|
-
|
27
|
-
# User schedules in the week
|
28
|
-
attr_accessor :user_schedules
|
29
|
-
|
30
|
-
# IDs of partial uploads to include in this imported schedule. It is applicable only for large schedules where activity count in schedule is greater than 17500
|
31
|
-
attr_accessor :partial_upload_ids
|
32
|
-
|
33
|
-
# Version metadata for this work plan
|
34
|
-
attr_accessor :metadata
|
35
|
-
|
36
|
-
# Version of agent schedules in the week schedule
|
37
|
-
attr_accessor :agent_schedules_version
|
38
|
-
|
39
|
-
# Reference to optionally point the schedule at a new short term forecast
|
40
|
-
attr_accessor :short_term_forecast
|
41
|
-
|
42
|
-
# The headcount forecast associated with the schedule. If not null, existing values will be irrecoverably replaced
|
43
|
-
attr_accessor :headcount_forecast
|
44
|
-
|
45
|
-
# For a published schedule, this determines whether a notification will be shown to agents in the default PureCloud user interface. The CPC notification will always be sent and the value specified here affects what data is returned in the 'updates' property. In the default PureCloud UI, \"None\" means that agents will not be notified, \"ShiftTimesOnly\" means agents will only be notified for changes to shift start and end times, and \"All\" means that agents will be notified for any change to a shift or activity (except for full day off activities). When building a custom client, use this property to specify the level of detail you need. Defaults to \"ShiftTimesOnly\".
|
46
|
-
attr_accessor :agent_update_filter
|
47
|
-
|
48
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
49
|
-
def self.attribute_map
|
50
|
-
{
|
51
|
-
|
52
|
-
:'description' => :'description',
|
53
|
-
|
54
|
-
:'published' => :'published',
|
55
|
-
|
56
|
-
:'user_schedules' => :'userSchedules',
|
57
|
-
|
58
|
-
:'partial_upload_ids' => :'partialUploadIds',
|
59
|
-
|
60
|
-
:'metadata' => :'metadata',
|
61
|
-
|
62
|
-
:'agent_schedules_version' => :'agentSchedulesVersion',
|
63
|
-
|
64
|
-
:'short_term_forecast' => :'shortTermForecast',
|
65
|
-
|
66
|
-
:'headcount_forecast' => :'headcountForecast',
|
67
|
-
|
68
|
-
:'agent_update_filter' => :'agentUpdateFilter'
|
69
|
-
|
70
|
-
}
|
71
|
-
end
|
72
|
-
|
73
|
-
# Attribute type mapping.
|
74
|
-
def self.swagger_types
|
75
|
-
{
|
76
|
-
|
77
|
-
:'description' => :'String',
|
78
|
-
|
79
|
-
:'published' => :'BOOLEAN',
|
80
|
-
|
81
|
-
:'user_schedules' => :'Hash<String, UserSchedule>',
|
82
|
-
|
83
|
-
:'partial_upload_ids' => :'Array<String>',
|
84
|
-
|
85
|
-
:'metadata' => :'WfmVersionedEntityMetadata',
|
86
|
-
|
87
|
-
:'agent_schedules_version' => :'Integer',
|
88
|
-
|
89
|
-
:'short_term_forecast' => :'ShortTermForecastReference',
|
90
|
-
|
91
|
-
:'headcount_forecast' => :'HeadcountForecast',
|
92
|
-
|
93
|
-
:'agent_update_filter' => :'String'
|
94
|
-
|
95
|
-
}
|
96
|
-
end
|
97
|
-
|
98
|
-
# Initializes the object
|
99
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
-
def initialize(attributes = {})
|
101
|
-
return unless attributes.is_a?(Hash)
|
102
|
-
|
103
|
-
# convert string to symbol for hash key
|
104
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
105
|
-
|
106
|
-
|
107
|
-
if attributes.has_key?(:'description')
|
108
|
-
|
109
|
-
|
110
|
-
self.description = attributes[:'description']
|
111
|
-
|
112
|
-
|
113
|
-
end
|
114
|
-
|
115
|
-
|
116
|
-
if attributes.has_key?(:'published')
|
117
|
-
|
118
|
-
|
119
|
-
self.published = attributes[:'published']
|
120
|
-
|
121
|
-
|
122
|
-
end
|
123
|
-
|
124
|
-
|
125
|
-
if attributes.has_key?(:'userSchedules')
|
126
|
-
|
127
|
-
if (value = attributes[:'userSchedules']).is_a?(Array)
|
128
|
-
self.user_schedules = value
|
129
|
-
end
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
end
|
134
|
-
|
135
|
-
|
136
|
-
if attributes.has_key?(:'partialUploadIds')
|
137
|
-
|
138
|
-
if (value = attributes[:'partialUploadIds']).is_a?(Array)
|
139
|
-
self.partial_upload_ids = value
|
140
|
-
end
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
end
|
145
|
-
|
146
|
-
|
147
|
-
if attributes.has_key?(:'metadata')
|
148
|
-
|
149
|
-
|
150
|
-
self.metadata = attributes[:'metadata']
|
151
|
-
|
152
|
-
|
153
|
-
end
|
154
|
-
|
155
|
-
|
156
|
-
if attributes.has_key?(:'agentSchedulesVersion')
|
157
|
-
|
158
|
-
|
159
|
-
self.agent_schedules_version = attributes[:'agentSchedulesVersion']
|
160
|
-
|
161
|
-
|
162
|
-
end
|
163
|
-
|
164
|
-
|
165
|
-
if attributes.has_key?(:'shortTermForecast')
|
166
|
-
|
167
|
-
|
168
|
-
self.short_term_forecast = attributes[:'shortTermForecast']
|
169
|
-
|
170
|
-
|
171
|
-
end
|
172
|
-
|
173
|
-
|
174
|
-
if attributes.has_key?(:'headcountForecast')
|
175
|
-
|
176
|
-
|
177
|
-
self.headcount_forecast = attributes[:'headcountForecast']
|
178
|
-
|
179
|
-
|
180
|
-
end
|
181
|
-
|
182
|
-
|
183
|
-
if attributes.has_key?(:'agentUpdateFilter')
|
184
|
-
|
185
|
-
|
186
|
-
self.agent_update_filter = attributes[:'agentUpdateFilter']
|
187
|
-
|
188
|
-
|
189
|
-
end
|
190
|
-
|
191
|
-
|
192
|
-
end
|
193
|
-
|
194
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
195
|
-
# @return Array for valid properies with the reasons
|
196
|
-
def list_invalid_properties
|
197
|
-
invalid_properties = Array.new
|
198
|
-
|
199
|
-
|
200
|
-
return invalid_properties
|
201
|
-
end
|
202
|
-
|
203
|
-
# Check to see if the all the properties in the model are valid
|
204
|
-
# @return true if the model is valid
|
205
|
-
def valid?
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
if @metadata.nil?
|
225
|
-
return false
|
226
|
-
end
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
if @agent_schedules_version.nil?
|
234
|
-
return false
|
235
|
-
end
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
allowed_values = ["All", "ShiftTimeChange", "None"]
|
252
|
-
if @agent_update_filter && !allowed_values.include?(@agent_update_filter)
|
253
|
-
return false
|
254
|
-
end
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
end
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
# Custom attribute writer method checking allowed values (enum).
|
303
|
-
# @param [Object] agent_update_filter Object to be assigned
|
304
|
-
def agent_update_filter=(agent_update_filter)
|
305
|
-
allowed_values = ["All", "ShiftTimeChange", "None"]
|
306
|
-
if agent_update_filter && !allowed_values.include?(agent_update_filter)
|
307
|
-
fail ArgumentError, "invalid value for 'agent_update_filter', must be one of #{allowed_values}."
|
308
|
-
end
|
309
|
-
@agent_update_filter = agent_update_filter
|
310
|
-
end
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
# Checks equality by comparing each attribute.
|
316
|
-
# @param [Object] Object to be compared
|
317
|
-
def ==(o)
|
318
|
-
return true if self.equal?(o)
|
319
|
-
self.class == o.class &&
|
320
|
-
description == o.description &&
|
321
|
-
published == o.published &&
|
322
|
-
user_schedules == o.user_schedules &&
|
323
|
-
partial_upload_ids == o.partial_upload_ids &&
|
324
|
-
metadata == o.metadata &&
|
325
|
-
agent_schedules_version == o.agent_schedules_version &&
|
326
|
-
short_term_forecast == o.short_term_forecast &&
|
327
|
-
headcount_forecast == o.headcount_forecast &&
|
328
|
-
agent_update_filter == o.agent_update_filter
|
329
|
-
end
|
330
|
-
|
331
|
-
# @see the `==` method
|
332
|
-
# @param [Object] Object to be compared
|
333
|
-
def eql?(o)
|
334
|
-
self == o
|
335
|
-
end
|
336
|
-
|
337
|
-
# Calculates hash code according to all attributes.
|
338
|
-
# @return [Fixnum] Hash code
|
339
|
-
def hash
|
340
|
-
[description, published, user_schedules, partial_upload_ids, metadata, agent_schedules_version, short_term_forecast, headcount_forecast, agent_update_filter].hash
|
341
|
-
end
|
342
|
-
|
343
|
-
# build the object from hash
|
344
|
-
def build_from_hash(attributes)
|
345
|
-
return nil unless attributes.is_a?(Hash)
|
346
|
-
self.class.swagger_types.each_pair do |key, type|
|
347
|
-
if type =~ /^Array<(.*)>/i
|
348
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
349
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
350
|
-
else
|
351
|
-
#TODO show warning in debug mode
|
352
|
-
end
|
353
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
354
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
355
|
-
else
|
356
|
-
# data not found in attributes(hash), not an issue as the data can be optional
|
357
|
-
end
|
358
|
-
end
|
359
|
-
|
360
|
-
self
|
361
|
-
end
|
362
|
-
|
363
|
-
def _deserialize(type, value)
|
364
|
-
case type.to_sym
|
365
|
-
when :DateTime
|
366
|
-
DateTime.parse(value)
|
367
|
-
when :Date
|
368
|
-
Date.parse(value)
|
369
|
-
when :String
|
370
|
-
value.to_s
|
371
|
-
when :Integer
|
372
|
-
value.to_i
|
373
|
-
when :Float
|
374
|
-
value.to_f
|
375
|
-
when :BOOLEAN
|
376
|
-
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
377
|
-
true
|
378
|
-
else
|
379
|
-
false
|
380
|
-
end
|
381
|
-
when :Object
|
382
|
-
# generic object (usually a Hash), return directly
|
383
|
-
value
|
384
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
385
|
-
inner_type = Regexp.last_match[:inner_type]
|
386
|
-
value.map { |v| _deserialize(inner_type, v) }
|
387
|
-
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
388
|
-
k_type = Regexp.last_match[:k_type]
|
389
|
-
v_type = Regexp.last_match[:v_type]
|
390
|
-
{}.tap do |hash|
|
391
|
-
value.each do |k, v|
|
392
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
393
|
-
end
|
394
|
-
end
|
395
|
-
else # model
|
396
|
-
_model = Object.const_get("PureCloud").const_get(type).new
|
397
|
-
_model.build_from_hash(value)
|
398
|
-
end
|
399
|
-
end
|
400
|
-
|
401
|
-
def to_s
|
402
|
-
to_hash.to_s
|
403
|
-
end
|
404
|
-
|
405
|
-
# to_body is an alias to to_body (backward compatibility))
|
406
|
-
def to_body
|
407
|
-
to_hash
|
408
|
-
end
|
409
|
-
|
410
|
-
# return the object in the form of hash
|
411
|
-
def to_hash
|
412
|
-
hash = {}
|
413
|
-
self.class.attribute_map.each_pair do |attr, param|
|
414
|
-
value = self.send(attr)
|
415
|
-
next if value.nil?
|
416
|
-
hash[param] = _to_hash(value)
|
417
|
-
end
|
418
|
-
hash
|
419
|
-
end
|
420
|
-
|
421
|
-
# Method to output non-array value in the form of hash
|
422
|
-
# For object, use to_hash. Otherwise, just return the value
|
423
|
-
def _to_hash(value)
|
424
|
-
if value.is_a?(Array)
|
425
|
-
value.compact.map{ |v| _to_hash(v) }
|
426
|
-
elsif value.is_a?(Hash)
|
427
|
-
{}.tap do |hash|
|
428
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
429
|
-
end
|
430
|
-
elsif value.respond_to? :to_hash
|
431
|
-
value.to_hash
|
432
|
-
else
|
433
|
-
value
|
434
|
-
end
|
435
|
-
end
|
436
|
-
|
437
|
-
end
|
438
|
-
end
|