mailslurp_client 15.12.16 → 15.13.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailslurp_client/api/inbox_controller_api.rb +89 -0
  3. data/lib/mailslurp_client/api/phone_controller_api.rb +64 -0
  4. data/lib/mailslurp_client/api/sent_emails_controller_api.rb +83 -3
  5. data/lib/mailslurp_client/api/sms_controller_api.rb +3 -3
  6. data/lib/mailslurp_client/api/wait_for_controller_api.rb +64 -0
  7. data/lib/mailslurp_client/api/webhook_controller_api.rb +70 -0
  8. data/lib/mailslurp_client/models/alias_projection.rb +19 -19
  9. data/lib/mailslurp_client/models/attachment_meta_data.rb +1 -1
  10. data/lib/mailslurp_client/models/bounce_projection.rb +22 -22
  11. data/lib/mailslurp_client/models/contact_projection.rb +13 -13
  12. data/lib/mailslurp_client/models/{delivery_status.rb → delivery_status_dto.rb} +18 -4
  13. data/lib/mailslurp_client/models/email.rb +11 -1
  14. data/lib/mailslurp_client/models/email_preview.rb +11 -1
  15. data/lib/mailslurp_client/models/email_projection.rb +42 -33
  16. data/lib/mailslurp_client/models/expired_inbox_record_projection.rb +15 -15
  17. data/lib/mailslurp_client/models/inbox_preview.rb +11 -1
  18. data/lib/mailslurp_client/models/missed_email_projection.rb +10 -10
  19. data/lib/mailslurp_client/models/organization_inbox_projection.rb +11 -1
  20. data/lib/mailslurp_client/models/page_delivery_status.rb +1 -1
  21. data/lib/mailslurp_client/models/page_sent_email_projection.rb +16 -16
  22. data/lib/mailslurp_client/models/page_sent_email_with_queue_projection.rb +16 -16
  23. data/lib/mailslurp_client/models/sent_email_dto.rb +11 -1
  24. data/lib/mailslurp_client/models/sent_email_projection.rb +56 -56
  25. data/lib/mailslurp_client/models/{sms_message.rb → sms_dto.rb} +9 -18
  26. data/lib/mailslurp_client/models/sms_preview.rb +15 -1
  27. data/lib/mailslurp_client/models/sms_projection.rb +32 -18
  28. data/lib/mailslurp_client/models/sort.rb +13 -13
  29. data/lib/mailslurp_client/models/test_phone_number_options.rb +211 -0
  30. data/lib/mailslurp_client/models/thread_projection.rb +20 -20
  31. data/lib/mailslurp_client/models/tracking_pixel_projection.rb +10 -10
  32. data/lib/mailslurp_client/models/wait_for_single_sms_options.rb +304 -0
  33. data/lib/mailslurp_client/models/webhook_new_email_payload.rb +11 -1
  34. data/lib/mailslurp_client/version.rb +1 -1
  35. data/lib/mailslurp_client.rb +4 -2
  36. metadata +6 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db8e97b69df32cf2d3d1b05a3abbf221b10d3ae316797ddf7b7ab6621982d43b
4
- data.tar.gz: 473249ad3e4a85771f550c8cd0ee92ae2ed36ce1d7674caca208d4bc79beb95f
3
+ metadata.gz: 89fc2b7730fb84ebf8de954f5115e453d5e822306164a491f169f531190563df
4
+ data.tar.gz: dbfa6ab3418b3fa360f3a8df1d67e023aa0d759a440719b1a9c3c57420fb1035
5
5
  SHA512:
6
- metadata.gz: d8a1bea553e9d274a097d316cea53d89000b57bd9310e6b12363d893ea50c567d3ee5d2b56492601cf15090339dd839a295e0ff91bfe3764037e14f49e58c511
7
- data.tar.gz: b7c74ae25aed2bc8847b704580cd4a99deb1eff427068a3f048943b52c003970e3a0ab6519acc1b1767779a22e225335e1458fe9189a0d9b6b9cd11a1ce2a36f
6
+ metadata.gz: e0490a8569dbbfa2d47bfa2e173bf3437265ed3a1a9d9d14edc0314c40c63d885d248421975b734ba1c75cb3eab35abbee3810228a248e2b111f9716fe1e2c5e
7
+ data.tar.gz: a8fc803bd768b8b30091116d9f37643add26f881b968df17c66f61d9426facf3e9de0007997281c54ceeec4df635427b411d88d0c795b279f78cfe4c7e963a64
@@ -608,6 +608,8 @@ module MailSlurpClient
608
608
  # @option opts [Boolean] :team_access DEPRECATED. Optionally filter by team access.
