prelude-sdk 0.1.0 → 0.2.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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +9 -9
  4. data/lib/prelude_sdk/client.rb +4 -0
  5. data/lib/prelude_sdk/models/notify_get_subscription_config_params.rb +14 -0
  6. data/lib/prelude_sdk/models/notify_get_subscription_config_response.rb +120 -0
  7. data/lib/prelude_sdk/models/notify_get_subscription_phone_number_params.rb +20 -0
  8. data/lib/prelude_sdk/models/notify_get_subscription_phone_number_response.rb +104 -0
  9. data/lib/prelude_sdk/models/notify_list_subscription_configs_params.rb +30 -0
  10. data/lib/prelude_sdk/models/notify_list_subscription_configs_response.rb +144 -0
  11. data/lib/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rb +37 -0
  12. data/lib/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rb +132 -0
  13. data/lib/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rb +49 -0
  14. data/lib/prelude_sdk/models/notify_list_subscription_phone_numbers_response.rb +132 -0
  15. data/lib/prelude_sdk/models/notify_send_batch_params.rb +110 -0
  16. data/lib/prelude_sdk/models/notify_send_batch_response.rb +201 -0
  17. data/lib/prelude_sdk/models/notify_send_params.rb +118 -0
  18. data/lib/prelude_sdk/models/notify_send_response.rb +94 -0
  19. data/lib/prelude_sdk/models.rb +15 -0
  20. data/lib/prelude_sdk/resources/notify.rb +247 -0
  21. data/lib/prelude_sdk/version.rb +1 -1
  22. data/lib/prelude_sdk.rb +16 -0
  23. data/manifest.yaml +1 -0
  24. data/rbi/prelude_sdk/client.rbi +3 -0
  25. data/rbi/prelude_sdk/models/notify_get_subscription_config_params.rbi +30 -0
  26. data/rbi/prelude_sdk/models/notify_get_subscription_config_response.rbi +224 -0
  27. data/rbi/prelude_sdk/models/notify_get_subscription_phone_number_params.rbi +38 -0
  28. data/rbi/prelude_sdk/models/notify_get_subscription_phone_number_response.rbi +199 -0
  29. data/rbi/prelude_sdk/models/notify_list_subscription_configs_params.rbi +60 -0
  30. data/rbi/prelude_sdk/models/notify_list_subscription_configs_response.rbi +286 -0
  31. data/rbi/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbi +66 -0
  32. data/rbi/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rbi +259 -0
  33. data/rbi/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbi +119 -0
  34. data/rbi/prelude_sdk/models/notify_list_subscription_phone_numbers_response.rbi +259 -0
  35. data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +191 -0
  36. data/rbi/prelude_sdk/models/notify_send_batch_response.rbi +360 -0
  37. data/rbi/prelude_sdk/models/notify_send_params.rbi +201 -0
  38. data/rbi/prelude_sdk/models/notify_send_response.rbi +128 -0
  39. data/rbi/prelude_sdk/models.rbi +19 -0
  40. data/rbi/prelude_sdk/resources/notify.rbi +218 -0
  41. data/sig/prelude_sdk/client.rbs +2 -0
  42. data/sig/prelude_sdk/models/notify_get_subscription_config_params.rbs +15 -0
  43. data/sig/prelude_sdk/models/notify_get_subscription_config_response.rbs +95 -0
  44. data/sig/prelude_sdk/models/notify_get_subscription_phone_number_params.rbs +23 -0
  45. data/sig/prelude_sdk/models/notify_get_subscription_phone_number_response.rbs +71 -0
  46. data/sig/prelude_sdk/models/notify_list_subscription_configs_params.rbs +32 -0
  47. data/sig/prelude_sdk/models/notify_list_subscription_configs_response.rbs +119 -0
  48. data/sig/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbs +36 -0
  49. data/sig/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rbs +95 -0
  50. data/sig/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbs +55 -0
  51. data/sig/prelude_sdk/models/notify_list_subscription_phone_numbers_response.rbs +95 -0
  52. data/sig/prelude_sdk/models/notify_send_batch_params.rbs +100 -0
  53. data/sig/prelude_sdk/models/notify_send_batch_response.rbs +187 -0
  54. data/sig/prelude_sdk/models/notify_send_params.rbs +100 -0
  55. data/sig/prelude_sdk/models/notify_send_response.rbs +73 -0
  56. data/sig/prelude_sdk/models.rbs +14 -0
  57. data/sig/prelude_sdk/resources/notify.rbs +68 -0
  58. metadata +47 -2
