mailslurp_client 15.20.0 → 15.21.1

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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/attachment_controller_api.rb +6 -0
  3. data/lib/mailslurp_client/api/bounce_controller_api.rb +79 -0
  4. data/lib/mailslurp_client/api/inbox_controller_api.rb +56 -2
  5. data/lib/mailslurp_client/api/o_auth_connection_api.rb +170 -0
  6. data/lib/mailslurp_client/api/phone_controller_api.rb +381 -1
  7. data/lib/mailslurp_client/api/user_controller_api.rb +267 -0
  8. data/lib/mailslurp_client/models/alias_projection.rb +29 -29
  9. data/lib/mailslurp_client/models/alias_thread_projection.rb +39 -39
  10. data/lib/mailslurp_client/models/attachment_projection.rb +25 -25
  11. data/lib/mailslurp_client/models/bounce_projection.rb +22 -22
  12. data/lib/mailslurp_client/models/bounce_recipient_projection.rb +10 -10
  13. data/lib/mailslurp_client/models/connector_event_projection.rb +15 -15
  14. data/lib/mailslurp_client/models/connector_projection.rb +15 -15
  15. data/lib/mailslurp_client/models/contact_projection.rb +10 -10
  16. data/lib/mailslurp_client/models/create_emergency_address_options.rb +2 -2
  17. data/lib/mailslurp_client/models/create_o_auth_connection_result.rb +211 -0
  18. data/lib/mailslurp_client/models/create_o_auth_exchange_result.rb +229 -0
  19. data/lib/mailslurp_client/models/create_phone_number_options.rb +284 -0
  20. data/lib/mailslurp_client/models/domain_dto.rb +27 -1
  21. data/lib/mailslurp_client/models/email.rb +12 -1
  22. data/lib/mailslurp_client/models/email_preview.rb +15 -5
  23. data/lib/mailslurp_client/models/email_projection.rb +35 -25
  24. data/lib/mailslurp_client/models/email_thread_projection.rb +52 -52
  25. data/lib/mailslurp_client/models/emergency_address.rb +2 -2
  26. data/lib/mailslurp_client/models/emergency_address_dto.rb +2 -2
  27. data/lib/mailslurp_client/models/entity_automation_item_projection.rb +295 -0
  28. data/lib/mailslurp_client/models/entity_event_item_projection.rb +303 -0
  29. data/lib/mailslurp_client/models/entity_favourite_item_projection.rb +296 -0
  30. data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +15 -15
  31. data/lib/mailslurp_client/models/guest_portal_user_projection.rb +39 -39
  32. data/lib/mailslurp_client/models/inbox_dto.rb +2 -2
  33. data/lib/mailslurp_client/models/inbox_forwarder_event_projection.rb +10 -10
  34. data/lib/mailslurp_client/models/inbox_preview.rb +2 -2
  35. data/lib/mailslurp_client/models/inbox_replier_event_projection.rb +10 -10
  36. data/lib/mailslurp_client/models/list_unsubscribe_recipient_projection.rb +15 -15
  37. data/lib/mailslurp_client/models/missed_email_projection.rb +14 -14
  38. data/lib/mailslurp_client/models/opt_in_identity_projection.rb +29 -29
  39. data/lib/mailslurp_client/models/organization_inbox_projection.rb +2 -2
  40. data/lib/mailslurp_client/models/page_entity_automation_items.rb +309 -0
  41. data/lib/mailslurp_client/models/page_entity_event_items.rb +309 -0
  42. data/lib/mailslurp_client/models/page_entity_favourite_items.rb +309 -0
  43. data/lib/mailslurp_client/models/page_phone_message_thread_item_projection.rb +309 -0
  44. data/lib/mailslurp_client/models/page_phone_message_thread_projection.rb +309 -0
  45. data/lib/mailslurp_client/models/page_reputation_items.rb +309 -0
  46. data/lib/mailslurp_client/models/phone_message_thread_item_projection.rb +315 -0
  47. data/lib/mailslurp_client/models/phone_message_thread_projection.rb +315 -0
  48. data/lib/mailslurp_client/models/phone_number_dto.rb +2 -2
  49. data/lib/mailslurp_client/models/phone_number_projection.rb +17 -17
  50. data/lib/mailslurp_client/models/phone_plan_availability_item.rb +2 -2
  51. data/lib/mailslurp_client/models/phone_plan_dto.rb +2 -2
  52. data/lib/mailslurp_client/models/plus_address_projection.rb +29 -29
  53. data/lib/mailslurp_client/models/reputation_item_projection.rb +317 -0
  54. data/lib/mailslurp_client/models/search_inboxes_options.rb +2 -2
  55. data/lib/mailslurp_client/models/sent_email_dto.rb +12 -1
  56. data/lib/mailslurp_client/models/sent_email_projection.rb +25 -25
  57. data/lib/mailslurp_client/models/sent_sms_projection.rb +15 -15
  58. data/lib/mailslurp_client/models/sms_preview.rb +15 -1
  59. data/lib/mailslurp_client/models/sms_projection.rb +15 -15
  60. data/lib/mailslurp_client/models/template_projection.rb +15 -15
  61. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +15 -15
  62. data/lib/mailslurp_client/models/unknown_missed_email_projection.rb +10 -10
  63. data/lib/mailslurp_client/models/wait_for_sms_conditions.rb +1 -1
  64. data/lib/mailslurp_client/models/webhook_projection.rb +47 -47
  65. data/lib/mailslurp_client/version.rb +1 -1
  66. data/lib/mailslurp_client.rb +16 -0
  67. metadata +18 -2
