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,132 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ # @see PreludeSDK::Resources::Notify#list_subscription_phone_number_events
6
+ class NotifyListSubscriptionPhoneNumberEventsResponse < PreludeSDK::Internal::Type::BaseModel
7
+ # @!attribute events
8
+ # A list of subscription events (status changes) ordered by timestamp descending.
9
+ #
10
+ # @return [Array<PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event>]
11
+ required :events,
12
+ -> { PreludeSDK::Internal::Type::ArrayOf[PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event] }
13
+
14
+ # @!attribute next_cursor
15
+ # Pagination cursor for the next page of results. Omitted if there are no more
16
+ # pages.
17
+ #
18
+ # @return [String, nil]
19
+ optional :next_cursor, String
20
+
21
+ # @!method initialize(events:, next_cursor: nil)
22
+ # Some parameter documentations has been truncated, see
23
+ # {PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse} for more
24
+ # details.
25
+ #
26
+ # @param events [Array<PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event>] A list of subscription events (status changes) ordered by timestamp descending.
27
+ #
28
+ # @param next_cursor [String] Pagination cursor for the next page of results. Omitted if there are no more pag
29
+
30
+ class Event < PreludeSDK::Internal::Type::BaseModel
31
+ # @!attribute config_id
32
+ # The subscription configuration ID.
33
+ #
34
+ # @return [String]
35
+ required :config_id, String
36
+
37
+ # @!attribute phone_number
38
+ # The phone number in E.164 format.
39
+ #
40
+ # @return [String]
41
+ required :phone_number, String
42
+
43
+ # @!attribute source
44
+ # How the subscription state was changed:
45
+ #
46
+ # - `MO_KEYWORD` - User sent a keyword (STOP/START)
47
+ # - `API` - Changed via API
48
+ # - `CSV_IMPORT` - Imported from CSV
49
+ # - `CARRIER_DISCONNECT` - Automatically unsubscribed due to carrier disconnect
50
+ #
51
+ # @return [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::Source]
52
+ required :source,
53
+ enum: -> { PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::Source }
54
+
55
+ # @!attribute state
56
+ # The subscription state after this event:
57
+ #
58
+ # - `SUB` - Subscribed (user can receive marketing messages)
59
+ # - `UNSUB` - Unsubscribed (user has opted out)
60
+ #
61
+ # @return [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::State]
62
+ required :state,
63
+ enum: -> { PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::State }
64
+
65
+ # @!attribute timestamp
66
+ # The date and time when the event occurred.
67
+ #
68
+ # @return [Time]
69
+ required :timestamp, Time
70
+
71
+ # @!attribute reason
72
+ # Additional context about the state change (e.g., the keyword that was sent).
73
+ #
74
+ # @return [String, nil]
75
+ optional :reason, String
76
+
77
+ # @!method initialize(config_id:, phone_number:, source:, state:, timestamp:, reason: nil)
78
+ # Some parameter documentations has been truncated, see
79
+ # {PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event} for
80
+ # more details.
81
+ #
82
+ # @param config_id [String] The subscription configuration ID.
83
+ #
84
+ # @param phone_number [String] The phone number in E.164 format.
85
+ #
86
+ # @param source [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::Source] How the subscription state was changed:
87
+ #
88
+ # @param state [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::State] The subscription state after this event:
89
+ #
90
+ # @param timestamp [Time] The date and time when the event occurred.
91
+ #
92
+ # @param reason [String] Additional context about the state change (e.g., the keyword that was sent).
93
+
94
+ # How the subscription state was changed:
95
+ #
96
+ # - `MO_KEYWORD` - User sent a keyword (STOP/START)
97
+ # - `API` - Changed via API
98
+ # - `CSV_IMPORT` - Imported from CSV
99
+ # - `CARRIER_DISCONNECT` - Automatically unsubscribed due to carrier disconnect
100
+ #
101
+ # @see PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event#source
102
+ module Source
103
+ extend PreludeSDK::Internal::Type::Enum
104
+
105
+ MO_KEYWORD = :MO_KEYWORD
106
+ API = :API
107
+ CSV_IMPORT = :CSV_IMPORT
108
+ CARRIER_DISCONNECT = :CARRIER_DISCONNECT
109
+
110
+ # @!method self.values
111
+ # @return [Array<Symbol>]
112
+ end
113
+
114
+ # The subscription state after this event:
115
+ #
116
+ # - `SUB` - Subscribed (user can receive marketing messages)
117
+ # - `UNSUB` - Unsubscribed (user has opted out)
118
+ #
119
+ # @see PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event#state
120
+ module State
121
+ extend PreludeSDK::Internal::Type::Enum
122
+
123
+ SUB = :SUB
124
+ UNSUB = :UNSUB
125
+
126
+ # @!method self.values
127
+ # @return [Array<Symbol>]
128
+ end
129
+ end
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ # @see PreludeSDK::Resources::Notify#list_subscription_phone_numbers
6
+ class NotifyListSubscriptionPhoneNumbersParams < PreludeSDK::Internal::Type::BaseModel
7
+ extend PreludeSDK::Internal::Type::RequestParameters::Converter
8
+ include PreludeSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute cursor
11
+ # Pagination cursor from the previous response
12
+ #
13
+ # @return [String, nil]
14
+ optional :cursor, String
15
+
16
+ # @!attribute limit
17
+ # Maximum number of phone numbers to return per page
18
+ #
19
+ # @return [Integer, nil]
20
+ optional :limit, Integer
21
+
22
+ # @!attribute state
23
+ # Filter by subscription state
24
+ #
25
+ # @return [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersParams::State, nil]
26
+ optional :state, enum: -> { PreludeSDK::NotifyListSubscriptionPhoneNumbersParams::State }
27
+
28
+ # @!method initialize(cursor: nil, limit: nil, state: nil, request_options: {})
29
+ # @param cursor [String] Pagination cursor from the previous response
30
+ #
31
+ # @param limit [Integer] Maximum number of phone numbers to return per page
32
+ #
33
+ # @param state [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersParams::State] Filter by subscription state
34
+ #
35
+ # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
36
+
37
+ # Filter by subscription state
38
+ module State
39
+ extend PreludeSDK::Internal::Type::Enum
40
+
41
+ SUB = :SUB
42
+ UNSUB = :UNSUB
43
+
44
+ # @!method self.values
45
+ # @return [Array<Symbol>]
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,132 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ # @see PreludeSDK::Resources::Notify#list_subscription_phone_numbers
6
+ class NotifyListSubscriptionPhoneNumbersResponse < PreludeSDK::Internal::Type::BaseModel
7
+ # @!attribute phone_numbers
8
+ # A list of phone numbers and their subscription statuses.
9
+ #
10
+ # @return [Array<PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse::PhoneNumber>]
11
+ required :phone_numbers,
12
+ -> { PreludeSDK::Internal::Type::ArrayOf[PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse::PhoneNumber] }
13
+
14
+ # @!attribute next_cursor
15
+ # Pagination cursor for the next page of results. Omitted if there are no more
16
+ # pages.
17
+ #
18
+ # @return [String, nil]
19
+ optional :next_cursor, String
20
+
21
+ # @!method initialize(phone_numbers:, next_cursor: nil)
22
+ # Some parameter documentations has been truncated, see
23
+ # {PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse} for more
24
+ # details.
25
+ #
26
+ # @param phone_numbers [Array<PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse::PhoneNumber>] A list of phone numbers and their subscription statuses.
27
+ #
28
+ # @param next_cursor [String] Pagination cursor for the next page of results. Omitted if there are no more pag
29
+
30
+ class PhoneNumber < PreludeSDK::Internal::Type::BaseModel
31
+ # @!attribute config_id
32
+ # The subscription configuration ID.
33
+ #
34
+ # @return [String]
35
+ required :config_id, String
36
+
37
+ # @!attribute phone_number
38
+ # The phone number in E.164 format.
39
+ #
40
+ # @return [String]
41
+ required :phone_number, String
42
+
43
+ # @!attribute source
44
+ # How the subscription state was changed:
45
+ #
46
+ # - `MO_KEYWORD` - User sent a keyword (STOP/START)
47
+ # - `API` - Changed via API
48
+ # - `CSV_IMPORT` - Imported from CSV
49
+ # - `CARRIER_DISCONNECT` - Automatically unsubscribed due to carrier disconnect
50
+ #
51
+ # @return [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse::PhoneNumber::Source]
52
+ required :source,
53
+ enum: -> { PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse::PhoneNumber::Source }
54
+
55
+ # @!attribute state
56
+ # The subscription state:
57
+ #
58
+ # - `SUB` - Subscribed (user can receive marketing messages)
59
+ # - `UNSUB` - Unsubscribed (user has opted out)
60
+ #
61
+ # @return [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse::PhoneNumber::State]
62
+ required :state,
63
+ enum: -> { PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse::PhoneNumber::State }
64
+
65
+ # @!attribute updated_at
66
+ # The date and time when the subscription status was last updated.
67
+ #
68
+ # @return [Time]
69
+ required :updated_at, Time
70
+
71
+ # @!attribute reason
72
+ # Additional context about the state change (e.g., the keyword that was sent).
73
+ #
74
+ # @return [String, nil]
75
+ optional :reason, String
76
+
77
+ # @!method initialize(config_id:, phone_number:, source:, state:, updated_at:, reason: nil)
78
+ # Some parameter documentations has been truncated, see
79
+ # {PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse::PhoneNumber}
80
+ # for more details.
81
+ #
82
+ # @param config_id [String] The subscription configuration ID.
83
+ #
84
+ # @param phone_number [String] The phone number in E.164 format.
85
+ #
86
+ # @param source [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse::PhoneNumber::Source] How the subscription state was changed:
87
+ #
88
+ # @param state [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse::PhoneNumber::State] The subscription state:
89
+ #
90
+ # @param updated_at [Time] The date and time when the subscription status was last updated.
91
+ #
92
+ # @param reason [String] Additional context about the state change (e.g., the keyword that was sent).
93
+
94
+ # How the subscription state was changed:
95
+ #
96
+ # - `MO_KEYWORD` - User sent a keyword (STOP/START)
97
+ # - `API` - Changed via API
98
+ # - `CSV_IMPORT` - Imported from CSV
99
+ # - `CARRIER_DISCONNECT` - Automatically unsubscribed due to carrier disconnect
100
+ #
101
+ # @see PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse::PhoneNumber#source
102
+ module Source
103
+ extend PreludeSDK::Internal::Type::Enum
104
+
105
+ MO_KEYWORD = :MO_KEYWORD
106
+ API = :API
107
+ CSV_IMPORT = :CSV_IMPORT
108
+ CARRIER_DISCONNECT = :CARRIER_DISCONNECT
109
+
110
+ # @!method self.values
111
+ # @return [Array<Symbol>]
112
+ end
113
+
114
+ # The subscription state:
115
+ #
116
+ # - `SUB` - Subscribed (user can receive marketing messages)
117
+ # - `UNSUB` - Unsubscribed (user has opted out)
118
+ #
119
+ # @see PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse::PhoneNumber#state
120
+ module State
121
+ extend PreludeSDK::Internal::Type::Enum
122
+
123
+ SUB = :SUB
124
+ UNSUB = :UNSUB
125
+
126
+ # @!method self.values
127
+ # @return [Array<Symbol>]
128
+ end
129
+ end
130
+ end
131
+ end
132
+ end
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ # @see PreludeSDK::Resources::Notify#send_batch
6
+ class NotifySendBatchParams < PreludeSDK::Internal::Type::BaseModel
7
+ extend PreludeSDK::Internal::Type::RequestParameters::Converter
8
+ include PreludeSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute template_id
11
+ # The template identifier configured by your Customer Success team.
12
+ #
13
+ # @return [String]
14
+ required :template_id, String
15
+
16
+ # @!attribute to
17
+ # The list of recipients' phone numbers in E.164 format.
18
+ #
19
+ # @return [Array<String>]
20
+ required :to, PreludeSDK::Internal::Type::ArrayOf[String]
21
+
22
+ # @!attribute callback_url
23
+ # The URL where webhooks will be sent for delivery events.
24
+ #
25
+ # @return [String, nil]
26
+ optional :callback_url, String
27
+
28
+ # @!attribute correlation_id
29
+ # A user-defined identifier to correlate this request with your internal systems.
30
+ #
31
+ # @return [String, nil]
32
+ optional :correlation_id, String
33
+
34
+ # @!attribute expires_at
35
+ # The message expiration date in RFC3339 format. Messages will not be sent after
36
+ # this time.
37
+ #
38
+ # @return [Time, nil]
39
+ optional :expires_at, Time
40
+
41
+ # @!attribute from
42
+ # The Sender ID. Must be approved for your account.
43
+ #
44
+ # @return [String, nil]
45
+ optional :from, String
46
+
47
+ # @!attribute locale
48
+ # A BCP-47 formatted locale string.
49
+ #
50
+ # @return [String, nil]
51
+ optional :locale, String
52
+
53
+ # @!attribute preferred_channel
54
+ # Preferred channel for delivery. If unavailable, automatic fallback applies.
55
+ #
56
+ # @return [Symbol, PreludeSDK::Models::NotifySendBatchParams::PreferredChannel, nil]
57
+ optional :preferred_channel, enum: -> { PreludeSDK::NotifySendBatchParams::PreferredChannel }
58
+
59
+ # @!attribute schedule_at
60
+ # Schedule delivery in RFC3339 format. Marketing sends may be adjusted to comply
61
+ # with local time windows.
62
+ #
63
+ # @return [Time, nil]
64
+ optional :schedule_at, Time
65
+
66
+ # @!attribute variables
67
+ # The variables to be replaced in the template.
68
+ #
69
+ # @return [Hash{Symbol=>String}, nil]
70
+ optional :variables, PreludeSDK::Internal::Type::HashOf[String]
71
+
72
+ # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
73
+ # Some parameter documentations has been truncated, see
74
+ # {PreludeSDK::Models::NotifySendBatchParams} for more details.
75
+ #
76
+ # @param template_id [String] The template identifier configured by your Customer Success team.
77
+ #
78
+ # @param to [Array<String>] The list of recipients' phone numbers in E.164 format.
79
+ #
80
+ # @param callback_url [String] The URL where webhooks will be sent for delivery events.
81
+ #
82
+ # @param correlation_id [String] A user-defined identifier to correlate this request with your internal systems.
83
+ #
84
+ # @param expires_at [Time] The message expiration date in RFC3339 format. Messages will not be sent after t
85
+ #
86
+ # @param from [String] The Sender ID. Must be approved for your account.
87
+ #
88
+ # @param locale [String] A BCP-47 formatted locale string.
89
+ #
90
+ # @param preferred_channel [Symbol, PreludeSDK::Models::NotifySendBatchParams::PreferredChannel] Preferred channel for delivery. If unavailable, automatic fallback applies.
91
+ #
92
+ # @param schedule_at [Time] Schedule delivery in RFC3339 format. Marketing sends may be adjusted to comply w
93
+ #
94
+ # @param variables [Hash{Symbol=>String}] The variables to be replaced in the template.
95
+ #
96
+ # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
97
+
98
+ # Preferred channel for delivery. If unavailable, automatic fallback applies.
99
+ module PreferredChannel
100
+ extend PreludeSDK::Internal::Type::Enum
101
+
102
+ SMS = :sms
103
+ WHATSAPP = :whatsapp
104
+
105
+ # @!method self.values
106
+ # @return [Array<Symbol>]
107
+ end
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,201 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ # @see PreludeSDK::Resources::Notify#send_batch
6
+ class NotifySendBatchResponse < PreludeSDK::Internal::Type::BaseModel
7
+ # @!attribute error_count
8
+ # Number of failed sends.
9
+ #
10
+ # @return [Integer]
11
+ required :error_count, Integer
12
+
13
+ # @!attribute results
14
+ # The per-recipient result of the bulk send.
15
+ #
16
+ # @return [Array<PreludeSDK::Models::NotifySendBatchResponse::Result>]
17
+ required :results,
18
+ -> { PreludeSDK::Internal::Type::ArrayOf[PreludeSDK::Models::NotifySendBatchResponse::Result] }
19
+
20
+ # @!attribute success_count
21
+ # Number of successful sends.
22
+ #
23
+ # @return [Integer]
24
+ required :success_count, Integer
25
+
26
+ # @!attribute total_count
27
+ # Total number of recipients.
28
+ #
29
+ # @return [Integer]
30
+ required :total_count, Integer
31
+
32
+ # @!attribute callback_url
33
+ # The callback URL used for this bulk request, if any.
34
+ #
35
+ # @return [String, nil]
36
+ optional :callback_url, String
37
+
38
+ # @!attribute request_id
39
+ # A string that identifies this specific request.
40
+ #
41
+ # @return [String, nil]
42
+ optional :request_id, String
43
+
44
+ # @!attribute template_id
45
+ # The template identifier used for this bulk request.
46
+ #
47
+ # @return [String, nil]
48
+ optional :template_id, String
49
+
50
+ # @!attribute variables
51
+ # The variables used for this bulk request.
52
+ #
53
+ # @return [Hash{Symbol=>String}, nil]
54
+ optional :variables, PreludeSDK::Internal::Type::HashOf[String]
55
+
56
+ # @!method initialize(error_count:, results:, success_count:, total_count:, callback_url: nil, request_id: nil, template_id: nil, variables: nil)
57
+ # @param error_count [Integer] Number of failed sends.
58
+ #
59
+ # @param results [Array<PreludeSDK::Models::NotifySendBatchResponse::Result>] The per-recipient result of the bulk send.
60
+ #
61
+ # @param success_count [Integer] Number of successful sends.
62
+ #
63
+ # @param total_count [Integer] Total number of recipients.
64
+ #
65
+ # @param callback_url [String] The callback URL used for this bulk request, if any.
66
+ #
67
+ # @param request_id [String] A string that identifies this specific request.
68
+ #
69
+ # @param template_id [String] The template identifier used for this bulk request.
70
+ #
71
+ # @param variables [Hash{Symbol=>String}] The variables used for this bulk request.
72
+
73
+ class Result < PreludeSDK::Internal::Type::BaseModel
74
+ # @!attribute phone_number
75
+ # The recipient's phone number in E.164 format.
76
+ #
77
+ # @return [String]
78
+ required :phone_number, String
79
+
80
+ # @!attribute success
81
+ # Whether the message was accepted for delivery.
82
+ #
83
+ # @return [Boolean]
84
+ required :success, PreludeSDK::Internal::Type::Boolean
85
+
86
+ # @!attribute error
87
+ # Present only if success is false.
88
+ #
89
+ # @return [PreludeSDK::Models::NotifySendBatchResponse::Result::Error, nil]
90
+ optional :error, -> { PreludeSDK::Models::NotifySendBatchResponse::Result::Error }
91
+
92
+ # @!attribute message
93
+ # Present only if success is true.
94
+ #
95
+ # @return [PreludeSDK::Models::NotifySendBatchResponse::Result::Message, nil]
96
+ optional :message, -> { PreludeSDK::Models::NotifySendBatchResponse::Result::Message }
97
+
98
+ # @!method initialize(phone_number:, success:, error: nil, message: nil)
99
+ # @param phone_number [String] The recipient's phone number in E.164 format.
100
+ #
101
+ # @param success [Boolean] Whether the message was accepted for delivery.
102
+ #
103
+ # @param error [PreludeSDK::Models::NotifySendBatchResponse::Result::Error] Present only if success is false.
104
+ #
105
+ # @param message [PreludeSDK::Models::NotifySendBatchResponse::Result::Message] Present only if success is true.
106
+
107
+ # @see PreludeSDK::Models::NotifySendBatchResponse::Result#error
108
+ class Error < PreludeSDK::Internal::Type::BaseModel
109
+ # @!attribute code
110
+ # The error code.
111
+ #
112
+ # @return [String, nil]
113
+ optional :code, String
114
+
115
+ # @!attribute message
116
+ # A human-readable error message.
117
+ #
118
+ # @return [String, nil]
119
+ optional :message, String
120
+
121
+ # @!method initialize(code: nil, message: nil)
122
+ # Present only if success is false.
123
+ #
124
+ # @param code [String] The error code.
125
+ #
126
+ # @param message [String] A human-readable error message.
127
+ end
128
+
129
+ # @see PreludeSDK::Models::NotifySendBatchResponse::Result#message
130
+ class Message < PreludeSDK::Internal::Type::BaseModel
131
+ # @!attribute id
132
+ # The message identifier.
133
+ #
134
+ # @return [String, nil]
135
+ optional :id, String
136
+
137
+ # @!attribute correlation_id
138
+ # The correlation identifier for the message.
139
+ #
140
+ # @return [String, nil]
141
+ optional :correlation_id, String
142
+
143
+ # @!attribute created_at
144
+ # The message creation date in RFC3339 format.
145
+ #
146
+ # @return [Time, nil]
147
+ optional :created_at, Time
148
+
149
+ # @!attribute expires_at
150
+ # The message expiration date in RFC3339 format.
151
+ #
152
+ # @return [Time, nil]
153
+ optional :expires_at, Time
154
+
155
+ # @!attribute from
156
+ # The Sender ID used for this message.
157
+ #
158
+ # @return [String, nil]
159
+ optional :from, String
160
+
161
+ # @!attribute locale
162
+ # The locale used for the message, if any.
163
+ #
164
+ # @return [String, nil]
165
+ optional :locale, String
166
+
167
+ # @!attribute schedule_at
168
+ # When the message will actually be sent in RFC3339 format with timezone offset.
169
+ #
170
+ # @return [Time, nil]
171
+ optional :schedule_at, Time
172
+
173
+ # @!attribute to
174
+ # The recipient's phone number in E.164 format.
175
+ #
176
+ # @return [String, nil]
177
+ optional :to, String
178
+
179
+ # @!method initialize(id: nil, correlation_id: nil, created_at: nil, expires_at: nil, from: nil, locale: nil, schedule_at: nil, to: nil)
180
+ # Present only if success is true.
181
+ #
182
+ # @param id [String] The message identifier.
183
+ #
184
+ # @param correlation_id [String] The correlation identifier for the message.
185
+ #
186
+ # @param created_at [Time] The message creation date in RFC3339 format.
187
+ #
188
+ # @param expires_at [Time] The message expiration date in RFC3339 format.
189
+ #
190
+ # @param from [String] The Sender ID used for this message.
191
+ #
192
+ # @param locale [String] The locale used for the message, if any.
193
+ #
194
+ # @param schedule_at [Time] When the message will actually be sent in RFC3339 format with timezone offset.
195
+ #
196
+ # @param to [String] The recipient's phone number in E.164 format.
197
+ end
198
+ end
199
+ end
200
+ end
201
+ end