609
609
  # @option opts [DateTime] :since Optional filter by created after given date time
610
610
  # @option opts [DateTime] :before Optional filter by created before given date time
611
+ # @option opts [String] :inbox_type Optional filter by inbox type
612
+ # @option opts [String] :domain_id Optional domain ID filter
611
613
  # @return [PageInboxProjection]
612
614
  def get_all_inboxes(opts = {})
613
615
  data, _status_code, _headers = get_all_inboxes_with_http_info(opts)
@@ -626,6 +628,8 @@ module MailSlurpClient
626
628
  # @option opts [Boolean] :team_access DEPRECATED. Optionally filter by team access.
627
629
  # @option opts [DateTime] :since Optional filter by created after given date time
628
630
  # @option opts [DateTime] :before Optional filter by created before given date time
631
+ # @option opts [String] :inbox_type Optional filter by inbox type
632
+ # @option opts [String] :domain_id Optional domain ID filter
629
633
  # @return [Array<(PageInboxProjection, Integer, Hash)>] PageInboxProjection data, response status code and response headers
630
634
  def get_all_inboxes_with_http_info(opts = {})
631
635
  if @api_client.config.debugging
@@ -635,6 +639,10 @@ module MailSlurpClient
635
639
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
636
640
  fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
637
641
  end
642
+ allowable_values = ["HTTP_INBOX", "SMTP_INBOX"]
643
+ if @api_client.config.client_side_validation && opts[:'inbox_type'] && !allowable_values.include?(opts[:'inbox_type'])
644
+ fail ArgumentError, "invalid value for \"inbox_type\", must be one of #{allowable_values}"
645
+ end
638
646
  # resource path
639
647
  local_var_path = '/inboxes/paginated'
640
648
 
@@ -649,6 +657,8 @@ module MailSlurpClient
649
657
  query_params[:'teamAccess'] = opts[:'team_access'] if !opts[:'team_access'].nil?
650
658
  query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
651
659
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
660
+ query_params[:'inboxType'] = opts[:'inbox_type'] if !opts[:'inbox_type'].nil?
661
+ query_params[:'domainId'] = opts[:'domain_id'] if !opts[:'domain_id'].nil?
652
662
 
653
663
  # header parameters
654
664
  header_params = opts[:header_params] || {}
@@ -683,6 +693,85 @@ module MailSlurpClient
683
693
  return data, status_code, headers
684
694
  end
685
695
 
