surge_api 0.24.0 → 0.26.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 +19 -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 +28 -2
  15. data/lib/surge_api/models/message_delivered_webhook_event.rb +20 -1
  16. data/lib/surge_api/models/message_failed_webhook_event.rb +17 -5
  17. data/lib/surge_api/models/message_received_webhook_event.rb +20 -1
  18. data/lib/surge_api/models/message_sent_webhook_event.rb +20 -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 +28 -0
  52. data/rbi/surge_api/models/message_delivered_webhook_event.rbi +22 -0
  53. data/rbi/surge_api/models/message_failed_webhook_event.rbi +21 -5
  54. data/rbi/surge_api/models/message_received_webhook_event.rbi +22 -0
  55. data/rbi/surge_api/models/message_sent_webhook_event.rbi +22 -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 +15 -0
  85. data/sig/surge_api/models/message_delivered_webhook_event.rbs +10 -0
  86. data/sig/surge_api/models/message_failed_webhook_event.rbs +9 -4
  87. data/sig/surge_api/models/message_received_webhook_event.rbs +10 -0
  88. data/sig/surge_api/models/message_sent_webhook_event.rbs +10 -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
@@ -4,6 +4,14 @@ module SurgeAPI
4
4
  module Models
5
5
  # @see SurgeAPI::Resources::Messages#create
6
6
  class Message < SurgeAPI::Internal::Type::BaseModel
7
+ # @!attribute created_at
8
+ # When the message was added to the conversation, in ISO8601 UTC format. Null for
9
+ # scheduled messages until they are created. For imported messages, this is the
10
+ # original creation time.
11
+ #
12
+ # @return [Time, nil]
13
+ required :created_at, Time, nil?: true
14
+
7
15
  # @!attribute id
8
16
  # Unique identifier for the object.
9
17
  #
@@ -34,6 +42,12 @@ module SurgeAPI
34
42
  # @return [SurgeAPI::Models::Message::Conversation, nil]
35
43
  optional :conversation, -> { SurgeAPI::Message::Conversation }
36
44
 
45
+ # @!attribute failure_reason
46
+ # The reason the message failed, or null if no failure reason is set.
47
+ #
48
+ # @return [String, nil]
49
+ optional :failure_reason, String, nil?: true
50
+
37
51
  # @!attribute metadata
38
52
  # Set of key-value pairs that will be stored with the object.
39
53
  #
@@ -46,12 +60,14 @@ module SurgeAPI
46
60
  # @return [Symbol, SurgeAPI::Models::Message::Status, nil]
47
61
  optional :status, enum: -> { SurgeAPI::Message::Status }
48
62
 
49
- # @!method initialize(id: nil, attachments: nil, blast_id: nil, body: nil, conversation: nil, metadata: nil, status: nil)
63
+ # @!method initialize(created_at:, id: nil, attachments: nil, blast_id: nil, body: nil, conversation: nil, failure_reason: nil, metadata: nil, status: nil)
50
64
  # Some parameter documentations has been truncated, see
51
65
  # {SurgeAPI::Models::Message} for more details.
52
66
  #
53
67
  # A Message is a communication sent to a Contact.
54
68
  #
69
+ # @param created_at [Time, nil] When the message was added to the conversation, in ISO8601 UTC format. Null for
70
+ #
55
71
  # @param id [String] Unique identifier for the object.
56
72
  #
57
73
  # @param attachments [Array<SurgeAPI::Models::Message::Attachment>]
@@ -62,6 +78,8 @@ module SurgeAPI
62
78
  #
63
79
  # @param conversation [SurgeAPI::Models::Message::Conversation] A conversation with a Contact
64
80
  #
81
+ # @param failure_reason [String, nil] The reason the message failed, or null if no failure reason is set.
82
+ #
65
83
  # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
66
84
  #
67
85
  # @param status [Symbol, SurgeAPI::Models::Message::Status] The current status of the message.
@@ -148,6 +166,12 @@ module SurgeAPI
148
166
  # @return [String]
149
167
  required :id, String
150
168
 
169
+ # @!attribute metadata
170
+ # Set of key-value pairs that will be stored with the object.
171
+ #
172
+ # @return [Hash{Symbol=>String}]
173
+ required :metadata, SurgeAPI::Internal::Type::HashOf[String]
174
+
151
175
  # @!attribute name
152
176
  # A human-readable name for the phone number
153
177
  #
@@ -166,11 +190,13 @@ module SurgeAPI
166
190
  # @return [Symbol, SurgeAPI::Models::Message::Conversation::PhoneNumber::Type]
167
191
  required :type, enum: -> { SurgeAPI::Message::Conversation::PhoneNumber::Type }
168
192
 
169
- # @!method initialize(id:, name:, number:, type:)
193
+ # @!method initialize(id:, metadata:, name:, number:, type:)
170
194
  # This is the phone number tied to the Surge account.