@@ -83,6 +83,70 @@ module MailSlurpClient
83
83
  return data, status_code, headers
84
84
  end
85
85
 
86
+ # Add phone number to your account. Only works if you have already added a plan and an initial phone number in your account and acknowledged the pricing and terms of service by enabling API phone creation.
87
+ # Create new phone number
88
+ # @param create_phone_number_options [CreatePhoneNumberOptions]
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [PhoneNumberDto]
91
+ def create_phone_number(create_phone_number_options, opts = {})
92
+ data, _status_code, _headers = create_phone_number_with_http_info(create_phone_number_options, opts)
93
+ data
94
+ end
95
+
96
+ # Add phone number to your account. Only works if you have already added a plan and an initial phone number in your account and acknowledged the pricing and terms of service by enabling API phone creation.
97
+ # Create new phone number
98
+ # @param create_phone_number_options [CreatePhoneNumberOptions]
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Array<(PhoneNumberDto, Integer, Hash)>] PhoneNumberDto data, response status code and response headers
101
+ def create_phone_number_with_http_info(create_phone_number_options, opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: PhoneControllerApi.create_phone_number ...'
104
+ end
105
+ # verify the required parameter 'create_phone_number_options' is set
106
+ if @api_client.config.client_side_validation && create_phone_number_options.nil?
107
+ fail ArgumentError, "Missing the required parameter 'create_phone_number_options' when calling PhoneControllerApi.create_phone_number"
108
+ end
109
+ # resource path
110
+ local_var_path = '/phone'
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+
115
+ # header parameters
116
+ header_params = opts[:header_params] || {}
117
+ # HTTP header 'Accept' (if needed)
118
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
119
+ # HTTP header 'Content-Type'
120
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
121
+
122
+ # form parameters
123
+ form_params = opts[:form_params] || {}
124
+
125
+ # http body (model)
126
+ post_body = opts[:body] || @api_client.object_to_http_body(create_phone_number_options)
127
+
128
+ # return_type
129
+ return_type = opts[:return_type] || 'PhoneNumberDto'
130
+
131
+ # auth_names
132
+ auth_names = opts[:auth_names] || ['API_KEY']
133
+
134
+ new_options = opts.merge(
135
+ :header_params => header_params,
136
+ :query_params => query_params,
137
+ :form_params => form_params,
138
+ :body => post_body,
139
+ :auth_names => auth_names,
140
+ :return_type => return_type
141
+ )
142
+
143
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug "API called: PhoneControllerApi#create_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
146
+ end
147
+ return data, status_code, headers
148
+ end
149
+
86
150
  # Delete an emergency address
87
151
  # Delete an emergency address
88
152
  # @param address_id [String]
@@ -205,6 +269,68 @@ module MailSlurpClient
205
269
  return data, status_code, headers
206
270
  end
207
271
 
272
+ # Get the latest messages for all phones
273
+ # List all message threads for all phones
274
+ # @param [Hash] opts the optional parameters
275
+ # @option opts [Integer] :page (default to 0)
276
+ # @option opts [Integer] :size (default to 20)
277
+ # @return [PagePhoneMessageThreadProjection]
278
+ def get_all_phone_message_threads(opts = {})
279
+ data, _status_code, _headers = get_all_phone_message_threads_with_http_info(opts)
280
+ data
281
+ end
282
+
283
+ # Get the latest messages for all phones
284
+ # List all message threads for all phones
285
+ # @param [Hash] opts the optional parameters
286
+ # @option opts [Integer] :page
287
+ # @option opts [Integer] :size
288
+ # @return [Array<(PagePhoneMessageThreadProjection, Integer, Hash)>] PagePhoneMessageThreadProjection data, response status code and response headers
289
+ def get_all_phone_message_threads_with_http_info(opts = {})
290
+ if @api_client.config.debugging
291
+ @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_all_phone_message_threads ...'
292
+ end
293
+ # resource path
294
+ local_var_path = '/phone/numbers/message-threads'
295
+
296
+ # query parameters
297
+ query_params = opts[:query_params] || {}
298
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
299
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
300
+
301
+ # header parameters
302
+ header_params = opts[:header_params] || {}
303
+ # HTTP header 'Accept' (if needed)
304
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
305
+
306
+ # form parameters
307
+ form_params = opts[:form_params] || {}
308
+
309
+ # http body (model)
310
+ post_body = opts[:body]
311
+
312
+ # return_type
313
+ return_type = opts[:return_type] || 'PagePhoneMessageThreadProjection'
314
+
315
+ # auth_names
316
+ auth_names = opts[:auth_names] || ['API_KEY']
317
+
318
+ new_options = opts.merge(
319
+ :header_params => header_params,
320
+ :query_params => query_params,
321
+ :form_params => form_params,
322
+ :body => post_body,
323
+ :auth_names => auth_names,
324
+ :return_type => return_type
325
+ )
326
+
327
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
328
+ if @api_client.config.debugging
329
+ @api_client.config.logger.debug "API called: PhoneControllerApi#get_all_phone_message_threads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
330
+ end
331
+ return data, status_code, headers
332
+ end
333
+
208
334
  # Get consent status
209
335
  # Get the status of phone usage consent
210
336
  # @param [Hash] opts the optional parameters
@@ -379,6 +505,148 @@ module MailSlurpClient
379
505
  return data, status_code, headers
380
506
  end
381
507
 
508
+ # Get messages in a phone thread
509
+ # List message thread messages for a phone message thread
510
+ # @param phone_number_id [String]
511
+ # @param other_number [String]
512
+ # @param [Hash] opts the optional parameters
513
+ # @option opts [Integer] :page (default to 0)
514
+ # @option opts [Integer] :size (default to 20)
515
+ # @return [PagePhoneMessageThreadItemProjection]
516
+ def get_phone_message_thread_items(phone_number_id, other_number, opts = {})
517
+ data, _status_code, _headers = get_phone_message_thread_items_with_http_info(phone_number_id, other_number, opts)
518
+ data
519
+ end
520
+
521
+ # Get messages in a phone thread
522
+ # List message thread messages for a phone message thread
523
+ # @param phone_number_id [String]
524
+ # @param other_number [String]
525
+ # @param [Hash] opts the optional parameters
526
+ # @option opts [Integer] :page
527
+ # @option opts [Integer] :size
528
+ # @return [Array<(PagePhoneMessageThreadItemProjection, Integer, Hash)>] PagePhoneMessageThreadItemProjection data, response status code and response headers
529
+ def get_phone_message_thread_items_with_http_info(phone_number_id, other_number, opts = {})
530
+ if @api_client.config.debugging
531
+ @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_message_thread_items ...'
532
+ end
533
+ # verify the required parameter 'phone_number_id' is set
534
+ if @api_client.config.client_side_validation && phone_number_id.nil?
535
+ fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.get_phone_message_thread_items"
536
+ end
537
+ # verify the required parameter 'other_number' is set
538
+ if @api_client.config.client_side_validation && other_number.nil?
539
+ fail ArgumentError, "Missing the required parameter 'other_number' when calling PhoneControllerApi.get_phone_message_thread_items"
540
+ end
541
+ # resource path
542
+ local_var_path = '/phone/numbers/{phoneNumberId}/message-threads/{otherNumber}'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_id.to_s)).sub('{' + 'otherNumber' + '}', CGI.escape(other_number.to_s))
543
+
544
+ # query parameters
545
+ query_params = opts[:query_params] || {}
546
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
547
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
548
+
549
+ # header parameters
550
+ header_params = opts[:header_params] || {}
551
+ # HTTP header 'Accept' (if needed)
552
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
553
+
554
+ # form parameters
555
+ form_params = opts[:form_params] || {}
556
+
557
+ # http body (model)
558
+ post_body = opts[:body]
559
+
560
+ # return_type
561
+ return_type = opts[:return_type] || 'PagePhoneMessageThreadItemProjection'
562
+
563
+ # auth_names
564
+ auth_names = opts[:auth_names] || ['API_KEY']
565
+
566
+ new_options = opts.merge(
567
+ :header_params => header_params,
568
+ :query_params => query_params,
569
+ :form_params => form_params,
570
+ :body => post_body,
571
+ :auth_names => auth_names,
572
+ :return_type => return_type
573
+ )
574
+
575
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
576
+ if @api_client.config.debugging
577
+ @api_client.config.logger.debug "API called: PhoneControllerApi#get_phone_message_thread_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
578
+ end
579
+ return data, status_code, headers
580
+ end
581
+
582
+ # Get the latest message preview for a thread
583
+ # List message threads for a phone
584
+ # @param phone_number_id [String]
585
+ # @param [Hash] opts the optional parameters
586
+ # @option opts [Integer] :page (default to 0)
587
+ # @option opts [Integer] :size (default to 20)
588
+ # @return [PagePhoneMessageThreadProjection]
589
+ def get_phone_message_threads(phone_number_id, opts = {})
590
+ data, _status_code, _headers = get_phone_message_threads_with_http_info(phone_number_id, opts)
591
+ data
592
+ end
593
+
594
+ # Get the latest message preview for a thread
595
+ # List message threads for a phone
596
+ # @param phone_number_id [String]
597
+ # @param [Hash] opts the optional parameters
598
+ # @option opts [Integer] :page
599
+ # @option opts [Integer] :size
600
+ # @return [Array<(PagePhoneMessageThreadProjection, Integer, Hash)>] PagePhoneMessageThreadProjection data, response status code and response headers
601
+ def get_phone_message_threads_with_http_info(phone_number_id, opts = {})
602
+ if @api_client.config.debugging
603
+ @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_message_threads ...'
604
+ end
605
+ # verify the required parameter 'phone_number_id' is set
606
+ if @api_client.config.client_side_validation && phone_number_id.nil?
607
+ fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.get_phone_message_threads"
608
+ end
609
+ # resource path
610
+ local_var_path = '/phone/numbers/{phoneNumberId}/message-threads'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_id.to_s))
611
+
612
+ # query parameters
613
+ query_params = opts[:query_params] || {}
614
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
615
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
616
+
617
+ # header parameters
618
+ header_params = opts[:header_params] || {}
619
+ # HTTP header 'Accept' (if needed)
620
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
621
+
622
+ # form parameters
623
+ form_params = opts[:form_params] || {}
624
+
625
+ # http body (model)
626
+ post_body = opts[:body]
627
+
628
+ # return_type
629
+ return_type = opts[:return_type] || 'PagePhoneMessageThreadProjection'
630
+
631
+ # auth_names
632
+ auth_names = opts[:auth_names] || ['API_KEY']
633
+
634
+ new_options = opts.merge(
635
+ :header_params => header_params,
636
+ :query_params => query_params,
637
+ :form_params => form_params,
638
+ :body => post_body,
639
+ :auth_names => auth_names,
640
+ :return_type => return_type
641
+ )
642
+
643
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
644
+ if @api_client.config.debugging
645
+ @api_client.config.logger.debug "API called: PhoneControllerApi#get_phone_message_threads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
646
+ end
647
+ return data, status_code, headers
648
+ end
649
+
382
650
  # Get a phone number by ID
