surge_api 0.17.0 → 0.19.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 (164) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/README.md +51 -16
  4. data/lib/surge_api/client.rb +22 -1
  5. data/lib/surge_api/internal/transport/base_client.rb +5 -0
  6. data/lib/surge_api/internal/util.rb +22 -7
  7. data/lib/surge_api/models/account_archive_params.rb +9 -1
  8. data/lib/surge_api/models/account_retrieve_status_params.rb +9 -1
  9. data/lib/surge_api/models/account_update_params.rb +9 -1
  10. data/lib/surge_api/models/attachment_get_file_params.rb +9 -1
  11. data/lib/surge_api/models/audience_add_contact_params.rb +9 -1
  12. data/lib/surge_api/models/audience_create_params.rb +9 -1
  13. data/lib/surge_api/models/audience_list_contacts_params.rb +9 -1
  14. data/lib/surge_api/models/blast_create_params.rb +9 -1
  15. data/lib/surge_api/models/call_ended_webhook_event.rb +25 -1
  16. data/lib/surge_api/models/campaign_create_params.rb +6 -10
  17. data/lib/surge_api/models/campaign_list_params.rb +9 -1
  18. data/lib/surge_api/models/campaign_retrieve_params.rb +9 -1
  19. data/lib/surge_api/models/campaign_update_params.rb +6 -10
  20. data/lib/surge_api/models/contact_create_params.rb +9 -1
  21. data/lib/surge_api/models/contact_list_params.rb +9 -1
  22. data/lib/surge_api/models/contact_retrieve_params.rb +9 -1
  23. data/lib/surge_api/models/contact_update_params.rb +9 -1
  24. data/lib/surge_api/models/message.rb +1 -0
  25. data/lib/surge_api/models/message_create_params.rb +6 -11
  26. data/lib/surge_api/models/message_delivered_webhook_event.rb +1 -0
  27. data/lib/surge_api/models/message_failed_webhook_event.rb +1 -0
  28. data/lib/surge_api/models/message_list_params.rb +9 -1
  29. data/lib/surge_api/models/message_params.rb +74 -2
  30. data/lib/surge_api/models/message_received_webhook_event.rb +1 -0
  31. data/lib/surge_api/models/message_retrieve_params.rb +9 -1
  32. data/lib/surge_api/models/message_sent_webhook_event.rb +1 -0
  33. data/lib/surge_api/models/phone_number.rb +1 -1
  34. data/lib/surge_api/models/phone_number_list_params.rb +9 -1
  35. data/lib/surge_api/models/phone_number_purchase_params.rb +9 -1
  36. data/lib/surge_api/models/phone_number_release_params.rb +22 -0
  37. data/lib/surge_api/models/phone_number_update_params.rb +38 -0
  38. data/lib/surge_api/models/recording_completed_webhook_event.rb +25 -1
  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/voicemail_received_webhook_event.rb +25 -1
  52. data/lib/surge_api/models.rb +4 -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 +3 -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_retrieve_status_params.rbi +8 -0
  64. data/rbi/surge_api/models/account_update_params.rbi +8 -0
  65. data/rbi/surge_api/models/attachment_get_file_params.rbi +18 -5
  66. data/rbi/surge_api/models/audience_add_contact_params.rbi +12 -1
  67. data/rbi/surge_api/models/audience_create_params.rbi +12 -1
  68. data/rbi/surge_api/models/audience_list_contacts_params.rbi +8 -0
  69. data/rbi/surge_api/models/blast_create_params.rbi +8 -0
  70. data/rbi/surge_api/models/call_ended_webhook_event.rbi +27 -3
  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_completed_webhook_event.rbi +27 -3
  93. data/rbi/surge_api/models/recording_delete_params.rbi +18 -5
  94. data/rbi/surge_api/models/recording_get_file_params.rbi +18 -5
  95. data/rbi/surge_api/models/recording_list_params.rbi +8 -0
  96. data/rbi/surge_api/models/recording_retrieve_params.rbi +18 -5
  97. data/rbi/surge_api/models/user_create_params.rbi +8 -0
  98. data/rbi/surge_api/models/user_create_token_params.rbi +8 -0
  99. data/rbi/surge_api/models/user_delete_params.rbi +18 -5
  100. data/rbi/surge_api/models/user_list_params.rbi +8 -0
  101. data/rbi/surge_api/models/user_retrieve_params.rbi +18 -5
  102. data/rbi/surge_api/models/user_update_params.rbi +8 -0
  103. data/rbi/surge_api/models/verification_check_params.rbi +12 -1
  104. data/rbi/surge_api/models/verification_create_params.rbi +12 -1
  105. data/rbi/surge_api/models/voicemail_received_webhook_event.rbi +27 -3
  106. data/rbi/surge_api/models.rbi +4 -0
  107. data/rbi/surge_api/resources/campaigns.rbi +10 -2
  108. data/rbi/surge_api/resources/messages.rbi +9 -1
  109. data/rbi/surge_api/resources/phone_numbers.rbi +34 -0
  110. data/rbi/surge_api/resources/verifications.rbi +5 -1
  111. data/rbi/surge_api/resources/webhooks.rbi +10 -2
  112. data/sig/surge_api/client.rbs +3 -0
  113. data/sig/surge_api/internal/util.rbs +4 -0
  114. data/sig/surge_api/models/account_archive_params.rbs +8 -3
  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/call_ended_webhook_event.rbs +18 -3
  123. data/sig/surge_api/models/campaign_create_params.rbs +4 -9
  124. data/sig/surge_api/models/campaign_list_params.rbs +5 -1
  125. data/sig/surge_api/models/campaign_retrieve_params.rbs +8 -3
  126. data/sig/surge_api/models/campaign_update_params.rbs +4 -12
  127. data/sig/surge_api/models/contact_create_params.rbs +5 -0
  128. data/sig/surge_api/models/contact_list_params.rbs +5 -1
  129. data/sig/surge_api/models/contact_retrieve_params.rbs +8 -3
  130. data/sig/surge_api/models/contact_update_params.rbs +5 -0
  131. data/sig/surge_api/models/message.rbs +2 -1
  132. data/sig/surge_api/models/message_create_params.rbs +4 -9
  133. data/sig/surge_api/models/message_delivered_webhook_event.rbs +2 -1
  134. data/sig/surge_api/models/message_failed_webhook_event.rbs +2 -1
  135. data/sig/surge_api/models/message_list_params.rbs +5 -1
  136. data/sig/surge_api/models/message_params.rbs +88 -6
  137. data/sig/surge_api/models/message_received_webhook_event.rbs +2 -1
  138. data/sig/surge_api/models/message_retrieve_params.rbs +8 -3
  139. data/sig/surge_api/models/message_sent_webhook_event.rbs +2 -1
  140. data/sig/surge_api/models/phone_number_list_params.rbs +5 -1
  141. data/sig/surge_api/models/phone_number_purchase_params.rbs +5 -0
  142. data/sig/surge_api/models/phone_number_release_params.rbs +20 -0
  143. data/sig/surge_api/models/phone_number_update_params.rbs +36 -0
  144. data/sig/surge_api/models/recording_completed_webhook_event.rbs +18 -3
  145. data/sig/surge_api/models/recording_delete_params.rbs +8 -3
  146. data/sig/surge_api/models/recording_get_file_params.rbs +11 -3
  147. data/sig/surge_api/models/recording_list_params.rbs +5 -1
  148. data/sig/surge_api/models/recording_retrieve_params.rbs +8 -3
  149. data/sig/surge_api/models/user_create_params.rbs +5 -0
  150. data/sig/surge_api/models/user_create_token_params.rbs +5 -1
  151. data/sig/surge_api/models/user_delete_params.rbs +8 -3
  152. data/sig/surge_api/models/user_list_params.rbs +5 -1
  153. data/sig/surge_api/models/user_retrieve_params.rbs +8 -3
  154. data/sig/surge_api/models/user_update_params.rbs +5 -0
  155. data/sig/surge_api/models/verification_check_params.rbs +6 -1
  156. data/sig/surge_api/models/verification_create_params.rbs +6 -1
  157. data/sig/surge_api/models/voicemail_received_webhook_event.rbs +18 -3
  158. data/sig/surge_api/models.rbs +4 -0
  159. data/sig/surge_api/resources/campaigns.rbs +2 -2
  160. data/sig/surge_api/resources/messages.rbs +1 -1
  161. data/sig/surge_api/resources/phone_numbers.rbs +12 -0
  162. data/sig/surge_api/resources/verifications.rbs +1 -0
  163. data/sig/surge_api/resources/webhooks.rbs +3 -1
  164. metadata +22 -2