696
+ # Get all email delivery statuses for an inbox
697
+ # @param inbox_id [String]
698
+ # @param [Hash] opts the optional parameters
699
+ # @option opts [Integer] :page Optional page index in delivery status list pagination (default to 0)
700
+ # @option opts [Integer] :size Optional page size in delivery status list pagination (default to 20)
701
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC (default to 'ASC')
702
+ # @option opts [DateTime] :since Filter by created at after the given timestamp
703
+ # @option opts [DateTime] :before Filter by created at before the given timestamp
704
+ # @return [PageDeliveryStatus]
705
+ def get_delivery_statuses_by_inbox_id(inbox_id, opts = {})
706
+ data, _status_code, _headers = get_delivery_statuses_by_inbox_id_with_http_info(inbox_id, opts)
707
+ data
708
+ end
709
+
710
+ # Get all email delivery statuses for an inbox
711
+ # @param inbox_id [String]
712
+ # @param [Hash] opts the optional parameters
713
+ # @option opts [Integer] :page Optional page index in delivery status list pagination
714
+ # @option opts [Integer] :size Optional page size in delivery status list pagination
715
+ # @option opts [String] :sort Optional createdAt sort direction ASC or DESC
716
+ # @option opts [DateTime] :since Filter by created at after the given timestamp
717
+ # @option opts [DateTime] :before Filter by created at before the given timestamp
718
+ # @return [Array<(PageDeliveryStatus, Integer, Hash)>] PageDeliveryStatus data, response status code and response headers
719
+ def get_delivery_statuses_by_inbox_id_with_http_info(inbox_id, opts = {})
720
+ if @api_client.config.debugging
721
+ @api_client.config.logger.debug 'Calling API: InboxControllerApi.get_delivery_statuses_by_inbox_id ...'
722
+ end
723
+ # verify the required parameter 'inbox_id' is set
724
+ if @api_client.config.client_side_validation && inbox_id.nil?
725
+ fail ArgumentError, "Missing the required parameter 'inbox_id' when calling InboxControllerApi.get_delivery_statuses_by_inbox_id"
726
+ end
727
+ allowable_values = ["ASC", "DESC"]
728
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
729
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
730
+ end
731
+ # resource path
732
+ local_var_path = '/inboxes/{inboxId}/delivery-status'.sub('{' + 'inboxId' + '}', CGI.escape(inbox_id.to_s))
733
+
734
+ # query parameters
735
+ query_params = opts[:query_params] || {}
736
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
737
+ query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
738
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
739
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
740
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
741
+
742
+ # header parameters
743
+ header_params = opts[:header_params] || {}
744
+ # HTTP header 'Accept' (if needed)
745
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
746
+
747
+ # form parameters
748
+ form_params = opts[:form_params] || {}
749
+
750
+ # http body (model)
751
+ post_body = opts[:body]
752
+
753
+ # return_type
754
+ return_type = opts[:return_type] || 'PageDeliveryStatus'
755
+
756
+ # auth_names
757
+ auth_names = opts[:auth_names] || ['API_KEY']
758
+
759
+ new_options = opts.merge(
760
+ :header_params => header_params,
761
+ :query_params => query_params,
762
+ :form_params => form_params,
763
+ :body => post_body,
764
+ :auth_names => auth_names,
765
+ :return_type => return_type
766
+ )
767
+
768
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
769
+ if @api_client.config.debugging
770
+ @api_client.config.logger.debug "API called: InboxControllerApi#get_delivery_statuses_by_inbox_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
771
+ end
772
+ return data, status_code, headers
773
+ end
774
+
686
775
  # Get emails in an Inbox. This method is not idempotent as it allows retries and waits if you want certain conditions to be met before returning. For simple listing and sorting of known emails use the email controller instead.
687
776
  # List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached
688
777
  # @param inbox_id [String] Id of inbox that emails belongs to
@@ -483,5 +483,69 @@ module MailSlurpClient
483
483
  end
484
484
  return data, status_code, headers
485
485
  end
486
+
487
+ # @param phone_number_id [String]
488
+ # @param test_phone_number_options [TestPhoneNumberOptions]
489
+ # @param [Hash] opts the optional parameters
490
+ # @return [nil]
491
+ def test_phone_number_send_sms(phone_number_id, test_phone_number_options, opts = {})
492
+ test_phone_number_send_sms_with_http_info(phone_number_id, test_phone_number_options, opts)
493
+ nil
494
+ end
495
+
496
+ # @param phone_number_id [String]
497
+ # @param test_phone_number_options [TestPhoneNumberOptions]
498
+ # @param [Hash] opts the optional parameters
499
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
500
+ def test_phone_number_send_sms_with_http_info(phone_number_id, test_phone_number_options, opts = {})
501
+ if @api_client.config.debugging
502
+ @api_client.config.logger.debug 'Calling API: PhoneControllerApi.test_phone_number_send_sms ...'
503
+ end
504
+ # verify the required parameter 'phone_number_id' is set
505
+ if @api_client.config.client_side_validation && phone_number_id.nil?
506
+ fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling PhoneControllerApi.test_phone_number_send_sms"
507
+ end
508
+ # verify the required parameter 'test_phone_number_options' is set
509
+ if @api_client.config.client_side_validation && test_phone_number_options.nil?
510
+ fail ArgumentError, "Missing the required parameter 'test_phone_number_options' when calling PhoneControllerApi.test_phone_number_send_sms"
511
+ end
512
+ # resource path
513
+ local_var_path = '/phone/numbers/{phoneNumberId}/test'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_id.to_s))
514
+
515
+ # query parameters
516
+ query_params = opts[:query_params] || {}
517
+
518
+ # header parameters
519
+ header_params = opts[:header_params] || {}
520
+ # HTTP header 'Content-Type'
521
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
522
+
523
+ # form parameters
524
+ form_params = opts[:form_params] || {}
525
+
526
+ # http body (model)
527
+ post_body = opts[:body] || @api_client.object_to_http_body(test_phone_number_options)
528
+
529
+ # return_type
530
+ return_type = opts[:return_type]
531
+
532
+ # auth_names
533
+ auth_names = opts[:auth_names] || ['API_KEY']
534
+
535
+ new_options = opts.merge(
536
+ :header_params => header_params,
537
+ :query_params => query_params,
538
+ :form_params => form_params,
539
+ :body => post_body,
540
+ :auth_names => auth_names,
541
+ :return_type => return_type
542
+ )
543
+
544
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
545
+ if @api_client.config.debugging
546
+ @api_client.config.logger.debug "API called: PhoneControllerApi#test_phone_number_send_sms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
547
+ end
548
+ return data, status_code, headers
549
+ end
486
550
  end
