surge_api 0.17.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 (155) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -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/campaign_create_params.rb +6 -10
  16. data/lib/surge_api/models/campaign_list_params.rb +9 -1
  17. data/lib/surge_api/models/campaign_retrieve_params.rb +9 -1
  18. data/lib/surge_api/models/campaign_update_params.rb +6 -10
  19. data/lib/surge_api/models/contact_create_params.rb +9 -1
  20. data/lib/surge_api/models/contact_list_params.rb +9 -1
  21. data/lib/surge_api/models/contact_retrieve_params.rb +9 -1
  22. data/lib/surge_api/models/contact_update_params.rb +9 -1
  23. data/lib/surge_api/models/message.rb +1 -0
  24. data/lib/surge_api/models/message_create_params.rb +6 -11
  25. data/lib/surge_api/models/message_delivered_webhook_event.rb +1 -0
  26. data/lib/surge_api/models/message_failed_webhook_event.rb +1 -0
  27. data/lib/surge_api/models/message_list_params.rb +9 -1
  28. data/lib/surge_api/models/message_params.rb +74 -2
  29. data/lib/surge_api/models/message_received_webhook_event.rb +1 -0
  30. data/lib/surge_api/models/message_retrieve_params.rb +9 -1
  31. data/lib/surge_api/models/message_sent_webhook_event.rb +1 -0
  32. data/lib/surge_api/models/phone_number.rb +1 -1
  33. data/lib/surge_api/models/phone_number_list_params.rb +9 -1
  34. data/lib/surge_api/models/phone_number_purchase_params.rb +9 -1
  35. data/lib/surge_api/models/phone_number_release_params.rb +22 -0
  36. data/lib/surge_api/models/phone_number_update_params.rb +38 -0
  37. data/lib/surge_api/models/recording_delete_params.rb +9 -1
  38. data/lib/surge_api/models/recording_get_file_params.rb +9 -1
  39. data/lib/surge_api/models/recording_list_params.rb +9 -1
  40. data/lib/surge_api/models/recording_retrieve_params.rb +9 -1
  41. data/lib/surge_api/models/user_create_params.rb +9 -1
  42. data/lib/surge_api/models/user_create_token_params.rb +9 -1
  43. data/lib/surge_api/models/user_delete_params.rb +9 -1
  44. data/lib/surge_api/models/user_list_params.rb +9 -1
  45. data/lib/surge_api/models/user_retrieve_params.rb +9 -1
  46. data/lib/surge_api/models/user_update_params.rb +9 -1
  47. data/lib/surge_api/models/verification_check_params.rb +9 -1
  48. data/lib/surge_api/models/verification_create_params.rb +9 -1
  49. data/lib/surge_api/models.rb +4 -0
  50. data/lib/surge_api/resources/campaigns.rb +4 -14
  51. data/lib/surge_api/resources/messages.rb +6 -7
  52. data/lib/surge_api/resources/phone_numbers.rb +46 -0
  53. data/lib/surge_api/resources/verifications.rb +7 -4
  54. data/lib/surge_api/resources/webhooks.rb +11 -1
  55. data/lib/surge_api/version.rb +1 -1
  56. data/lib/surge_api.rb +3 -0
  57. data/rbi/surge_api/client.rbi +6 -0
  58. data/rbi/surge_api/internal/util.rbi +8 -0
  59. data/rbi/surge_api/models/account_archive_params.rbi +18 -5
  60. data/rbi/surge_api/models/account_retrieve_status_params.rbi +8 -0
  61. data/rbi/surge_api/models/account_update_params.rbi +8 -0
  62. data/rbi/surge_api/models/attachment_get_file_params.rbi +18 -5
  63. data/rbi/surge_api/models/audience_add_contact_params.rbi +12 -1
  64. data/rbi/surge_api/models/audience_create_params.rbi +12 -1
  65. data/rbi/surge_api/models/audience_list_contacts_params.rbi +8 -0
  66. data/rbi/surge_api/models/blast_create_params.rbi +8 -0
  67. data/rbi/surge_api/models/campaign_create_params.rbi +7 -27
  68. data/rbi/surge_api/models/campaign_list_params.rbi +8 -0
  69. data/rbi/surge_api/models/campaign_retrieve_params.rbi +18 -5
  70. data/rbi/surge_api/models/campaign_update_params.rbi +7 -27
  71. data/rbi/surge_api/models/contact_create_params.rbi +8 -0
  72. data/rbi/surge_api/models/contact_list_params.rbi +8 -0
  73. data/rbi/surge_api/models/contact_retrieve_params.rbi +18 -5
  74. data/rbi/surge_api/models/contact_update_params.rbi +8 -0
  75. data/rbi/surge_api/models/message.rbi +2 -0
  76. data/rbi/surge_api/models/message_create_params.rbi +7 -29
  77. data/rbi/surge_api/models/message_delivered_webhook_event.rbi +5 -0
  78. data/rbi/surge_api/models/message_failed_webhook_event.rbi +5 -0
  79. data/rbi/surge_api/models/message_list_params.rbi +8 -0
  80. data/rbi/surge_api/models/message_params.rbi +225 -6
  81. data/rbi/surge_api/models/message_received_webhook_event.rbi +5 -0
  82. data/rbi/surge_api/models/message_retrieve_params.rbi +18 -5
  83. data/rbi/surge_api/models/message_sent_webhook_event.rbi +5 -0
  84. data/rbi/surge_api/models/phone_number_list_params.rbi +8 -0
  85. data/rbi/surge_api/models/phone_number_purchase_params.rbi +8 -0
  86. data/rbi/surge_api/models/phone_number_release_params.rbi +40 -0
  87. data/rbi/surge_api/models/phone_number_update_params.rbi +65 -0
  88. data/rbi/surge_api/models/recording_delete_params.rbi +18 -5
  89. data/rbi/surge_api/models/recording_get_file_params.rbi +18 -5
  90. data/rbi/surge_api/models/recording_list_params.rbi +8 -0
  91. data/rbi/surge_api/models/recording_retrieve_params.rbi +18 -5
  92. data/rbi/surge_api/models/user_create_params.rbi +8 -0
  93. data/rbi/surge_api/models/user_create_token_params.rbi +8 -0
  94. data/rbi/surge_api/models/user_delete_params.rbi +18 -5
  95. data/rbi/surge_api/models/user_list_params.rbi +8 -0
  96. data/rbi/surge_api/models/user_retrieve_params.rbi +18 -5
  97. data/rbi/surge_api/models/user_update_params.rbi +8 -0
  98. data/rbi/surge_api/models/verification_check_params.rbi +12 -1
  99. data/rbi/surge_api/models/verification_create_params.rbi +12 -1
  100. data/rbi/surge_api/models.rbi +4 -0
  101. data/rbi/surge_api/resources/campaigns.rbi +10 -2
  102. data/rbi/surge_api/resources/messages.rbi +9 -1
  103. data/rbi/surge_api/resources/phone_numbers.rbi +34 -0
  104. data/rbi/surge_api/resources/verifications.rbi +5 -1
  105. data/rbi/surge_api/resources/webhooks.rbi +10 -2
  106. data/sig/surge_api/client.rbs +3 -0
  107. data/sig/surge_api/internal/util.rbs +4 -0
  108. data/sig/surge_api/models/account_archive_params.rbs +8 -3
  109. data/sig/surge_api/models/account_retrieve_status_params.rbs +5 -0
  110. data/sig/surge_api/models/account_update_params.rbs +5 -0
  111. data/sig/surge_api/models/attachment_get_file_params.rbs +11 -3
  112. data/sig/surge_api/models/audience_add_contact_params.rbs +10 -2
  113. data/sig/surge_api/models/audience_create_params.rbs +6 -1
  114. data/sig/surge_api/models/audience_list_contacts_params.rbs +5 -1
  115. data/sig/surge_api/models/blast_create_params.rbs +5 -0
  116. data/sig/surge_api/models/campaign_create_params.rbs +4 -9
  117. data/sig/surge_api/models/campaign_list_params.rbs +5 -1
  118. data/sig/surge_api/models/campaign_retrieve_params.rbs +8 -3
  119. data/sig/surge_api/models/campaign_update_params.rbs +4 -12
  120. data/sig/surge_api/models/contact_create_params.rbs +5 -0
  121. data/sig/surge_api/models/contact_list_params.rbs +5 -1
  122. data/sig/surge_api/models/contact_retrieve_params.rbs +8 -3
  123. data/sig/surge_api/models/contact_update_params.rbs +5 -0
  124. data/sig/surge_api/models/message.rbs +2 -1
  125. data/sig/surge_api/models/message_create_params.rbs +4 -9
  126. data/sig/surge_api/models/message_delivered_webhook_event.rbs +2 -1
  127. data/sig/surge_api/models/message_failed_webhook_event.rbs +2 -1
  128. data/sig/surge_api/models/message_list_params.rbs +5 -1
  129. data/sig/surge_api/models/message_params.rbs +88 -6
  130. data/sig/surge_api/models/message_received_webhook_event.rbs +2 -1
  131. data/sig/surge_api/models/message_retrieve_params.rbs +8 -3
  132. data/sig/surge_api/models/message_sent_webhook_event.rbs +2 -1
  133. data/sig/surge_api/models/phone_number_list_params.rbs +5 -1
  134. data/sig/surge_api/models/phone_number_purchase_params.rbs +5 -0
  135. data/sig/surge_api/models/phone_number_release_params.rbs +20 -0
  136. data/sig/surge_api/models/phone_number_update_params.rbs +36 -0
  137. data/sig/surge_api/models/recording_delete_params.rbs +8 -3
  138. data/sig/surge_api/models/recording_get_file_params.rbs +11 -3
  139. data/sig/surge_api/models/recording_list_params.rbs +5 -1
  140. data/sig/surge_api/models/recording_retrieve_params.rbs +8 -3
  141. data/sig/surge_api/models/user_create_params.rbs +5 -0
  142. data/sig/surge_api/models/user_create_token_params.rbs +5 -1
  143. data/sig/surge_api/models/user_delete_params.rbs +8 -3
  144. data/sig/surge_api/models/user_list_params.rbs +5 -1
  145. data/sig/surge_api/models/user_retrieve_params.rbs +8 -3
  146. data/sig/surge_api/models/user_update_params.rbs +5 -0
  147. data/sig/surge_api/models/verification_check_params.rbs +6 -1
  148. data/sig/surge_api/models/verification_create_params.rbs +6 -1
  149. data/sig/surge_api/models.rbs +4 -0
  150. data/sig/surge_api/resources/campaigns.rbs +2 -2
  151. data/sig/surge_api/resources/messages.rbs +1 -1
  152. data/sig/surge_api/resources/phone_numbers.rbs +12 -0
  153. data/sig/surge_api/resources/verifications.rbs +1 -0
  154. data/sig/surge_api/resources/webhooks.rbs +3 -1
  155. metadata +22 -2
