ultracart_api 4.0.200 → 4.0.202

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +88 -4
  3. data/docs/ConversationApi.md +3565 -549
  4. data/docs/ConversationPbxAgent.md +34 -0
  5. data/docs/ConversationPbxAgentResponse.md +26 -0
  6. data/docs/ConversationPbxAgentsResponse.md +26 -0
  7. data/docs/ConversationPbxAudio.md +34 -0
  8. data/docs/ConversationPbxAudioResponse.md +26 -0
  9. data/docs/ConversationPbxAudiosResponse.md +26 -0
  10. data/docs/ConversationPbxCustomerSnapshotRequest.md +32 -0
  11. data/docs/ConversationPbxCustomerSnapshotResponse.md +30 -0
  12. data/docs/ConversationPbxMenu.md +36 -0
  13. data/docs/ConversationPbxMenuMapping.md +24 -0
  14. data/docs/ConversationPbxMenuResponse.md +26 -0
  15. data/docs/ConversationPbxMenusResponse.md +26 -0
  16. data/docs/ConversationPbxPhoneNumber.md +26 -0
  17. data/docs/ConversationPbxPhoneNumberResponse.md +26 -0
  18. data/docs/ConversationPbxPhoneNumbersResponse.md +26 -0
  19. data/docs/ConversationPbxQueue.md +52 -0
  20. data/docs/ConversationPbxQueueMembers.md +20 -0
  21. data/docs/ConversationPbxQueueResponse.md +26 -0
  22. data/docs/ConversationPbxQueuesResponse.md +26 -0
  23. data/docs/ConversationPbxTimeBased.md +24 -0
  24. data/docs/ConversationPbxTimeBasedMapping.md +24 -0
  25. data/docs/ConversationPbxTimeBasedMappingConfig.md +20 -0
  26. data/docs/ConversationPbxTimeBasedResponse.md +26 -0
  27. data/docs/ConversationPbxTimeBasedsResponse.md +26 -0
  28. data/docs/ConversationPbxTimeRange.md +26 -0
  29. data/docs/ConversationPbxTimeRangeConfig.md +28 -0
  30. data/docs/ConversationPbxTimeRangeResponse.md +26 -0
  31. data/docs/ConversationPbxTimeRangesResponse.md +26 -0
  32. data/docs/ConversationPbxVoicemailMailbox.md +38 -0
  33. data/docs/ConversationPbxVoicemailMailboxResponse.md +26 -0
  34. data/docs/ConversationPbxVoicemailMailboxesResponse.md +26 -0
  35. data/docs/EmailSmsOrder.md +24 -0
  36. data/docs/EmailSmsOrdersResponse.md +26 -0
  37. data/docs/EmailSmsStat.md +76 -0
  38. data/docs/EmailStatSmsSummaryRequest.md +20 -0
  39. data/docs/EmailStatSmsSummaryResponse.md +26 -0
  40. data/docs/PricingTier.md +2 -0
  41. data/docs/StorefrontApi.md +152 -0
  42. data/docs/WorkflowApi.md +69 -0
  43. data/docs/WorkflowTaskTagsResponse.md +26 -0
  44. data/lib/ultracart_api/api/conversation_api.rb +3422 -649
  45. data/lib/ultracart_api/api/storefront_api.rb +156 -0
  46. data/lib/ultracart_api/api/workflow_api.rb +58 -0
  47. data/lib/ultracart_api/models/conversation_pbx_agent.rb +360 -0
  48. data/lib/ultracart_api/models/conversation_pbx_agent_response.rb +256 -0
  49. data/lib/ultracart_api/models/conversation_pbx_agents_response.rb +258 -0
  50. data/lib/ultracart_api/models/conversation_pbx_audio.rb +390 -0
  51. data/lib/ultracart_api/models/conversation_pbx_audio_response.rb +256 -0
  52. data/lib/ultracart_api/models/conversation_pbx_audios_response.rb +258 -0
  53. data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_request.rb +283 -0
  54. data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_response.rb +278 -0
  55. data/lib/ultracart_api/models/conversation_pbx_menu.rb +402 -0
  56. data/lib/ultracart_api/models/conversation_pbx_menu_mapping.rb +250 -0
  57. data/lib/ultracart_api/models/conversation_pbx_menu_response.rb +256 -0
  58. data/lib/ultracart_api/models/conversation_pbx_menus_response.rb +258 -0
  59. data/lib/ultracart_api/models/conversation_pbx_phone_number.rb +335 -0
  60. data/lib/ultracart_api/models/conversation_pbx_phone_number_response.rb +256 -0
  61. data/lib/ultracart_api/models/conversation_pbx_phone_numbers_response.rb +258 -0
  62. data/lib/ultracart_api/models/conversation_pbx_queue.rb +539 -0
  63. data/lib/ultracart_api/models/conversation_pbx_queue_members.rb +232 -0
  64. data/lib/ultracart_api/models/conversation_pbx_queue_response.rb +256 -0
  65. data/lib/ultracart_api/models/conversation_pbx_queues_response.rb +258 -0
  66. data/lib/ultracart_api/models/conversation_pbx_time_based.rb +246 -0
  67. data/lib/ultracart_api/models/conversation_pbx_time_based_mapping.rb +310 -0
  68. data/lib/ultracart_api/models/conversation_pbx_time_based_mapping_config.rb +231 -0
  69. data/lib/ultracart_api/models/conversation_pbx_time_based_response.rb +256 -0
  70. data/lib/ultracart_api/models/conversation_pbx_time_baseds_response.rb +258 -0
  71. data/lib/ultracart_api/models/conversation_pbx_time_range.rb +322 -0
  72. data/lib/ultracart_api/models/conversation_pbx_time_range_config.rb +270 -0
  73. data/lib/ultracart_api/models/conversation_pbx_time_range_response.rb +256 -0
  74. data/lib/ultracart_api/models/conversation_pbx_time_ranges_response.rb +258 -0
  75. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox.rb +440 -0
  76. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox_response.rb +256 -0
  77. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailboxes_response.rb +258 -0
  78. data/lib/ultracart_api/models/email_sms_order.rb +249 -0
  79. data/lib/ultracart_api/models/email_sms_orders_response.rb +258 -0
  80. data/lib/ultracart_api/models/email_sms_stat.rb +511 -0
  81. data/lib/ultracart_api/models/email_stat_sms_summary_request.rb +230 -0
  82. data/lib/ultracart_api/models/email_stat_sms_summary_response.rb +258 -0
  83. data/lib/ultracart_api/models/pricing_tier.rb +11 -1
  84. data/lib/ultracart_api/models/workflow_task_tags_response.rb +259 -0
  85. data/lib/ultracart_api/version.rb +1 -1
  86. data/lib/ultracart_api.rb +37 -0
  87. metadata +76 -2