487
551
  end
@@ -332,7 +332,7 @@ module MailSlurpClient
332
332
  # Get a sent email delivery status
333
333
  # @param delivery_id [String]
334
334
  # @param [Hash] opts the optional parameters
335
- # @return [DeliveryStatus]
335
+ # @return [DeliveryStatusDto]
336
336
  def get_sent_delivery_status(delivery_id, opts = {})
337
337
  data, _status_code, _headers = get_sent_delivery_status_with_http_info(delivery_id, opts)
338
338
  data
@@ -341,7 +341,7 @@ module MailSlurpClient
341
341
  # Get a sent email delivery status
342
342
  # @param delivery_id [String]
343
343
  # @param [Hash] opts the optional parameters
344
- # @return [Array<(DeliveryStatus, Integer, Hash)>] DeliveryStatus data, response status code and response headers
344
+ # @return [Array<(DeliveryStatusDto, Integer, Hash)>] DeliveryStatusDto data, response status code and response headers
345
345
  def get_sent_delivery_status_with_http_info(delivery_id, opts = {})
346
346
  if @api_client.config.debugging
347
347
  @api_client.config.logger.debug 'Calling API: SentEmailsControllerApi.get_sent_delivery_status ...'
@@ -368,7 +368,7 @@ module MailSlurpClient
368
368
  post_body = opts[:body]
369
369
 
370
370
  # return_type
371
- return_type = opts[:return_type] || 'DeliveryStatus'
371
+ return_type = opts[:return_type] || 'DeliveryStatusDto'
372
372
 
373
373
  # auth_names
374
374
  auth_names = opts[:auth_names] || ['API_KEY']
@@ -1035,5 +1035,85 @@ module MailSlurpClient
1035
1035
  end
1036
1036
  return data, status_code, headers
1037
1037
  end
