surge_api 0.24.0 → 0.25.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 (109) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +9 -9
  4. data/lib/surge_api/client.rb +4 -0
  5. data/lib/surge_api/internal/type/union.rb +2 -2
  6. data/lib/surge_api/models/call_ended_webhook_event.rb +8 -3
  7. data/lib/surge_api/models/campaign.rb +15 -7
  8. data/lib/surge_api/models/campaign_approved_webhook_event.rb +9 -1
  9. data/lib/surge_api/models/campaign_params.rb +6 -6
  10. data/lib/surge_api/models/campaign_rejected_webhook_event.rb +135 -0
  11. data/lib/surge_api/models/campaign_submitted_webhook_event.rb +74 -0
  12. data/lib/surge_api/models/campaign_update_params.rb +188 -1
  13. data/lib/surge_api/models/campaign_warning_webhook_event.rb +134 -0
  14. data/lib/surge_api/models/message.rb +18 -2
  15. data/lib/surge_api/models/message_delivered_webhook_event.rb +9 -1
  16. data/lib/surge_api/models/message_failed_webhook_event.rb +5 -4
  17. data/lib/surge_api/models/message_received_webhook_event.rb +9 -1
  18. data/lib/surge_api/models/message_sent_webhook_event.rb +9 -1
  19. data/lib/surge_api/models/phone_number.rb +9 -1
  20. data/lib/surge_api/models/phone_number_attached_to_campaign_webhook_event.rb +9 -1
  21. data/lib/surge_api/models/phone_number_imported_webhook_event.rb +9 -1
  22. data/lib/surge_api/models/phone_number_purchase_params.rb +9 -1
  23. data/lib/surge_api/models/phone_number_update_params.rb +9 -1
  24. data/lib/surge_api/models/toll_free_campaign.rb +132 -0
  25. data/lib/surge_api/models/toll_free_campaign_consent_flow.rb +176 -0
  26. data/lib/surge_api/models/toll_free_campaign_create_params.rb +22 -0
  27. data/lib/surge_api/models/toll_free_campaign_list_params.rb +42 -0
  28. data/lib/surge_api/models/toll_free_campaign_params.rb +286 -0
  29. data/lib/surge_api/models/toll_free_campaign_retrieve_params.rb +22 -0
  30. data/lib/surge_api/models/toll_free_campaign_update_params.rb +278 -0
  31. data/lib/surge_api/models/unwrap_webhook_event.rb +7 -1
  32. data/lib/surge_api/models/user_create_token_params.rb +15 -1
  33. data/lib/surge_api/models.rb +20 -0
  34. data/lib/surge_api/resources/accounts.rb +2 -2
  35. data/lib/surge_api/resources/campaigns.rb +26 -8
  36. data/lib/surge_api/resources/phone_numbers.rb +6 -2
  37. data/lib/surge_api/resources/toll_free_campaigns.rb +140 -0
  38. data/lib/surge_api/resources/users.rb +6 -1
  39. data/lib/surge_api/resources/webhooks.rb +1 -1
  40. data/lib/surge_api/version.rb +1 -1
  41. data/lib/surge_api.rb +11 -0
  42. data/rbi/surge_api/client.rbi +3 -0
  43. data/rbi/surge_api/models/call_ended_webhook_event.rbi +6 -3
  44. data/rbi/surge_api/models/campaign.rbi +17 -9
  45. data/rbi/surge_api/models/campaign_approved_webhook_event.rbi +8 -0
  46. data/rbi/surge_api/models/campaign_params.rbi +9 -9
  47. data/rbi/surge_api/models/campaign_rejected_webhook_event.rbi +269 -0
  48. data/rbi/surge_api/models/campaign_submitted_webhook_event.rbi +149 -0
  49. data/rbi/surge_api/models/campaign_update_params.rbi +378 -1
  50. data/rbi/surge_api/models/campaign_warning_webhook_event.rbi +259 -0
  51. data/rbi/surge_api/models/message.rbi +16 -0
  52. data/rbi/surge_api/models/message_delivered_webhook_event.rbi +8 -0
  53. data/rbi/surge_api/models/message_failed_webhook_event.rbi +7 -5
  54. data/rbi/surge_api/models/message_received_webhook_event.rbi +8 -0
  55. data/rbi/surge_api/models/message_sent_webhook_event.rbi +8 -0
  56. data/rbi/surge_api/models/phone_number.rbi +8 -0
  57. data/rbi/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbi +8 -0
  58. data/rbi/surge_api/models/phone_number_imported_webhook_event.rbi +8 -0
  59. data/rbi/surge_api/models/phone_number_purchase_params.rbi +11 -0
  60. data/rbi/surge_api/models/phone_number_update_params.rbi +11 -0
  61. data/rbi/surge_api/models/toll_free_campaign.rbi +230 -0
  62. data/rbi/surge_api/models/toll_free_campaign_consent_flow.rbi +476 -0
  63. data/rbi/surge_api/models/toll_free_campaign_create_params.rbi +43 -0
  64. data/rbi/surge_api/models/toll_free_campaign_list_params.rbi +70 -0
  65. data/rbi/surge_api/models/toll_free_campaign_params.rbi +711 -0
  66. data/rbi/surge_api/models/toll_free_campaign_retrieve_params.rbi +43 -0
  67. data/rbi/surge_api/models/toll_free_campaign_update_params.rbi +760 -0
  68. data/rbi/surge_api/models/unwrap_webhook_event.rbi +3 -0
  69. data/rbi/surge_api/models/user_create_token_params.rbi +17 -0
  70. data/rbi/surge_api/models.rbi +22 -0
  71. data/rbi/surge_api/resources/accounts.rbi +2 -2
  72. data/rbi/surge_api/resources/campaigns.rbi +94 -12
  73. data/rbi/surge_api/resources/phone_numbers.rbi +6 -0
  74. data/rbi/surge_api/resources/toll_free_campaigns.rbi +129 -0
  75. data/rbi/surge_api/resources/users.rbi +6 -0
  76. data/rbi/surge_api/resources/webhooks.rbi +3 -0
  77. data/sig/surge_api/client.rbs +2 -0
  78. data/sig/surge_api/models/campaign.rbs +5 -0
  79. data/sig/surge_api/models/campaign_approved_webhook_event.rbs +5 -0
  80. data/sig/surge_api/models/campaign_rejected_webhook_event.rbs +115 -0
  81. data/sig/surge_api/models/campaign_submitted_webhook_event.rbs +67 -0
  82. data/sig/surge_api/models/campaign_update_params.rbs +128 -2
  83. data/sig/surge_api/models/campaign_warning_webhook_event.rbs +114 -0
  84. data/sig/surge_api/models/message.rbs +10 -0
  85. data/sig/surge_api/models/message_delivered_webhook_event.rbs +5 -0
  86. data/sig/surge_api/models/message_failed_webhook_event.rbs +4 -4
  87. data/sig/surge_api/models/message_received_webhook_event.rbs +5 -0
  88. data/sig/surge_api/models/message_sent_webhook_event.rbs +5 -0
  89. data/sig/surge_api/models/phone_number.rbs +5 -0
  90. data/sig/surge_api/models/phone_number_attached_to_campaign_webhook_event.rbs +5 -0
  91. data/sig/surge_api/models/phone_number_imported_webhook_event.rbs +5 -0
  92. data/sig/surge_api/models/phone_number_purchase_params.rbs +7 -0
  93. data/sig/surge_api/models/phone_number_update_params.rbs +12 -1
  94. data/sig/surge_api/models/toll_free_campaign.rbs +126 -0
  95. data/sig/surge_api/models/toll_free_campaign_consent_flow.rbs +207 -0
  96. data/sig/surge_api/models/toll_free_campaign_create_params.rbs +25 -0
  97. data/sig/surge_api/models/toll_free_campaign_list_params.rbs +36 -0
  98. data/sig/surge_api/models/toll_free_campaign_params.rbs +321 -0
  99. data/sig/surge_api/models/toll_free_campaign_retrieve_params.rbs +23 -0
  100. data/sig/surge_api/models/toll_free_campaign_update_params.rbs +332 -0
  101. data/sig/surge_api/models/unwrap_webhook_event.rbs +3 -0
  102. data/sig/surge_api/models/user_create_token_params.rbs +7 -1
  103. data/sig/surge_api/models.rbs +20 -0
  104. data/sig/surge_api/resources/campaigns.rbs +9 -1
  105. data/sig/surge_api/resources/phone_numbers.rbs +2 -0
  106. data/sig/surge_api/resources/toll_free_campaigns.rbs +44 -0
  107. data/sig/surge_api/resources/users.rbs +1 -0
  108. data/sig/surge_api/resources/webhooks.rbs +3 -0
  109. metadata +50 -7
