ultracart_api 3.10.183 → 3.10.185

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +88 -4
  3. data/docs/ConversationApi.md +2466 -340
  4. data/docs/ConversationPbxAgent.md +16 -0
  5. data/docs/ConversationPbxAgentResponse.md +12 -0
  6. data/docs/ConversationPbxAgentsResponse.md +12 -0
  7. data/docs/ConversationPbxAudio.md +16 -0
  8. data/docs/ConversationPbxAudioResponse.md +12 -0
  9. data/docs/ConversationPbxAudiosResponse.md +12 -0
  10. data/docs/ConversationPbxCustomerSnapshotRequest.md +15 -0
  11. data/docs/ConversationPbxCustomerSnapshotResponse.md +14 -0
  12. data/docs/ConversationPbxMenu.md +17 -0
  13. data/docs/ConversationPbxMenuMapping.md +11 -0
  14. data/docs/ConversationPbxMenuResponse.md +12 -0
  15. data/docs/ConversationPbxMenusResponse.md +12 -0
  16. data/docs/ConversationPbxPhoneNumber.md +12 -0
  17. data/docs/ConversationPbxPhoneNumberResponse.md +12 -0
  18. data/docs/ConversationPbxPhoneNumbersResponse.md +12 -0
  19. data/docs/ConversationPbxQueue.md +25 -0
  20. data/docs/ConversationPbxQueueMembers.md +9 -0
  21. data/docs/ConversationPbxQueueResponse.md +12 -0
  22. data/docs/ConversationPbxQueuesResponse.md +12 -0
  23. data/docs/ConversationPbxTimeBased.md +11 -0
  24. data/docs/ConversationPbxTimeBasedMapping.md +11 -0
  25. data/docs/ConversationPbxTimeBasedMappingConfig.md +9 -0
  26. data/docs/ConversationPbxTimeBasedResponse.md +12 -0
  27. data/docs/ConversationPbxTimeBasedsResponse.md +12 -0
  28. data/docs/ConversationPbxTimeRange.md +12 -0
  29. data/docs/ConversationPbxTimeRangeConfig.md +13 -0
  30. data/docs/ConversationPbxTimeRangeResponse.md +12 -0
  31. data/docs/ConversationPbxTimeRangesResponse.md +12 -0
  32. data/docs/ConversationPbxVoicemailMailbox.md +18 -0
  33. data/docs/ConversationPbxVoicemailMailboxResponse.md +12 -0
  34. data/docs/ConversationPbxVoicemailMailboxesResponse.md +12 -0
  35. data/docs/EmailSmsOrder.md +11 -0
  36. data/docs/EmailSmsOrdersResponse.md +12 -0
  37. data/docs/EmailSmsStat.md +37 -0
  38. data/docs/EmailStatSmsSummaryRequest.md +9 -0
  39. data/docs/EmailStatSmsSummaryResponse.md +12 -0
  40. data/docs/PricingTier.md +1 -0
  41. data/docs/StorefrontApi.md +114 -0
  42. data/docs/WorkflowApi.md +46 -0
  43. data/docs/WorkflowTaskTagsResponse.md +12 -0
  44. data/lib/ultracart_api/api/conversation_api.rb +2919 -609
  45. data/lib/ultracart_api/api/storefront_api.rb +133 -0
  46. data/lib/ultracart_api/api/workflow_api.rb +49 -0
  47. data/lib/ultracart_api/models/conversation_pbx_agent.rb +325 -0
  48. data/lib/ultracart_api/models/conversation_pbx_agent_response.rb +221 -0
  49. data/lib/ultracart_api/models/conversation_pbx_agents_response.rb +223 -0
  50. data/lib/ultracart_api/models/conversation_pbx_audio.rb +355 -0
  51. data/lib/ultracart_api/models/conversation_pbx_audio_response.rb +221 -0
  52. data/lib/ultracart_api/models/conversation_pbx_audios_response.rb +223 -0
  53. data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_request.rb +248 -0
  54. data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_response.rb +243 -0
  55. data/lib/ultracart_api/models/conversation_pbx_menu.rb +367 -0
  56. data/lib/ultracart_api/models/conversation_pbx_menu_mapping.rb +215 -0
  57. data/lib/ultracart_api/models/conversation_pbx_menu_response.rb +221 -0
  58. data/lib/ultracart_api/models/conversation_pbx_menus_response.rb +223 -0
  59. data/lib/ultracart_api/models/conversation_pbx_phone_number.rb +300 -0
  60. data/lib/ultracart_api/models/conversation_pbx_phone_number_response.rb +221 -0
  61. data/lib/ultracart_api/models/conversation_pbx_phone_numbers_response.rb +223 -0
  62. data/lib/ultracart_api/models/conversation_pbx_queue.rb +504 -0
  63. data/lib/ultracart_api/models/conversation_pbx_queue_members.rb +197 -0
  64. data/lib/ultracart_api/models/conversation_pbx_queue_response.rb +221 -0
  65. data/lib/ultracart_api/models/conversation_pbx_queues_response.rb +223 -0
  66. data/lib/ultracart_api/models/conversation_pbx_time_based.rb +211 -0
  67. data/lib/ultracart_api/models/conversation_pbx_time_based_mapping.rb +275 -0
  68. data/lib/ultracart_api/models/conversation_pbx_time_based_mapping_config.rb +196 -0
  69. data/lib/ultracart_api/models/conversation_pbx_time_based_response.rb +221 -0
  70. data/lib/ultracart_api/models/conversation_pbx_time_baseds_response.rb +223 -0
  71. data/lib/ultracart_api/models/conversation_pbx_time_range.rb +287 -0
  72. data/lib/ultracart_api/models/conversation_pbx_time_range_config.rb +235 -0
  73. data/lib/ultracart_api/models/conversation_pbx_time_range_response.rb +221 -0
  74. data/lib/ultracart_api/models/conversation_pbx_time_ranges_response.rb +223 -0
  75. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox.rb +405 -0
  76. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox_response.rb +221 -0
  77. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailboxes_response.rb +223 -0
  78. data/lib/ultracart_api/models/email_sms_order.rb +214 -0
  79. data/lib/ultracart_api/models/email_sms_orders_response.rb +223 -0
  80. data/lib/ultracart_api/models/email_sms_stat.rb +476 -0
  81. data/lib/ultracart_api/models/email_stat_sms_summary_request.rb +195 -0
  82. data/lib/ultracart_api/models/email_stat_sms_summary_response.rb +223 -0
  83. data/lib/ultracart_api/models/pricing_tier.rb +11 -1
  84. data/lib/ultracart_api/models/workflow_task_tags_response.rb +224 -0
  85. data/lib/ultracart_api/version.rb +1 -1
  86. data/lib/ultracart_api.rb +37 -0
  87. metadata +76 -2