383
651
  # Get a phone number by ID
384
652
  # @param phone_number_id [String]
@@ -441,6 +709,118 @@ module MailSlurpClient
441
709
  return data, status_code, headers
442
710
  end
443
711
 
712
+ # Get a phone number by name
713
+ # Get a phone number by name
714
+ # @param [Hash] opts the optional parameters
715
+ # @return [PhoneNumberDto]
716
+ def get_phone_number_by_name(opts = {})
717
+ data, _status_code, _headers = get_phone_number_by_name_with_http_info(opts)
718
+ data
719
+ end
720
+
721
+ # Get a phone number by name
722
+ # Get a phone number by name
723
+ # @param [Hash] opts the optional parameters
724
+ # @return [Array<(PhoneNumberDto, Integer, Hash)>] PhoneNumberDto data, response status code and response headers
725
+ def get_phone_number_by_name_with_http_info(opts = {})
726
+ if @api_client.config.debugging
727
+ @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_number_by_name ...'
728
+ end
729
+ # resource path
730
+ local_var_path = '/phone/numbers/by-name'
731
+
732
+ # query parameters
733
+ query_params = opts[:query_params] || {}
734
+
735
+ # header parameters
736
+ header_params = opts[:header_params] || {}
737
+ # HTTP header 'Accept' (if needed)
738
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
739
+
740
+ # form parameters
741
+ form_params = opts[:form_params] || {}
742
+
743
+ # http body (model)
744
+ post_body = opts[:body]
745
+
746
+ # return_type
747
+ return_type = opts[:return_type] || 'PhoneNumberDto'
748
+
749
+ # auth_names
750
+ auth_names = opts[:auth_names] || ['API_KEY']
751
+
752
+ new_options = opts.merge(
753
+ :header_params => header_params,
754
+ :query_params => query_params,
755
+ :form_params => form_params,
756
+ :body => post_body,
757
+ :auth_names => auth_names,
758
+ :return_type => return_type
759
+ )
760
+
761
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
762
+ if @api_client.config.debugging
763
+ @api_client.config.logger.debug "API called: PhoneControllerApi#get_phone_number_by_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
764
+ end
765
+ return data, status_code, headers
766
+ end
767
+
768
+ # Get a phone number by phone number
769
+ # Get a phone number by phone number
770
+ # @param [Hash] opts the optional parameters
771
+ # @return [PhoneNumberDto]
772
+ def get_phone_number_by_phone_number(opts = {})
773
+ data, _status_code, _headers = get_phone_number_by_phone_number_with_http_info(opts)
774
+ data
775
+ end
776
+
777
+ # Get a phone number by phone number
778
+ # Get a phone number by phone number
779
+ # @param [Hash] opts the optional parameters
780
+ # @return [Array<(PhoneNumberDto, Integer, Hash)>] PhoneNumberDto data, response status code and response headers
781
+ def get_phone_number_by_phone_number_with_http_info(opts = {})
782
+ if @api_client.config.debugging
783
+ @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_number_by_phone_number ...'
784
+ end
785
+ # resource path
786
+ local_var_path = '/phone/numbers/by-phone-number'
787
+
788
+ # query parameters
789
+ query_params = opts[:query_params] || {}
790
+
791
+ # header parameters
792
+ header_params = opts[:header_params] || {}
793
+ # HTTP header 'Accept' (if needed)
794
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
795
+
796
+ # form parameters
797
+ form_params = opts[:form_params] || {}
798
+
799
+ # http body (model)
800
+ post_body = opts[:body]
801
+
802
+ # return_type
803
+ return_type = opts[:return_type] || 'PhoneNumberDto'
804
+
805
+ # auth_names
806
+ auth_names = opts[:auth_names] || ['API_KEY']
807
+
808
+ new_options = opts.merge(
809
+ :header_params => header_params,
810
+ :query_params => query_params,
811
+ :form_params => form_params,
812
+ :body => post_body,
813
+ :auth_names => auth_names,
814
+ :return_type => return_type
815
+ )
816
+
817
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
818
+ if @api_client.config.debugging
819
+ @api_client.config.logger.debug "API called: PhoneControllerApi#get_phone_number_by_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
820
+ end
821
+ return data, status_code, headers
822
+ end
823
+
444
824
  # Get phone numbers