@@ -7,7 +7,11 @@ module SurgeAPI
7
7
  sig do
8
8
  params(
9
9
  account_id: String,
10
- campaign_params: SurgeAPI::CampaignParams,
10
+ campaign_params:
11
+ T.any(
12
+ SurgeAPI::CampaignParams::StandardCampaignParams::OrHash,
13
+ SurgeAPI::CampaignParams::ExternalCampaignParams::OrHash
14
+ ),
11
15
  request_options: SurgeAPI::RequestOptions::OrHash
12
16
  ).returns(SurgeAPI::Campaign)
13
17
  end
@@ -42,7 +46,11 @@ module SurgeAPI
42
46
  sig do
43
47
  params(
44
48
  id: String,
45
- campaign_params: SurgeAPI::CampaignParams,
49
+ campaign_params:
50
+ T.any(
51
+ SurgeAPI::CampaignParams::StandardCampaignParams::OrHash,
52
+ SurgeAPI::CampaignParams::ExternalCampaignParams::OrHash
53
+ ),
46
54
  request_options: SurgeAPI::RequestOptions::OrHash
47
55
  ).returns(SurgeAPI::Campaign)
48
56
  end
@@ -28,10 +28,18 @@ module SurgeAPI
28
28
  # are provided. Similarly the `from` field cannot be used together with the
