telnyx 5.72.0 → 5.73.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -541,6 +541,29 @@ module Telnyx
541
541
  end
542
542
  attr_writer :transcription_config
543
543
 
544
+ # A map of event types to retry policies. Each retry policy contains an array of
545
+ # `retries_ms` specifying the delays between retry attempts in milliseconds.
546
+ # Maximum 5 retries, total delay cannot exceed 60 seconds.
547
+ sig do
548
+ returns(
549
+ T.nilable(
550
+ T::Hash[Symbol, Telnyx::CallDialParams::WebhookRetriesPolicy]
551
+ )
552
+ )
553
+ end
554
+ attr_reader :webhook_retries_policies
555
+
556
+ sig do
557
+ params(
558
+ webhook_retries_policies:
559
+ T::Hash[
560
+ Symbol,
561
+ Telnyx::CallDialParams::WebhookRetriesPolicy::OrHash
562
+ ]
563
+ ).void
564
+ end
565
+ attr_writer :webhook_retries_policies
566
+
544
567
  # Use this field to override the URL for which Telnyx will send subsequent
545
568
  # webhooks to for this call.
546
569
  sig { returns(T.nilable(String)) }
@@ -562,6 +585,30 @@ module Telnyx
562
585
  end
563
586
  attr_writer :webhook_url_method
564
587
 
588
+ # A map of event types to webhook URLs. When an event of the specified type
589
+ # occurs, the webhook URL associated with that event type will be called instead
590
+ # of the default webhook URL. Events not mapped here will use the default webhook
591
+ # URL.
592
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
593
+ attr_reader :webhook_urls
594
+
595
+ sig { params(webhook_urls: T::Hash[Symbol, String]).void }
596
+ attr_writer :webhook_urls
597
+
598
+ # HTTP request method to invoke `webhook_urls`.
599
+ sig do
600
+ returns(T.nilable(Telnyx::CallDialParams::WebhookURLsMethod::OrSymbol))
601
+ end
602
+ attr_reader :webhook_urls_method
603
+
604
+ sig do
605
+ params(
606
+ webhook_urls_method:
607
+ Telnyx::CallDialParams::WebhookURLsMethod::OrSymbol
608
+ ).void
609
+ end
610
+ attr_writer :webhook_urls_method
611
+
565
612
  sig do
566
613
  params(
567
614
  connection_id: String,
@@ -625,9 +672,17 @@ module Telnyx
625
672
  transcription: T::Boolean,
626
673
  transcription_config:
627
674
  Telnyx::Calls::TranscriptionStartRequest::OrHash,
675
+ webhook_retries_policies:
676
+ T::Hash[
677
+ Symbol,
678
+ Telnyx::CallDialParams::WebhookRetriesPolicy::OrHash
679
+ ],
628
680
  webhook_url: String,
629
681
  webhook_url_method:
630
682
  Telnyx::CallDialParams::WebhookURLMethod::OrSymbol,
683
+ webhook_urls: T::Hash[Symbol, String],
684
+ webhook_urls_method:
685
+ Telnyx::CallDialParams::WebhookURLsMethod::OrSymbol,
631
686
  request_options: Telnyx::RequestOptions::OrHash
632
687
  ).returns(T.attached_class)
633
688
  end
@@ -810,11 +865,22 @@ module Telnyx
810
865
  # Enable transcription upon call answer. The default value is false.
811
866
  transcription: nil,
812
867
  transcription_config: nil,
868
+ # A map of event types to retry policies. Each retry policy contains an array of
869
+ # `retries_ms` specifying the delays between retry attempts in milliseconds.
870
+ # Maximum 5 retries, total delay cannot exceed 60 seconds.
871
+ webhook_retries_policies: nil,
813
872
  # Use this field to override the URL for which Telnyx will send subsequent
814
873
  # webhooks to for this call.
815
874
  webhook_url: nil,
816
875
  # HTTP request type used for `webhook_url`.
817
876
  webhook_url_method: nil,