@@ -13,10 +13,197 @@ module SurgeAPI
13
13
  # @return [String]
14
14
  required :id, String
15
15
 
16
- # @!method initialize(id:, request_options: {})
16
+ # @!attribute consent_flow
17
+ # A string explaining the method through which end users will opt in to receive
18
+ # messages from the brand. Typically this should include URLs for opt-in forms or
19
+ # screenshots that might be helpful in explaining the flow to someone unfamiliar
20
+ # with the organization's purpose.
21
+ #
22
+ # @return [String, nil]
23
+ optional :consent_flow, String
24
+
25
+ # @!attribute description
26
+ # An explanation of the organization's purpose and how it will be using text
27
+ # messaging to accomplish that purpose.
28
+ #
29
+ # @return [String, nil]
30
+ optional :description, String
31
+
32
+ # @!attribute includes
33
+ # A list of properties that this campaign should include. These properties can be
34
+ # any of the following values:
35
+ #
36
+ # - `links` - whether the campaign might send links in messages
37
+ # - `phone_numbers` - whether the campaign might send phone numbers in messages
38
+ # - `age_gated` - whether the campaign contains age gated content (controlled
39
+ # substances or adult content)
40
+ # - `direct_lending` - whether the campaign contains content related to direct
41
+ # lending or other loan arrangements
42
+ #
43
+ # @return [Array<Symbol, SurgeAPI::Models::CampaignUpdateParams::Include>, nil]
44
+ optional :includes,
45
+ -> { SurgeAPI::Internal::Type::ArrayOf[enum: SurgeAPI::CampaignUpdateParams::Include] }
46
+
47
+ # @!attribute link_sample
48
+ # A sample link that might be sent by this campaign. This is required when
49
+ # `includes` contains `links`. Provide the same URL or domain that the campaign
50
+ # will use in production. If links from other domains are sent through this
51
+ # campaign, they are much more likely to be filtered by the carriers.
52
+ #
53
+ # @return [String, nil]
54
+ optional :link_sample, String, nil?: true
55
+
56
+ # @!attribute message_samples
57
+ # An array of 2-5 strings with examples of the messages that will be sent from
58
+ # this campaign. Typically the first sample should be a compliance message like
59
+ # `You are now opted in to messages from {brand name}. Frequency varies. Msg&data rates apply. Reply STOP to opt out.`
60
+ # These samples don't necessarily need to be the only templates that will be used
61
+ # for the campaign, but they should reflect the purpose of the messages that will
62
+ # be sent. Any variable content can be reflected by wrapping it in square brackets
63
+ # like `[customer name]`.
64
+ #
65
+ # @return [Array<String>, nil]
66
+ optional :message_samples, SurgeAPI::Internal::Type::ArrayOf[String]
67
+
68
+ # @!attribute privacy_policy_url
69
+ # The URL of the privacy policy for the brand in question. This may be a shared
70
+ # privacy policy if it's the policy that is displayed to end users when they opt
71
+ # in to messaging.
72
+ #
73
+ # @return [String, nil]
74
+ optional :privacy_policy_url, String
75
+
76
+ # @!attribute terms_and_conditions_url
77
+ # The URL of the terms and conditions presented to end users when they opt in to
78
+ # messaging. These terms and conditions may be shared among all of a platform's
79
+ # customers if they're the terms that are presented to end users when they opt in
80
+ # to messaging.
81
+ #
82
+ # @return [String, nil]
83
+ optional :terms_and_conditions_url, String
84
+
85
+ # @!attribute use_cases
86
+ # A list containing 1-5 types of messages that will be sent with this campaign.
87
+ #
88
+ # The following use cases are typically available to all brands:
89
+ #
90
+ # - `account_notification` - For sending reminders, alerts, and general
91
+ # account-related notifications like booking confirmations or appointment
92
+ # reminders.
93
+ # - `customer_care` - For account support, troubleshooting, and general customer
94
+ # service communication.
95
+ # - `delivery_notification` - For notifying customers about the status of product
96
+ # or service deliveries.
97
+ # - `fraud_alert` - For warning customers about suspicious or potentially
98
+ # fraudulent activity.
99
+ # - `higher_education` - For messaging related to colleges, universities, and
100
+ # school districts outside of K–12.
101
+ # - `marketing` - For promotional or advertising messages intended to market
102
+ # products or services.
103
+ # - `polling_voting` - For conducting surveys, polls, or voting-related messaging.
104
+ # - `public_service_announcement` - For raising awareness about social issues or
105
+ # important public information.
106
+ # - `security_alert` - For alerts related to potential security breaches or
107
+ # compromised systems requiring user action.
108
+ # - `two_factor_authentication` - For sending one-time passwords or verification
109
+ # codes for login or password reset.
110
+ #
111
+ # For access to special use cases not shown here, reach out to support@surge.app.
112
+ #
113
+ # @return [Array<Symbol, SurgeAPI::Models::CampaignUpdateParams::UseCase>, nil]
114
+ optional :use_cases,
115
+ -> { SurgeAPI::Internal::Type::ArrayOf[enum: SurgeAPI::CampaignUpdateParams::UseCase] }
116
+
117
+ # @!attribute volume
118
+ # This will be one of the following:
119
+ #
120
+ # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
121
+ # T-Mobile customers each day. In this case your project will be charged for the
122
+ # setup fee for a low volume number upon receipt of the API request.
123
+ # - `high` - The campaign will be allowed to send up to 200k SMS segments to
124
+ # T-Mobile customers each day, depending on the trust score assigned by The
125
+ # Campaign Registry. Your project will be charged for the setup fee for a high
126
+ # volume number upon receipt of the API request, and phone numbers will be
127
+ # charged as high volume numbers going forward.
128
+ #
129
+ # @return [Symbol, SurgeAPI::Models::CampaignUpdateParams::Volume, nil]
130
+ optional :volume, enum: -> { SurgeAPI::CampaignUpdateParams::Volume }
131
+
132
+ # @!method initialize(id:, consent_flow: nil, description: nil, includes: nil, link_sample: nil, message_samples: nil, privacy_policy_url: nil, terms_and_conditions_url: nil, use_cases: nil, volume: nil, request_options: {})
133
+ # Some parameter documentations has been truncated, see
134
+ # {SurgeAPI::Models::CampaignUpdateParams} for more details.
135
+ #
17
136
  # @param id [String] The ID of the campaign to update.