@@ -2955,6 +2955,85 @@ module UltracartClient
2955
2955
  return data, status_code, headers
2956
2956
  end
2957
2957
 
2958
+ # Get email communication sequence sms stats
2959
+ # @param storefront_oid [Integer]
2960
+ # @param commseq_uuid [String]
2961
+ # @param stats_request [EmailStatSmsSummaryRequest] StatsRequest
2962
+ # @param [Hash] opts the optional parameters
2963
+ # @return [EmailStatSmsSummaryResponse]
2964
+ def get_email_commseq_sms_stats(storefront_oid, commseq_uuid, stats_request, opts = {})
2965
+ data, _status_code, _headers = get_email_commseq_sms_stats_with_http_info(storefront_oid, commseq_uuid, stats_request, opts)
2966
+ data
2967
+ end
2968
+
2969
+ # Get email communication sequence sms stats
2970
+ # @param storefront_oid [Integer]
2971
+ # @param commseq_uuid [String]
2972
+ # @param stats_request [EmailStatSmsSummaryRequest] StatsRequest
2973
+ # @param [Hash] opts the optional parameters
2974
+ # @return [Array<(EmailStatSmsSummaryResponse, Integer, Hash)>] EmailStatSmsSummaryResponse data, response status code and response headers
2975
+ def get_email_commseq_sms_stats_with_http_info(storefront_oid, commseq_uuid, stats_request, opts = {})
2976
+ if @api_client.config.debugging
2977
+ @api_client.config.logger.debug 'Calling API: StorefrontApi.get_email_commseq_sms_stats ...'
2978
+ end
2979
+ # verify the required parameter 'storefront_oid' is set
2980
+ if @api_client.config.client_side_validation && storefront_oid.nil?
2981
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling StorefrontApi.get_email_commseq_sms_stats"
2982
+ end
2983
+ # verify the required parameter 'commseq_uuid' is set
2984
+ if @api_client.config.client_side_validation && commseq_uuid.nil?
2985
+ fail ArgumentError, "Missing the required parameter 'commseq_uuid' when calling StorefrontApi.get_email_commseq_sms_stats"
2986
+ end
2987
+ # verify the required parameter 'stats_request' is set
2988
+ if @api_client.config.client_side_validation && stats_request.nil?
2989
+ fail ArgumentError, "Missing the required parameter 'stats_request' when calling StorefrontApi.get_email_commseq_sms_stats"
2990
+ end
2991
+ # resource path
2992
+ local_var_path = '/storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/smsStats'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'commseq_uuid' + '}', CGI.escape(commseq_uuid.to_s))
2993
+
2994
+ # query parameters
2995
+ query_params = opts[:query_params] || {}
2996
+
2997
+ # header parameters
2998
+ header_params = opts[:header_params] || {}
2999
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
3000
+ # HTTP header 'Accept' (if needed)
3001
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
3002
+ # HTTP header 'Content-Type'
3003
+ content_type = @api_client.select_header_content_type(['application/json'])
3004
+ if !content_type.nil?
3005
+ header_params['Content-Type'] = content_type
3006
+ end
3007
+
3008
+ # form parameters
3009
+ form_params = opts[:form_params] || {}
3010
+
3011
+ # http body (model)
3012
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(stats_request)
3013
+
3014
+ # return_type
3015
+ return_type = opts[:debug_return_type] || 'EmailStatSmsSummaryResponse'
3016
+
3017
+ # auth_names
3018
+ auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']
3019
+
3020
+ new_options = opts.merge(
3021
+ :operation => :"StorefrontApi.get_email_commseq_sms_stats",
3022
+ :header_params => header_params,
3023
+ :query_params => query_params,
3024
+ :form_params => form_params,
3025
+ :body => post_body,
3026
+ :auth_names => auth_names,
3027
+ :return_type => return_type
3028
+ )
3029
+
3030
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
3031
+ if @api_client.config.debugging
3032
+ @api_client.config.logger.debug "API called: StorefrontApi#get_email_commseq_sms_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3033
+ end
3034
+ return data, status_code, headers
3035
+ end
3036
+
2958
3037
  # Get communication sequence stats overall