1038
+
1039
+ # Wait for delivery statuses
1040
+ # @param [Hash] opts the optional parameters
1041
+ # @option opts [String] :sent_id Optional sent email ID filter
1042
+ # @option opts [String] :inbox_id Optional inbox ID filter
1043
+ # @option opts [Integer] :timeout Optional timeout milliseconds
1044
+ # @option opts [Integer] :index Zero based index of the delivery status to wait for. If 1 delivery status already and you want to wait for the 2nd pass index&#x3D;1
1045
+ # @option opts [DateTime] :since Filter by created at after the given timestamp
1046
+ # @option opts [DateTime] :before Filter by created at before the given timestamp
1047
+ # @return [DeliveryStatusDto]
1048
+ def wait_for_delivery_statuses(opts = {})
1049
+ data, _status_code, _headers = wait_for_delivery_statuses_with_http_info(opts)
1050
+ data
1051
+ end
1052
+
1053
+ # Wait for delivery statuses
1054
+ # @param [Hash] opts the optional parameters
1055
+ # @option opts [String] :sent_id Optional sent email ID filter
1056
+ # @option opts [String] :inbox_id Optional inbox ID filter
1057
+ # @option opts [Integer] :timeout Optional timeout milliseconds
1058
+ # @option opts [Integer] :index Zero based index of the delivery status to wait for. If 1 delivery status already and you want to wait for the 2nd pass index&#x3D;1
1059
+ # @option opts [DateTime] :since Filter by created at after the given timestamp
1060
+ # @option opts [DateTime] :before Filter by created at before the given timestamp
1061
+ # @return [Array<(DeliveryStatusDto, Integer, Hash)>] DeliveryStatusDto data, response status code and response headers
1062
+ def wait_for_delivery_statuses_with_http_info(opts = {})
1063
+ if @api_client.config.debugging
1064
+ @api_client.config.logger.debug 'Calling API: SentEmailsControllerApi.wait_for_delivery_statuses ...'
1065
+ end
1066
+ if @api_client.config.client_side_validation && !opts[:'index'].nil? && opts[:'index'] > 2147483647
1067
+ fail ArgumentError, 'invalid value for "opts[:"index"]" when calling SentEmailsControllerApi.wait_for_delivery_statuses, must be smaller than or equal to 2147483647.'
1068
+ end
1069
+
1070
+ if @api_client.config.client_side_validation && !opts[:'index'].nil? && opts[:'index'] < 0
1071
+ fail ArgumentError, 'invalid value for "opts[:"index"]" when calling SentEmailsControllerApi.wait_for_delivery_statuses, must be greater than or equal to 0.'
1072
+ end
1073
+
1074
+ # resource path
1075
+ local_var_path = '/sent/delivery-status/wait-for'
1076
+
1077
+ # query parameters
1078
+ query_params = opts[:query_params] || {}
1079
+ query_params[:'sentId'] = opts[:'sent_id'] if !opts[:'sent_id'].nil?
1080
+ query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?
1081
+ query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].nil?
1082
+ query_params[:'index'] = opts[:'index'] if !opts[:'index'].nil?
1083
+ query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?
1084
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
1085
+
1086
+ # header parameters
1087
+ header_params = opts[:header_params] || {}
1088
+ # HTTP header 'Accept' (if needed)
1089
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
1090
+
1091
+ # form parameters
1092
+ form_params = opts[:form_params] || {}
1093
+
1094
+ # http body (model)
1095
+ post_body = opts[:body]
1096
+
1097
+ # return_type
1098
+ return_type = opts[:return_type] || 'DeliveryStatusDto'
1099
+
1100
+ # auth_names
1101
+ auth_names = opts[:auth_names] || ['API_KEY']
1102
+
1103
+ new_options = opts.merge(
1104
+ :header_params => header_params,
1105
+ :query_params => query_params,
1106
+ :form_params => form_params,
1107
+ :body => post_body,
1108
+ :auth_names => auth_names,
1109
+ :return_type => return_type
1110
+ )
1111
+
1112
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1113
+ if @api_client.config.debugging
1114
+ @api_client.config.logger.debug "API called: SentEmailsControllerApi#wait_for_delivery_statuses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1115
+ end
1116
+ return data, status_code, headers
1117
+ end
1038
1118
  end
1039
1119
  end
@@ -140,7 +140,7 @@ module MailSlurpClient
140
140
  # Returns a SMS summary object with content.
141
141
  # @param sms_id [String]
142
142
  # @param [Hash] opts the optional parameters
143
- # @return [SmsMessage]
143
+ # @return [SmsDto]
144
144
  def get_sms_message(sms_id, opts = {})
145
145
  data, _status_code, _headers = get_sms_message_with_http_info(sms_id, opts)
146
146
  data
@@ -150,7 +150,7 @@ module MailSlurpClient
150
150
  # Returns a SMS summary object with content.
151
151
  # @param sms_id [String]
152
152
  # @param [Hash] opts the optional parameters
153
- # @return [Array<(SmsMessage, Integer, Hash)>] SmsMessage data, response status code and response headers
153
+ # @return [Array<(SmsDto, Integer, Hash)>] SmsDto data, response status code and response headers
154
154
  def get_sms_message_with_http_info(sms_id, opts = {})
155
155
  if @api_client.config.debugging
156
156
  @api_client.config.logger.debug 'Calling API: SmsControllerApi.get_sms_message ...'
@@ -177,7 +177,7 @@ module MailSlurpClient
177
177
  post_body = opts[:body]