18
137
  #
138
+ # @param consent_flow [String] A string explaining the method through which end users will opt in to receive me
139
+ #
140
+ # @param description [String] An explanation of the organization's purpose and how it will be using text messa
141
+ #
142
+ # @param includes [Array<Symbol, SurgeAPI::Models::CampaignUpdateParams::Include>] A list of properties that this campaign should include. These properties can be
143
+ #
144
+ # @param link_sample [String, nil] A sample link that might be sent by this campaign. This is required when `includ
145
+ #
146
+ # @param message_samples [Array<String>] An array of 2-5 strings with examples of the messages that will be sent from thi
147
+ #
148
+ # @param privacy_policy_url [String] The URL of the privacy policy for the brand in question. This may be a shared pr
149
+ #
150
+ # @param terms_and_conditions_url [String] The URL of the terms and conditions presented to end users when they opt in to m
151
+ #
152
+ # @param use_cases [Array<Symbol, SurgeAPI::Models::CampaignUpdateParams::UseCase>] A list containing 1-5 types of messages that will be sent with this campaign.
153
+ #
154
+ # @param volume [Symbol, SurgeAPI::Models::CampaignUpdateParams::Volume] This will be one of the following:
155
+ #
19
156
  # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
157
+
158
+ module Include
159
+ extend SurgeAPI::Internal::Type::Enum
160
+
161
+ LINKS = :links
162
+ PHONE_NUMBERS = :phone_numbers
163
+ AGE_GATED = :age_gated
164
+ DIRECT_LENDING = :direct_lending
165
+
166
+ # @!method self.values
167
+ # @return [Array<Symbol>]
168
+ end
169
+
170
+ module UseCase
171
+ extend SurgeAPI::Internal::Type::Enum
172
+
173
+ ACCOUNT_NOTIFICATION = :account_notification
174
+ CUSTOMER_CARE = :customer_care
175
+ DELIVERY_NOTIFICATION = :delivery_notification
176
+ FRAUD_ALERT = :fraud_alert
177
+ HIGHER_EDUCATION = :higher_education
178
+ MARKETING = :marketing
179
+ POLLING_VOTING = :polling_voting
180
+ PUBLIC_SERVICE_ANNOUNCEMENT = :public_service_announcement
181
+ SECURITY_ALERT = :security_alert
182
+ TWO_FACTOR_AUTHENTICATION = :two_factor_authentication
183
+
184
+ # @!method self.values
185
+ # @return [Array<Symbol>]
186
+ end
187
+
188
+ # This will be one of the following:
189
+ #
190
+ # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
191
+ # T-Mobile customers each day. In this case your project will be charged for the
192
+ # setup fee for a low volume number upon receipt of the API request.
193
+ # - `high` - The campaign will be allowed to send up to 200k SMS segments to
194
+ # T-Mobile customers each day, depending on the trust score assigned by The
195
+ # Campaign Registry. Your project will be charged for the setup fee for a high
196
+ # volume number upon receipt of the API request, and phone numbers will be
197
+ # charged as high volume numbers going forward.
198
+ module Volume
199
+ extend SurgeAPI::Internal::Type::Enum
200
+
201
+ HIGH = :high
202
+ LOW = :low
203
+
204
+ # @!method self.values
205
+ # @return [Array<Symbol>]
206
+ end
20
207
  end