2959
3038
  # @param storefront_oid [Integer]
2960
3039
  # @param commseq_uuid [String]
@@ -5736,6 +5815,83 @@ module UltracartClient
5736
5815
  return data, status_code, headers
5737
5816
  end
5738
5817
 
5818
+ # Get email sms orders
5819
+ # @param storefront_oid [Integer]
5820
+ # @param commseq_uuid [String]
5821
+ # @param commseq_step_uuid [String]
5822
+ # @param [Hash] opts the optional parameters
5823
+ # @option opts [Integer] :days
5824
+ # @return [EmailSmsOrdersResponse]
5825
+ def get_email_sms_orders(storefront_oid, commseq_uuid, commseq_step_uuid, opts = {})
5826
+ data, _status_code, _headers = get_email_sms_orders_with_http_info(storefront_oid, commseq_uuid, commseq_step_uuid, opts)
5827
+ data
5828
+ end
5829
+
5830
+ # Get email sms orders
5831
+ # @param storefront_oid [Integer]
5832
+ # @param commseq_uuid [String]
5833
+ # @param commseq_step_uuid [String]
5834
+ # @param [Hash] opts the optional parameters
5835
+ # @option opts [Integer] :days
5836
+ # @return [Array<(EmailSmsOrdersResponse, Integer, Hash)>] EmailSmsOrdersResponse data, response status code and response headers
5837
+ def get_email_sms_orders_with_http_info(storefront_oid, commseq_uuid, commseq_step_uuid, opts = {})
5838
+ if @api_client.config.debugging
5839
+ @api_client.config.logger.debug 'Calling API: StorefrontApi.get_email_sms_orders ...'
5840
+ end
5841
+ # verify the required parameter 'storefront_oid' is set
5842
+ if @api_client.config.client_side_validation && storefront_oid.nil?
5843
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling StorefrontApi.get_email_sms_orders"
5844
+ end
5845
+ # verify the required parameter 'commseq_uuid' is set
5846
+ if @api_client.config.client_side_validation && commseq_uuid.nil?
5847
+ fail ArgumentError, "Missing the required parameter 'commseq_uuid' when calling StorefrontApi.get_email_sms_orders"
5848
+ end
5849
+ # verify the required parameter 'commseq_step_uuid' is set
5850
+ if @api_client.config.client_side_validation && commseq_step_uuid.nil?
5851
+ fail ArgumentError, "Missing the required parameter 'commseq_step_uuid' when calling StorefrontApi.get_email_sms_orders"
5852
+ end
5853
+ # resource path
5854
+ local_var_path = '/storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/steps/{commseq_step_uuid}/sms/orders'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'commseq_uuid' + '}', CGI.escape(commseq_uuid.to_s)).sub('{' + 'commseq_step_uuid' + '}', CGI.escape(commseq_step_uuid.to_s))
5855
+
5856
+ # query parameters
5857
+ query_params = opts[:query_params] || {}
5858
+ query_params[:'days'] = opts[:'days'] if !opts[:'days'].nil?
5859
+
5860
+ # header parameters
5861
+ header_params = opts[:header_params] || {}
5862
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
5863
+ # HTTP header 'Accept' (if needed)
5864
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
5865
+
5866
+ # form parameters
5867
+ form_params = opts[:form_params] || {}
5868
+
5869
+ # http body (model)
5870
+ post_body = opts[:debug_body]
5871
+
5872
+ # return_type
5873
+ return_type = opts[:debug_return_type] || 'EmailSmsOrdersResponse'
5874
+
5875
+ # auth_names
5876
+ auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']
5877
+
5878
+ new_options = opts.merge(
5879
+ :operation => :"StorefrontApi.get_email_sms_orders",
5880
+ :header_params => header_params,
5881
+ :query_params => query_params,
5882
+ :form_params => form_params,
5883
+ :body => post_body,
5884
+ :auth_names => auth_names,
5885
+ :return_type => return_type
5886
+ )
5887
+
5888
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
5889
+ if @api_client.config.debugging
5890
+ @api_client.config.logger.debug "API called: StorefrontApi#get_email_sms_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5891
+ end
5892
+ return data, status_code, headers
5893
+ end
5894
+
5739
5895
  # Get email template