@@ -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],
@@ -94,6 +94,18 @@ module SurgeAPI
94
94
  end
95
95
  attr_accessor :status
96
96
 
97
+ # The E.164 phone number of the caller
98
+ sig { returns(T.nilable(String)) }
99
+ attr_accessor :from
100
+
101
+ # The Surge phone number ID (e.g. pn\_...)
102
+ sig { returns(T.nilable(String)) }
103
+ attr_accessor :phone_number_id
104
+
105
+ # The E.164 phone number of the callee
106
+ sig { returns(T.nilable(String)) }
107
+ attr_accessor :to
108
+
97
109
  # The data associated with the event
98
110
  sig do
99
111
  params(
@@ -101,7 +113,10 @@ module SurgeAPI
101
113
  contact: SurgeAPI::Contact::OrHash,
102
114
  duration: Integer,
103
115
  initiated_at: Time,
104
- status: SurgeAPI::CallEndedWebhookEvent::Data::Status::OrSymbol
116
+ status: SurgeAPI::CallEndedWebhookEvent::Data::Status::OrSymbol,
117
+ from: T.nilable(String),
118
+ phone_number_id: T.nilable(String),
119
+ to: T.nilable(String)
105
120
  ).returns(T.attached_class)
106
121
  end
107
122
  def self.new(
@@ -114,7 +129,13 @@ module SurgeAPI
114
129
  # When the call was initiated
115
130
  initiated_at:,
116
131
  # The status of the call
117
- status:
132
+ status:,
133
+ # The E.164 phone number of the caller
134
+ from: nil,
135
+ # The Surge phone number ID (e.g. pn\_...)
136
+ phone_number_id: nil,
137
+ # The E.164 phone number of the callee
138
+ to: nil
118
139
  )
119
140
  end
120
141
 
@@ -126,7 +147,10 @@ module SurgeAPI
126
147
  duration: Integer,
127
148
  initiated_at: Time,
128
149
  status:
129
- SurgeAPI::CallEndedWebhookEvent::Data::Status::TaggedSymbol
150
+ SurgeAPI::CallEndedWebhookEvent::Data::Status::TaggedSymbol,
151
+ from: T.nilable(String),
152
+ phone_number_id: T.nilable(String),
153
+ to: T.nilable(String)
130
154
  }
131
155
  )
132
156
  end
@@ -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