21
208
  end
22
209
  end
@@ -0,0 +1,134 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class CampaignWarningWebhookEvent < SurgeAPI::Internal::Type::BaseModel
6
+ # @!attribute account_id
7
+ # The ID of the account in which this event occurred
8
+ #
9
+ # @return [String]
10
+ required :account_id, String
11
+
12
+ # @!attribute data
13
+ # The data associated with the event
14
+ #
15
+ # @return [SurgeAPI::Models::CampaignWarningWebhookEvent::Data]
16
+ required :data, -> { SurgeAPI::CampaignWarningWebhookEvent::Data }
17
+
18
+ # @!attribute timestamp
19
+ # The timestamp when this event occurred, in ISO8601 format
20
+ #
21
+ # @return [Time]
22
+ required :timestamp, Time
23
+
24
+ # @!attribute type
25
+ # The type of the event. Always `campaign.warning` for this event.
26
+ #
27
+ # @return [Symbol, :"campaign.warning"]
28
+ required :type, const: :"campaign.warning"
29
+
30
+ # @!method initialize(account_id:, data:, timestamp:, type: :"campaign.warning")
31
+ # @param account_id [String] The ID of the account in which this event occurred
32
+ #
33
+ # @param data [SurgeAPI::Models::CampaignWarningWebhookEvent::Data] The data associated with the event
34
+ #
35
+ # @param timestamp [Time] The timestamp when this event occurred, in ISO8601 format
36
+ #
37
+ # @param type [Symbol, :"campaign.warning"] The type of the event. Always `campaign.warning` for this event.
38
+
39
+ # @see SurgeAPI::Models::CampaignWarningWebhookEvent#data
40
+ class Data < SurgeAPI::Internal::Type::BaseModel
41
+ # @!attribute id
42
+ # The unique identifier for the campaign
43
+ #
44
+ # @return [String]
45
+ required :id, String
46
+
47
+ # @!attribute feedback
48
+ # Customer-visible field-level registration feedback. Rejection events may include
49
+ # non-blocking warnings alongside changes-needed items.
50
+ #
51
+ # @return [Array<SurgeAPI::Models::CampaignWarningWebhookEvent::Data::Feedback>]
52
+ required :feedback,
53
+ -> { SurgeAPI::Internal::Type::ArrayOf[SurgeAPI::CampaignWarningWebhookEvent::Data::Feedback] }
54
+
55
+ # @!attribute status
56
+ # The public campaign status. Always `in_review` for this event.
57
+ #
58
+ # @return [Symbol, SurgeAPI::Models::CampaignWarningWebhookEvent::Data::Status]
59
+ required :status, enum: -> { SurgeAPI::CampaignWarningWebhookEvent::Data::Status }
60
+
61
+ # @!method initialize(id:, feedback:, status:)
62
+ # Some parameter documentations has been truncated, see
63
+ # {SurgeAPI::Models::CampaignWarningWebhookEvent::Data} for more details.
64
+ #
65
+ # The data associated with the event
66
+ #
67
+ # @param id [String] The unique identifier for the campaign
68
+ #
69
+ # @param feedback [Array<SurgeAPI::Models::CampaignWarningWebhookEvent::Data::Feedback>] Customer-visible field-level registration feedback. Rejection events may include
70
+ #
71
+ # @param status [Symbol, SurgeAPI::Models::CampaignWarningWebhookEvent::Data::Status] The public campaign status. Always `in_review` for this event.
72
+
73
+ class Feedback < SurgeAPI::Internal::Type::BaseModel
74
+ # @!attribute field
75
+ # The stable registration field key
76
+ #
77
+ # @return [String]
78
+ required :field, String
79
+
80
+ # @!attribute message
81
+ # Actionable review feedback
82
+ #
83
+ # @return [String]
84
+ required :message, String
85
+
86
+ # @!attribute outcome
87
+ # Whether the feedback blocks registration or is a non-blocking warning
88
+ #
89
+ # @return [Symbol, SurgeAPI::Models::CampaignWarningWebhookEvent::Data::Feedback::Outcome]
90
+ required :outcome, enum: -> { SurgeAPI::CampaignWarningWebhookEvent::Data::Feedback::Outcome }
91
+
92
+ # @!attribute suggested_value
93
+ # A suggested replacement value, or null when none is suggested
94
+ #
95
+ # @return [String, nil]
96
+ required :suggested_value, String, nil?: true
97
+
98
+ # @!method initialize(field:, message:, outcome:, suggested_value:)
99
+ # @param field [String] The stable registration field key
100
+ #
101
+ # @param message [String] Actionable review feedback
102
+ #
103
+ # @param outcome [Symbol, SurgeAPI::Models::CampaignWarningWebhookEvent::Data::Feedback::Outcome] Whether the feedback blocks registration or is a non-blocking warning
104
+ #
105
+ # @param suggested_value [String, nil] A suggested replacement value, or null when none is suggested
106
+
107
+ # Whether the feedback blocks registration or is a non-blocking warning
108
+ #
109
+ # @see SurgeAPI::Models::CampaignWarningWebhookEvent::Data::Feedback#outcome
110
+ module Outcome
111
+ extend SurgeAPI::Internal::Type::Enum
112
+
113
+ WARNING = :warning
114
+
115
+ # @!method self.values
116
+ # @return [Array<Symbol>]
117
+ end
118
+ end
119
+
120
+ # The public campaign status. Always `in_review` for this event.
121
+ #
122
+ # @see SurgeAPI::Models::CampaignWarningWebhookEvent::Data#status
123
+ module Status
124
+ extend SurgeAPI::Internal::Type::Enum
125
+
126
+ IN_REVIEW = :in_review
127
+
128
+ # @!method self.values
129
+ # @return [Array<Symbol>]
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end
@@ -34,6 +34,12 @@ module SurgeAPI
34
34
  # @return [SurgeAPI::Models::Message::Conversation, nil]