@@ -2516,6 +2516,71 @@ module UltracartClient
2516
2516
  end
2517
2517
  return data, status_code, headers
2518
2518
  end
2519
+ # Get email communication sequence sms stats
2520
+ # @param storefront_oid
2521
+ # @param commseq_uuid
2522
+ # @param stats_request StatsRequest
2523
+ # @param [Hash] opts the optional parameters
2524
+ # @return [EmailStatSmsSummaryResponse]
2525
+ def get_email_commseq_sms_stats(storefront_oid, commseq_uuid, stats_request, opts = {})
2526
+ data, _status_code, _headers = get_email_commseq_sms_stats_with_http_info(storefront_oid, commseq_uuid, stats_request, opts)
2527
+ data
2528
+ end
2529
+
2530
+ # Get email communication sequence sms stats
2531
+ # @param storefront_oid
2532
+ # @param commseq_uuid
2533
+ # @param stats_request StatsRequest
2534
+ # @param [Hash] opts the optional parameters
2535
+ # @return [Array<(EmailStatSmsSummaryResponse, Fixnum, Hash)>] EmailStatSmsSummaryResponse data, response status code and response headers
2536
+ def get_email_commseq_sms_stats_with_http_info(storefront_oid, commseq_uuid, stats_request, opts = {})
2537
+ if @api_client.config.debugging
2538
+ @api_client.config.logger.debug 'Calling API: StorefrontApi.get_email_commseq_sms_stats ...'
2539
+ end
2540
+ # verify the required parameter 'storefront_oid' is set
2541
+ if @api_client.config.client_side_validation && storefront_oid.nil?
2542
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling StorefrontApi.get_email_commseq_sms_stats"
2543
+ end
2544
+ # verify the required parameter 'commseq_uuid' is set
2545
+ if @api_client.config.client_side_validation && commseq_uuid.nil?
2546
+ fail ArgumentError, "Missing the required parameter 'commseq_uuid' when calling StorefrontApi.get_email_commseq_sms_stats"
2547
+ end
2548
+ # verify the required parameter 'stats_request' is set
2549
+ if @api_client.config.client_side_validation && stats_request.nil?
2550
+ fail ArgumentError, "Missing the required parameter 'stats_request' when calling StorefrontApi.get_email_commseq_sms_stats"
2551
+ end
2552
+ # resource path
2553
+ local_var_path = '/storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/smsStats'.sub('{' + 'storefront_oid' + '}', storefront_oid.to_s).sub('{' + 'commseq_uuid' + '}', commseq_uuid.to_s)
2554
+
2555
+ # query parameters
2556
+ query_params = {}
2557
+
2558
+ # header parameters
2559
+ header_params = {}
2560
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
2561
+ # HTTP header 'Accept' (if needed)
2562
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2563
+ # HTTP header 'Content-Type'
2564
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
2565
+
2566
+ # form parameters
2567
+ form_params = {}
2568
+
2569
+ # http body (model)
2570
+ post_body = @api_client.object_to_http_body(stats_request)
2571
+ auth_names = ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']
2572
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
2573
+ :header_params => header_params,
2574
+ :query_params => query_params,
2575
+ :form_params => form_params,
2576
+ :body => post_body,
2577
+ :auth_names => auth_names,
2578
+ :return_type => 'EmailStatSmsSummaryResponse')
2579
+ if @api_client.config.debugging
2580
+ @api_client.config.logger.debug "API called: StorefrontApi#get_email_commseq_sms_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2581
+ end
2582
+ return data, status_code, headers
2583
+ end
2519
2584
  # Get communication sequence stats overall