171
195
  #
172
196
  # @param id [String] Unique identifier for the phone number
173
197
  #
198
+ # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
199
+ #
174
200
  # @param name [String, nil] A human-readable name for the phone number
175
201
  #
176
202
  # @param number [String] The canonical format of the phone number.
@@ -56,12 +56,27 @@ module SurgeAPI
56
56
  # @return [SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Conversation]
57
57
  required :conversation, -> { SurgeAPI::MessageDeliveredWebhookEvent::Data::Conversation }
58
58
 
59
+ # @!attribute created_at
60
+ # When the message was added to the conversation, in ISO8601 UTC format. For
61
+ # scheduled messages, this is the actual creation time, which may be later than
62
+ # the requested send_at. For imported messages, this is the original creation
63
+ # time.
64
+ #
65
+ # @return [Time]
66
+ required :created_at, Time
67
+
59
68
  # @!attribute delivered_at
60
69
  # When the message was delivered
61
70
  #
62
71
  # @return [Time]
63
72
  required :delivered_at, Time
64
73
 
74
+ # @!attribute failure_reason
75
+ # The reason the message failed, or null if no failure reason is set
76
+ #
77
+ # @return [String, nil]
78
+ required :failure_reason, String, nil?: true
79
+
65
80
  # @!attribute metadata
66
81
  # Set of key-value pairs that will be stored with the object.
67
82
  #
@@ -88,7 +103,7 @@ module SurgeAPI
88
103
  # @return [String, nil]
89
104
  optional :blast_id, String
90
105
 
91
- # @!method initialize(id:, body:, conversation:, delivered_at:, metadata:, status:, attachments: nil, blast_id: nil)
106
+ # @!method initialize(id:, body:, conversation:, created_at:, delivered_at:, failure_reason:, metadata:, status:, attachments: nil, blast_id: nil)
92
107
  # Some parameter documentations has been truncated, see
93
108
  # {SurgeAPI::Models::MessageDeliveredWebhookEvent::Data} for more details.
94
109
  #
@@ -100,8 +115,12 @@ module SurgeAPI
100
115
  #
101
116
  # @param conversation [SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Conversation] The conversation this message belongs to
102
117
  #
118
+ # @param created_at [Time] When the message was added to the conversation, in ISO8601 UTC format. For sched
119
+ #
103
120
  # @param delivered_at [Time] When the message was delivered
104
121
  #
122
+ # @param failure_reason [String, nil] The reason the message failed, or null if no failure reason is set
123
+ #
105
124
  # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
106
125
  #
107
126
  # @param status [Symbol, SurgeAPI::Models::MessageDeliveredWebhookEvent::Data::Status] The message status represented by this event
@@ -56,6 +56,15 @@ module SurgeAPI
56
56
  # @return [SurgeAPI::Models::MessageFailedWebhookEvent::Data::Conversation]
57
57
  required :conversation, -> { SurgeAPI::MessageFailedWebhookEvent::Data::Conversation }
58
58
 
59
+ # @!attribute created_at
60
+ # When the message was added to the conversation, in ISO8601 UTC format. For
61
+ # scheduled messages, this is the actual creation time, which may be later than
62
+ # the requested send_at. For imported messages, this is the original creation
63
+ # time.
64
+ #
65
+ # @return [Time]
66
+ required :created_at, Time
67
+
59
68
  # @!attribute failed_at
60
69
  # When the message failed
61
70
  #
@@ -63,10 +72,11 @@ module SurgeAPI
63
72
  required :failed_at, Time
64
73
 
65
74
  # @!attribute failure_reason
66
- # The reason the message failed to be delivered
75
+ # The reason the message failed to be delivered, or null if no failure reason is
76
+ # set
67
77
  #
68
- # @return [String]
69
- required :failure_reason, String
78
+ # @return [String, nil]
79
+ required :failure_reason, String, nil?: true
70
80
 
71
81
  # @!attribute metadata
72
82
  # Set of key-value pairs that will be stored with the object.
@@ -94,7 +104,7 @@ module SurgeAPI
94
104
  # @return [String, nil]
95
105
  optional :blast_id, String
96
106
 
97
- # @!method initialize(id:, body:, conversation:, failed_at:, failure_reason:, metadata:, status:, attachments: nil, blast_id: nil)
107
+ # @!method initialize(id:, body:, conversation:, created_at:, failed_at:, failure_reason:, metadata:, status:, attachments: nil, blast_id: nil)
98
108
  # Some parameter documentations has been truncated, see
99
109
  # {SurgeAPI::Models::MessageFailedWebhookEvent::Data} for more details.
100
110
  #
@@ -106,9 +116,11 @@ module SurgeAPI
106
116
  #