178
178
 
179
179
  # return_type
180
- return_type = opts[:return_type] || 'SmsMessage'
180
+ return_type = opts[:return_type] || 'SmsDto'
181
181
 
182
182
  # auth_names
183
183
  auth_names = opts[:auth_names] || ['API_KEY']
@@ -260,6 +260,70 @@ module MailSlurpClient
260
260
  return data, status_code, headers
261
261
  end
262
262
 
263
+ # Wait for the latest SMS message to match the provided filter conditions such as body contains keyword.
264
+ # Wait until a phone number meets given conditions or return immediately if already met
265
+ # @param wait_for_single_sms_options [WaitForSingleSmsOptions]
266
+ # @param [Hash] opts the optional parameters
267
+ # @return [SmsDto]
268
+ def wait_for_latest_sms(wait_for_single_sms_options, opts = {})
269
+ data, _status_code, _headers = wait_for_latest_sms_with_http_info(wait_for_single_sms_options, opts)
270
+ data
271
+ end
272
+
273
+ # Wait for the latest SMS message to match the provided filter conditions such as body contains keyword.
274
+ # Wait until a phone number meets given conditions or return immediately if already met
275
+ # @param wait_for_single_sms_options [WaitForSingleSmsOptions]
276
+ # @param [Hash] opts the optional parameters
277
+ # @return [Array<(SmsDto, Integer, Hash)>] SmsDto data, response status code and response headers
278
+ def wait_for_latest_sms_with_http_info(wait_for_single_sms_options, opts = {})
279
+ if @api_client.config.debugging
280
+ @api_client.config.logger.debug 'Calling API: WaitForControllerApi.wait_for_latest_sms ...'
281
+ end
282
+ # verify the required parameter 'wait_for_single_sms_options' is set
283
+ if @api_client.config.client_side_validation && wait_for_single_sms_options.nil?
284
+ fail ArgumentError, "Missing the required parameter 'wait_for_single_sms_options' when calling WaitForControllerApi.wait_for_latest_sms"
285
+ end
286
+ # resource path
287
+ local_var_path = '/waitForLatestSms'
288
+
289
+ # query parameters
290
+ query_params = opts[:query_params] || {}
291
+
292
+ # header parameters
293
+ header_params = opts[:header_params] || {}
294
+ # HTTP header 'Accept' (if needed)
295
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
296
+ # HTTP header 'Content-Type'
297
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
298
+
299
+ # form parameters
300
+ form_params = opts[:form_params] || {}
301
+
302
+ # http body (model)
303
+ post_body = opts[:body] || @api_client.object_to_http_body(wait_for_single_sms_options)
304
+
305
+ # return_type
306
+ return_type = opts[:return_type] || 'SmsDto'
307
+
308
+ # auth_names
309
+ auth_names = opts[:auth_names] || ['API_KEY']
310
+
311
+ new_options = opts.merge(
312
+ :header_params => header_params,
313
+ :query_params => query_params,
314
+ :form_params => form_params,
315
+ :body => post_body,
316
+ :auth_names => auth_names,
317
+ :return_type => return_type
318
+ )
319
+
320
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
321
+ if @api_client.config.debugging
322
+ @api_client.config.logger.debug "API called: WaitForControllerApi#wait_for_latest_sms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
323
+ end
324
+ return data, status_code, headers
325
+ end
326
+
263
327
  # Wait or return list of emails that match simple matching patterns
264
328
  # Perform a search of emails in an inbox with the given patterns. If results match expected count then return or else retry the search until results are found or timeout is reached. Match options allow simple CONTAINS or EQUALS filtering on SUBJECT, TO, BCC, CC, and FROM. See the `MatchOptions` object for options. An example payload is `{ matches: [{field: 'SUBJECT',should:'CONTAIN',value:'needle'}] }`. You can use an array of matches and they will be applied sequentially to filter out emails. If you want to perform matches and extractions of content using Regex patterns see the EmailController `getEmailContentMatch` method.
265
329
  # @param inbox_id [String] Id of the inbox we are fetching emails from
@@ -153,6 +153,76 @@ module MailSlurpClient
153
153
  return data, status_code, headers
154
154
  end
155
155
 