2520
2585
  # @param storefront_oid
2521
2586
  # @param commseq_uuid
@@ -4908,6 +4973,74 @@ module UltracartClient
4908
4973
  end
4909
4974
  return data, status_code, headers
4910
4975
  end
4976
+ # Get email sms orders
4977
+ # @param storefront_oid
4978
+ # @param commseq_uuid
4979
+ # @param commseq_step_uuid
4980
+ # @param [Hash] opts the optional parameters
4981
+ # @option opts [Integer] :days
4982
+ # @return [EmailSmsOrdersResponse]
4983
+ def get_email_sms_orders(storefront_oid, commseq_uuid, commseq_step_uuid, opts = {})
4984
+ data, _status_code, _headers = get_email_sms_orders_with_http_info(storefront_oid, commseq_uuid, commseq_step_uuid, opts)
4985
+ data
4986
+ end
4987
+
4988
+ # Get email sms orders
4989
+ # @param storefront_oid
4990
+ # @param commseq_uuid
4991
+ # @param commseq_step_uuid
4992
+ # @param [Hash] opts the optional parameters
4993
+ # @option opts [Integer] :days
4994
+ # @return [Array<(EmailSmsOrdersResponse, Fixnum, Hash)>] EmailSmsOrdersResponse data, response status code and response headers
4995
+ def get_email_sms_orders_with_http_info(storefront_oid, commseq_uuid, commseq_step_uuid, opts = {})
4996
+ if @api_client.config.debugging
4997
+ @api_client.config.logger.debug 'Calling API: StorefrontApi.get_email_sms_orders ...'
4998
+ end
4999
+ # verify the required parameter 'storefront_oid' is set
5000
+ if @api_client.config.client_side_validation && storefront_oid.nil?
5001
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling StorefrontApi.get_email_sms_orders"
5002
+ end
5003
+ # verify the required parameter 'commseq_uuid' is set
5004
+ if @api_client.config.client_side_validation && commseq_uuid.nil?
5005
+ fail ArgumentError, "Missing the required parameter 'commseq_uuid' when calling StorefrontApi.get_email_sms_orders"
5006
+ end
5007
+ # verify the required parameter 'commseq_step_uuid' is set
5008
+ if @api_client.config.client_side_validation && commseq_step_uuid.nil?
5009
+ fail ArgumentError, "Missing the required parameter 'commseq_step_uuid' when calling StorefrontApi.get_email_sms_orders"
5010
+ end
5011
+ # resource path
5012
+ local_var_path = '/storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/steps/{commseq_step_uuid}/sms/orders'.sub('{' + 'storefront_oid' + '}', storefront_oid.to_s).sub('{' + 'commseq_uuid' + '}', commseq_uuid.to_s).sub('{' + 'commseq_step_uuid' + '}', commseq_step_uuid.to_s)
5013
+
5014
+ # query parameters
5015
+ query_params = {}
5016
+ query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
5017
+
5018
+ # header parameters
5019
+ header_params = {}
5020
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
5021
+ # HTTP header 'Accept' (if needed)
5022
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
5023
+ # HTTP header 'Content-Type'
5024
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5025
+
5026
+ # form parameters
5027
+ form_params = {}
5028
+
5029
+ # http body (model)
5030
+ post_body = nil
5031
+ auth_names = ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']
5032
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
5033
+ :header_params => header_params,
5034
+ :query_params => query_params,
5035
+ :form_params => form_params,
5036
+ :body => post_body,
5037
+ :auth_names => auth_names,
5038
+ :return_type => 'EmailSmsOrdersResponse')
5039
+ if @api_client.config.debugging
5040
+ @api_client.config.logger.debug "API called: StorefrontApi#get_email_sms_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5041
+ end
5042
+ return data, status_code, headers
5043
+ end
4911
5044
  # Get email template