107
117
  # @param conversation [SurgeAPI::Models::MessageFailedWebhookEvent::Data::Conversation] The conversation this message belongs to
108
118
  #
119
+ # @param created_at [Time] When the message was added to the conversation, in ISO8601 UTC format. For sched
120
+ #
109
121
  # @param failed_at [Time] When the message failed
110
122
  #
111
- # @param failure_reason [String] The reason the message failed to be delivered
123
+ # @param failure_reason [String, nil] The reason the message failed to be delivered, or null if no failure reason is s
112
124
  #
113
125
  # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
114
126
  #
@@ -56,6 +56,21 @@ module SurgeAPI
56
56
  # @return [SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Conversation]
57
57
  required :conversation, -> { SurgeAPI::MessageReceivedWebhookEvent::Data::Conversation }
58
58
 
59
+ # @!attribute created_at
60
+ # When the message was added to the conversation, in ISO8601 UTC format. For
61
+ # scheduled messages, this is the actual creation time, which may be later than
62
+ # the requested send_at. For imported messages, this is the original creation
63
+ # time.
64
+ #
65
+ # @return [Time]
66
+ required :created_at, Time
67
+
68
+ # @!attribute failure_reason
69
+ # The reason the message failed, or null if no failure reason is set
70
+ #
71
+ # @return [String, nil]
72
+ required :failure_reason, String, nil?: true
73
+
59
74
  # @!attribute metadata
60
75
  # Set of key-value pairs that will be stored with the object.
61
76
  #
@@ -88,7 +103,7 @@ module SurgeAPI
88
103
  # @return [String, nil]
89
104
  optional :blast_id, String
90
105
 
91
- # @!method initialize(id:, body:, conversation:, metadata:, received_at:, status:, attachments: nil, blast_id: nil)
106
+ # @!method initialize(id:, body:, conversation:, created_at:, failure_reason:, metadata:, received_at:, status:, attachments: nil, blast_id: nil)
92
107
  # Some parameter documentations has been truncated, see
93
108
  # {SurgeAPI::Models::MessageReceivedWebhookEvent::Data} for more details.
94
109
  #
@@ -100,6 +115,10 @@ module SurgeAPI
100
115
  #
101
116
  # @param conversation [SurgeAPI::Models::MessageReceivedWebhookEvent::Data::Conversation] The conversation this message belongs to
102
117
  #
118
+ # @param created_at [Time] When the message was added to the conversation, in ISO8601 UTC format. For sched
119
+ #
120
+ # @param failure_reason [String, nil] The reason the message failed, or null if no failure reason is set
121
+ #
103
122
  # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
104
123
  #
105
124
  # @param received_at [Time] When the message was received
@@ -56,6 +56,21 @@ module SurgeAPI
56
56
  # @return [SurgeAPI::Models::MessageSentWebhookEvent::Data::Conversation]
57
57
  required :conversation, -> { SurgeAPI::MessageSentWebhookEvent::Data::Conversation }
58
58
 
59
+ # @!attribute created_at
60
+ # When the message was added to the conversation, in ISO8601 UTC format. For
61
+ # scheduled messages, this is the actual creation time, which may be later than
62
+ # the requested send_at. For imported messages, this is the original creation
63
+ # time.
64
+ #
65
+ # @return [Time]
66
+ required :created_at, Time
67
+
68
+ # @!attribute failure_reason
69
+ # The reason the message failed, or null if no failure reason is set
70
+ #
71
+ # @return [String, nil]
72
+ required :failure_reason, String, nil?: true
73
+
59
74
  # @!attribute metadata
60
75
  # Set of key-value pairs that will be stored with the object.
61
76
  #
@@ -88,7 +103,7 @@ module SurgeAPI
88
103
  # @return [String, nil]
89
104
  optional :blast_id, String
90
105
 
91
- # @!method initialize(id:, body:, conversation:, metadata:, sent_at:, status:, attachments: nil, blast_id: nil)
106
+ # @!method initialize(id:, body:, conversation:, created_at:, failure_reason:, metadata:, sent_at:, status:, attachments: nil, blast_id: nil)
92
107
  # Some parameter documentations has been truncated, see
93
108
  # {SurgeAPI::Models::MessageSentWebhookEvent::Data} for more details.
94
109
  #
@@ -100,6 +115,10 @@ module SurgeAPI
100
115
  #
101
116
  # @param conversation [SurgeAPI::Models::MessageSentWebhookEvent::Data::Conversation] The conversation this message belongs to
102
117
  #
118
+ # @param created_at [Time] When the message was added to the conversation, in ISO8601 UTC format. For sched
119
+ #
120
+ # @param failure_reason [String, nil] The reason the message failed, or null if no failure reason is set
121
+ #
103
122
  # @param metadata [Hash{Symbol=>String}] Set of key-value pairs that will be stored with the object.
104
123
  #
105
124
  # @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