surge_api 0.1.0 → 0.2.1

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 (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -0
  3. data/README.md +12 -63
  4. data/lib/surge_api/file_part.rb +10 -7
  5. data/lib/surge_api/internal/transport/pooled_net_requester.rb +34 -31
  6. data/lib/surge_api/internal/type/file_input.rb +7 -4
  7. data/lib/surge_api/internal/type/union.rb +1 -1
  8. data/lib/surge_api/internal/util.rb +5 -5
  9. data/lib/surge_api/models/account_create_params.rb +13 -6
  10. data/lib/surge_api/models/account_update_params.rb +13 -6
  11. data/lib/surge_api/models/campaign_create_params.rb +7 -183
  12. data/lib/surge_api/models/campaign_params.rb +228 -0
  13. data/lib/surge_api/models/contact_opted_in_webhook_event.rb +54 -0
  14. data/lib/surge_api/models/contact_opted_out_webhook_event.rb +54 -0
  15. data/lib/surge_api/models/message_create_params.rb +8 -134
  16. data/lib/surge_api/models/message_params.rb +216 -0
  17. data/lib/surge_api/models/unwrap_webhook_event.rb +5 -1
  18. data/lib/surge_api/models.rb +8 -0
  19. data/lib/surge_api/resources/campaigns.rb +7 -18
  20. data/lib/surge_api/resources/messages.rb +7 -12
  21. data/lib/surge_api/resources/webhooks.rb +1 -1
  22. data/lib/surge_api/version.rb +1 -1
  23. data/lib/surge_api.rb +4 -0
  24. data/rbi/surge_api/file_part.rbi +1 -1
  25. data/rbi/surge_api/models/account_create_params.rbi +19 -8
  26. data/rbi/surge_api/models/account_update_params.rbi +19 -8
  27. data/rbi/surge_api/models/campaign_create_params.rbi +20 -346
  28. data/rbi/surge_api/models/campaign_params.rbi +481 -0
  29. data/rbi/surge_api/models/contact_opted_in_webhook_event.rbi +95 -0
  30. data/rbi/surge_api/models/contact_opted_out_webhook_event.rbi +95 -0
  31. data/rbi/surge_api/models/message_create_params.rbi +24 -243
  32. data/rbi/surge_api/models/message_params.rbi +430 -0
  33. data/rbi/surge_api/models/unwrap_webhook_event.rbi +2 -0
  34. data/rbi/surge_api/models.rbi +8 -0
  35. data/rbi/surge_api/resources/campaigns.rbi +4 -89
  36. data/rbi/surge_api/resources/messages.rbi +5 -22
  37. data/rbi/surge_api/resources/webhooks.rbi +2 -0
  38. data/sig/surge_api/file_part.rbs +1 -1
  39. data/sig/surge_api/models/campaign_create_params.rbs +7 -106
  40. data/sig/surge_api/models/campaign_params.rbs +141 -0
  41. data/sig/surge_api/models/contact_opted_in_webhook_event.rbs +45 -0
  42. data/sig/surge_api/models/contact_opted_out_webhook_event.rbs +45 -0
  43. data/sig/surge_api/models/message_create_params.rbs +7 -119
  44. data/sig/surge_api/models/message_params.rbs +189 -0
  45. data/sig/surge_api/models/unwrap_webhook_event.rbs +2 -0
  46. data/sig/surge_api/models.rbs +8 -0
  47. data/sig/surge_api/resources/campaigns.rbs +1 -9
  48. data/sig/surge_api/resources/messages.rbs +1 -6
  49. data/sig/surge_api/resources/webhooks.rbs +2 -0
  50. metadata +14 -2
@@ -7,196 +7,20 @@ module SurgeAPI
7
7
  extend SurgeAPI::Internal::Type::RequestParameters::Converter
8
8
  include SurgeAPI::Internal::Type::RequestParameters
9
9
 
10
- # @!attribute consent_flow
11
- # A string explaining the method through which end users will opt in to receive
12
- # messages from the brand. Typically this should include URLs for opt-in forms or
13
- # screenshots that might be helpful in explaining the flow to someone unfamiliar
14
- # with the organization's purpose.
10
+ # @!attribute campaign_params
11
+ # Parameters for creating a new campaign. Either provide full campaign details or
12
+ # import using a TCR ID.
15
13
  #
16
- # @return [String]
17
- required :consent_flow, String
14
+ # @return [SurgeAPI::Models::CampaignParams::StandardCampaignParams, SurgeAPI::Models::CampaignParams::ExternalCampaignParams]
15
+ required :campaign_params, union: -> { SurgeAPI::CampaignParams }
18
16
 
19
- # @!attribute description
20
- # An explanation of the organization's purpose and how it will be using text
21
- # messaging to accomplish that purpose.
22
- #
23
- # @return [String]
24
- required :description, String
25
-
26
- # @!attribute message_samples
27
- # An array of 2-5 strings with examples of the messages that will be sent from
28
- # this campaign. Typically the first sample should be a compliance message like
29
- # `You are now opted in to messages from {brand name}. Frequency varies. Msg&data rates apply. Reply STOP to opt out.`
30
- # These samples don't necessarily need to be the only templates that will be used
31
- # for the campaign, but they should reflect the purpose of the messages that will
32
- # be sent. Any variable content can be reflected by wrapping it in square brackets
33
- # like `[customer name]`.
34
- #
35
- # @return [Array<String>]
36
- required :message_samples, SurgeAPI::Internal::Type::ArrayOf[String]
37
-
38
- # @!attribute privacy_policy_url
39
- # The URL of the privacy policy for the brand in question. This may be a shared
40
- # privacy policy if it's the policy that is displayed to end users when they opt
41
- # in to messaging.
42
- #
43
- # @return [String]
44
- required :privacy_policy_url, String
45
-
46
- # @!attribute use_cases
47
- # A list containing 1-5 types of messages that will be sent with this campaign.
48
- #
49
- # The following use cases are typically available to all brands:
50
- #
51
- # - `account_notification` - For sending reminders, alerts, and general
52
- # account-related notifications like booking confirmations or appointment
53
- # reminders.
54
- # - `customer_care` - For account support, troubleshooting, and general customer
55
- # service communication.
56
- # - `delivery_notification` - For notifying customers about the status of product
57
- # or service deliveries.
58
- # - `fraud_alert` - For warning customers about suspicious or potentially
59
- # fraudulent activity.
60
- # - `higher_education` - For messaging related to colleges, universities, and
61
- # school districts outside of K–12.
62
- # - `marketing` - For promotional or advertising messages intended to market
63
- # products or services.
64
- # - `polling_voting` - For conducting surveys, polls, or voting-related messaging.
65
- # - `public_service_announcement` - For raising awareness about social issues or
66
- # important public information.
67
- # - `security_alert` - For alerts related to potential security breaches or
68
- # compromised systems requiring user action.
69
- # - `two_factor_authentication` - For sending one-time passwords or verification
70
- # codes for login or password reset.
71
- #
72
- # For access to special use cases not shown here, reach out to support@surge.app.
73
- #
74
- # @return [Array<Symbol, SurgeAPI::Models::CampaignCreateParams::UseCase>]
75
- required :use_cases,
76
- -> { SurgeAPI::Internal::Type::ArrayOf[enum: SurgeAPI::CampaignCreateParams::UseCase] }
77
-
78
- # @!attribute volume
79
- # This will be one of the following:
80
- #
81
- # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
82
- # T-Mobile customers each day. In this case your platform will be charged for
83
- # the setup fee for a low volume number upon receipt of the API request.
84
- # - `high` - The campaign will be allowed to send up to 200k SMS segments to
85
- # T-Mobile customers each day, depending on the trust score assigned by The
86
- # Campaign Registry. Your platform will be charged for the setup fee for a high
87
- # volume number upon receipt of the API request, and phone numbers will be
88
- # charged as high volume numbers going forward.
89
- #
90
- # @return [Symbol, SurgeAPI::Models::CampaignCreateParams::Volume]
91
- required :volume, enum: -> { SurgeAPI::CampaignCreateParams::Volume }
92
-
93
- # @!attribute includes
94
- # A list of properties that this campaign should include. These properties can be
95
- # any of the following values:
96
- #
97
- # - `links` - whether the campaign might send links in messages
98
- # - `phone_numbers` - whether the campaign might send phone numbers in messages
99
- # - `age_gated` - whether the campaign contains age gated content (controlled
100
- # substances or adult content)
101
- # - `direct_lending` - whether the campaign contains content related to direct
102
- # lending or other loan arrangements
103
- #
104
- # @return [Array<Symbol, SurgeAPI::Models::CampaignCreateParams::Include>, nil]
105
- optional :includes,
106
- -> { SurgeAPI::Internal::Type::ArrayOf[enum: SurgeAPI::CampaignCreateParams::Include] }
107
-
108
- # @!attribute link_sample
109
- # A sample link that might be sent by this campaign. If links from other domains
110
- # are sent through this campaign, they are much more likely to be filtered by the
111
- # carriers. If link shortening is enabled for the account, the link shortener URL
112
- # will be used instead of what is provided. Reach out to support if you would like
113
- # to disable automatic link shortening.
114
- #
115
- # @return [String, nil]
116
- optional :link_sample, String
117
-
118
- # @!attribute terms_and_conditions_url
119
- # The URL of the terms and conditions presented to end users when they opt in to
120
- # messaging. These terms and conditions may be shared among all of a platform's
121
- # customers if they're the terms that are presented to end users when they opt in
122
- # to messaging.
123
- #
124
- # @return [String, nil]
125
- optional :terms_and_conditions_url, String
126
-
127
- # @!method initialize(consent_flow:, description:, message_samples:, privacy_policy_url:, use_cases:, volume:, includes: nil, link_sample: nil, terms_and_conditions_url: nil, request_options: {})
17
+ # @!method initialize(campaign_params:, request_options: {})
128
18
  # Some parameter documentations has been truncated, see
129
19
  # {SurgeAPI::Models::CampaignCreateParams} for more details.
130
20
  #
131
- # @param consent_flow [String] A string explaining the method through which end users will opt in to receive me
132
- #
133
- # @param description [String] An explanation of the organization's purpose and how it will be using text messa
134
- #
135
- # @param message_samples [Array<String>] An array of 2-5 strings with examples of the messages that will be sent from thi
136
- #
137
- # @param privacy_policy_url [String] The URL of the privacy policy for the brand in question. This may be a shared pr
138
- #
139
- # @param use_cases [Array<Symbol, SurgeAPI::Models::CampaignCreateParams::UseCase>] A list containing 1-5 types of messages that will be sent with this campaign.
140
- #
141
- # @param volume [Symbol, SurgeAPI::Models::CampaignCreateParams::Volume] This will be one of the following:
142
- #
143
- # @param includes [Array<Symbol, SurgeAPI::Models::CampaignCreateParams::Include>] A list of properties that this campaign should include. These properties can be
144
- #
145
- # @param link_sample [String] A sample link that might be sent by this campaign. If links from other domains a
146
- #
147
- # @param terms_and_conditions_url [String] The URL of the terms and conditions presented to end users when they opt in to m
21
+ # @param campaign_params [SurgeAPI::Models::CampaignParams::StandardCampaignParams, SurgeAPI::Models::CampaignParams::ExternalCampaignParams] Parameters for creating a new campaign. Either provide full campaign details or
148
22
  #
149
23
  # @param request_options [SurgeAPI::RequestOptions, Hash{Symbol=>Object}]
150
-
151
- module UseCase
152
- extend SurgeAPI::Internal::Type::Enum
153
-
154
- ACCOUNT_NOTIFICATION = :account_notification
155
- CUSTOMER_CARE = :customer_care
156
- DELIVERY_NOTIFICATION = :delivery_notification
157
- FRAUD_ALERT = :fraud_alert
158
- HIGHER_EDUCATION = :higher_education
159
- MARKETING = :marketing
160
- POLLING_VOTING = :polling_voting
161
- PUBLIC_SERVICE_ANNOUNCEMENT = :public_service_announcement
162
- SECURITY_ALERT = :security_alert
163
- TWO_FACTOR_AUTHENTICATION = :two_factor_authentication
164
-
165
- # @!method self.values
166
- # @return [Array<Symbol>]
167
- end
168
-
169
- # This will be one of the following:
170
- #
171
- # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
172
- # T-Mobile customers each day. In this case your platform will be charged for
173
- # the setup fee for a low volume number upon receipt of the API request.
174
- # - `high` - The campaign will be allowed to send up to 200k SMS segments to
175
- # T-Mobile customers each day, depending on the trust score assigned by The
176
- # Campaign Registry. Your platform will be charged for the setup fee for a high
177
- # volume number upon receipt of the API request, and phone numbers will be
178
- # charged as high volume numbers going forward.
179
- module Volume
180
- extend SurgeAPI::Internal::Type::Enum
181
-
182
- HIGH = :high
183
- LOW = :low
184
-
185
- # @!method self.values
186
- # @return [Array<Symbol>]
187
- end
188
-
189
- module Include
190
- extend SurgeAPI::Internal::Type::Enum
191
-
192
- LINKS = :links
193
- PHONE_NUMBERS = :phone_numbers
194
- AGE_GATED = :age_gated
195
- DIRECT_LENDING = :direct_lending
196
-
197
- # @!method self.values
198
- # @return [Array<Symbol>]
199
- end
200
24
  end
201
25
  end
202
26
  end
@@ -0,0 +1,228 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ # Parameters for creating a new campaign. Either provide full campaign details or
6
+ # import using a TCR ID.
7
+ module CampaignParams
8
+ extend SurgeAPI::Internal::Type::Union
9
+
10
+ # Full campaign details for standard registration through Surge
11
+ variant -> { SurgeAPI::CampaignParams::StandardCampaignParams }
12
+
13
+ # Import an externally registered campaign from The Campaign Registry (TCR)
14
+ variant -> { SurgeAPI::CampaignParams::ExternalCampaignParams }
15
+
16
+ class StandardCampaignParams < SurgeAPI::Internal::Type::BaseModel
17
+ # @!attribute consent_flow
18
+ # A string explaining the method through which end users will opt in to receive
19
+ # messages from the brand. Typically this should include URLs for opt-in forms or
20
+ # screenshots that might be helpful in explaining the flow to someone unfamiliar
21
+ # with the organization's purpose.
22
+ #
23
+ # @return [String]
24
+ required :consent_flow, String
25
+
26
+ # @!attribute description
27
+ # An explanation of the organization's purpose and how it will be using text
28
+ # messaging to accomplish that purpose.
29
+ #
30
+ # @return [String]
31
+ required :description, String
32
+
33
+ # @!attribute message_samples
34
+ # An array of 2-5 strings with examples of the messages that will be sent from
35
+ # this campaign. Typically the first sample should be a compliance message like
36
+ # `You are now opted in to messages from {brand name}. Frequency varies. Msg&data rates apply. Reply STOP to opt out.`
37
+ # These samples don't necessarily need to be the only templates that will be used
38
+ # for the campaign, but they should reflect the purpose of the messages that will
39
+ # be sent. Any variable content can be reflected by wrapping it in square brackets
40
+ # like `[customer name]`.
41
+ #
42
+ # @return [Array<String>]
43
+ required :message_samples, SurgeAPI::Internal::Type::ArrayOf[String]
44
+
45
+ # @!attribute privacy_policy_url
46
+ # The URL of the privacy policy for the brand in question. This may be a shared
47
+ # privacy policy if it's the policy that is displayed to end users when they opt
48
+ # in to messaging.
49
+ #
50
+ # @return [String]
51
+ required :privacy_policy_url, String
52
+
53
+ # @!attribute use_cases
54
+ # A list containing 1-5 types of messages that will be sent with this campaign.
55
+ #
56
+ # The following use cases are typically available to all brands:
57
+ #
58
+ # - `account_notification` - For sending reminders, alerts, and general
59
+ # account-related notifications like booking confirmations or appointment
60
+ # reminders.
61
+ # - `customer_care` - For account support, troubleshooting, and general customer
62
+ # service communication.
63
+ # - `delivery_notification` - For notifying customers about the status of product
64
+ # or service deliveries.
65
+ # - `fraud_alert` - For warning customers about suspicious or potentially
66
+ # fraudulent activity.
67
+ # - `higher_education` - For messaging related to colleges, universities, and
68
+ # school districts outside of K–12.
69
+ # - `marketing` - For promotional or advertising messages intended to market
70
+ # products or services.
71
+ # - `polling_voting` - For conducting surveys, polls, or voting-related messaging.
72
+ # - `public_service_announcement` - For raising awareness about social issues or
73
+ # important public information.
74
+ # - `security_alert` - For alerts related to potential security breaches or
75
+ # compromised systems requiring user action.
76
+ # - `two_factor_authentication` - For sending one-time passwords or verification
77
+ # codes for login or password reset.
78
+ #
79
+ # For access to special use cases not shown here, reach out to support@surge.app.
80
+ #
81
+ # @return [Array<Symbol, SurgeAPI::Models::CampaignParams::StandardCampaignParams::UseCase>]
82
+ required :use_cases,
83
+ -> { SurgeAPI::Internal::Type::ArrayOf[enum: SurgeAPI::CampaignParams::StandardCampaignParams::UseCase] }
84
+
85
+ # @!attribute volume
86
+ # This will be one of the following:
87
+ #
88
+ # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
89
+ # T-Mobile customers each day. In this case your platform will be charged for
90
+ # the setup fee for a low volume number upon receipt of the API request.
91
+ # - `high` - The campaign will be allowed to send up to 200k SMS segments to
92
+ # T-Mobile customers each day, depending on the trust score assigned by The
93
+ # Campaign Registry. Your platform will be charged for the setup fee for a high
94
+ # volume number upon receipt of the API request, and phone numbers will be
95
+ # charged as high volume numbers going forward.
96
+ #
97
+ # @return [Symbol, SurgeAPI::Models::CampaignParams::StandardCampaignParams::Volume]
98
+ required :volume, enum: -> { SurgeAPI::CampaignParams::StandardCampaignParams::Volume }
99
+
100
+ # @!attribute includes
101
+ # A list of properties that this campaign should include. These properties can be
102
+ # any of the following values:
103
+ #
104
+ # - `links` - whether the campaign might send links in messages
105
+ # - `phone_numbers` - whether the campaign might send phone numbers in messages
106
+ # - `age_gated` - whether the campaign contains age gated content (controlled
107
+ # substances or adult content)
108
+ # - `direct_lending` - whether the campaign contains content related to direct
109
+ # lending or other loan arrangements
110
+ #
111
+ # @return [Array<Symbol, SurgeAPI::Models::CampaignParams::StandardCampaignParams::Include>, nil]
112
+ optional :includes,
113
+ -> { SurgeAPI::Internal::Type::ArrayOf[enum: SurgeAPI::CampaignParams::StandardCampaignParams::Include] }
114
+
115
+ # @!attribute link_sample
116
+ # A sample link that might be sent by this campaign. If links from other domains
117
+ # are sent through this campaign, they are much more likely to be filtered by the
118
+ # carriers. If link shortening is enabled for the account, the link shortener URL
119
+ # will be used instead of what is provided. Reach out to support if you would like
120
+ # to disable automatic link shortening.
121
+ #
122
+ # @return [String, nil]
123
+ optional :link_sample, String
124
+
125
+ # @!attribute terms_and_conditions_url
126
+ # The URL of the terms and conditions presented to end users when they opt in to
127
+ # messaging. These terms and conditions may be shared among all of a platform's
128
+ # customers if they're the terms that are presented to end users when they opt in
129
+ # to messaging.
130
+ #
131
+ # @return [String, nil]
132
+ optional :terms_and_conditions_url, String
133
+
134
+ # @!method initialize(consent_flow:, description:, message_samples:, privacy_policy_url:, use_cases:, volume:, includes: nil, link_sample: nil, terms_and_conditions_url: nil)
135
+ # Some parameter documentations has been truncated, see
136
+ # {SurgeAPI::Models::CampaignParams::StandardCampaignParams} for more details.
137
+ #
138
+ # Full campaign details for standard registration through Surge
139
+ #
140
+ # @param consent_flow [String] A string explaining the method through which end users will opt in to receive me
141
+ #
142
+ # @param description [String] An explanation of the organization's purpose and how it will be using text messa
143
+ #
144
+ # @param message_samples [Array<String>] An array of 2-5 strings with examples of the messages that will be sent from thi
145
+ #
146
+ # @param privacy_policy_url [String] The URL of the privacy policy for the brand in question. This may be a shared pr
147
+ #
148
+ # @param use_cases [Array<Symbol, SurgeAPI::Models::CampaignParams::StandardCampaignParams::UseCase>] A list containing 1-5 types of messages that will be sent with this campaign.
149
+ #
150
+ # @param volume [Symbol, SurgeAPI::Models::CampaignParams::StandardCampaignParams::Volume] This will be one of the following:
151
+ #
152
+ # @param includes [Array<Symbol, SurgeAPI::Models::CampaignParams::StandardCampaignParams::Include>] A list of properties that this campaign should include. These properties can be
153
+ #
154
+ # @param link_sample [String] A sample link that might be sent by this campaign. If links from other domains a
155
+ #
156
+ # @param terms_and_conditions_url [String] The URL of the terms and conditions presented to end users when they opt in to m
157
+
158
+ module UseCase
159
+ extend SurgeAPI::Internal::Type::Enum
160
+
161
+ ACCOUNT_NOTIFICATION = :account_notification
162
+ CUSTOMER_CARE = :customer_care
163
+ DELIVERY_NOTIFICATION = :delivery_notification
164
+ FRAUD_ALERT = :fraud_alert
165
+ HIGHER_EDUCATION = :higher_education
166
+ MARKETING = :marketing
167
+ POLLING_VOTING = :polling_voting
168
+ PUBLIC_SERVICE_ANNOUNCEMENT = :public_service_announcement
169
+ SECURITY_ALERT = :security_alert
170
+ TWO_FACTOR_AUTHENTICATION = :two_factor_authentication
171
+
172
+ # @!method self.values
173
+ # @return [Array<Symbol>]
174
+ end
175
+
176
+ # This will be one of the following:
177
+ #
178
+ # - `low` - The campaign will be allowed to send up to 2000 SMS segments to
179
+ # T-Mobile customers each day. In this case your platform will be charged for
180
+ # the setup fee for a low volume number upon receipt of the API request.
181
+ # - `high` - The campaign will be allowed to send up to 200k SMS segments to
182
+ # T-Mobile customers each day, depending on the trust score assigned by The
183
+ # Campaign Registry. Your platform will be charged for the setup fee for a high
184
+ # volume number upon receipt of the API request, and phone numbers will be
185
+ # charged as high volume numbers going forward.
186
+ #
187
+ # @see SurgeAPI::Models::CampaignParams::StandardCampaignParams#volume
188
+ module Volume
189
+ extend SurgeAPI::Internal::Type::Enum
190
+
191
+ HIGH = :high
192
+ LOW = :low
193
+
194
+ # @!method self.values
195
+ # @return [Array<Symbol>]
196
+ end
197
+
198
+ module Include
199
+ extend SurgeAPI::Internal::Type::Enum
200
+
201
+ LINKS = :links
202
+ PHONE_NUMBERS = :phone_numbers
203
+ AGE_GATED = :age_gated
204
+ DIRECT_LENDING = :direct_lending
205
+
206
+ # @!method self.values
207
+ # @return [Array<Symbol>]
208
+ end
209
+ end
210
+
211
+ class ExternalCampaignParams < SurgeAPI::Internal::Type::BaseModel
212
+ # @!attribute tcr_id
213
+ # The Campaign Registry (TCR) ID for the externally registered campaign
214
+ #
215
+ # @return [String]
216
+ required :tcr_id, String
217
+
218
+ # @!method initialize(tcr_id:)
219
+ # Import an externally registered campaign from The Campaign Registry (TCR)
220
+ #
221
+ # @param tcr_id [String] The Campaign Registry (TCR) ID for the externally registered campaign
222
+ end
223
+
224
+ # @!method self.variants
225
+ # @return [Array(SurgeAPI::Models::CampaignParams::StandardCampaignParams, SurgeAPI::Models::CampaignParams::ExternalCampaignParams)]
226
+ end
227
+ end
228
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class ContactOptedInWebhookEvent < 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::ContactOptedInWebhookEvent::Data]
16
+ required :data, -> { SurgeAPI::ContactOptedInWebhookEvent::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 `contact.opted_in` for this event.
26
+ #
27
+ # @return [Symbol, :"contact.opted_in"]
28
+ required :type, const: :"contact.opted_in"
29
+
30
+ # @!method initialize(account_id:, data:, timestamp:, type: :"contact.opted_in")
31
+ # @param account_id [String] The ID of the account in which this event occurred
32
+ #
33
+ # @param data [SurgeAPI::Models::ContactOptedInWebhookEvent::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, :"contact.opted_in"] The type of the event. Always `contact.opted_in` for this event.
38
+
39
+ # @see SurgeAPI::Models::ContactOptedInWebhookEvent#data
40
+ class Data < SurgeAPI::Internal::Type::BaseModel
41
+ # @!attribute id
42
+ # The unique identifier for the contact
43
+ #
44
+ # @return [String]
45
+ required :id, String
46
+
47
+ # @!method initialize(id:)
48
+ # The data associated with the event
49
+ #
50
+ # @param id [String] The unique identifier for the contact
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SurgeAPI
4
+ module Models
5
+ class ContactOptedOutWebhookEvent < 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::ContactOptedOutWebhookEvent::Data]
16
+ required :data, -> { SurgeAPI::ContactOptedOutWebhookEvent::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 `contact.opted_out` for this event.
26
+ #
27
+ # @return [Symbol, :"contact.opted_out"]
28
+ required :type, const: :"contact.opted_out"
29
+
30
+ # @!method initialize(account_id:, data:, timestamp:, type: :"contact.opted_out")
31
+ # @param account_id [String] The ID of the account in which this event occurred
32
+ #
33
+ # @param data [SurgeAPI::Models::ContactOptedOutWebhookEvent::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, :"contact.opted_out"] The type of the event. Always `contact.opted_out` for this event.
38
+
39
+ # @see SurgeAPI::Models::ContactOptedOutWebhookEvent#data
40
+ class Data < SurgeAPI::Internal::Type::BaseModel
41
+ # @!attribute id
42
+ # The unique identifier for the contact
43
+ #
44
+ # @return [String]
45
+ required :id, String
46
+
47
+ # @!method initialize(id:)
48
+ # The data associated with the event
49
+ #
50
+ # @param id [String] The unique identifier for the contact
51
+ end
52
+ end
53
+ end
54
+ end