5740
5896
  # @param storefront_oid [Integer]
5741
5897
  # @param email_template_oid [Integer]
@@ -416,6 +416,64 @@ module UltracartClient
416
416
  return data, status_code, headers
417
417
  end
418
418
 
419
+ # Get a list of existing workflow task tags
420
+ # Retrieves a unique list of all the existing workflow task tags.
421
+ # @param [Hash] opts the optional parameters
422
+ # @return [WorkflowTaskTagsResponse]
423
+ def get_workflow_task_tags(opts = {})
424
+ data, _status_code, _headers = get_workflow_task_tags_with_http_info(opts)
425
+ data
426
+ end
427
+
428
+ # Get a list of existing workflow task tags
429
+ # Retrieves a unique list of all the existing workflow task tags.
430
+ # @param [Hash] opts the optional parameters
431
+ # @return [Array<(WorkflowTaskTagsResponse, Integer, Hash)>] WorkflowTaskTagsResponse data, response status code and response headers
432
+ def get_workflow_task_tags_with_http_info(opts = {})
433
+ if @api_client.config.debugging
434
+ @api_client.config.logger.debug 'Calling API: WorkflowApi.get_workflow_task_tags ...'
435
+ end
436
+ # resource path
437
+ local_var_path = '/workflow/tasks/tags'
438
+
439
+ # query parameters
440
+ query_params = opts[:query_params] || {}
441
+
442
+ # header parameters
443
+ header_params = opts[:header_params] || {}
444
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
445
+ # HTTP header 'Accept' (if needed)
446
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
447
+
448
+ # form parameters
449
+ form_params = opts[:form_params] || {}
450
+
451
+ # http body (model)
452
+ post_body = opts[:debug_body]
453
+
454
+ # return_type
455
+ return_type = opts[:debug_return_type] || 'WorkflowTaskTagsResponse'
456
+
457
+ # auth_names
458
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
459
+
460
+ new_options = opts.merge(
461
+ :operation => :"WorkflowApi.get_workflow_task_tags",
462
+ :header_params => header_params,
463
+ :query_params => query_params,
464
+ :form_params => form_params,
465
+ :body => post_body,
466
+ :auth_names => auth_names,
467
+ :return_type => return_type
468
+ )
469
+
470
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
471
+ if @api_client.config.debugging
472
+ @api_client.config.logger.debug "API called: WorkflowApi#get_workflow_task_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
473
+ end
474
+ return data, status_code, headers
475
+ end
476
+
419
477
  # Search workflow tasks