35
35
  optional :conversation, -> { SurgeAPI::Message::Conversation }
36
36
 
37
+ # @!attribute failure_reason
38
+ # The reason the message failed, or null if no failure reason is set.
39
+ #
40
+ # @return [String, nil]
41
+ optional :failure_reason, String, nil?: true
42
+
37
43
  # @!attribute metadata
38
44
  # Set of key-value pairs that will be stored with the object.
39
45
  #
@@ -46,7 +52,7 @@ module SurgeAPI
46
52
  # @return [Symbol, SurgeAPI::Models::Message::Status, nil]
47
53
  optional :status, enum: -> { SurgeAPI::Message::Status }
48
54
 
49
- # @!method initialize(id: nil, attachments: nil, blast_id: nil, body: nil, conversation: nil, metadata: nil, status: nil)
55
+ # @!method initialize(id: nil, attachments: nil, blast_id: nil, body: nil, conversation: nil, failure_reason: nil, metadata: nil, status: nil)
50
56
  # Some parameter documentations has been truncated, see
51
57
  # {SurgeAPI::Models::Message} for more details.
52
58
  #
@@ -62,6 +68,8 @@ module SurgeAPI
62
68
  #
63
69
  # @param conversation [SurgeAPI::Models::Message::Conversation] A conversation with a Contact