29
29
  # `conversation` field, and `conversation.phone_number` should be specified
30
30
  # instead.
31
+ #
32
+ # Optionally, you can pass a `settings` object to override account-level settings
33
+ # for this message. Currently the only supported setting is `link_shortening`,
34
+ # which accepts `"enabled"` or `"disabled"`.
31
35
  sig do
32
36
  params(
33
37
  account_id: String,
34
- message_params: SurgeAPI::MessageParams,
38
+ message_params:
39
+ T.any(
40
+ SurgeAPI::MessageParams::MessageParamsWithConversation::OrHash,
41
+ SurgeAPI::MessageParams::SimpleMessageParams::OrHash
42
+ ),
35
43
  request_options: SurgeAPI::RequestOptions::OrHash
36
44
  ).returns(SurgeAPI::Message)
37
45
  end
@@ -3,6 +3,26 @@
3
3
  module SurgeAPI
4
4
  module Resources
5
5
  class PhoneNumbers
6
+ # Updates a phone number's details.
7
+ sig do
8
+ params(
9
+ id: String,
10
+ campaign_id: String,
11
+ name: String,
12
+ request_options: SurgeAPI::RequestOptions::OrHash
13
+ ).returns(SurgeAPI::PhoneNumber)
14
+ end
15
+ def update(
16
+ # The ID of the phone number to update.
17
+ id,
18
+ # Campaign ID to attach this number to (`cpn_...`).
19
+ campaign_id: nil,
20
+ # A human-readable name for the phone number.
21
+ name: nil,
22
+ request_options: {}
23
+ )
24
+ end
25
+
6
26
  # List all phone numbers for an account with cursor-based pagination.