4912
5045
  # @param storefront_oid
4913
5046
  # @param email_template_oid
@@ -362,6 +362,55 @@ module UltracartClient
362
362
  end
363
363
  return data, status_code, headers
364
364
  end
365
+ # Get a list of existing workflow task tags
366
+ # Retrieves a unique list of all the existing workflow task tags.
367
+ # @param [Hash] opts the optional parameters
368
+ # @return [WorkflowTaskTagsResponse]
369
+ def get_workflow_task_tags(opts = {})
370
+ data, _status_code, _headers = get_workflow_task_tags_with_http_info(opts)
371
+ data
372
+ end
373
+
374
+ # Get a list of existing workflow task tags
375
+ # Retrieves a unique list of all the existing workflow task tags.
376
+ # @param [Hash] opts the optional parameters
377
+ # @return [Array<(WorkflowTaskTagsResponse, Fixnum, Hash)>] WorkflowTaskTagsResponse data, response status code and response headers
378
+ def get_workflow_task_tags_with_http_info(opts = {})
379
+ if @api_client.config.debugging
380
+ @api_client.config.logger.debug 'Calling API: WorkflowApi.get_workflow_task_tags ...'
381
+ end
382
+ # resource path
383
+ local_var_path = '/workflow/tasks/tags'
384
+
385
+ # query parameters
386
+ query_params = {}
387
+
388
+ # header parameters
389
+ header_params = {}
390
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
391
+ # HTTP header 'Accept' (if needed)
392
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
393
+ # HTTP header 'Content-Type'
394
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
395
+
396
+ # form parameters
397
+ form_params = {}
398
+
399
+ # http body (model)
400
+ post_body = nil
401
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
402
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
403
+ :header_params => header_params,
404
+ :query_params => query_params,
405
+ :form_params => form_params,
406
+ :body => post_body,
407
+ :auth_names => auth_names,
408
+ :return_type => 'WorkflowTaskTagsResponse')
409
+ if @api_client.config.debugging
410
+ @api_client.config.logger.debug "API called: WorkflowApi#get_workflow_task_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
411
+ end
412
+ return data, status_code, headers
413
+ end
365
414
  # Search workflow tasks
366
415
  # Retrieves a set of workflow tasks from the account based on a query object.
367
416
  # @param workflow_tasks_query Workflow tasks query