64
70
  #
71
+ # @param failure_reason [String, nil] The reason the message failed, or null if no failure reason is set.
72
+ #
65
73
  # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
66
74
  #
67
75
  # @param status [Symbol, SurgeAPI::Models::Message::Status] The current status of the message.
@@ -148,6 +156,12 @@ module SurgeAPI
148
156
  # @return [String]
149
157
  required :id, String
150
158
 
159
+ # @!attribute metadata
160
+ # Set of key-value pairs that will be stored with the object.
161
+ #
162
+ # @return [Hash{Symbol=>String}]
163
+ required :metadata, SurgeAPI::Internal::Type::HashOf[String]
164
+
151
165
  # @!attribute name
152
166
  # A human-readable name for the phone number
153
167
  #
@@ -166,11 +180,13 @@ module SurgeAPI
166
180
  # @return [Symbol, SurgeAPI::Models::Message::Conversation::PhoneNumber::Type]
167
181
  required :type, enum: -> { SurgeAPI::Message::Conversation::PhoneNumber::Type }
168
182
 
169
- # @!method initialize(id:, name:, number:, type:)
183
+ # @!method initialize(id:, metadata:, name:, number:, type:)
170
184
  # This is the phone number tied to the Surge account.
171
185
  #
172
186
  # @param id [String] Unique identifier for the phone number
173
187
  #
188
+ # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
189
+ #
174
190
  # @param name [String, nil] A human-readable name for the phone number
175
191
  #
176
192
  # @param number [String] The canonical format of the phone number.
@@ -62,6 +62,12 @@ module SurgeAPI
62
62
  # @return [Time]
63
63
  required :delivered_at, Time
64
64
 
65
+ # @!attribute failure_reason
66
+ # The reason the message failed, or null if no failure reason is set
67
+ #
68
+ # @return [String, nil]
69
+ required :failure_reason, String, nil?: true
70
+
65
71
  # @!attribute metadata
66
72
  # Set of key-value pairs that will be stored with the object.
67
73
  #
@@ -88,7 +94,7 @@ module SurgeAPI
88
94
  # @return [String, nil]
89
95
  optional :blast_id, String
90
96
 
91
- # @!method initialize(id:, body:, conversation:, delivered_at:, metadata:, status:, attachments: nil, blast_id: nil)
97
+ # @!method initialize(id:, body:, conversation:, delivered_at:, failure_reason:, metadata:, status:, attachments: nil, blast_id: nil)
92
98
  # Some parameter documentations has been truncated, see
93
99
  # {SurgeAPI::Models::MessageDeliveredWebhookEvent::Data} for more details.
94
100
  #
@@ -102,6 +108,8 @@ module SurgeAPI
102
108
  #
103
109
  # @param delivered_at [Time] When the message was delivered
104
110
  #
111
+ # @param failure_reason [String, nil] The reason the message failed, or null if no failure reason is set
112
+ #
105
113
  # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
106
114
  #
107
115
  # @param status [Symbol, SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Status] The message status represented by this event
@@ -63,10 +63,11 @@ module SurgeAPI
63
63
  required :failed_at, Time
64
64
 
65
65
  # @!attribute failure_reason
66
- # The reason the message failed to be delivered
66
+ # The reason the message failed to be delivered, or null if no failure reason is
67
+ # set
67
68
  #
68
- # @return [String]
69
- required :failure_reason, String
69
+ # @return [String, nil]
70
+ required :failure_reason, String, nil?: true
70
71
 
71
72
  # @!attribute metadata
72
73
  # Set of key-value pairs that will be stored with the object.
@@ -108,7 +109,7 @@ module SurgeAPI
108
109
  #
109
110
  # @param failed_at [Time] When the message failed
110
111
  #
111
- # @param failure_reason [String] The reason the message failed to be delivered
112
+ # @param failure_reason [String, nil] The reason the message failed to be delivered, or null if no failure reason is s
112
113
  #
113
114
  # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
114
115
  #
@@ -56,6 +56,12 @@ module SurgeAPI
56
56
  # @return [SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Conversation]
57
57
  required :conversation, -> { SurgeAPI::MessageReceivedWebhookEvent::Data::Conversation }
58
58
 
59
+ # @!attribute failure_reason
60
+ # The reason the message failed, or null if no failure reason is set
61
+ #
62
+ # @return [String, nil]
63
+ required :failure_reason, String, nil?: true
64
+
59
65
  # @!attribute metadata
60
66
  # Set of key-value pairs that will be stored with the object.
61
67
  #
@@ -88,7 +94,7 @@ module SurgeAPI
88
94
  # @return [String, nil]