7
27
  sig do
8
28
  params(
@@ -59,6 +79,20 @@ module SurgeAPI
59
79
  )
60
80
  end
61
81
 
82
+ # Releases a phone number from the account.
83
+ sig do
84
+ params(
85
+ id: String,
86
+ request_options: SurgeAPI::RequestOptions::OrHash
87
+ ).returns(SurgeAPI::PhoneNumber)
88
+ end
89
+ def release(
90
+ # The ID of the phone number to release.
91
+ id,
92
+ request_options: {}
93
+ )
94
+ end
95
+
62
96
  # @api private
63
97
  sig { params(client: SurgeAPI::Client).returns(T.attached_class) }
64
98
  def self.new(client:)
@@ -3,14 +3,18 @@
3
3
  module SurgeAPI
4
4
  module Resources
5
5
  class Verifications
6
- # Creates a new Verification and sends the code to the given phone number.
6
+ # Creates a new Verification for an account and sends the code to the given phone
7
+ # number.
7
8
  sig do
8
9
  params(
10
+ account_id: String,
9
11
  phone_number: String,
10
12
  request_options: SurgeAPI::RequestOptions::OrHash
11
13
  ).returns(SurgeAPI::Verification)
12
14
  end
13
15
  def create(
16
+ # The account to associate with the verification.
17
+ account_id,
14
18
  # The phone number to be verified. In E.164 format.
15
19
  phone_number:,
16
20
  request_options: {}
@@ -4,7 +4,11 @@ module SurgeAPI
4
4
  module Resources
5
5
  class Webhooks
6
6
  sig do
7
- params(payload: String).returns(
7
+ params(
8
+ payload: String,
9
+ headers: T::Hash[String, String],
10
+ key: T.nilable(String)
11
+ ).returns(
8
12
  T.any(
9
13
  SurgeAPI::CallEndedWebhookEvent,
10
14
  SurgeAPI::CampaignApprovedWebhookEvent,
@@ -24,7 +28,11 @@ module SurgeAPI
24
28
  end
25
29
  def unwrap(
26
30
  # The raw webhook payload as a string
27
- payload
31
+ payload,
32
+ # The raw HTTP headers that came with the payload
33
+ headers:,
34
+ # The webhook signing key
35
+ key: @client.webhook_signing_secret
28
36
  )
29
37
  end
30
38
 
@@ -10,6 +10,8 @@ module SurgeAPI
10
10
 
11
11
  attr_reader api_key: String
12
12
 
13
+ attr_reader webhook_signing_secret: String?
14
+
13
15
  attr_reader accounts: SurgeAPI::Resources::Accounts
14
16
 
15
17
  attr_reader attachments: SurgeAPI::Resources::Attachments
@@ -38,6 +40,7 @@ module SurgeAPI
38
40
 
39
41
  def initialize: (
40
42
  ?api_key: String?,
43
+ ?webhook_signing_secret: String?,
41
44
  ?base_url: String?,
42
45
  ?max_retries: Integer,
43
46
  ?timeout: Float,
@@ -45,8 +45,12 @@ module SurgeAPI
45
45
  -> top?
46
46
  } -> top?
47
47
 
48
+ RFC_3986_NOT_PCHARS: Regexp
49
+
48
50
  def self?.uri_origin: (URI::Generic uri) -> String
49
51
 
52
+ def self?.encode_path: (String | Integer path) -> String
53
+
50
54
  def self?.interpolate_path: (String | ::Array[String] path) -> String
51
55
 
52
56
  def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]]
@@ -1,15 +1,20 @@
1
1
  module SurgeAPI
2
2
  module Models
3
3
  type account_archive_params =
4
- { } & SurgeAPI::Internal::Type::request_parameters
4
+ { id: String } & SurgeAPI::Internal::Type::request_parameters
5
5
 
6
6
  class AccountArchiveParams < SurgeAPI::Internal::Type::BaseModel
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
- def initialize: (?request_options: SurgeAPI::request_opts) -> void
10
+ attr_accessor id: String
11
11
 
12
- def to_hash: -> { request_options: SurgeAPI::RequestOptions }
12
+ def initialize: (
13
+ id: String,
14
+ ?request_options: SurgeAPI::request_opts
15
+ ) -> void
16
+
17
+ def to_hash: -> { id: String, request_options: SurgeAPI::RequestOptions }
13
18
  end
14
19
  end
15
20
  end
@@ -2,6 +2,7 @@ module SurgeAPI
2
2
  module Models
3
3
  type account_retrieve_status_params =
4
4
  {
5
+ account_id: String,
5
6
  capabilities: ::Array[SurgeAPI::Models::AccountRetrieveStatusParams::capability]
6
7
  }
7
8
  & SurgeAPI::Internal::Type::request_parameters
@@ -10,6 +11,8 @@ module SurgeAPI
10
11
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
11
12
  include SurgeAPI::Internal::Type::RequestParameters
12
13
 
14
+ attr_accessor account_id: String
15
+
13
16
  attr_reader capabilities: ::Array[SurgeAPI::Models::AccountRetrieveStatusParams::capability]?
14
17
 
15
18
  def capabilities=: (
@@ -17,11 +20,13 @@ module SurgeAPI
17
20
  ) -> ::Array[SurgeAPI::Models::AccountRetrieveStatusParams::capability]
18
21
 
19
22
  def initialize: (
23
+ account_id: String,
20
24
  ?capabilities: ::Array[SurgeAPI::Models::AccountRetrieveStatusParams::capability],
21
25
  ?request_options: SurgeAPI::request_opts
22
26
  ) -> void
23
27
 
24
28
  def to_hash: -> {
29
+ account_id: String,
25
30
  capabilities: ::Array[SurgeAPI::Models::AccountRetrieveStatusParams::capability],
26
31
  request_options: SurgeAPI::RequestOptions
27
32
  }
@@ -2,6 +2,7 @@ module SurgeAPI
2
2
  module Models
3
3
  type account_update_params =
4
4
  {
5
+ id: String,
5
6
  brand_name: String,
6
7
  name: String,
7
8
  organization: SurgeAPI::AccountUpdateParams::Organization,
@@ -13,6 +14,8 @@ module SurgeAPI
13
14
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
14
15
  include SurgeAPI::Internal::Type::RequestParameters
15
16
 
17
+ attr_accessor id: String
18
+
16
19
  attr_reader brand_name: String?
17
20
 
18
21
  def brand_name=: (String) -> String
@@ -30,6 +33,7 @@ module SurgeAPI
30
33
  attr_accessor time_zone: String?
31
34
 
32
35
  def initialize: (
36
+ id: String,
33
37
  ?brand_name: String,
34
38
  ?name: String,
35
39
  ?organization: SurgeAPI::AccountUpdateParams::Organization,
@@ -38,6 +42,7 @@ module SurgeAPI
38
42
  ) -> void
39
43
 
40
44
  def to_hash: -> {
45
+ id: String,
41
46
  brand_name: String,
42
47
  name: String,
43
48
  organization: SurgeAPI::AccountUpdateParams::Organization,
@@ -1,15 +1,23 @@
1
1
  module SurgeAPI
2
2
  module Models
3
3
  type attachment_get_file_params =
4
- { } & SurgeAPI::Internal::Type::request_parameters
4
+ { attachment_id: String } & SurgeAPI::Internal::Type::request_parameters
5
5
 
6
6
  class AttachmentGetFileParams < SurgeAPI::Internal::Type::BaseModel
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
- def initialize: (?request_options: SurgeAPI::request_opts) -> void
10
+ attr_accessor attachment_id: String
11
11
 
12
- def to_hash: -> { request_options: SurgeAPI::RequestOptions }
12
+ def initialize: (
13
+ attachment_id: String,
14
+ ?request_options: SurgeAPI::request_opts
15
+ ) -> void
16
+
17
+ def to_hash: -> {
18
+ attachment_id: String,
19
+ request_options: SurgeAPI::RequestOptions
20
+ }
13
21
  end
14
22
  end
15
23
  end
@@ -1,20 +1,28 @@
1
1
  module SurgeAPI
2
2
  module Models
3
3
  type audience_add_contact_params =
4
- { id: String } & SurgeAPI::Internal::Type::request_parameters
4
+ { audience_id: String, id: String }
5
+ & SurgeAPI::Internal::Type::request_parameters
5
6
 
6
7
  class AudienceAddContactParams < SurgeAPI::Internal::Type::BaseModel
7
8
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
9
  include SurgeAPI::Internal::Type::RequestParameters
9
10
 
11
+ attr_accessor audience_id: String
12
+
10
13
  attr_accessor id: String
11
14
 
12
15
  def initialize: (
16
+ audience_id: String,
13
17
  id: String,
14
18
  ?request_options: SurgeAPI::request_opts
15
19
  ) -> void
16
20
 
17
- def to_hash: -> { id: String, request_options: SurgeAPI::RequestOptions }
21
+ def to_hash: -> {
22
+ audience_id: String,
23
+ id: String,
24
+ request_options: SurgeAPI::RequestOptions
25
+ }
18
26
  end
19
27
  end
20
28
  end
@@ -1,20 +1,25 @@
1
1
  module SurgeAPI
2
2
  module Models
3
3
  type audience_create_params =
4
- { name: String } & SurgeAPI::Internal::Type::request_parameters
4
+ { account_id: String, name: String }
5
+ & SurgeAPI::Internal::Type::request_parameters
5
6
 
6
7
  class AudienceCreateParams < SurgeAPI::Internal::Type::BaseModel
7
8
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
9
  include SurgeAPI::Internal::Type::RequestParameters
9
10
 
11
+ attr_accessor account_id: String
12
+
10
13
  attr_accessor name: String
11
14
 
12
15
  def initialize: (
16
+ account_id: String,
13
17
  name: String,
14
18
  ?request_options: SurgeAPI::request_opts
15
19
  ) -> void
16
20
 
17
21
  def to_hash: -> {
22
+ account_id: String,
18
23
  name: String,
19
24
  request_options: SurgeAPI::RequestOptions
20
25
  }
@@ -1,13 +1,15 @@
1
1
  module SurgeAPI
2
2
  module Models
3
3
  type audience_list_contacts_params =
4
- { after: String, before: String }
4
+ { audience_id: String, after: String, before: String }
5
5
  & SurgeAPI::Internal::Type::request_parameters
6
6
 
7
7
  class AudienceListContactsParams < SurgeAPI::Internal::Type::BaseModel
8
8
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
9
9
  include SurgeAPI::Internal::Type::RequestParameters
10
10
 
11
+ attr_accessor audience_id: String
12
+
11
13
  attr_reader after: String?
12
14
 
13
15
  def after=: (String) -> String
@@ -17,12 +19,14 @@ module SurgeAPI
17
19
  def before=: (String) -> String
18
20
 
19
21
  def initialize: (
22
+ audience_id: String,
20
23
  ?after: String,
21
24
  ?before: String,
22
25
  ?request_options: SurgeAPI::request_opts
23
26
  ) -> void
24
27
 
25
28
  def to_hash: -> {
29
+ audience_id: String,
26
30
  after: String,
27
31
  before: String,
28
32
  request_options: SurgeAPI::RequestOptions
@@ -2,6 +2,7 @@ module SurgeAPI
2
2
  module Models
3
3
  type blast_create_params =
4
4
  {
5
+ account_id: String,
5
6
  attachments: ::Array[SurgeAPI::BlastCreateParams::Attachment],
6
7
  body: String?,
7
8
  contacts: ::Array[String],
@@ -17,6 +18,8 @@ module SurgeAPI
17
18
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
18
19
  include SurgeAPI::Internal::Type::RequestParameters
19
20
 
21
+ attr_accessor account_id: String
22
+
20
23
  attr_reader attachments: ::Array[SurgeAPI::BlastCreateParams::Attachment]?
21
24
 
22
25
  def attachments=: (
@@ -50,6 +53,7 @@ module SurgeAPI
50
53
  def to=: (::Array[String]) -> ::Array[String]
51
54
 
52
55
  def initialize: (
56
+ account_id: String,
53
57
  ?attachments: ::Array[SurgeAPI::BlastCreateParams::Attachment],
54
58
  ?body: String?,
55
59
  ?contacts: ::Array[String],
@@ -62,6 +66,7 @@ module SurgeAPI
62
66
  ) -> void
63
67
 
64
68
  def to_hash: -> {
69
+ account_id: String,
65
70
  attachments: ::Array[SurgeAPI::BlastCreateParams::Attachment],
66
71
  body: String?,
67
72
  contacts: ::Array[String],
@@ -1,26 +1,21 @@
1
1
  module SurgeAPI
2
2
  module Models
3
3
  type campaign_create_params =
4
- { campaign_params: SurgeAPI::Models::campaign_params }
5
- & SurgeAPI::Internal::Type::request_parameters
4
+ { account_id: String } & SurgeAPI::Internal::Type::request_parameters
6
5
 
7
6
  class CampaignCreateParams < SurgeAPI::Internal::Type::BaseModel
8
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
9
8
  include SurgeAPI::Internal::Type::RequestParameters
10
9
 
11
- def campaign_params: -> SurgeAPI::Models::campaign_params
12
-
13
- def campaign_params=: (
14
- SurgeAPI::Models::campaign_params _
15
- ) -> SurgeAPI::Models::campaign_params
10
+ attr_accessor account_id: String
16
11
 
17
12
  def initialize: (
18
- campaign_params: SurgeAPI::Models::campaign_params,
13
+ account_id: String,
19
14
  ?request_options: SurgeAPI::request_opts
20
15
  ) -> void
21
16
 
22
17
  def to_hash: -> {
23
- campaign_params: SurgeAPI::Models::campaign_params,
18
+ account_id: String,
24
19
  request_options: SurgeAPI::RequestOptions
25
20
  }
26
21
  end
@@ -1,13 +1,15 @@
1
1
  module SurgeAPI
2
2
  module Models
3
3
  type campaign_list_params =
4
- { after: String, before: String }
4
+ { account_id: String, after: String, before: String }
5
5
  & SurgeAPI::Internal::Type::request_parameters
6
6
 
7
7
  class CampaignListParams < SurgeAPI::Internal::Type::BaseModel
8
8
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
9
9
  include SurgeAPI::Internal::Type::RequestParameters
10
10
 
11
+ attr_accessor account_id: String
12
+
11
13
  attr_reader after: String?
12
14
 
13
15
  def after=: (String) -> String
@@ -17,12 +19,14 @@ module SurgeAPI
17
19
  def before=: (String) -> String
18
20
 
19
21
  def initialize: (
22
+ account_id: String,
20
23
  ?after: String,
21
24
  ?before: String,
22
25
  ?request_options: SurgeAPI::request_opts
23
26
  ) -> void
24
27
 
25
28
  def to_hash: -> {
29
+ account_id: String,
26
30
  after: String,
27
31
  before: String,
28
32
  request_options: SurgeAPI::RequestOptions
@@ -1,15 +1,20 @@
1
1
  module SurgeAPI
2
2
  module Models
3
3
  type campaign_retrieve_params =
4
- { } & SurgeAPI::Internal::Type::request_parameters
4
+ { id: String } & SurgeAPI::Internal::Type::request_parameters
5
5
 
6
6
  class CampaignRetrieveParams < SurgeAPI::Internal::Type::BaseModel
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
- def initialize: (?request_options: SurgeAPI::request_opts) -> void
10
+ attr_accessor id: String
11
11
 
12
- def to_hash: -> { request_options: SurgeAPI::RequestOptions }
12
+ def initialize: (
13
+ id: String,
14
+ ?request_options: SurgeAPI::request_opts
15
+ ) -> void
16
+
17
+ def to_hash: -> { id: String, request_options: SurgeAPI::RequestOptions }
13
18
  end
14
19
  end
15
20
  end
@@ -1,28 +1,20 @@
1
1
  module SurgeAPI
2
2
  module Models
3
3
  type campaign_update_params =
4
- { campaign_params: SurgeAPI::Models::campaign_params }
5
- & SurgeAPI::Internal::Type::request_parameters
4
+ { id: String } & SurgeAPI::Internal::Type::request_parameters
6
5
 
7
6
  class CampaignUpdateParams < SurgeAPI::Internal::Type::BaseModel
8
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
9
8
  include SurgeAPI::Internal::Type::RequestParameters
10
9
 
11
- def campaign_params: -> SurgeAPI::Models::campaign_params
12
-
13
- def campaign_params=: (
14
- SurgeAPI::Models::campaign_params _
15
- ) -> SurgeAPI::Models::campaign_params
10
+ attr_accessor id: String
16
11
 
17
12
  def initialize: (
18
- campaign_params: SurgeAPI::Models::campaign_params,
13
+ id: String,
19
14
  ?request_options: SurgeAPI::request_opts
20
15
  ) -> void
21
16
 
22
- def to_hash: -> {
23
- campaign_params: SurgeAPI::Models::campaign_params,
24
- request_options: SurgeAPI::RequestOptions
25
- }
17
+ def to_hash: -> { id: String, request_options: SurgeAPI::RequestOptions }
26
18
  end
27
19
  end
28
20
  end
@@ -2,6 +2,7 @@ module SurgeAPI
2
2
  module Models
3
3
  type contact_create_params =
4
4
  {
5
+ account_id: String,
5
6
  phone_number: String,
6
7
  email: String,
7
8
  first_name: String,
@@ -14,6 +15,8 @@ module SurgeAPI
14
15
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
15
16
  include SurgeAPI::Internal::Type::RequestParameters
16
17
 
18
+ attr_accessor account_id: String
19
+
17
20
  attr_accessor phone_number: String
18
21
 
19
22
  attr_reader email: String?
@@ -33,6 +36,7 @@ module SurgeAPI
33
36
  def metadata=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String]
34
37
 
35
38
  def initialize: (
39
+ account_id: String,
36
40
  phone_number: String,
37
41
  ?email: String,
38
42
  ?first_name: String,
@@ -42,6 +46,7 @@ module SurgeAPI
42
46
  ) -> void
43
47
 
44
48
  def to_hash: -> {
49
+ account_id: String,
45
50
  phone_number: String,
46
51
  email: String,
47
52
  first_name: String,
@@ -1,13 +1,15 @@
1
1
  module SurgeAPI
2
2
  module Models
3
3
  type contact_list_params =
4
- { after: String, before: String }
4
+ { account_id: String, after: String, before: String }
5
5
  & SurgeAPI::Internal::Type::request_parameters
6
6
 
7
7
  class ContactListParams < SurgeAPI::Internal::Type::BaseModel
8
8
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
9
9
  include SurgeAPI::Internal::Type::RequestParameters
10
10
 
11
+ attr_accessor account_id: String
12
+
11
13
  attr_reader after: String?
12
14
 
13
15
  def after=: (String) -> String
@@ -17,12 +19,14 @@ module SurgeAPI
17
19
  def before=: (String) -> String
18
20
 
19
21
  def initialize: (
22
+ account_id: String,
20
23
  ?after: String,
21
24
  ?before: String,
22
25
  ?request_options: SurgeAPI::request_opts
23
26
  ) -> void
24
27
 
25
28
  def to_hash: -> {
29
+ account_id: String,
26
30
  after: String,
27
31
  before: String,
28
32
  request_options: SurgeAPI::RequestOptions
@@ -1,15 +1,20 @@
1
1
  module SurgeAPI
2
2
  module Models
3
3
  type contact_retrieve_params =
4
- { } & SurgeAPI::Internal::Type::request_parameters
4
+ { id: String } & SurgeAPI::Internal::Type::request_parameters
5
5
 
6
6
  class ContactRetrieveParams < SurgeAPI::Internal::Type::BaseModel
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
- def initialize: (?request_options: SurgeAPI::request_opts) -> void
10
+ attr_accessor id: String
11
11
 
12
- def to_hash: -> { request_options: SurgeAPI::RequestOptions }
12
+ def initialize: (
13
+ id: String,
14
+ ?request_options: SurgeAPI::request_opts
15
+ ) -> void
16
+
17
+ def to_hash: -> { id: String, request_options: SurgeAPI::RequestOptions }
13
18
  end
14
19
  end
15
20
  end
@@ -2,6 +2,7 @@ module SurgeAPI
2
2
  module Models
3
3
  type contact_update_params =
4
4
  {
5
+ id: String,
5
6
  phone_number: String,
6
7
  email: String,
7
8
  first_name: String,
@@ -14,6 +15,8 @@ module SurgeAPI
14
15
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
15
16
  include SurgeAPI::Internal::Type::RequestParameters
16
17
 
18
+ attr_accessor id: String
19
+
17
20
  attr_accessor phone_number: String
18
21
 
19
22
  attr_reader email: String?
@@ -33,6 +36,7 @@ module SurgeAPI
33
36
  def metadata=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String]
34
37
 
35
38
  def initialize: (
39
+ id: String,
36
40
  phone_number: String,
37
41
  ?email: String,
38
42
  ?first_name: String,
@@ -42,6 +46,7 @@ module SurgeAPI
42
46
  ) -> void
43
47
 
44
48
  def to_hash: -> {
49
+ id: String,
45
50
  phone_number: String,
46
51
  email: String,
47
52
  first_name: String,
@@ -87,7 +87,7 @@ module SurgeAPI
87
87
  url: String
88
88
  }
89
89
 
90
- type type_ = :file | :image | :link | :video
90
+ type type_ = :file | :image | :link | :contact | :video
91
91
 
92
92
  module Type
93
93
  extend SurgeAPI::Internal::Type::Enum
@@ -95,6 +95,7 @@ module SurgeAPI
95
95
  FILE: :file
96
96
  IMAGE: :image
97
97
  LINK: :link
98
+ CONTACT: :contact
98
99
  VIDEO: :video
99
100
 
100
101
  def self?.values: -> ::Array[SurgeAPI::Models::Message::Attachment::type_]