877
+ # A map of event types to webhook URLs. When an event of the specified type
878
+ # occurs, the webhook URL associated with that event type will be called instead
879
+ # of the default webhook URL. Events not mapped here will use the default webhook
880
+ # URL.
881
+ webhook_urls: nil,
882
+ # HTTP request method to invoke `webhook_urls`.
883
+ webhook_urls_method: nil,
818
884
  request_options: {}
819
885
  )
820
886
  end
@@ -883,9 +949,14 @@ module Telnyx
883
949
  timeout_secs: Integer,
884
950
  transcription: T::Boolean,
885
951
  transcription_config: Telnyx::Calls::TranscriptionStartRequest,
952
+ webhook_retries_policies:
953
+ T::Hash[Symbol, Telnyx::CallDialParams::WebhookRetriesPolicy],
886
954
  webhook_url: String,
887
955
  webhook_url_method:
888
956
  Telnyx::CallDialParams::WebhookURLMethod::OrSymbol,
957
+ webhook_urls: T::Hash[Symbol, String],
958
+ webhook_urls_method:
959
+ Telnyx::CallDialParams::WebhookURLsMethod::OrSymbol,
889
960
  request_options: Telnyx::RequestOptions
890
961
  }
891
962
  )
@@ -1764,6 +1835,36 @@ module Telnyx
1764
1835
  end
1765
1836
  end
1766
1837
 
1838
+ class WebhookRetriesPolicy < Telnyx::Internal::Type::BaseModel
1839
+ OrHash =
1840
+ T.type_alias do
1841
+ T.any(
1842
+ Telnyx::CallDialParams::WebhookRetriesPolicy,
1843
+ Telnyx::Internal::AnyHash
1844
+ )
1845
+ end
1846
+
1847
+ # Array of delays in milliseconds between retry attempts. Total sum cannot exceed
1848
+ # 60000ms.
1849
+ sig { returns(T.nilable(T::Array[Integer])) }
1850
+ attr_reader :retries_ms
1851
+
1852
+ sig { params(retries_ms: T::Array[Integer]).void }
1853
+ attr_writer :retries_ms
1854
+
1855
+ sig { params(retries_ms: T::Array[Integer]).returns(T.attached_class) }
1856
+ def self.new(
1857
+ # Array of delays in milliseconds between retry attempts. Total sum cannot exceed
1858
+ # 60000ms.
1859
+ retries_ms: nil
1860
+ )
1861
+ end
1862
+
1863
+ sig { override.returns({ retries_ms: T::Array[Integer] }) }
1864
+ def to_hash
1865
+ end
1866
+ end
1867
+
1767
1868
  # HTTP request type used for `webhook_url`.
1768
1869
  module WebhookURLMethod
1769
1870
  extend Telnyx::Internal::Type::Enum
@@ -1787,6 +1888,30 @@ module Telnyx
1787
1888
  def self.values
1788
1889
  end
1789
1890
  end
1891
+
1892
+ # HTTP request method to invoke `webhook_urls`.
1893
+ module WebhookURLsMethod
1894
+ extend Telnyx::Internal::Type::Enum
1895
+
1896
+ TaggedSymbol =
1897
+ T.type_alias do
1898
+ T.all(Symbol, Telnyx::CallDialParams::WebhookURLsMethod)
1899
+ end
1900
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1901
+
1902
+ POST =
1903
+ T.let(:POST, Telnyx::CallDialParams::WebhookURLsMethod::TaggedSymbol)
1904
+ GET =
1905
+ T.let(:GET, Telnyx::CallDialParams::WebhookURLsMethod::TaggedSymbol)
1906
+
1907
+ sig do
1908
+ override.returns(
1909
+ T::Array[Telnyx::CallDialParams::WebhookURLsMethod::TaggedSymbol]
1910
+ )
1911
+ end
1912
+ def self.values
1913
+ end
1914
+ end
1790
1915
  end
1791
1916
  end
1792
1917
  end