89
95
  optional :blast_id, String
90
96
 
91
- # @!method initialize(id:, body:, conversation:, metadata:, received_at:, status:, attachments: nil, blast_id: nil)
97
+ # @!method initialize(id:, body:, conversation:, failure_reason:, metadata:, received_at:, status:, attachments: nil, blast_id: nil)
92
98
  # Some parameter documentations has been truncated, see
93
99
  # {SurgeAPI::Models::MessageReceivedWebhookEvent::Data} for more details.
94
100
  #
@@ -100,6 +106,8 @@ module SurgeAPI
100
106
  #
101
107
  # @param conversation [SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Conversation] The conversation this message belongs to
102
108
  #
109
+ # @param failure_reason [String, nil] The reason the message failed, or null if no failure reason is set
110
+ #
103
111
  # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
104
112
  #
105
113
  # @param received_at [Time] When the message was received
@@ -56,6 +56,12 @@ module SurgeAPI
56
56
  # @return [SurgeAPI::Models::MessageSentWebhookEvent::Data::Conversation]
57
57
  required :conversation, -> { SurgeAPI::MessageSentWebhookEvent::Data::Conversation }
58
58
 
59
+ # @!attribute failure_reason
60
+ # The reason the message failed, or null if no failure reason is set
61
+ #
62
+ # @return [String, nil]
63
+ required :failure_reason, String, nil?: true
64
+
59
65
  # @!attribute metadata
60
66
  # Set of key-value pairs that will be stored with the object.
61
67
  #
@@ -88,7 +94,7 @@ module SurgeAPI
88
94
  # @return [String, nil]
89
95
  optional :blast_id, String
90
96
 
91
- # @!method initialize(id:, body:, conversation:, metadata:, sent_at:, status:, attachments: nil, blast_id: nil)
97
+ # @!method initialize(id:, body:, conversation:, failure_reason:, metadata:, sent_at:, status:, attachments: nil, blast_id: nil)
92
98
  # Some parameter documentations has been truncated, see
93
99
  # {SurgeAPI::Models::MessageSentWebhookEvent::Data} for more details.
94
100
  #
@@ -100,6 +106,8 @@ module SurgeAPI
100
106
  #
101
107
  # @param conversation [SurgeAPI::Models::MessageSentWebhookEvent::Data::Conversation] The conversation this message belongs to
102
108
  #
109
+ # @param failure_reason [String, nil] The reason the message failed, or null if no failure reason is set
110
+ #
103
111
  # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
104
112
  #
105
113
  # @param sent_at [Time] When the message was sent
@@ -25,6 +25,12 @@ module SurgeAPI
25
25
  # @return [String, nil]
26
26
  required :campaign_id, String, nil?: true
27
27
 
28
+ # @!attribute metadata
29
+ # Set of key-value pairs that will be stored with the object.
30
+ #
31
+ # @return [Hash{Symbol=>String}]
32
+ required :metadata, SurgeAPI::Internal::Type::HashOf[String]
33
+
28
34
  # @!attribute name
29
35
  # A human-readable name for the phone number
30
36
  #
@@ -43,7 +49,7 @@ module SurgeAPI
43
49
  # @return [Symbol, SurgeAPI::Models::PhoneNumber::Type]
44
50
  required :type, enum: -> { SurgeAPI::PhoneNumber::Type }
45
51
 
46
- # @!method initialize(id:, campaign:, campaign_id:, name:, number:, type:)
52
+ # @!method initialize(id:, campaign:, campaign_id:, metadata:, name:, number:, type:)
47
53
  # Some parameter documentations has been truncated, see
48
54
  # {SurgeAPI::Models::PhoneNumber} for more details.
49
55
  #
@@ -55,6 +61,8 @@ module SurgeAPI
55
61
  #
56
62
  # @param campaign_id [String, nil] Deprecated. The unique identifier of the campaign this phone number is attached
57
63
  #
64
+ # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
65
+ #
58
66
  # @param name [String, nil] A human-readable name for the phone number
59
67
  #
60
68
  # @param number [String] The phone number in E.164 format
@@ -67,6 +67,12 @@ module SurgeAPI
67
67
  # @return [String]
68
68
  required :campaign_id, String
69
69
 
70
+ # @!attribute metadata
71
+ # Set of key-value pairs that will be stored with the object.
72
+ #
73
+ # @return [Hash{Symbol=>String}]
74
+ required :metadata, SurgeAPI::Internal::Type::HashOf[String]
75
+
70
76
  # @!attribute name
71
77
  # A human-readable name for the phone number
72
78
  #
@@ -85,7 +91,7 @@ module SurgeAPI
85
91
  # @return [Symbol, SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type]
86
92
  required :type, enum: -> { SurgeAPI::PhoneNumberAttachedToCampaignWebhookEvent::Data::Type }
87
93
 
88
- # @!method initialize(id:, campaign:, campaign_id:, name:, number:, type:)
94
+ # @!method initialize(id:, campaign:, campaign_id:, metadata:, name:, number:, type:)
89
95
  # Some parameter documentations has been truncated, see