445
825
  # List phone numbers for account
446
826
  # @param [Hash] opts the optional parameters
@@ -476,7 +856,7 @@ module MailSlurpClient
476
856
  if @api_client.config.debugging
477
857
  @api_client.config.logger.debug 'Calling API: PhoneControllerApi.get_phone_numbers ...'
478
858
  end
479
- allowable_values = ["US", "GB", "AU"]
859
+ allowable_values = ["US", "GB", "AU", "CA", "EE", "HK", "PL", "CH", "PT", "NL", "IL", "SE"]
480
860
  if @api_client.config.client_side_validation && opts[:'phone_country'] && !allowable_values.include?(opts[:'phone_country'])
481
861
  fail ArgumentError, "invalid value for \"phone_country\", must be one of #{allowable_values}"
482
862
  end
@@ -19,6 +19,273 @@ module MailSlurpClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # @param [Hash] opts the optional parameters
23
+ # @option opts [Integer] :page Optional page index (default to 0)
24
+ # @option opts [Integer] :size Optional page size (default to 20)
25
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'DESC')
26
+ # @option opts [DateTime] :since Filter by created at after the given timestamp
27
+ # @option opts [DateTime] :before Filter by created at before the given timestamp
28
+ # @option opts [String] :inbox_id Optional inbox ID
29
+ # @option opts [String] :phone_id Optional phone ID
30
+ # @option opts [String] :filter Optional automation type filter
31
+ # @return [PageEntityAutomationItems]
32
+ def get_entity_automations(opts = {})
33
+ data, _status_code, _headers = get_entity_automations_with_http_info(opts)
34
+ data
35
+ end
36
+
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [Integer] :page Optional page index
39
+ # @option opts [Integer] :size Optional page size
40
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
41
+ # @option opts [DateTime] :since Filter by created at after the given timestamp
42
+ # @option opts [DateTime] :before Filter by created at before the given timestamp
43
+ # @option opts [String] :inbox_id Optional inbox ID
44
+ # @option opts [String] :phone_id Optional phone ID
45
+ # @option opts [String] :filter Optional automation type filter
46
+ # @return [Array<(PageEntityAutomationItems, Integer, Hash)>] PageEntityAutomationItems data, response status code and response headers
47
+ def get_entity_automations_with_http_info(opts = {})
48
+ if @api_client.config.debugging
49
+ @api_client.config.logger.debug 'Calling API: UserControllerApi.get_entity_automations ...'
50
+ end
51
+ if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
52
+ fail ArgumentError, 'invalid value for "opts[:"size"]" when calling UserControllerApi.get_entity_automations, must be smaller than or equal to 100.'
53
+ end
54
+
55
+ allowable_values = ["ASC", "DESC"]
56
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
57
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
58
+ end
59
+ allowable_values = ["INBOX_FORWARDER", "INBOX_REPLIER", "INBOX_RULESET"]
60
+ if @api_client.config.client_side_validation && opts[:'filter'] && !allowable_values.include?(opts[:'filter'])
61
+ fail ArgumentError, "invalid value for \"filter\", must be one of #{allowable_values}"
62
+ end
63
+ # resource path
64
+ local_var_path = '/user/automations'
65
+
66
+ # query parameters
67
+ query_params = opts[:query_params] || {}
68
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
69
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
70
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
71
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
72
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
73
+ query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
74
+ query_params[:'phoneId'] = opts[:'phone_id'] if !opts[:'phone_id'].nil?
75
+ query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
76
+
77
+ # header parameters
78
+ header_params = opts[:header_params] || {}
79
+ # HTTP header 'Accept' (if needed)
80
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
81
+
82
+ # form parameters
83
+ form_params = opts[:form_params] || {}
84
+
85
+ # http body (model)
86
+ post_body = opts[:body]
87
+
88
+ # return_type
89
+ return_type = opts[:return_type] || 'PageEntityAutomationItems'
90
+
91
+ # auth_names
92
+ auth_names = opts[:auth_names] || ['API_KEY']
93
+
94
+ new_options = opts.merge(
95
+ :header_params => header_params,
96
+ :query_params => query_params,
97
+ :form_params => form_params,
98
+ :body => post_body,
99
+ :auth_names => auth_names,
100
+ :return_type => return_type
101
+ )
102
+
103
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug "API called: UserControllerApi#get_entity_automations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
106
+ end
107
+ return data, status_code, headers
108
+ end
109
+
110
+ # @param [Hash] opts the optional parameters
111
+ # @option opts [Integer] :page Optional page index (default to 0)
112
+ # @option opts [Integer] :size Optional page size (default to 20)
113
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'DESC')
114
+ # @option opts [DateTime] :since Filter by created at after the given timestamp
115
+ # @option opts [DateTime] :before Filter by created at before the given timestamp
116
+ # @option opts [String] :inbox_id Optional inbox ID
117
+ # @option opts [String] :email_id Optional email ID
118
+ # @option opts [String] :phone_id Optional phone ID
119
+ # @option opts [String] :sms_id Optional SMS ID
120
+ # @option opts [String] :attachment_id Optional attachment ID
121
+ # @option opts [String] :filter Optional type filter
122
+ # @return [PageEntityEventItems]
123
+ def get_entity_events(opts = {})
124
+ data, _status_code, _headers = get_entity_events_with_http_info(opts)
125
+ data
126
+ end
127
+
128
+ # @param [Hash] opts the optional parameters
129
+ # @option opts [Integer] :page Optional page index
130
+ # @option opts [Integer] :size Optional page size
131
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
132
+ # @option opts [DateTime] :since Filter by created at after the given timestamp
133
+ # @option opts [DateTime] :before Filter by created at before the given timestamp
134
+ # @option opts [String] :inbox_id Optional inbox ID
135
+ # @option opts [String] :email_id Optional email ID
136
+ # @option opts [String] :phone_id Optional phone ID
137
+ # @option opts [String] :sms_id Optional SMS ID
138
+ # @option opts [String] :attachment_id Optional attachment ID
139
+ # @option opts [String] :filter Optional type filter
140
+ # @return [Array<(PageEntityEventItems, Integer, Hash)>] PageEntityEventItems data, response status code and response headers
141
+ def get_entity_events_with_http_info(opts = {})
142
+ if @api_client.config.debugging
143
+ @api_client.config.logger.debug 'Calling API: UserControllerApi.get_entity_events ...'
144
+ end
145
+ if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
146
+ fail ArgumentError, 'invalid value for "opts[:"size"]" when calling UserControllerApi.get_entity_events, must be smaller than or equal to 100.'
147
+ end
148
+
149
+ allowable_values = ["ASC", "DESC"]
150
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
151
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
152
+ end
153
+ allowable_values = ["WEBHOOK_EVENT", "INBOX_FORWARDER_EVENT", "INBOX_REPLIER_EVENT", "INBOX_RULESET_EVENT", "ALIAS_EVENT"]
154
+ if @api_client.config.client_side_validation && opts[:'filter'] && !allowable_values.include?(opts[:'filter'])
155
+ fail ArgumentError, "invalid value for \"filter\", must be one of #{allowable_values}"
156
+ end
157
+ # resource path
158
+ local_var_path = '/user/events'
159
+
160
+ # query parameters
161
+ query_params = opts[:query_params] || {}
162
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
163
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
164
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
165
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
166
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
167
+ query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
168
+ query_params[:'emailId'] = opts[:'email_id'] if !opts[:'email_id'].nil?
169
+ query_params[:'phoneId'] = opts[:'phone_id'] if !opts[:'phone_id'].nil?
170
+ query_params[:'smsId'] = opts[:'sms_id'] if !opts[:'sms_id'].nil?
171
+ query_params[:'attachmentId'] = opts[:'attachment_id'] if !opts[:'attachment_id'].nil?
172
+ query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
173
+
174
+ # header parameters
175
+ header_params = opts[:header_params] || {}
176
+ # HTTP header 'Accept' (if needed)
177
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
178
+
179
+ # form parameters
180
+ form_params = opts[:form_params] || {}
181
+
182
+ # http body (model)
183
+ post_body = opts[:body]
184
+
185
+ # return_type
186
+ return_type = opts[:return_type] || 'PageEntityEventItems'
187
+
188
+ # auth_names
189
+ auth_names = opts[:auth_names] || ['API_KEY']
190
+
191
+ new_options = opts.merge(
192
+ :header_params => header_params,
193
+ :query_params => query_params,
194
+ :form_params => form_params,
195
+ :body => post_body,
196
+ :auth_names => auth_names,
197
+ :return_type => return_type
198
+ )
199
+
200
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
201
+ if @api_client.config.debugging
202
+ @api_client.config.logger.debug "API called: UserControllerApi#get_entity_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
203
+ end
204
+ return data, status_code, headers
205
+ end
206
+
207
+ # @param [Hash] opts the optional parameters
208
+ # @option opts [Integer] :page Optional page index (default to 0)
209
+ # @option opts [Integer] :size Optional page size (default to 20)
210
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'DESC')
211
+ # @option opts [DateTime] :since Filter by created at after the given timestamp
212
+ # @option opts [DateTime] :before Filter by created at before the given timestamp
213
+ # @option opts [String] :filter Optional type filter
214
+ # @return [PageEntityFavouriteItems]
215
+ def get_entity_favorites(opts = {})
216
+ data, _status_code, _headers = get_entity_favorites_with_http_info(opts)
217
+ data
218
+ end
219
+
220
+ # @param [Hash] opts the optional parameters
221
+ # @option opts [Integer] :page Optional page index
222
+ # @option opts [Integer] :size Optional page size
223
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
224
+ # @option opts [DateTime] :since Filter by created at after the given timestamp
225
+ # @option opts [DateTime] :before Filter by created at before the given timestamp
226
+ # @option opts [String] :filter Optional type filter
227
+ # @return [Array<(PageEntityFavouriteItems, Integer, Hash)>] PageEntityFavouriteItems data, response status code and response headers
228
+ def get_entity_favorites_with_http_info(opts = {})
229
+ if @api_client.config.debugging
230
+ @api_client.config.logger.debug 'Calling API: UserControllerApi.get_entity_favorites ...'
231
+ end
232
+ if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100
233
+ fail ArgumentError, 'invalid value for "opts[:"size"]" when calling UserControllerApi.get_entity_favorites, must be smaller than or equal to 100.'
234
+ end
235
+
236
+ allowable_values = ["ASC", "DESC"]
237
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
238
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
239
+ end
240
+ allowable_values = ["INBOX", "EMAIL", "ATTACHMENT", "PHONE", "SMS"]
241
+ if @api_client.config.client_side_validation && opts[:'filter'] && !allowable_values.include?(opts[:'filter'])
242
+ fail ArgumentError, "invalid value for \"filter\", must be one of #{allowable_values}"
243
+ end
244
+ # resource path
245
+ local_var_path = '/user/favorites'
246
+
247
+ # query parameters
248
+ query_params = opts[:query_params] || {}
249
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
250
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
251
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
252
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
253
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
254
+ query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
255
+
256
+ # header parameters
257
+ header_params = opts[:header_params] || {}
258
+ # HTTP header 'Accept' (if needed)
259
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
260
+
261
+ # form parameters
262
+ form_params = opts[:form_params] || {}
263
+
264
+ # http body (model)
265
+ post_body = opts[:body]
266
+
267
+ # return_type
268
+ return_type = opts[:return_type] || 'PageEntityFavouriteItems'
269
+
270
+ # auth_names
271
+ auth_names = opts[:auth_names] || ['API_KEY']
272
+
273
+ new_options = opts.merge(
274
+ :header_params => header_params,
275
+ :query_params => query_params,
276
+ :form_params => form_params,
277
+ :body => post_body,
278
+ :auth_names => auth_names,
279
+ :return_type => return_type
280
+ )
281
+
282
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
283
+ if @api_client.config.debugging
284
+ @api_client.config.logger.debug "API called: UserControllerApi#get_entity_favorites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
285
+ end
286
+ return data, status_code, headers
287
+ end
288
+
22
289
  # Utility function to extract properties from JSON objects in language where this is cumbersome.
23
290
  # @param property [String] JSON property name or dot separated path selector such as &#x60;a.b.c&#x60;
24
291
  # @param body [Object]