@@ -0,0 +1,224 @@
1
+ # typed: strong
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ class NotifyGetSubscriptionConfigResponse < PreludeSDK::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ PreludeSDK::Models::NotifyGetSubscriptionConfigResponse,
10
+ PreludeSDK::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The subscription configuration ID.
15
+ sig { returns(String) }
16
+ attr_accessor :id
17
+
18
+ # The URL to call when subscription status changes.
19
+ sig { returns(String) }
20
+ attr_accessor :callback_url
21
+
22
+ # The date and time when the configuration was created.
23
+ sig { returns(Time) }
24
+ attr_accessor :created_at
25
+
26
+ # The subscription messages configuration.
27
+ sig do
28
+ returns(
29
+ PreludeSDK::Models::NotifyGetSubscriptionConfigResponse::Messages
30
+ )
31
+ end
32
+ attr_reader :messages
33
+
34
+ sig do
35
+ params(
36
+ messages:
37
+ PreludeSDK::Models::NotifyGetSubscriptionConfigResponse::Messages::OrHash
38
+ ).void
39
+ end
40
+ attr_writer :messages
41
+
42
+ # The human-readable name for the subscription configuration.
43
+ sig { returns(String) }
44
+ attr_accessor :name
45
+
46
+ # The date and time when the configuration was last updated.
47
+ sig { returns(Time) }
48
+ attr_accessor :updated_at
49
+
50
+ # A list of phone numbers for receiving inbound messages.
51
+ sig do
52
+ returns(
53
+ T.nilable(
54
+ T::Array[
55
+ PreludeSDK::Models::NotifyGetSubscriptionConfigResponse::MoPhoneNumber
56
+ ]
57
+ )
58
+ )
59
+ end
60
+ attr_reader :mo_phone_numbers
61
+
62
+ sig do
63
+ params(
64
+ mo_phone_numbers:
65
+ T::Array[
66
+ PreludeSDK::Models::NotifyGetSubscriptionConfigResponse::MoPhoneNumber::OrHash
67
+ ]
68
+ ).void
69
+ end
70
+ attr_writer :mo_phone_numbers
71
+
72
+ sig do
73
+ params(
74
+ id: String,
75
+ callback_url: String,
76
+ created_at: Time,
77
+ messages:
78
+ PreludeSDK::Models::NotifyGetSubscriptionConfigResponse::Messages::OrHash,
79
+ name: String,
80
+ updated_at: Time,
81
+ mo_phone_numbers:
82
+ T::Array[
83
+ PreludeSDK::Models::NotifyGetSubscriptionConfigResponse::MoPhoneNumber::OrHash
84
+ ]
85
+ ).returns(T.attached_class)
86
+ end
87
+ def self.new(
88
+ # The subscription configuration ID.
89
+ id:,
90
+ # The URL to call when subscription status changes.
91
+ callback_url:,
92
+ # The date and time when the configuration was created.
93
+ created_at:,
94
+ # The subscription messages configuration.
95
+ messages:,
96
+ # The human-readable name for the subscription configuration.
97
+ name:,
98
+ # The date and time when the configuration was last updated.
99
+ updated_at:,
100
+ # A list of phone numbers for receiving inbound messages.
101
+ mo_phone_numbers: nil
102
+ )
103
+ end
104
+
105
+ sig do
106
+ override.returns(
107
+ {
108
+ id: String,
109
+ callback_url: String,
110
+ created_at: Time,
111
+ messages:
112
+ PreludeSDK::Models::NotifyGetSubscriptionConfigResponse::Messages,
113
+ name: String,
114
+ updated_at: Time,
115
+ mo_phone_numbers:
116
+ T::Array[
117
+ PreludeSDK::Models::NotifyGetSubscriptionConfigResponse::MoPhoneNumber
118
+ ]
119
+ }
120
+ )
121
+ end
122
+ def to_hash
123
+ end
124
+
125
+ class Messages < PreludeSDK::Internal::Type::BaseModel
126
+ OrHash =
127
+ T.type_alias do
128
+ T.any(
129
+ PreludeSDK::Models::NotifyGetSubscriptionConfigResponse::Messages,
130
+ PreludeSDK::Internal::AnyHash
131
+ )
132
+ end
133
+
134
+ # Message sent when user requests help.
135
+ sig { returns(T.nilable(String)) }
136
+ attr_reader :help_message
137
+
138
+ sig { params(help_message: String).void }
139
+ attr_writer :help_message
140
+
141
+ # Message sent when user subscribes.
142
+ sig { returns(T.nilable(String)) }
143
+ attr_reader :start_message
144
+
145
+ sig { params(start_message: String).void }
146
+ attr_writer :start_message
147
+
148
+ # Message sent when user unsubscribes.
149
+ sig { returns(T.nilable(String)) }
150
+ attr_reader :stop_message
151
+
152
+ sig { params(stop_message: String).void }
153
+ attr_writer :stop_message
154
+
155
+ # The subscription messages configuration.
156
+ sig do
157
+ params(
158
+ help_message: String,
159
+ start_message: String,
160
+ stop_message: String
161
+ ).returns(T.attached_class)
162
+ end
163
+ def self.new(
164
+ # Message sent when user requests help.
165
+ help_message: nil,
166
+ # Message sent when user subscribes.
167
+ start_message: nil,
168
+ # Message sent when user unsubscribes.
169
+ stop_message: nil
170
+ )
171
+ end
172
+
173
+ sig do
174
+ override.returns(
175
+ {
176
+ help_message: String,
177
+ start_message: String,
178
+ stop_message: String
179
+ }
180
+ )
181
+ end
182
+ def to_hash
183
+ end
184
+ end
185
+
186
+ class MoPhoneNumber < PreludeSDK::Internal::Type::BaseModel
187
+ OrHash =
188
+ T.type_alias do
189
+ T.any(
190
+ PreludeSDK::Models::NotifyGetSubscriptionConfigResponse::MoPhoneNumber,
191
+ PreludeSDK::Internal::AnyHash
192
+ )
193
+ end
194
+
195
+ # The ISO 3166-1 alpha-2 country code.
196
+ sig { returns(String) }
197
+ attr_accessor :country_code
198
+
199
+ # The phone number in E.164 format for long codes, or short code format for short
200
+ # codes.
201
+ sig { returns(String) }
202
+ attr_accessor :phone_number
203
+
204
+ sig do
205
+ params(country_code: String, phone_number: String).returns(
206
+ T.attached_class
207
+ )
208
+ end
209
+ def self.new(
210
+ # The ISO 3166-1 alpha-2 country code.
211
+ country_code:,
212
+ # The phone number in E.164 format for long codes, or short code format for short
213
+ # codes.
214
+ phone_number:
215
+ )
216
+ end
217
+
218
+ sig { override.returns({ country_code: String, phone_number: String }) }
219
+ def to_hash
220
+ end
221
+ end
222
+ end
223
+ end
224
+ end
@@ -0,0 +1,38 @@
1
+ # typed: strong
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ class NotifyGetSubscriptionPhoneNumberParams < PreludeSDK::Internal::Type::BaseModel
6
+ extend PreludeSDK::Internal::Type::RequestParameters::Converter
7
+ include PreludeSDK::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ PreludeSDK::NotifyGetSubscriptionPhoneNumberParams,
13
+ PreludeSDK::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :config_id
19
+
20
+ sig do
21
+ params(
22
+ config_id: String,
23
+ request_options: PreludeSDK::RequestOptions::OrHash
24
+ ).returns(T.attached_class)
25
+ end
26
+ def self.new(config_id:, request_options: {})
27
+ end
28
+
29
+ sig do
30
+ override.returns(
31
+ { config_id: String, request_options: PreludeSDK::RequestOptions }
32
+ )
33
+ end
34
+ def to_hash
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,199 @@
1
+ # typed: strong
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ class NotifyGetSubscriptionPhoneNumberResponse < PreludeSDK::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse,
10
+ PreludeSDK::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The subscription configuration ID.
15
+ sig { returns(String) }
16
+ attr_accessor :config_id
17
+
18
+ # The phone number in E.164 format.
19
+ sig { returns(String) }
20
+ attr_accessor :phone_number
21
+
22
+ # How the subscription state was changed:
23
+ #
24
+ # - `MO_KEYWORD` - User sent a keyword (STOP/START)
25
+ # - `API` - Changed via API
26
+ # - `CSV_IMPORT` - Imported from CSV
27
+ # - `CARRIER_DISCONNECT` - Automatically unsubscribed due to carrier disconnect
28
+ sig do
29
+ returns(
30
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::Source::TaggedSymbol
31
+ )
32
+ end
33
+ attr_accessor :source
34
+
35
+ # The subscription state:
36
+ #
37
+ # - `SUB` - Subscribed (user can receive marketing messages)
38
+ # - `UNSUB` - Unsubscribed (user has opted out)
39
+ sig do
40
+ returns(
41
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::State::TaggedSymbol
42
+ )
43
+ end
44
+ attr_accessor :state
45
+
46
+ # The date and time when the subscription status was last updated.
47
+ sig { returns(Time) }
48
+ attr_accessor :updated_at
49
+
50
+ # Additional context about the state change (e.g., the keyword that was sent).
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :reason
53
+
54
+ sig { params(reason: String).void }
55
+ attr_writer :reason
56
+
57
+ sig do
58
+ params(
59
+ config_id: String,
60
+ phone_number: String,
61
+ source:
62
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::Source::OrSymbol,
63
+ state:
64
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::State::OrSymbol,
65
+ updated_at: Time,
66
+ reason: String
67
+ ).returns(T.attached_class)
68
+ end
69
+ def self.new(
70
+ # The subscription configuration ID.
71
+ config_id:,
72
+ # The phone number in E.164 format.
73
+ phone_number:,
74
+ # How the subscription state was changed:
75
+ #
76
+ # - `MO_KEYWORD` - User sent a keyword (STOP/START)
77
+ # - `API` - Changed via API
78
+ # - `CSV_IMPORT` - Imported from CSV
79
+ # - `CARRIER_DISCONNECT` - Automatically unsubscribed due to carrier disconnect
80
+ source:,
81
+ # The subscription state:
82
+ #
83
+ # - `SUB` - Subscribed (user can receive marketing messages)
84
+ # - `UNSUB` - Unsubscribed (user has opted out)
85
+ state:,
86
+ # The date and time when the subscription status was last updated.
87
+ updated_at:,
88
+ # Additional context about the state change (e.g., the keyword that was sent).
89
+ reason: nil
90
+ )
91
+ end
92
+
93
+ sig do
94
+ override.returns(
95
+ {
96
+ config_id: String,
97
+ phone_number: String,
98
+ source:
99
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::Source::TaggedSymbol,
100
+ state:
101
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::State::TaggedSymbol,
102
+ updated_at: Time,
103
+ reason: String
104
+ }
105
+ )
106
+ end
107
+ def to_hash
108
+ end
109
+
110
+ # How the subscription state was changed:
111
+ #
112
+ # - `MO_KEYWORD` - User sent a keyword (STOP/START)
113
+ # - `API` - Changed via API
114
+ # - `CSV_IMPORT` - Imported from CSV
115
+ # - `CARRIER_DISCONNECT` - Automatically unsubscribed due to carrier disconnect
116
+ module Source
117
+ extend PreludeSDK::Internal::Type::Enum
118
+
119
+ TaggedSymbol =
120
+ T.type_alias do
121
+ T.all(
122
+ Symbol,
123
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::Source
124
+ )
125
+ end
126
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
127
+
128
+ MO_KEYWORD =
129
+ T.let(
130
+ :MO_KEYWORD,
131
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::Source::TaggedSymbol
132
+ )
133
+ API =
134
+ T.let(
135
+ :API,
136
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::Source::TaggedSymbol
137
+ )
138
+ CSV_IMPORT =
139
+ T.let(
140
+ :CSV_IMPORT,
141
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::Source::TaggedSymbol
142
+ )
143
+ CARRIER_DISCONNECT =
144
+ T.let(
145
+ :CARRIER_DISCONNECT,
146
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::Source::TaggedSymbol
147
+ )
148
+
149
+ sig do
150
+ override.returns(
151
+ T::Array[
152
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::Source::TaggedSymbol
153
+ ]
154
+ )
155
+ end
156
+ def self.values
157
+ end
158
+ end
159
+
160
+ # The subscription state:
161
+ #
162
+ # - `SUB` - Subscribed (user can receive marketing messages)
163
+ # - `UNSUB` - Unsubscribed (user has opted out)
164
+ module State
165
+ extend PreludeSDK::Internal::Type::Enum
166
+
167
+ TaggedSymbol =
168
+ T.type_alias do
169
+ T.all(
170
+ Symbol,
171
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::State
172
+ )
173
+ end
174
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
175
+
176
+ SUB =
177
+ T.let(
178
+ :SUB,
179
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::State::TaggedSymbol
180
+ )
181
+ UNSUB =
182
+ T.let(
183
+ :UNSUB,
184
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::State::TaggedSymbol
185
+ )
186
+
187
+ sig do
188
+ override.returns(
189
+ T::Array[
190
+ PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse::State::TaggedSymbol
191
+ ]
192
+ )
193
+ end
194
+ def self.values
195
+ end
196
+ end
197
+ end
198
+ end
199
+ end
@@ -0,0 +1,60 @@
1
+ # typed: strong
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ class NotifyListSubscriptionConfigsParams < PreludeSDK::Internal::Type::BaseModel
6
+ extend PreludeSDK::Internal::Type::RequestParameters::Converter
7
+ include PreludeSDK::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ PreludeSDK::NotifyListSubscriptionConfigsParams,
13
+ PreludeSDK::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # Pagination cursor from the previous response
18
+ sig { returns(T.nilable(String)) }
19
+ attr_reader :cursor
20
+
21
+ sig { params(cursor: String).void }
22
+ attr_writer :cursor
23
+
24
+ # Maximum number of configurations to return per page
25
+ sig { returns(T.nilable(Integer)) }
26
+ attr_reader :limit
27
+
28
+ sig { params(limit: Integer).void }
29
+ attr_writer :limit
30
+
31
+ sig do
32
+ params(
33
+ cursor: String,
34
+ limit: Integer,
35
+ request_options: PreludeSDK::RequestOptions::OrHash
36
+ ).returns(T.attached_class)
37
+ end
38
+ def self.new(
39
+ # Pagination cursor from the previous response
40
+ cursor: nil,
41
+ # Maximum number of configurations to return per page
42
+ limit: nil,
43
+ request_options: {}
44
+ )
45
+ end
46
+
47
+ sig do
48
+ override.returns(
49
+ {
50
+ cursor: String,
51
+ limit: Integer,
52
+ request_options: PreludeSDK::RequestOptions
53
+ }
54
+ )
55
+ end
56
+ def to_hash
57
+ end
58
+ end
59
+ end
60
+ end