90
96
  # {SurgeAPI::Models::PhoneNumberAttachedToCampaignWebhookEvent::Data} for more
91
97
  # details.
@@ -98,6 +104,8 @@ module SurgeAPI
98
104
  #
99
105
  # @param campaign_id [String] Deprecated. The unique identifier of the campaign this phone number is attached
100
106
  #
107
+ # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
108
+ #
101
109
  # @param name [String, nil] A human-readable name for the phone number
102
110
  #
103
111
  # @param number [String] The phone number in E.164 format
@@ -59,6 +59,12 @@ module SurgeAPI
59
59
  # @return [String, nil]
60
60
  required :campaign_id, String, nil?: true
61
61
 
62
+ # @!attribute metadata
63
+ # Set of key-value pairs that will be stored with the object.
64
+ #
65
+ # @return [Hash{Symbol=>String}]
66
+ required :metadata, SurgeAPI::Internal::Type::HashOf[String]
67
+
62
68
  # @!attribute name
63
69
  # A human-readable name for the phone number
64
70
  #
@@ -77,7 +83,7 @@ module SurgeAPI
77
83
  # @return [Symbol, SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data::Type]
78
84
  required :type, enum: -> { SurgeAPI::PhoneNumberImportedWebhookEvent::Data::Type }
79
85
 
80
- # @!method initialize(id:, campaign:, campaign_id:, name:, number:, type:)
86
+ # @!method initialize(id:, campaign:, campaign_id:, metadata:, name:, number:, type:)
81
87
  # Some parameter documentations has been truncated, see
82
88
  # {SurgeAPI::Models::PhoneNumberImportedWebhookEvent::Data} for more details.
83
89
  #
@@ -89,6 +95,8 @@ module SurgeAPI
89
95
  #
90
96
  # @param campaign_id [String, nil] Deprecated. The unique identifier of the campaign this phone number is attached
91
97
  #
98
+ # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
99
+ #
92
100
  # @param name [String, nil] A human-readable name for the phone number
93
101
  #
94
102
  # @param number [String] The phone number in E.164 format
@@ -34,6 +34,12 @@ module SurgeAPI
34
34
  # @return [Float, nil]
35
35
  optional :longitude, Float
36
36
 
37
+ # @!attribute metadata
38
+ # Set of key-value pairs that will be stored with the object.
39
+ #
40
+ # @return [Hash{Symbol=>String}, nil]
41
+ optional :metadata, SurgeAPI::Internal::Type::HashOf[String]
42
+
37
43
  # @!attribute name
38
44
  # A human-readable name for the phone number. If not provided, defaults to the
39
45
  # formatted phone number.
@@ -55,7 +61,7 @@ module SurgeAPI
55
61
  # @return [Symbol, SurgeAPI::Models::PhoneNumberPurchaseParams::Type, nil]
56
62
  optional :type, enum: -> { SurgeAPI::PhoneNumberPurchaseParams::Type }
57
63
 
58
- # @!method initialize(account_id:, area_code: nil, latitude: nil, longitude: nil, name: nil, phone_number: nil, type: nil, request_options: {})
64
+ # @!method initialize(account_id:, area_code: nil, latitude: nil, longitude: nil, metadata: nil, name: nil, phone_number: nil, type: nil, request_options: {})
59
65
  # Some parameter documentations has been truncated, see
60
66
  # {SurgeAPI::Models::PhoneNumberPurchaseParams} for more details.
61
67
  #
@@ -67,6 +73,8 @@ module SurgeAPI
67
73
  #
68
74
  # @param longitude [Float] Longitude to search for nearby phone numbers. Must be used with latitude. If pro
69
75
  #
76
+ # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
77
+ #
70
78
  # @param name [String] A human-readable name for the phone number. If not provided, defaults to the for
71
79
  #
72
80
  # @param phone_number [String] The exact phone number to purchase in E.164 format. When provided, all other sea
@@ -19,17 +19,25 @@ module SurgeAPI
19
19
  # @return [String, nil]
20
20
  optional :campaign_id, String
21
21
 
22
+ # @!attribute metadata
23
+ # Set of key-value pairs that will be stored with the object.
24
+ #
25
+ # @return [Hash{Symbol=>String}, nil]
26
+ optional :metadata, SurgeAPI::Internal::Type::HashOf[String]
27
+
22
28
  # @!attribute name
23
29
  # A human-readable name for the phone number.
24
30
  #
25
31
  # @return [String, nil]
26
32
  optional :name, String
27
33
 
28
- # @!method initialize(id:, campaign_id: nil, name: nil, request_options: {})
34
+ # @!method initialize(id:, campaign_id: nil, metadata: nil, name: nil, request_options: {})
29
35
  # @param id [String] The ID of the phone number to update.
30
36
  #
31
37
  # @param campaign_id [String] Campaign ID to attach this number to (`cpn_...`).
32
38
  #
39
+ # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
40
+ #
33
41
  # @param name [String] A human-readable name for the phone number.
34
42
  #
35
43
  # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]