surge_api 0.16.0 → 0.18.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.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/README.md +56 -21
  4. data/lib/surge_api/client.rb +22 -1
  5. data/lib/surge_api/internal/cursor.rb +2 -2
  6. data/lib/surge_api/internal/transport/base_client.rb +5 -0
  7. data/lib/surge_api/internal/util.rb +22 -7
  8. data/lib/surge_api/models/account_archive_params.rb +9 -1
  9. data/lib/surge_api/models/account_list_params.rb +34 -0
  10. data/lib/surge_api/models/account_retrieve_status_params.rb +9 -1
  11. data/lib/surge_api/models/account_update_params.rb +9 -1
  12. data/lib/surge_api/models/attachment_get_file_params.rb +9 -1
  13. data/lib/surge_api/models/audience_add_contact_params.rb +9 -1
  14. data/lib/surge_api/models/audience_create_params.rb +9 -1
  15. data/lib/surge_api/models/audience_list_contacts_params.rb +9 -1
  16. data/lib/surge_api/models/blast_create_params.rb +9 -1
  17. data/lib/surge_api/models/campaign_create_params.rb +6 -10
  18. data/lib/surge_api/models/campaign_list_params.rb +9 -1
  19. data/lib/surge_api/models/campaign_retrieve_params.rb +9 -1
  20. data/lib/surge_api/models/campaign_update_params.rb +6 -10
  21. data/lib/surge_api/models/contact_create_params.rb +9 -1
  22. data/lib/surge_api/models/contact_list_params.rb +9 -1
  23. data/lib/surge_api/models/contact_retrieve_params.rb +9 -1
  24. data/lib/surge_api/models/contact_update_params.rb +9 -1
  25. data/lib/surge_api/models/message.rb +1 -0
  26. data/lib/surge_api/models/message_create_params.rb +6 -11
  27. data/lib/surge_api/models/message_delivered_webhook_event.rb +1 -0
  28. data/lib/surge_api/models/message_failed_webhook_event.rb +1 -0
  29. data/lib/surge_api/models/message_list_params.rb +9 -1
  30. data/lib/surge_api/models/message_params.rb +74 -2
  31. data/lib/surge_api/models/message_received_webhook_event.rb +1 -0
  32. data/lib/surge_api/models/message_retrieve_params.rb +9 -1
  33. data/lib/surge_api/models/message_sent_webhook_event.rb +1 -0
  34. data/lib/surge_api/models/phone_number.rb +1 -1
  35. data/lib/surge_api/models/phone_number_list_params.rb +9 -1
  36. data/lib/surge_api/models/phone_number_purchase_params.rb +9 -1
  37. data/lib/surge_api/models/phone_number_release_params.rb +22 -0
  38. data/lib/surge_api/models/phone_number_update_params.rb +38 -0
  39. data/lib/surge_api/models/recording_delete_params.rb +9 -1
  40. data/lib/surge_api/models/recording_get_file_params.rb +9 -1
  41. data/lib/surge_api/models/recording_list_params.rb +9 -1
  42. data/lib/surge_api/models/recording_retrieve_params.rb +9 -1
  43. data/lib/surge_api/models/user_create_params.rb +9 -1
  44. data/lib/surge_api/models/user_create_token_params.rb +9 -1
  45. data/lib/surge_api/models/user_delete_params.rb +9 -1
  46. data/lib/surge_api/models/user_list_params.rb +9 -1
  47. data/lib/surge_api/models/user_retrieve_params.rb +9 -1
  48. data/lib/surge_api/models/user_update_params.rb +9 -1
  49. data/lib/surge_api/models/verification_check_params.rb +9 -1
  50. data/lib/surge_api/models/verification_create_params.rb +9 -1
  51. data/lib/surge_api/models.rb +6 -0
  52. data/lib/surge_api/resources/accounts.rb +29 -0
  53. data/lib/surge_api/resources/campaigns.rb +4 -14
  54. data/lib/surge_api/resources/messages.rb +6 -7
  55. data/lib/surge_api/resources/phone_numbers.rb +46 -0
  56. data/lib/surge_api/resources/verifications.rb +7 -4
  57. data/lib/surge_api/resources/webhooks.rb +11 -1
  58. data/lib/surge_api/version.rb +1 -1
  59. data/lib/surge_api.rb +4 -0
  60. data/rbi/surge_api/client.rbi +6 -0
  61. data/rbi/surge_api/internal/util.rbi +8 -0
  62. data/rbi/surge_api/models/account_archive_params.rbi +18 -5
  63. data/rbi/surge_api/models/account_list_params.rbi +59 -0
  64. data/rbi/surge_api/models/account_retrieve_status_params.rbi +8 -0
  65. data/rbi/surge_api/models/account_update_params.rbi +8 -0
  66. data/rbi/surge_api/models/attachment_get_file_params.rbi +18 -5
  67. data/rbi/surge_api/models/audience_add_contact_params.rbi +12 -1
  68. data/rbi/surge_api/models/audience_create_params.rbi +12 -1
  69. data/rbi/surge_api/models/audience_list_contacts_params.rbi +8 -0
  70. data/rbi/surge_api/models/blast_create_params.rbi +8 -0
  71. data/rbi/surge_api/models/campaign_create_params.rbi +7 -27
  72. data/rbi/surge_api/models/campaign_list_params.rbi +8 -0
  73. data/rbi/surge_api/models/campaign_retrieve_params.rbi +18 -5
  74. data/rbi/surge_api/models/campaign_update_params.rbi +7 -27
  75. data/rbi/surge_api/models/contact_create_params.rbi +8 -0
  76. data/rbi/surge_api/models/contact_list_params.rbi +8 -0
  77. data/rbi/surge_api/models/contact_retrieve_params.rbi +18 -5
  78. data/rbi/surge_api/models/contact_update_params.rbi +8 -0
  79. data/rbi/surge_api/models/message.rbi +2 -0
  80. data/rbi/surge_api/models/message_create_params.rbi +7 -29
  81. data/rbi/surge_api/models/message_delivered_webhook_event.rbi +5 -0
  82. data/rbi/surge_api/models/message_failed_webhook_event.rbi +5 -0
  83. data/rbi/surge_api/models/message_list_params.rbi +8 -0
  84. data/rbi/surge_api/models/message_params.rbi +225 -6
  85. data/rbi/surge_api/models/message_received_webhook_event.rbi +5 -0
  86. data/rbi/surge_api/models/message_retrieve_params.rbi +18 -5
  87. data/rbi/surge_api/models/message_sent_webhook_event.rbi +5 -0
  88. data/rbi/surge_api/models/phone_number_list_params.rbi +8 -0
  89. data/rbi/surge_api/models/phone_number_purchase_params.rbi +8 -0
  90. data/rbi/surge_api/models/phone_number_release_params.rbi +40 -0
  91. data/rbi/surge_api/models/phone_number_update_params.rbi +65 -0
  92. data/rbi/surge_api/models/recording_delete_params.rbi +18 -5
  93. data/rbi/surge_api/models/recording_get_file_params.rbi +18 -5
  94. data/rbi/surge_api/models/recording_list_params.rbi +8 -0
  95. data/rbi/surge_api/models/recording_retrieve_params.rbi +18 -5
  96. data/rbi/surge_api/models/user_create_params.rbi +8 -0
  97. data/rbi/surge_api/models/user_create_token_params.rbi +8 -0
  98. data/rbi/surge_api/models/user_delete_params.rbi +18 -5
  99. data/rbi/surge_api/models/user_list_params.rbi +8 -0
  100. data/rbi/surge_api/models/user_retrieve_params.rbi +18 -5
  101. data/rbi/surge_api/models/user_update_params.rbi +8 -0
  102. data/rbi/surge_api/models/verification_check_params.rbi +12 -1
  103. data/rbi/surge_api/models/verification_create_params.rbi +12 -1
  104. data/rbi/surge_api/models.rbi +6 -0
  105. data/rbi/surge_api/resources/accounts.rbi +18 -0
  106. data/rbi/surge_api/resources/campaigns.rbi +10 -2
  107. data/rbi/surge_api/resources/messages.rbi +9 -1
  108. data/rbi/surge_api/resources/phone_numbers.rbi +34 -0
  109. data/rbi/surge_api/resources/verifications.rbi +5 -1
  110. data/rbi/surge_api/resources/webhooks.rbi +10 -2
  111. data/sig/surge_api/client.rbs +3 -0
  112. data/sig/surge_api/internal/util.rbs +4 -0
  113. data/sig/surge_api/models/account_archive_params.rbs +8 -3
  114. data/sig/surge_api/models/account_list_params.rbs +32 -0
  115. data/sig/surge_api/models/account_retrieve_status_params.rbs +5 -0
  116. data/sig/surge_api/models/account_update_params.rbs +5 -0
  117. data/sig/surge_api/models/attachment_get_file_params.rbs +11 -3
  118. data/sig/surge_api/models/audience_add_contact_params.rbs +10 -2
  119. data/sig/surge_api/models/audience_create_params.rbs +6 -1
  120. data/sig/surge_api/models/audience_list_contacts_params.rbs +5 -1
  121. data/sig/surge_api/models/blast_create_params.rbs +5 -0
  122. data/sig/surge_api/models/campaign_create_params.rbs +4 -9
  123. data/sig/surge_api/models/campaign_list_params.rbs +5 -1
  124. data/sig/surge_api/models/campaign_retrieve_params.rbs +8 -3
  125. data/sig/surge_api/models/campaign_update_params.rbs +4 -12
  126. data/sig/surge_api/models/contact_create_params.rbs +5 -0
  127. data/sig/surge_api/models/contact_list_params.rbs +5 -1
  128. data/sig/surge_api/models/contact_retrieve_params.rbs +8 -3
  129. data/sig/surge_api/models/contact_update_params.rbs +5 -0
  130. data/sig/surge_api/models/message.rbs +2 -1
  131. data/sig/surge_api/models/message_create_params.rbs +4 -9
  132. data/sig/surge_api/models/message_delivered_webhook_event.rbs +2 -1
  133. data/sig/surge_api/models/message_failed_webhook_event.rbs +2 -1
  134. data/sig/surge_api/models/message_list_params.rbs +5 -1
  135. data/sig/surge_api/models/message_params.rbs +88 -6
  136. data/sig/surge_api/models/message_received_webhook_event.rbs +2 -1
  137. data/sig/surge_api/models/message_retrieve_params.rbs +8 -3
  138. data/sig/surge_api/models/message_sent_webhook_event.rbs +2 -1
  139. data/sig/surge_api/models/phone_number_list_params.rbs +5 -1
  140. data/sig/surge_api/models/phone_number_purchase_params.rbs +5 -0
  141. data/sig/surge_api/models/phone_number_release_params.rbs +20 -0
  142. data/sig/surge_api/models/phone_number_update_params.rbs +36 -0
  143. data/sig/surge_api/models/recording_delete_params.rbs +8 -3
  144. data/sig/surge_api/models/recording_get_file_params.rbs +11 -3
  145. data/sig/surge_api/models/recording_list_params.rbs +5 -1
  146. data/sig/surge_api/models/recording_retrieve_params.rbs +8 -3
  147. data/sig/surge_api/models/user_create_params.rbs +5 -0
  148. data/sig/surge_api/models/user_create_token_params.rbs +5 -1
  149. data/sig/surge_api/models/user_delete_params.rbs +8 -3
  150. data/sig/surge_api/models/user_list_params.rbs +5 -1
  151. data/sig/surge_api/models/user_retrieve_params.rbs +8 -3
  152. data/sig/surge_api/models/user_update_params.rbs +5 -0
  153. data/sig/surge_api/models/verification_check_params.rbs +6 -1
  154. data/sig/surge_api/models/verification_create_params.rbs +6 -1
  155. data/sig/surge_api/models.rbs +6 -0
  156. data/sig/surge_api/resources/accounts.rbs +6 -0
  157. data/sig/surge_api/resources/campaigns.rbs +2 -2
  158. data/sig/surge_api/resources/messages.rbs +1 -1
  159. data/sig/surge_api/resources/phone_numbers.rbs +12 -0
  160. data/sig/surge_api/resources/verifications.rbs +1 -0
  161. data/sig/surge_api/resources/webhooks.rbs +3 -1
  162. metadata +25 -2