420
478
  # Retrieves a set of workflow tasks from the account based on a query object.
421
479
  # @param workflow_tasks_query [WorkflowTasksRequest] Workflow tasks query
@@ -0,0 +1,360 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ConversationPbxAgent
18
+ # Cellphone number of agent in E.164 format
19
+ attr_accessor :cellphone
20
+
21
+ # Conversation Pbx Agent unique identifier
22
+ attr_accessor :conversation_pbx_agent_uuid
23
+
24
+ # Conversation Pbx Voicemail Mailbox UUID
25
+ attr_accessor :conversation_pbx_voicemail_mailbox_uuid
26
+
27
+ # True if calls to this agent should be forwarded to their cellphone
28
+ attr_accessor :forward_calls_to_cellphone
29
+
30
+ # Merchant Id
31
+ attr_accessor :merchant_id
32
+
33
+ # True if outgoing calls should be automatically recorded
34
+ attr_accessor :record_outgoing_automatically
35
+
36
+ # Twilio taskrouter worker Id
37
+ attr_accessor :twilio_taskrouter_worker_id
38
+
39
+ # User Id
40
+ attr_accessor :user_id
41
+
42
+ # True if this agent has voicemail configured
43
+ attr_accessor :voicemail
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'cellphone' => :'cellphone',
49
+ :'conversation_pbx_agent_uuid' => :'conversation_pbx_agent_uuid',
50
+ :'conversation_pbx_voicemail_mailbox_uuid' => :'conversation_pbx_voicemail_mailbox_uuid',
51
+ :'forward_calls_to_cellphone' => :'forward_calls_to_cellphone',
52
+ :'merchant_id' => :'merchant_id',
53
+ :'record_outgoing_automatically' => :'record_outgoing_automatically',
54
+ :'twilio_taskrouter_worker_id' => :'twilio_taskrouter_worker_id',
55
+ :'user_id' => :'user_id',
56
+ :'voicemail' => :'voicemail'
57
+ }
58
+ end
59
+
60
+ # Returns all the JSON keys this model knows about
61
+ def self.acceptable_attributes
62
+ attribute_map.values
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.openapi_types
67
+ {
68
+ :'cellphone' => :'String',
69
+ :'conversation_pbx_agent_uuid' => :'String',
70
+ :'conversation_pbx_voicemail_mailbox_uuid' => :'String',
71
+ :'forward_calls_to_cellphone' => :'Boolean',
72
+ :'merchant_id' => :'String',
73
+ :'record_outgoing_automatically' => :'Boolean',
74
+ :'twilio_taskrouter_worker_id' => :'String',
75
+ :'user_id' => :'Integer',
76
+ :'voicemail' => :'Boolean'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxAgent` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ attributes = attributes.each_with_object({}) { |(k, v), h|
95
+ if (!self.class.attribute_map.key?(k.to_sym))
96
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxAgent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
97
+ end
98
+ h[k.to_sym] = v
99
+ }
100
+
101
+ if attributes.key?(:'cellphone')
102
+ self.cellphone = attributes[:'cellphone']
103
+ end
104
+
105
+ if attributes.key?(:'conversation_pbx_agent_uuid')
106
+ self.conversation_pbx_agent_uuid = attributes[:'conversation_pbx_agent_uuid']
107
+ end
108
+
109
+ if attributes.key?(:'conversation_pbx_voicemail_mailbox_uuid')
110
+ self.conversation_pbx_voicemail_mailbox_uuid = attributes[:'conversation_pbx_voicemail_mailbox_uuid']
111
+ end
112
+
113
+ if attributes.key?(:'forward_calls_to_cellphone')
114
+ self.forward_calls_to_cellphone = attributes[:'forward_calls_to_cellphone']
115
+ end
116
+
117
+ if attributes.key?(:'merchant_id')
118
+ self.merchant_id = attributes[:'merchant_id']
119
+ end
120
+
121
+ if attributes.key?(:'record_outgoing_automatically')
122
+ self.record_outgoing_automatically = attributes[:'record_outgoing_automatically']
123
+ end
124
+
125
+ if attributes.key?(:'twilio_taskrouter_worker_id')
126
+ self.twilio_taskrouter_worker_id = attributes[:'twilio_taskrouter_worker_id']
127
+ end
128
+
129
+ if attributes.key?(:'user_id')
130
+ self.user_id = attributes[:'user_id']
131
+ end
132
+
133
+ if attributes.key?(:'voicemail')
134
+ self.voicemail = attributes[:'voicemail']
135
+ end
136
+ end
137
+
138
+ # Show invalid properties with the reasons. Usually used together with valid?
139
+ # @return Array for valid properties with the reasons
140
+ def list_invalid_properties
141
+ invalid_properties = Array.new
142
+ if !@cellphone.nil? && @cellphone.to_s.length > 50
143
+ invalid_properties.push('invalid value for "cellphone", the character length must be smaller than or equal to 50.')
144
+ end
145
+
146
+ if !@conversation_pbx_voicemail_mailbox_uuid.nil? && @conversation_pbx_voicemail_mailbox_uuid.to_s.length > 50
147
+ invalid_properties.push('invalid value for "conversation_pbx_voicemail_mailbox_uuid", the character length must be smaller than or equal to 50.')
148
+ end
149
+
150
+ if !@merchant_id.nil? && @merchant_id.to_s.length > 5
151
+ invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 5.')
152
+ end
153
+
154
+ if !@twilio_taskrouter_worker_id.nil? && @twilio_taskrouter_worker_id.to_s.length > 100
155
+ invalid_properties.push('invalid value for "twilio_taskrouter_worker_id", the character length must be smaller than or equal to 100.')
156
+ end
157
+
158
+ invalid_properties
159
+ end
160
+
161
+ # Check to see if the all the properties in the model are valid
162
+ # @return true if the model is valid
163
+ def valid?
164
+ return false if !@cellphone.nil? && @cellphone.to_s.length > 50
165
+ return false if !@conversation_pbx_voicemail_mailbox_uuid.nil? && @conversation_pbx_voicemail_mailbox_uuid.to_s.length > 50
166
+ return false if !@merchant_id.nil? && @merchant_id.to_s.length > 5
167
+ return false if !@twilio_taskrouter_worker_id.nil? && @twilio_taskrouter_worker_id.to_s.length > 100
168
+ true
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] cellphone Value to be assigned
173
+ def cellphone=(cellphone)
174
+ if !cellphone.nil? && cellphone.to_s.length > 50
175
+ fail ArgumentError, 'invalid value for "cellphone", the character length must be smaller than or equal to 50.'
176
+ end
177
+
178
+ @cellphone = cellphone
179
+ end
180
+
181
+ # Custom attribute writer method with validation
182
+ # @param [Object] conversation_pbx_voicemail_mailbox_uuid Value to be assigned
183
+ def conversation_pbx_voicemail_mailbox_uuid=(conversation_pbx_voicemail_mailbox_uuid)
184
+ if !conversation_pbx_voicemail_mailbox_uuid.nil? && conversation_pbx_voicemail_mailbox_uuid.to_s.length > 50
185
+ fail ArgumentError, 'invalid value for "conversation_pbx_voicemail_mailbox_uuid", the character length must be smaller than or equal to 50.'
186
+ end
187
+
188
+ @conversation_pbx_voicemail_mailbox_uuid = conversation_pbx_voicemail_mailbox_uuid
189
+ end
190
+
191
+ # Custom attribute writer method with validation
192
+ # @param [Object] merchant_id Value to be assigned
193
+ def merchant_id=(merchant_id)
194
+ if !merchant_id.nil? && merchant_id.to_s.length > 5
195
+ fail ArgumentError, 'invalid value for "merchant_id", the character length must be smaller than or equal to 5.'
196
+ end
197
+
198
+ @merchant_id = merchant_id
199
+ end
200
+
201
+ # Custom attribute writer method with validation
202
+ # @param [Object] twilio_taskrouter_worker_id Value to be assigned
203
+ def twilio_taskrouter_worker_id=(twilio_taskrouter_worker_id)
204
+ if !twilio_taskrouter_worker_id.nil? && twilio_taskrouter_worker_id.to_s.length > 100
205
+ fail ArgumentError, 'invalid value for "twilio_taskrouter_worker_id", the character length must be smaller than or equal to 100.'
206
+ end
207
+
208
+ @twilio_taskrouter_worker_id = twilio_taskrouter_worker_id
209
+ end
210
+
211
+ # Checks equality by comparing each attribute.
212
+ # @param [Object] Object to be compared
213
+ def ==(o)
214
+ return true if self.equal?(o)
215
+ self.class == o.class &&
216
+ cellphone == o.cellphone &&
217
+ conversation_pbx_agent_uuid == o.conversation_pbx_agent_uuid &&
218
+ conversation_pbx_voicemail_mailbox_uuid == o.conversation_pbx_voicemail_mailbox_uuid &&
219
+ forward_calls_to_cellphone == o.forward_calls_to_cellphone &&
220
+ merchant_id == o.merchant_id &&
221
+ record_outgoing_automatically == o.record_outgoing_automatically &&
222
+ twilio_taskrouter_worker_id == o.twilio_taskrouter_worker_id &&
223
+ user_id == o.user_id &&
224
+ voicemail == o.voicemail
225
+ end
226
+
227
+ # @see the `==` method
228
+ # @param [Object] Object to be compared
229
+ def eql?(o)
230
+ self == o
231
+ end
232
+
233
+ # Calculates hash code according to all attributes.
234
+ # @return [Integer] Hash code
235
+ def hash
236
+ [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
237
+ end
238
+
239
+ # Builds the object from hash
240
+ # @param [Hash] attributes Model attributes in the form of hash
241
+ # @return [Object] Returns the model itself
242
+ def self.build_from_hash(attributes)
243
+ new.build_from_hash(attributes)
244
+ end
245
+
246
+ # Builds the object from hash
247
+ # @param [Hash] attributes Model attributes in the form of hash
248
+ # @return [Object] Returns the model itself
249
+ def build_from_hash(attributes)
250
+ return nil unless attributes.is_a?(Hash)
251
+ attributes = attributes.transform_keys(&:to_sym)
252
+ self.class.openapi_types.each_pair do |key, type|
253
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
254
+ self.send("#{key}=", nil)
255
+ elsif type =~ /\AArray<(.*)>/i
256
+ # check to ensure the input is an array given that the attribute
257
+ # is documented as an array but the input is not
258
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
259
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
260
+ end
261
+ elsif !attributes[self.class.attribute_map[key]].nil?
262
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
263
+ end
264
+ end
265
+
266
+ self
267
+ end
268
+
269
+ # Deserializes the data based on type
270
+ # @param string type Data type
271
+ # @param string value Value to be deserialized
272
+ # @return [Object] Deserialized data
273
+ def _deserialize(type, value)
274
+ case type.to_sym
275
+ when :Time
276
+ Time.parse(value)
277
+ when :Date
278
+ Date.parse(value)
279
+ when :String
280
+ value.to_s
281
+ when :Integer
282
+ value.to_i
283
+ when :Float
284
+ value.to_f
285
+ when :Boolean
286
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
287
+ true
288
+ else
289
+ false
290
+ end
291
+ when :Object
292
+ # generic object (usually a Hash), return directly
293
+ value
294
+ when /\AArray<(?<inner_type>.+)>\z/
295
+ inner_type = Regexp.last_match[:inner_type]
296
+ value.map { |v| _deserialize(inner_type, v) }
297
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
298
+ k_type = Regexp.last_match[:k_type]
299
+ v_type = Regexp.last_match[:v_type]
300
+ {}.tap do |hash|
301
+ value.each do |k, v|
302
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
303
+ end
304
+ end
305
+ else # model
306
+ # models (e.g. Pet) or oneOf
307
+ klass = UltracartClient.const_get(type)
308
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
309
+ end
310
+ end
311
+
312
+ # Returns the string representation of the object
313
+ # @return [String] String presentation of the object
314
+ def to_s
315
+ to_hash.to_s
316
+ end
317
+
318
+ # to_body is an alias to to_hash (backward compatibility)
319
+ # @return [Hash] Returns the object in the form of hash
320
+ def to_body
321
+ to_hash
322
+ end
323
+
324
+ # Returns the object in the form of hash
325
+ # @return [Hash] Returns the object in the form of hash
326
+ def to_hash
327
+ hash = {}
328
+ self.class.attribute_map.each_pair do |attr, param|
329
+ value = self.send(attr)
330
+ if value.nil?
331
+ is_nullable = self.class.openapi_nullable.include?(attr)
332
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
333
+ end
334
+
335
+ hash[param] = _to_hash(value)
336
+ end
337
+ hash
338
+ end
339
+
340
+ # Outputs non-array value in the form of hash
341
+ # For object, use to_hash. Otherwise, just return the value
342
+ # @param [Object] value Any valid value
343
+ # @return [Hash] Returns the value in the form of hash
344
+ def _to_hash(value)
345
+ if value.is_a?(Array)
346
+ value.compact.map { |v| _to_hash(v) }
347
+ elsif value.is_a?(Hash)
348
+ {}.tap do |hash|
349
+ value.each { |k, v| hash[k] = _to_hash(v) }
350
+ end
351
+ elsif value.respond_to? :to_hash
352
+ value.to_hash
353
+ else
354
+ value
355
+ end
356
+ end
357
+
358
+ end
359
+
360
+ end