156
+ # Attach a WebHook URL to a phone number
157
+ # Get notified whenever a phone number receives an SMS via a WebHook URL.
158
+ # @param phone_number_id [String]
159
+ # @param create_webhook_options [CreateWebhookOptions]
160
+ # @param [Hash] opts the optional parameters
161
+ # @return [WebhookDto]
162
+ def create_webhook_for_phone_number(phone_number_id, create_webhook_options, opts = {})
163
+ data, _status_code, _headers = create_webhook_for_phone_number_with_http_info(phone_number_id, create_webhook_options, opts)
164
+ data
165
+ end
166
+
167
+ # Attach a WebHook URL to a phone number
168
+ # Get notified whenever a phone number receives an SMS via a WebHook URL.
169
+ # @param phone_number_id [String]
170
+ # @param create_webhook_options [CreateWebhookOptions]
171
+ # @param [Hash] opts the optional parameters
172
+ # @return [Array<(WebhookDto, Integer, Hash)>] WebhookDto data, response status code and response headers
173
+ def create_webhook_for_phone_number_with_http_info(phone_number_id, create_webhook_options, opts = {})
174
+ if @api_client.config.debugging
175
+ @api_client.config.logger.debug 'Calling API: WebhookControllerApi.create_webhook_for_phone_number ...'
176
+ end
177
+ # verify the required parameter 'phone_number_id' is set
178
+ if @api_client.config.client_side_validation && phone_number_id.nil?
179
+ fail ArgumentError, "Missing the required parameter 'phone_number_id' when calling WebhookControllerApi.create_webhook_for_phone_number"
180
+ end
181
+ # verify the required parameter 'create_webhook_options' is set
182
+ if @api_client.config.client_side_validation && create_webhook_options.nil?
183
+ fail ArgumentError, "Missing the required parameter 'create_webhook_options' when calling WebhookControllerApi.create_webhook_for_phone_number"
184
+ end
185
+ # resource path
186
+ local_var_path = '/phone/numbers/{phoneNumberId}/webhooks'.sub('{' + 'phoneNumberId' + '}', CGI.escape(phone_number_id.to_s))
187
+
188
+ # query parameters
189
+ query_params = opts[:query_params] || {}
190
+
191
+ # header parameters
192
+ header_params = opts[:header_params] || {}
193
+ # HTTP header 'Accept' (if needed)
194
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
195
+ # HTTP header 'Content-Type'
196
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
197
+
198
+ # form parameters
199
+ form_params = opts[:form_params] || {}
200
+
201
+ # http body (model)
202
+ post_body = opts[:body] || @api_client.object_to_http_body(create_webhook_options)
203
+
204
+ # return_type
205
+ return_type = opts[:return_type] || 'WebhookDto'
206
+
207
+ # auth_names
208
+ auth_names = opts[:auth_names] || ['API_KEY']
209
+
210
+ new_options = opts.merge(
211
+ :header_params => header_params,
212
+ :query_params => query_params,
213
+ :form_params => form_params,
214
+ :body => post_body,
215
+ :auth_names => auth_names,
216
+ :return_type => return_type
217
+ )
218
+
219
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
220
+ if @api_client.config.debugging
221
+ @api_client.config.logger.debug "API called: WebhookControllerApi#create_webhook_for_phone_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
222
+ end
223
+ return data, status_code, headers
224
+ end
225
+
156
226
  # Delete all webhooks
157
227
  # @param [Hash] opts the optional parameters
158
228
  # @option opts [DateTime] :before before
@@ -19,11 +19,11 @@ module MailSlurpClient
19
19
 
20
20
  attr_accessor :id
21
21
 
22
- attr_accessor :user_id
22
+ attr_accessor :inbox_id
23
23
 
24
24
  attr_accessor :email_address
25
25
 
26
- attr_accessor :inbox_id
26
+ attr_accessor :user_id
27
27
 
28
28
  attr_accessor :created_at
29
29
 