@@ -11,6 +11,10 @@ module SurgeAPI
11
11
  T.any(SurgeAPI::AudienceAddContactParams, SurgeAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # The audience ID to add the contact to.
15
+ sig { returns(String) }
16
+ attr_accessor :audience_id
17
+
14
18
  # The ID of the contact to add. The contact must belong to the same account as the
15
19
  # audience.
16
20
  sig { returns(String) }
@@ -18,11 +22,14 @@ module SurgeAPI
18
22
 
19
23
  sig do
20
24
  params(
25
+ audience_id: String,
21
26
  id: String,
22
27
  request_options: SurgeAPI::RequestOptions::OrHash
23
28
  ).returns(T.attached_class)
24
29
  end
25
30
  def self.new(
31
+ # The audience ID to add the contact to.
32
+ audience_id:,
26
33
  # The ID of the contact to add. The contact must belong to the same account as the
27
34
  # audience.
28
35
  id:,
@@ -32,7 +39,11 @@ module SurgeAPI
32
39
 
33
40
  sig do
34
41
  override.returns(
35
- { id: String, request_options: SurgeAPI::RequestOptions }
42
+ {
43
+ audience_id: String,
44
+ id: String,
45
+ request_options: SurgeAPI::RequestOptions
46
+ }
36
47
  )
37
48
  end
38
49
  def to_hash
@@ -11,17 +11,24 @@ module SurgeAPI
11
11
  T.any(SurgeAPI::AudienceCreateParams, SurgeAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # The account for which the audience should be created.
15
+ sig { returns(String) }
16
+ attr_accessor :account_id
17
+
14
18
  # The audience name.
15
19
  sig { returns(String) }
16
20
  attr_accessor :name
17
21
 
18
22
  sig do
19
23
  params(
24
+ account_id: String,
20
25
  name: String,
21
26
  request_options: SurgeAPI::RequestOptions::OrHash
22
27
  ).returns(T.attached_class)
23
28
  end
24
29
  def self.new(
30
+ # The account for which the audience should be created.
31
+ account_id:,
25
32
  # The audience name.
26
33
  name:,
27
34
  request_options: {}
@@ -30,7 +37,11 @@ module SurgeAPI
30
37
 
31
38
  sig do
32
39
  override.returns(
33
- { name: String, request_options: SurgeAPI::RequestOptions }
40
+ {
41
+ account_id: String,
42
+ name: String,
43
+ request_options: SurgeAPI::RequestOptions
44
+ }
34
45
  )
35
46
  end
36
47
  def to_hash
@@ -14,6 +14,10 @@ module SurgeAPI
14
14
  )
15
15
  end
16
16
 
17
+ # The audience ID to list contacts for.
18
+ sig { returns(String) }
19
+ attr_accessor :audience_id
20
+
17
21
  # Cursor for forward pagination. Use the next_cursor from a previous response.
18
22
  sig { returns(T.nilable(String)) }
19
23
  attr_reader :after
@@ -31,12 +35,15 @@ module SurgeAPI
31
35
 
32
36
  sig do
33
37
  params(
38
+ audience_id: String,
34
39
  after: String,
35
40
  before: String,
36
41
  request_options: SurgeAPI::RequestOptions::OrHash
37
42
  ).returns(T.attached_class)
38
43
  end
39
44
  def self.new(
45
+ # The audience ID to list contacts for.
46
+ audience_id:,
40
47
  # Cursor for forward pagination. Use the next_cursor from a previous response.
41
48
  after: nil,
42
49
  # Cursor for backward pagination. Use the previous_cursor from a previous
@@ -49,6 +56,7 @@ module SurgeAPI
49
56
  sig do
50
57
  override.returns(
51
58
  {
59
+ audience_id: String,
52
60
  after: String,
53
61
  before: String,
54
62
  request_options: SurgeAPI::RequestOptions
@@ -11,6 +11,10 @@ module SurgeAPI
11
11
  T.any(SurgeAPI::BlastCreateParams, SurgeAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # The account for which the blast should be sent.
15
+ sig { returns(String) }
16
+ attr_accessor :account_id
17
+
14
18
  sig do
15
19
  returns(T.nilable(T::Array[SurgeAPI::BlastCreateParams::Attachment]))
16
20
  end
@@ -74,6 +78,7 @@ module SurgeAPI
74
78
 
75
79
  sig do
76
80
  params(
81
+ account_id: String,
77
82
  attachments:
78
83
  T::Array[SurgeAPI::BlastCreateParams::Attachment::OrHash],
79
84
  body: T.nilable(String),
@@ -87,6 +92,8 @@ module SurgeAPI
87
92
  ).returns(T.attached_class)
88
93
  end
89
94
  def self.new(
95
+ # The account for which the blast should be sent.
96
+ account_id:,
90
97
  attachments: nil,
91
98
  # The message body.
92
99
  body: nil,
@@ -112,6 +119,7 @@ module SurgeAPI
112
119
  sig do
113
120
  override.returns(
114
121
  {
122
+ account_id: String,
115
123
  attachments: T::Array[SurgeAPI::BlastCreateParams::Attachment],
116
124
  body: T.nilable(String),
117
125
  contacts: T::Array[String],
@@ -11,46 +11,26 @@ module SurgeAPI
11
11
  T.any(SurgeAPI::CampaignCreateParams, SurgeAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
- # Parameters for creating a new campaign. Either provide full campaign details or
15
- # import using a TCR ID.
16
- sig do
17
- returns(
18
- T.any(
19
- SurgeAPI::CampaignParams::StandardCampaignParams,
20
- SurgeAPI::CampaignParams::ExternalCampaignParams
21
- )
22
- )
23
- end
24
- attr_accessor :campaign_params
14
+ # The account for which the campaign should be created.
15
+ sig { returns(String) }
16
+ attr_accessor :account_id
25
17
 
26
18
  sig do
27
19
  params(
28
- campaign_params:
29
- T.any(
30
- SurgeAPI::CampaignParams::StandardCampaignParams::OrHash,
31
- SurgeAPI::CampaignParams::ExternalCampaignParams::OrHash
32
- ),
20
+ account_id: String,
33
21
  request_options: SurgeAPI::RequestOptions::OrHash
34
22
  ).returns(T.attached_class)
35
23
  end
36
24
  def self.new(
37
- # Parameters for creating a new campaign. Either provide full campaign details or
38
- # import using a TCR ID.
39
- campaign_params:,
25
+ # The account for which the campaign should be created.
26
+ account_id:,
40
27
  request_options: {}
41
28
  )
42
29
  end
43
30
 
44
31
  sig do
45
32
  override.returns(
46
- {
47
- campaign_params:
48
- T.any(
49
- SurgeAPI::CampaignParams::StandardCampaignParams,
50
- SurgeAPI::CampaignParams::ExternalCampaignParams
51
- ),
52
- request_options: SurgeAPI::RequestOptions
53
- }
33
+ { account_id: String, request_options: SurgeAPI::RequestOptions }
54
34
  )
55
35
  end
56
36
  def to_hash
@@ -11,6 +11,10 @@ module SurgeAPI
11
11
  T.any(SurgeAPI::CampaignListParams, SurgeAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # The account ID to list campaigns for.
15
+ sig { returns(String) }
16
+ attr_accessor :account_id
17
+
14
18
  # Cursor for forward pagination. Use the next_cursor from a previous response.
15
19
  sig { returns(T.nilable(String)) }
16
20
  attr_reader :after
@@ -28,12 +32,15 @@ module SurgeAPI
28
32
 
29
33
  sig do
30
34
  params(
35
+ account_id: String,
31
36
  after: String,
32
37
  before: String,
33
38
  request_options: SurgeAPI::RequestOptions::OrHash
34
39
  ).returns(T.attached_class)
35
40
  end
36
41
  def self.new(
42
+ # The account ID to list campaigns for.
43
+ account_id:,
37
44
  # Cursor for forward pagination. Use the next_cursor from a previous response.
38
45
  after: nil,
39
46
  # Cursor for backward pagination. Use the previous_cursor from a previous
@@ -46,6 +53,7 @@ module SurgeAPI
46
53
  sig do
47
54
  override.returns(
48
55
  {
56
+ account_id: String,
49
57
  after: String,
50
58
  before: String,
51
59
  request_options: SurgeAPI::RequestOptions
@@ -11,15 +11,28 @@ module SurgeAPI
11
11
  T.any(SurgeAPI::CampaignRetrieveParams, SurgeAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # The ID of the campaign to retrieve.
15
+ sig { returns(String) }
16
+ attr_accessor :id
17
+
14
18
  sig do
15
- params(request_options: SurgeAPI::RequestOptions::OrHash).returns(
16
- T.attached_class
17
- )
19
+ params(
20
+ id: String,
21
+ request_options: SurgeAPI::RequestOptions::OrHash
22
+ ).returns(T.attached_class)
18
23
  end
19
- def self.new(request_options: {})
24
+ def self.new(
25
+ # The ID of the campaign to retrieve.
26
+ id:,
27
+ request_options: {}
28
+ )
20
29
  end
21
30
 
22
- sig { override.returns({ request_options: SurgeAPI::RequestOptions }) }
31
+ sig do
32
+ override.returns(
33
+ { id: String, request_options: SurgeAPI::RequestOptions }
34
+ )
35
+ end
23
36
  def to_hash
24
37
  end
25
38
  end
@@ -11,46 +11,26 @@ module SurgeAPI
11
11
  T.any(SurgeAPI::CampaignUpdateParams, SurgeAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
- # Parameters for creating a new campaign. Either provide full campaign details or
15
- # import using a TCR ID.
16
- sig do
17
- returns(
18
- T.any(
19
- SurgeAPI::CampaignParams::StandardCampaignParams,
20
- SurgeAPI::CampaignParams::ExternalCampaignParams
21
- )
22
- )
23
- end
24
- attr_accessor :campaign_params
14
+ # The ID of the campaign to update.
15
+ sig { returns(String) }
16
+ attr_accessor :id
25
17
 
26
18
  sig do
27
19
  params(
28
- campaign_params:
29
- T.any(
30
- SurgeAPI::CampaignParams::StandardCampaignParams::OrHash,
31
- SurgeAPI::CampaignParams::ExternalCampaignParams::OrHash
32
- ),
20
+ id: String,
33
21
  request_options: SurgeAPI::RequestOptions::OrHash
34
22
  ).returns(T.attached_class)
35
23
  end
36
24
  def self.new(
37
- # Parameters for creating a new campaign. Either provide full campaign details or
38
- # import using a TCR ID.
39
- campaign_params:,
25
+ # The ID of the campaign to update.
26
+ id:,
40
27
  request_options: {}
41
28
  )
42
29
  end
43
30
 
44
31
  sig do
45
32
  override.returns(
46
- {
47
- campaign_params:
48
- T.any(
49
- SurgeAPI::CampaignParams::StandardCampaignParams,
50
- SurgeAPI::CampaignParams::ExternalCampaignParams
51
- ),
52
- request_options: SurgeAPI::RequestOptions
53
- }
33
+ { id: String, request_options: SurgeAPI::RequestOptions }
54
34
  )
55
35
  end
56
36
  def to_hash
@@ -11,6 +11,10 @@ module SurgeAPI
11
11
  T.any(SurgeAPI::ContactCreateParams, SurgeAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # The account for which the contact should be created.
15
+ sig { returns(String) }
16
+ attr_accessor :account_id
17
+
14
18
  # The contact's phone number in E.164 format.
15
19
  sig { returns(String) }
16
20
  attr_accessor :phone_number
@@ -45,6 +49,7 @@ module SurgeAPI
45
49
 
46
50
  sig do
47
51
  params(
52
+ account_id: String,
48
53
  phone_number: String,
49
54
  email: String,
50
55
  first_name: String,
@@ -54,6 +59,8 @@ module SurgeAPI
54
59
  ).returns(T.attached_class)
55
60
  end
56
61
  def self.new(
62
+ # The account for which the contact should be created.
63
+ account_id:,
57
64
  # The contact's phone number in E.164 format.
58
65
  phone_number:,
59
66
  # The contact's email address.
@@ -71,6 +78,7 @@ module SurgeAPI
71
78
  sig do
72
79
  override.returns(
73
80
  {
81
+ account_id: String,
74
82
  phone_number: String,
75
83
  email: String,
76
84
  first_name: String,
@@ -11,6 +11,10 @@ module SurgeAPI
11
11
  T.any(SurgeAPI::ContactListParams, SurgeAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # The account ID to list contacts for.
15
+ sig { returns(String) }
16
+ attr_accessor :account_id
17
+
14
18
  # Cursor for forward pagination. Use the next_cursor from a previous response.
15
19
  sig { returns(T.nilable(String)) }
16
20
  attr_reader :after
@@ -28,12 +32,15 @@ module SurgeAPI
28
32
 
29
33
  sig do
30
34
  params(
35
+ account_id: String,
31
36
  after: String,
32
37
  before: String,
33
38
  request_options: SurgeAPI::RequestOptions::OrHash
34
39
  ).returns(T.attached_class)
35
40
  end
36
41
  def self.new(
42
+ # The account ID to list contacts for.
43
+ account_id:,
37
44
  # Cursor for forward pagination. Use the next_cursor from a previous response.
38
45
  after: nil,
39
46
  # Cursor for backward pagination. Use the previous_cursor from a previous
@@ -46,6 +53,7 @@ module SurgeAPI
46
53
  sig do
47
54
  override.returns(
48
55
  {
56
+ account_id: String,
49
57
  after: String,
50
58
  before: String,
51
59
  request_options: SurgeAPI::RequestOptions
@@ -11,15 +11,28 @@ module SurgeAPI
11
11
  T.any(SurgeAPI::ContactRetrieveParams, SurgeAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # The ID of the contact to retrieve.
15
+ sig { returns(String) }
16
+ attr_accessor :id
17
+
14
18
  sig do
15
- params(request_options: SurgeAPI::RequestOptions::OrHash).returns(
16
- T.attached_class
17
- )
19
+ params(
20
+ id: String,
21
+ request_options: SurgeAPI::RequestOptions::OrHash
22
+ ).returns(T.attached_class)
18
23
  end
19
- def self.new(request_options: {})
24
+ def self.new(
25
+ # The ID of the contact to retrieve.
26
+ id:,
27
+ request_options: {}
28
+ )
20
29
  end
21
30
 
22
- sig { override.returns({ request_options: SurgeAPI::RequestOptions }) }
31
+ sig do
32
+ override.returns(
33
+ { id: String, request_options: SurgeAPI::RequestOptions }
34
+ )
35
+ end
23
36
  def to_hash
24
37
  end
25
38
  end
@@ -11,6 +11,10 @@ module SurgeAPI
11
11
  T.any(SurgeAPI::ContactUpdateParams, SurgeAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # The ID of the contact to update.
15
+ sig { returns(String) }
16
+ attr_accessor :id
17
+
14
18
  # The contact's phone number in E.164 format.
15
19
  sig { returns(String) }
16
20
  attr_accessor :phone_number
@@ -45,6 +49,7 @@ module SurgeAPI
45
49
 
46
50
  sig do
47
51
  params(
52
+ id: String,
48
53
  phone_number: String,
49
54
  email: String,
50
55
  first_name: String,
@@ -54,6 +59,8 @@ module SurgeAPI
54
59
  ).returns(T.attached_class)
55
60
  end
56
61
  def self.new(
62
+ # The ID of the contact to update.
63
+ id:,
57
64
  # The contact's phone number in E.164 format.
58
65
  phone_number:,
59
66
  # The contact's email address.
@@ -71,6 +78,7 @@ module SurgeAPI
71
78
  sig do
72
79
  override.returns(
73
80
  {
81
+ id: String,
74
82
  phone_number: String,
75
83
  email: String,
76
84
  first_name: String,
@@ -159,6 +159,8 @@ module SurgeAPI
159
159
  IMAGE =
160
160
  T.let(:image, SurgeAPI::Message::Attachment::Type::TaggedSymbol)
161
161
  LINK = T.let(:link, SurgeAPI::Message::Attachment::Type::TaggedSymbol)
162
+ CONTACT =
163
+ T.let(:contact, SurgeAPI::Message::Attachment::Type::TaggedSymbol)
162
164
  VIDEO =
163
165
  T.let(:video, SurgeAPI::Message::Attachment::Type::TaggedSymbol)
164
166
 
@@ -11,48 +11,26 @@ module SurgeAPI
11
11
  T.any(SurgeAPI::MessageCreateParams, SurgeAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
- # Payload for creating a message. Either an attachment or the body must be given.
15
- # You can specify the recipient either using the 'conversation' parameter or the
16
- # 'to'/'from' parameters, but not both.
17
- sig do
18
- returns(
19
- T.any(
20
- SurgeAPI::MessageParams::MessageParamsWithConversation,
21
- SurgeAPI::MessageParams::SimpleMessageParams
22
- )
23
- )
24
- end
25
- attr_accessor :message_params
14
+ # The account from which the message should be sent.
15
+ sig { returns(String) }
16
+ attr_accessor :account_id
26
17
 
27
18
  sig do
28
19
  params(
29
- message_params:
30
- T.any(
31
- SurgeAPI::MessageParams::MessageParamsWithConversation::OrHash,
32
- SurgeAPI::MessageParams::SimpleMessageParams::OrHash
33
- ),
20
+ account_id: String,
34
21
  request_options: SurgeAPI::RequestOptions::OrHash
35
22
  ).returns(T.attached_class)
36
23
  end
37
24
  def self.new(
38
- # Payload for creating a message. Either an attachment or the body must be given.
39
- # You can specify the recipient either using the 'conversation' parameter or the
40
- # 'to'/'from' parameters, but not both.
41
- message_params:,
25
+ # The account from which the message should be sent.
26
+ account_id:,
42
27
  request_options: {}
43
28
  )
44
29
  end
45
30
 
46
31
  sig do
47
32
  override.returns(
48
- {
49
- message_params:
50
- T.any(
51
- SurgeAPI::MessageParams::MessageParamsWithConversation,
52
- SurgeAPI::MessageParams::SimpleMessageParams
53
- ),
54
- request_options: SurgeAPI::RequestOptions
55
- }
33
+ { account_id: String, request_options: SurgeAPI::RequestOptions }
56
34
  )
57
35
  end
58
36
  def to_hash
@@ -329,6 +329,11 @@ module SurgeAPI
329
329
  :link,
330
330
  SurgeAPI::MessageDeliveredWebhookEvent::Data::Attachment::Type::TaggedSymbol
331
331
  )
332
+ CONTACT =
333
+ T.let(
334
+ :contact,
335
+ SurgeAPI::MessageDeliveredWebhookEvent::Data::Attachment::Type::TaggedSymbol
336
+ )
332
337
  VIDEO =
333
338
  T.let(
334
339
  :video,
@@ -333,6 +333,11 @@ module SurgeAPI
333
333
  :link,
334
334
  SurgeAPI::MessageFailedWebhookEvent::Data::Attachment::Type::TaggedSymbol
335
335
  )
336
+ CONTACT =
337
+ T.let(
338
+ :contact,
339
+ SurgeAPI::MessageFailedWebhookEvent::Data::Attachment::Type::TaggedSymbol
340
+ )
336
341
  VIDEO =
337
342
  T.let(
338
343
  :video,
@@ -11,6 +11,10 @@ module SurgeAPI
11
11
  T.any(SurgeAPI::MessageListParams, SurgeAPI::Internal::AnyHash)
12
12
  end
13
13
 
14
+ # The account ID to list messages for.
15
+ sig { returns(String) }
16
+ attr_accessor :account_id
17
+
14
18
  # Cursor for forward pagination. Use the next_cursor from a previous response.
15
19
  sig { returns(T.nilable(String)) }
16
20
  attr_reader :after
@@ -28,12 +32,15 @@ module SurgeAPI
28
32
 
29
33
  sig do
30
34
  params(
35
+ account_id: String,
31
36
  after: String,
32
37
  before: String,
33
38
  request_options: SurgeAPI::RequestOptions::OrHash
34
39
  ).returns(T.attached_class)
35
40
  end
36
41
  def self.new(
42
+ # The account ID to list messages for.
43
+ account_id:,
37
44
  # Cursor for forward pagination. Use the next_cursor from a previous response.
38
45
  after: nil,
39
46
  # Cursor for backward pagination. Use the previous_cursor from a previous
@@ -46,6 +53,7 @@ module SurgeAPI
46
53
  sig do
47
54
  override.returns(
48
55
  {
56
+ account_id: String,
49
57
  after: String,
50
58
  before: String,
51
59
  request_options: SurgeAPI::RequestOptions