@@ -0,0 +1,325 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ConversationPbxAgent
17
+ # Cellphone number of agent in E.164 format
18
+ attr_accessor :cellphone
19
+
20
+ # Conversation Pbx Agent unique identifier
21
+ attr_accessor :conversation_pbx_agent_uuid
22
+
23
+ # Conversation Pbx Voicemail Mailbox UUID
24
+ attr_accessor :conversation_pbx_voicemail_mailbox_uuid
25
+
26
+ # True if calls to this agent should be forwarded to their cellphone
27
+ attr_accessor :forward_calls_to_cellphone
28
+
29
+ # Merchant Id
30
+ attr_accessor :merchant_id
31
+
32
+ # True if outgoing calls should be automatically recorded
33
+ attr_accessor :record_outgoing_automatically
34
+
35
+ # Twilio taskrouter worker Id
36
+ attr_accessor :twilio_taskrouter_worker_id
37
+
38
+ # User Id
39
+ attr_accessor :user_id
40
+
41
+ # True if this agent has voicemail configured
42
+ attr_accessor :voicemail
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'cellphone' => :'cellphone',
48
+ :'conversation_pbx_agent_uuid' => :'conversation_pbx_agent_uuid',
49
+ :'conversation_pbx_voicemail_mailbox_uuid' => :'conversation_pbx_voicemail_mailbox_uuid',
50
+ :'forward_calls_to_cellphone' => :'forward_calls_to_cellphone',
51
+ :'merchant_id' => :'merchant_id',
52
+ :'record_outgoing_automatically' => :'record_outgoing_automatically',
53
+ :'twilio_taskrouter_worker_id' => :'twilio_taskrouter_worker_id',
54
+ :'user_id' => :'user_id',
55
+ :'voicemail' => :'voicemail'
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.swagger_types
61
+ {
62
+ :'cellphone' => :'String',
63
+ :'conversation_pbx_agent_uuid' => :'String',
64
+ :'conversation_pbx_voicemail_mailbox_uuid' => :'String',
65
+ :'forward_calls_to_cellphone' => :'BOOLEAN',
66
+ :'merchant_id' => :'String',
67
+ :'record_outgoing_automatically' => :'BOOLEAN',
68
+ :'twilio_taskrouter_worker_id' => :'String',
69
+ :'user_id' => :'Integer',
70
+ :'voicemail' => :'BOOLEAN'
71
+ }
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ return unless attributes.is_a?(Hash)
78
+
79
+ # convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
81
+
82
+ if attributes.has_key?(:'cellphone')
83
+ self.cellphone = attributes[:'cellphone']
84
+ end
85
+
86
+ if attributes.has_key?(:'conversation_pbx_agent_uuid')
87
+ self.conversation_pbx_agent_uuid = attributes[:'conversation_pbx_agent_uuid']
88
+ end
89
+
90
+ if attributes.has_key?(:'conversation_pbx_voicemail_mailbox_uuid')
91
+ self.conversation_pbx_voicemail_mailbox_uuid = attributes[:'conversation_pbx_voicemail_mailbox_uuid']
92
+ end
93
+
94
+ if attributes.has_key?(:'forward_calls_to_cellphone')
95
+ self.forward_calls_to_cellphone = attributes[:'forward_calls_to_cellphone']
96
+ end
97
+
98
+ if attributes.has_key?(:'merchant_id')
99
+ self.merchant_id = attributes[:'merchant_id']
100
+ end
101
+
102
+ if attributes.has_key?(:'record_outgoing_automatically')
103
+ self.record_outgoing_automatically = attributes[:'record_outgoing_automatically']
104
+ end
105
+
106
+ if attributes.has_key?(:'twilio_taskrouter_worker_id')
107
+ self.twilio_taskrouter_worker_id = attributes[:'twilio_taskrouter_worker_id']
108
+ end
109
+
110
+ if attributes.has_key?(:'user_id')
111
+ self.user_id = attributes[:'user_id']
112
+ end
113
+
114
+ if attributes.has_key?(:'voicemail')
115
+ self.voicemail = attributes[:'voicemail']
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ invalid_properties = Array.new
123
+ if !@cellphone.nil? && @cellphone.to_s.length > 50
124
+ invalid_properties.push('invalid value for "cellphone", the character length must be smaller than or equal to 50.')
125
+ end
126
+
127
+ if !@conversation_pbx_voicemail_mailbox_uuid.nil? && @conversation_pbx_voicemail_mailbox_uuid.to_s.length > 50
128
+ invalid_properties.push('invalid value for "conversation_pbx_voicemail_mailbox_uuid", the character length must be smaller than or equal to 50.')
129
+ end
130
+
131
+ if !@merchant_id.nil? && @merchant_id.to_s.length > 5
132
+ invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 5.')
133
+ end
134
+
135
+ if !@twilio_taskrouter_worker_id.nil? && @twilio_taskrouter_worker_id.to_s.length > 100
136
+ invalid_properties.push('invalid value for "twilio_taskrouter_worker_id", the character length must be smaller than or equal to 100.')
137
+ end
138
+
139
+ invalid_properties
140
+ end
141
+
142
+ # Check to see if the all the properties in the model are valid
143
+ # @return true if the model is valid
144
+ def valid?
145
+ return false if !@cellphone.nil? && @cellphone.to_s.length > 50
146
+ return false if !@conversation_pbx_voicemail_mailbox_uuid.nil? && @conversation_pbx_voicemail_mailbox_uuid.to_s.length > 50
147
+ return false if !@merchant_id.nil? && @merchant_id.to_s.length > 5
148
+ return false if !@twilio_taskrouter_worker_id.nil? && @twilio_taskrouter_worker_id.to_s.length > 100
149
+ true
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] cellphone Value to be assigned
154
+ def cellphone=(cellphone)
155
+ if !cellphone.nil? && cellphone.to_s.length > 50
156
+ fail ArgumentError, 'invalid value for "cellphone", the character length must be smaller than or equal to 50.'
157
+ end
158
+
159
+ @cellphone = cellphone
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] conversation_pbx_voicemail_mailbox_uuid Value to be assigned
164
+ def conversation_pbx_voicemail_mailbox_uuid=(conversation_pbx_voicemail_mailbox_uuid)
165
+ if !conversation_pbx_voicemail_mailbox_uuid.nil? && conversation_pbx_voicemail_mailbox_uuid.to_s.length > 50
166
+ fail ArgumentError, 'invalid value for "conversation_pbx_voicemail_mailbox_uuid", the character length must be smaller than or equal to 50.'
167
+ end
168
+
169
+ @conversation_pbx_voicemail_mailbox_uuid = conversation_pbx_voicemail_mailbox_uuid
170
+ end
171
+
172
+ # Custom attribute writer method with validation
173
+ # @param [Object] merchant_id Value to be assigned
174
+ def merchant_id=(merchant_id)
175
+ if !merchant_id.nil? && merchant_id.to_s.length > 5
176
+ fail ArgumentError, 'invalid value for "merchant_id", the character length must be smaller than or equal to 5.'
177
+ end
178
+
179
+ @merchant_id = merchant_id
180
+ end
181
+
182
+ # Custom attribute writer method with validation
183
+ # @param [Object] twilio_taskrouter_worker_id Value to be assigned
184
+ def twilio_taskrouter_worker_id=(twilio_taskrouter_worker_id)
185
+ if !twilio_taskrouter_worker_id.nil? && twilio_taskrouter_worker_id.to_s.length > 100
186
+ fail ArgumentError, 'invalid value for "twilio_taskrouter_worker_id", the character length must be smaller than or equal to 100.'
187
+ end
188
+
189
+ @twilio_taskrouter_worker_id = twilio_taskrouter_worker_id
190
+ end
191
+
192
+ # Checks equality by comparing each attribute.
193
+ # @param [Object] Object to be compared
194
+ def ==(o)
195
+ return true if self.equal?(o)
196
+ self.class == o.class &&
197
+ cellphone == o.cellphone &&
198
+ conversation_pbx_agent_uuid == o.conversation_pbx_agent_uuid &&
199
+ conversation_pbx_voicemail_mailbox_uuid == o.conversation_pbx_voicemail_mailbox_uuid &&
200
+ forward_calls_to_cellphone == o.forward_calls_to_cellphone &&
201
+ merchant_id == o.merchant_id &&
202
+ record_outgoing_automatically == o.record_outgoing_automatically &&
203
+ twilio_taskrouter_worker_id == o.twilio_taskrouter_worker_id &&
204
+ user_id == o.user_id &&
205
+ voicemail == o.voicemail
206
+ end
207
+
208
+ # @see the `==` method
209
+ # @param [Object] Object to be compared
210
+ def eql?(o)
211
+ self == o
212
+ end
213
+
214
+ # Calculates hash code according to all attributes.
215
+ # @return [Fixnum] Hash code
216
+ def hash
217
+ [cellphone, conversation_pbx_agent_uuid, conversation_pbx_voicemail_mailbox_uuid, forward_calls_to_cellphone, merchant_id, record_outgoing_automatically, twilio_taskrouter_worker_id, user_id, voicemail].hash
218
+ end
219
+
220
+ # Builds the object from hash
221
+ # @param [Hash] attributes Model attributes in the form of hash
222
+ # @return [Object] Returns the model itself
223
+ def build_from_hash(attributes)
224
+ return nil unless attributes.is_a?(Hash)
225
+ self.class.swagger_types.each_pair do |key, type|
226
+ if type =~ /\AArray<(.*)>/i
227
+ # check to ensure the input is an array given that the attribute
228
+ # is documented as an array but the input is not
229
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
230
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
231
+ end
232
+ elsif !attributes[self.class.attribute_map[key]].nil?
233
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
234
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
235
+ end
236
+
237
+ self
238
+ end
239
+
240
+ # Deserializes the data based on type
241
+ # @param string type Data type
242
+ # @param string value Value to be deserialized
243
+ # @return [Object] Deserialized data
244
+ def _deserialize(type, value)
245
+ case type.to_sym
246
+ when :DateTime
247
+ DateTime.parse(value)
248
+ when :Date
249
+ Date.parse(value)
250
+ when :String
251
+ value.to_s
252
+ when :Integer
253
+ value.to_i
254
+ when :Float
255
+ value.to_f
256
+ when :BOOLEAN
257
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
258
+ true
259
+ else
260
+ false
261
+ end
262
+ when :Object
263
+ # generic object (usually a Hash), return directly
264
+ value
265
+ when /\AArray<(?<inner_type>.+)>\z/
266
+ inner_type = Regexp.last_match[:inner_type]
267
+ value.map { |v| _deserialize(inner_type, v) }
268
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
269
+ k_type = Regexp.last_match[:k_type]
270
+ v_type = Regexp.last_match[:v_type]
271
+ {}.tap do |hash|
272
+ value.each do |k, v|
273
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
274
+ end
275
+ end
276
+ else # model
277
+ temp_model = UltracartClient.const_get(type).new
278
+ temp_model.build_from_hash(value)
279
+ end
280
+ end
281
+
282
+ # Returns the string representation of the object
283
+ # @return [String] String presentation of the object
284
+ def to_s
285
+ to_hash.to_s
286
+ end
287
+
288
+ # to_body is an alias to to_hash (backward compatibility)
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_body
291
+ to_hash
292
+ end
293
+
294
+ # Returns the object in the form of hash
295
+ # @return [Hash] Returns the object in the form of hash
296
+ def to_hash
297
+ hash = {}
298
+ self.class.attribute_map.each_pair do |attr, param|
299
+ value = self.send(attr)
300
+ next if value.nil?
301
+ hash[param] = _to_hash(value)
302
+ end
303
+ hash
304
+ end
305
+
306
+ # Outputs non-array value in the form of hash
307
+ # For object, use to_hash. Otherwise, just return the value
308
+ # @param [Object] value Any valid value
309
+ # @return [Hash] Returns the value in the form of hash
310
+ def _to_hash(value)
311
+ if value.is_a?(Array)
312
+ value.compact.map { |v| _to_hash(v) }
313
+ elsif value.is_a?(Hash)
314
+ {}.tap do |hash|
315
+ value.each { |k, v| hash[k] = _to_hash(v) }
316
+ end
317
+ elsif value.respond_to? :to_hash
318
+ value.to_hash
319
+ else
320
+ value
321
+ end
322
+ end
323
+
324
+ end
325
+ end