@@ -36,9 +36,9 @@ module MailSlurpClient
36
36
  {
37
37
  :'name' => :'name',
38
38
  :'id' => :'id',
39
- :'user_id' => :'userId',
40
- :'email_address' => :'emailAddress',
41
39
  :'inbox_id' => :'inboxId',
40
+ :'email_address' => :'emailAddress',
41
+ :'user_id' => :'userId',
42
42
  :'created_at' => :'createdAt',
43
43
  :'updated_at' => :'updatedAt',
44
44
  :'use_threads' => :'useThreads'
@@ -50,9 +50,9 @@ module MailSlurpClient
50
50
  {
51
51
  :'name' => :'String',
52
52
  :'id' => :'String',
53
- :'user_id' => :'String',
54
- :'email_address' => :'String',
55
53
  :'inbox_id' => :'String',
54
+ :'email_address' => :'String',
55
+ :'user_id' => :'String',
56
56
  :'created_at' => :'DateTime',
57
57
  :'updated_at' => :'DateTime',
58
58
  :'use_threads' => :'Boolean'
@@ -88,16 +88,16 @@ module MailSlurpClient
88
88
  self.id = attributes[:'id']
89
89
  end
90
90
 
91
- if attributes.key?(:'user_id')
92
- self.user_id = attributes[:'user_id']
91
+ if attributes.key?(:'inbox_id')
92
+ self.inbox_id = attributes[:'inbox_id']
93
93
  end
94
94
 
95
95
  if attributes.key?(:'email_address')
96
96
  self.email_address = attributes[:'email_address']
97
97
  end
98
98
 
99
- if attributes.key?(:'inbox_id')
100
- self.inbox_id = attributes[:'inbox_id']
99
+ if attributes.key?(:'user_id')
100
+ self.user_id = attributes[:'user_id']
101
101
  end
102
102
 
103
103
  if attributes.key?(:'created_at')
@@ -121,16 +121,16 @@ module MailSlurpClient
121
121
  invalid_properties.push('invalid value for "id", id cannot be nil.')
122
122
  end
123
123
 
124
- if @user_id.nil?
125
- invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
124
+ if @inbox_id.nil?
125
+ invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
126
126
  end
127
127
 
128
128
  if @email_address.nil?
129
129
  invalid_properties.push('invalid value for "email_address", email_address cannot be nil.')
130
130
  end
131
131
 
132
- if @inbox_id.nil?
133
- invalid_properties.push('invalid value for "inbox_id", inbox_id cannot be nil.')
132
+ if @user_id.nil?
133
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
134
134
  end
135
135
 
136
136
  if @created_at.nil?
@@ -148,9 +148,9 @@ module MailSlurpClient
148
148
  # @return true if the model is valid
149
149
  def valid?
150
150
  return false if @id.nil?
151
- return false if @user_id.nil?
152
- return false if @email_address.nil?
153
151
  return false if @inbox_id.nil?
152
+ return false if @email_address.nil?
153
+ return false if @user_id.nil?
154
154
  return false if @created_at.nil?
155
155
  return false if @updated_at.nil?
156
156
  true
@@ -163,9 +163,9 @@ module MailSlurpClient
163
163
  self.class == o.class &&
164
164
  name == o.name &&
165
165
  id == o.id &&
166
- user_id == o.user_id &&
167
- email_address == o.email_address &&
168
166
  inbox_id == o.inbox_id &&
167
+ email_address == o.email_address &&
168
+ user_id == o.user_id &&
169
169
  created_at == o.created_at &&
170
170
  updated_at == o.updated_at &&
171
171
  use_threads == o.use_threads
@@ -180,7 +180,7 @@ module MailSlurpClient
180
180
  # Calculates hash code according to all attributes.
181
181
  # @return [Integer] Hash code
182
182
  def hash
183
- [name, id, user_id, email_address, inbox_id, created_at, updated_at, use_threads].hash
183
+ [name, id, inbox_id, email_address, user_id, created_at, updated_at, use_threads].hash
184
184
  end
185
185
 
186
186
  # Builds the object from hash
@@ -24,7 +24,7 @@ module MailSlurpClient
24
24
  # Size of attachment in bytes
25
25
  attr_accessor :content_length
26
26
 
27
- # ID of attachment
27
+ # ID of attachment. Can be used to with attachment controller endpoints to download attachment or with sending methods to attach to an email.
28
28
  attr_accessor :id
29
29
 
30
30
  # Attribute mapping from ruby-style variable name to JSON key.