prelude-sdk 0.1.0 → 0.3.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 (102) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +61 -0
  3. data/README.md +9 -9
  4. data/lib/prelude_sdk/client.rb +11 -0
  5. data/lib/prelude_sdk/internal/transport/pooled_net_requester.rb +13 -11
  6. data/lib/prelude_sdk/internal/util.rb +39 -3
  7. data/lib/prelude_sdk/models/lookup_lookup_params.rb +9 -1
  8. data/lib/prelude_sdk/models/notify_get_subscription_config_params.rb +20 -0
  9. data/lib/prelude_sdk/models/notify_get_subscription_config_response.rb +120 -0
  10. data/lib/prelude_sdk/models/notify_get_subscription_phone_number_params.rb +26 -0
  11. data/lib/prelude_sdk/models/notify_get_subscription_phone_number_response.rb +104 -0
  12. data/lib/prelude_sdk/models/notify_list_subscription_configs_params.rb +30 -0
  13. data/lib/prelude_sdk/models/notify_list_subscription_configs_response.rb +144 -0
  14. data/lib/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rb +44 -0
  15. data/lib/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rb +132 -0
  16. data/lib/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rb +56 -0
  17. data/lib/prelude_sdk/models/notify_list_subscription_phone_numbers_response.rb +132 -0
  18. data/lib/prelude_sdk/models/notify_send_batch_params.rb +141 -0
  19. data/lib/prelude_sdk/models/notify_send_batch_response.rb +239 -0
  20. data/lib/prelude_sdk/models/notify_send_params.rb +149 -0
  21. data/lib/prelude_sdk/models/notify_send_response.rb +129 -0
  22. data/lib/prelude_sdk/models/transactional_send_params.rb +32 -1
  23. data/lib/prelude_sdk/models/verification_create_params.rb +35 -48
  24. data/lib/prelude_sdk/models/verification_create_response.rb +15 -0
  25. data/lib/prelude_sdk/models/verification_management_delete_phone_number_params.rb +8 -1
  26. data/lib/prelude_sdk/models/verification_management_list_phone_numbers_params.rb +7 -1
  27. data/lib/prelude_sdk/models/verification_management_set_phone_number_params.rb +8 -1
  28. data/lib/prelude_sdk/models/watch_predict_params.rb +16 -12
  29. data/lib/prelude_sdk/models/watch_predict_response.rb +51 -1
  30. data/lib/prelude_sdk/models/watch_send_feedbacks_params.rb +1 -128
  31. data/lib/prelude_sdk/models.rb +15 -0
  32. data/lib/prelude_sdk/resources/lookup.rb +4 -1
  33. data/lib/prelude_sdk/resources/notify.rb +255 -0
  34. data/lib/prelude_sdk/resources/transactional.rb +4 -1
  35. data/lib/prelude_sdk/resources/verification.rb +1 -0
  36. data/lib/prelude_sdk/resources/verification_management.rb +1 -0
  37. data/lib/prelude_sdk/resources/watch.rb +1 -0
  38. data/lib/prelude_sdk/version.rb +1 -1
  39. data/lib/prelude_sdk.rb +16 -0
  40. data/manifest.yaml +1 -0
  41. data/rbi/prelude_sdk/client.rbi +10 -0
  42. data/rbi/prelude_sdk/internal/util.rbi +21 -1
  43. data/rbi/prelude_sdk/models/lookup_lookup_params.rbi +8 -0
  44. data/rbi/prelude_sdk/models/notify_get_subscription_config_params.rbi +38 -0
  45. data/rbi/prelude_sdk/models/notify_get_subscription_config_response.rbi +224 -0
  46. data/rbi/prelude_sdk/models/notify_get_subscription_phone_number_params.rbi +46 -0
  47. data/rbi/prelude_sdk/models/notify_get_subscription_phone_number_response.rbi +199 -0
  48. data/rbi/prelude_sdk/models/notify_list_subscription_configs_params.rbi +60 -0
  49. data/rbi/prelude_sdk/models/notify_list_subscription_configs_response.rbi +286 -0
  50. data/rbi/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbi +72 -0
  51. data/rbi/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rbi +259 -0
  52. data/rbi/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbi +125 -0
  53. data/rbi/prelude_sdk/models/notify_list_subscription_phone_numbers_response.rbi +259 -0
  54. data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +241 -0
  55. data/rbi/prelude_sdk/models/notify_send_batch_response.rbi +440 -0
  56. data/rbi/prelude_sdk/models/notify_send_params.rbi +249 -0
  57. data/rbi/prelude_sdk/models/notify_send_response.rbi +203 -0
  58. data/rbi/prelude_sdk/models/transactional_send_params.rbi +50 -0
  59. data/rbi/prelude_sdk/models/verification_create_params.rbi +53 -93
  60. data/rbi/prelude_sdk/models/verification_create_response.rbi +26 -0
  61. data/rbi/prelude_sdk/models/verification_management_delete_phone_number_params.rbi +16 -1
  62. data/rbi/prelude_sdk/models/verification_management_list_phone_numbers_params.rbi +21 -4
  63. data/rbi/prelude_sdk/models/verification_management_set_phone_number_params.rbi +16 -1
  64. data/rbi/prelude_sdk/models/watch_predict_params.rbi +24 -16
  65. data/rbi/prelude_sdk/models/watch_predict_response.rbi +152 -3
  66. data/rbi/prelude_sdk/models/watch_send_feedbacks_params.rbi +3 -243
  67. data/rbi/prelude_sdk/models.rbi +19 -0
  68. data/rbi/prelude_sdk/resources/lookup.rbi +2 -0
  69. data/rbi/prelude_sdk/resources/notify.rbi +227 -0
  70. data/rbi/prelude_sdk/resources/transactional.rbi +5 -0
  71. data/rbi/prelude_sdk/resources/verification.rbi +1 -0
  72. data/rbi/prelude_sdk/resources/verification_management.rbi +1 -0
  73. data/rbi/prelude_sdk/resources/watch.rbi +1 -0
  74. data/sig/prelude_sdk/client.rbs +2 -0
  75. data/sig/prelude_sdk/internal/util.rbs +10 -0
  76. data/sig/prelude_sdk/models/lookup_lookup_params.rbs +8 -1
  77. data/sig/prelude_sdk/models/notify_get_subscription_config_params.rbs +23 -0
  78. data/sig/prelude_sdk/models/notify_get_subscription_config_response.rbs +95 -0
  79. data/sig/prelude_sdk/models/notify_get_subscription_phone_number_params.rbs +28 -0
  80. data/sig/prelude_sdk/models/notify_get_subscription_phone_number_response.rbs +71 -0
  81. data/sig/prelude_sdk/models/notify_list_subscription_configs_params.rbs +32 -0
  82. data/sig/prelude_sdk/models/notify_list_subscription_configs_response.rbs +119 -0
  83. data/sig/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbs +45 -0
  84. data/sig/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rbs +95 -0
  85. data/sig/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbs +60 -0
  86. data/sig/prelude_sdk/models/notify_list_subscription_phone_numbers_response.rbs +95 -0
  87. data/sig/prelude_sdk/models/notify_send_batch_params.rbs +121 -0
  88. data/sig/prelude_sdk/models/notify_send_batch_response.rbs +214 -0
  89. data/sig/prelude_sdk/models/notify_send_params.rbs +121 -0
  90. data/sig/prelude_sdk/models/notify_send_response.rbs +100 -0
  91. data/sig/prelude_sdk/models/transactional_send_params.rbs +21 -0
  92. data/sig/prelude_sdk/models/verification_create_params.rbs +2 -21
  93. data/sig/prelude_sdk/models/verification_create_response.rbs +2 -1
  94. data/sig/prelude_sdk/models/verification_management_delete_phone_number_params.rbs +9 -1
  95. data/sig/prelude_sdk/models/verification_management_list_phone_numbers_params.rbs +14 -3
  96. data/sig/prelude_sdk/models/verification_management_set_phone_number_params.rbs +9 -1
  97. data/sig/prelude_sdk/models/watch_predict_response.rbs +41 -3
  98. data/sig/prelude_sdk/models/watch_send_feedbacks_params.rbs +3 -110
  99. data/sig/prelude_sdk/models.rbs +14 -0
  100. data/sig/prelude_sdk/resources/notify.rbs +70 -0
  101. data/sig/prelude_sdk/resources/transactional.rbs +1 -0
  102. metadata +61 -2
@@ -0,0 +1,144 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ # @see PreludeSDK::Resources::Notify#list_subscription_configs
6
+ class NotifyListSubscriptionConfigsResponse < PreludeSDK::Internal::Type::BaseModel
7
+ # @!attribute configs
8
+ # A list of subscription management configurations.
9
+ #
10
+ # @return [Array<PreludeSDK::Models::NotifyListSubscriptionConfigsResponse::Config>]
11
+ required :configs,
12
+ -> { PreludeSDK::Internal::Type::ArrayOf[PreludeSDK::Models::NotifyListSubscriptionConfigsResponse::Config] }
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(configs:, next_cursor: nil)
22
+ # Some parameter documentations has been truncated, see
23
+ # {PreludeSDK::Models::NotifyListSubscriptionConfigsResponse} for more details.
24
+ #
25
+ # @param configs [Array<PreludeSDK::Models::NotifyListSubscriptionConfigsResponse::Config>] A list of subscription management configurations.
26
+ #
27
+ # @param next_cursor [String] Pagination cursor for the next page of results. Omitted if there are no more pag
28
+
29
+ class Config < PreludeSDK::Internal::Type::BaseModel
30
+ # @!attribute id
31
+ # The subscription configuration ID.
32
+ #
33
+ # @return [String]
34
+ required :id, String
35
+
36
+ # @!attribute callback_url
37
+ # The URL to call when subscription status changes.
38
+ #
39
+ # @return [String]
40
+ required :callback_url, String
41
+
42
+ # @!attribute created_at
43
+ # The date and time when the configuration was created.
44
+ #
45
+ # @return [Time]
46
+ required :created_at, Time
47
+
48
+ # @!attribute messages
49
+ # The subscription messages configuration.
50
+ #
51
+ # @return [PreludeSDK::Models::NotifyListSubscriptionConfigsResponse::Config::Messages]
52
+ required :messages, -> { PreludeSDK::Models::NotifyListSubscriptionConfigsResponse::Config::Messages }
53
+
54
+ # @!attribute name
55
+ # The human-readable name for the subscription configuration.
56
+ #
57
+ # @return [String]
58
+ required :name, String
59
+
60
+ # @!attribute updated_at
61
+ # The date and time when the configuration was last updated.
62
+ #
63
+ # @return [Time]
64
+ required :updated_at, Time
65
+
66
+ # @!attribute mo_phone_numbers
67
+ # A list of phone numbers for receiving inbound messages.
68
+ #
69
+ # @return [Array<PreludeSDK::Models::NotifyListSubscriptionConfigsResponse::Config::MoPhoneNumber>, nil]
70
+ optional :mo_phone_numbers,
71
+ -> { PreludeSDK::Internal::Type::ArrayOf[PreludeSDK::Models::NotifyListSubscriptionConfigsResponse::Config::MoPhoneNumber] }
72
+
73
+ # @!method initialize(id:, callback_url:, created_at:, messages:, name:, updated_at:, mo_phone_numbers: nil)
74
+ # @param id [String] The subscription configuration ID.
75
+ #
76
+ # @param callback_url [String] The URL to call when subscription status changes.
77
+ #
78
+ # @param created_at [Time] The date and time when the configuration was created.
79
+ #
80
+ # @param messages [PreludeSDK::Models::NotifyListSubscriptionConfigsResponse::Config::Messages] The subscription messages configuration.
81
+ #
82
+ # @param name [String] The human-readable name for the subscription configuration.
83
+ #
84
+ # @param updated_at [Time] The date and time when the configuration was last updated.
85
+ #
86
+ # @param mo_phone_numbers [Array<PreludeSDK::Models::NotifyListSubscriptionConfigsResponse::Config::MoPhoneNumber>] A list of phone numbers for receiving inbound messages.
87
+
88
+ # @see PreludeSDK::Models::NotifyListSubscriptionConfigsResponse::Config#messages
89
+ class Messages < PreludeSDK::Internal::Type::BaseModel
90
+ # @!attribute help_message
91
+ # Message sent when user requests help.
92
+ #
93
+ # @return [String, nil]
94
+ optional :help_message, String
95
+
96
+ # @!attribute start_message
97
+ # Message sent when user subscribes.
98
+ #
99
+ # @return [String, nil]
100
+ optional :start_message, String
101
+
102
+ # @!attribute stop_message
103
+ # Message sent when user unsubscribes.
104
+ #
105
+ # @return [String, nil]
106
+ optional :stop_message, String
107
+
108
+ # @!method initialize(help_message: nil, start_message: nil, stop_message: nil)
109
+ # The subscription messages configuration.
110
+ #
111
+ # @param help_message [String] Message sent when user requests help.
112
+ #
113
+ # @param start_message [String] Message sent when user subscribes.
114
+ #
115
+ # @param stop_message [String] Message sent when user unsubscribes.
116
+ end
117
+
118
+ class MoPhoneNumber < PreludeSDK::Internal::Type::BaseModel
119
+ # @!attribute country_code
120
+ # The ISO 3166-1 alpha-2 country code.
121
+ #
122
+ # @return [String]
123
+ required :country_code, String
124
+
125
+ # @!attribute phone_number
126
+ # The phone number in E.164 format for long codes, or short code format for short
127
+ # codes.
128
+ #
129
+ # @return [String]
130
+ required :phone_number, String
131
+
132
+ # @!method initialize(country_code:, phone_number:)
133
+ # Some parameter documentations has been truncated, see
134
+ # {PreludeSDK::Models::NotifyListSubscriptionConfigsResponse::Config::MoPhoneNumber}
135
+ # for more details.
136
+ #
137
+ # @param country_code [String] The ISO 3166-1 alpha-2 country code.
138
+ #
139
+ # @param phone_number [String] The phone number in E.164 format for long codes, or short code format for short
140
+ end
141
+ end
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PreludeSDK
4
+ module Models
5
+ # @see PreludeSDK::Resources::Notify#list_subscription_phone_number_events
6
+ class NotifyListSubscriptionPhoneNumberEventsParams < PreludeSDK::Internal::Type::BaseModel
7
+ extend PreludeSDK::Internal::Type::RequestParameters::Converter
8
+ include PreludeSDK::Internal::Type::RequestParameters
9
+
10
+ # @!attribute config_id
11
+ #
12
+ # @return [String]
13
+ required :config_id, String
14
+
15
+ # @!attribute phone_number
16
+ #
17
+ # @return [String]
18
+ required :phone_number, String
19
+
20
+ # @!attribute cursor
21
+ # Pagination cursor from the previous response
22
+ #
23
+ # @return [String, nil]
24
+ optional :cursor, String
25
+
26
+ # @!attribute limit
27
+ # Maximum number of events to return per page
28
+ #
29
+ # @return [Integer, nil]
30
+ optional :limit, Integer
31
+
32
+ # @!method initialize(config_id:, phone_number:, cursor: nil, limit: nil, request_options: {})
33
+ # @param config_id [String]
34
+ #
35
+ # @param phone_number [String]
36
+ #
37
+ # @param cursor [String] Pagination cursor from the previous response
38
+ #
39
+ # @param limit [Integer] Maximum number of events to return per page
40
+ #
41
+ # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
42
+ end
43
+ end
44
+ 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_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,56 @@
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 config_id
11
+ #
12
+ # @return [String]
13
+ required :config_id, String
14
+
15
+ # @!attribute cursor
16
+ # Pagination cursor from the previous response
17
+ #
18
+ # @return [String, nil]
19
+ optional :cursor, String
20
+
21
+ # @!attribute limit
22
+ # Maximum number of phone numbers to return per page
23
+ #
24
+ # @return [Integer, nil]
25
+ optional :limit, Integer
26
+
27
+ # @!attribute state
28
+ # Filter by subscription state
29
+ #
30
+ # @return [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersParams::State, nil]
31
+ optional :state, enum: -> { PreludeSDK::NotifyListSubscriptionPhoneNumbersParams::State }
32
+
33
+ # @!method initialize(config_id:, cursor: nil, limit: nil, state: nil, request_options: {})
34
+ # @param config_id [String]
35
+ #
36
+ # @param cursor [String] Pagination cursor from the previous response
37
+ #
38
+ # @param limit [Integer] Maximum number of phone numbers to return per page
39
+ #
40
+ # @param state [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersParams::State] Filter by subscription state
41
+ #
42
+ # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
43
+
44
+ # Filter by subscription state
45
+ module State
46
+ extend PreludeSDK::Internal::Type::Enum
47
+
48
+ SUB = :SUB
49
+ UNSUB = :UNSUB
50
+
51
+ # @!method self.values
52
+ # @return [Array<Symbol>]
53
+ end
54
+ end
55
+ end
56
+ 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,141 @@
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 document
35
+ # A document to attach to the message. Only supported on WhatsApp templates that
36
+ # have a document header.
37
+ #
38
+ # @return [PreludeSDK::Models::NotifySendBatchParams::Document, nil]
39
+ optional :document, -> { PreludeSDK::NotifySendBatchParams::Document }
40
+
41
+ # @!attribute expires_at
42
+ # The message expiration date in RFC3339 format. Messages will not be sent after
43
+ # this time.
44
+ #
45
+ # @return [Time, nil]
46
+ optional :expires_at, Time
47
+
48
+ # @!attribute from
49
+ # The Sender ID. Must be approved for your account.
50
+ #
51
+ # @return [String, nil]
52
+ optional :from, String
53
+
54
+ # @!attribute locale
55
+ # A BCP-47 formatted locale string.
56
+ #
57
+ # @return [String, nil]
58
+ optional :locale, String
59
+
60
+ # @!attribute preferred_channel
61
+ # Preferred channel for delivery. If unavailable, automatic fallback applies.
62
+ #
63
+ # @return [Symbol, PreludeSDK::Models::NotifySendBatchParams::PreferredChannel, nil]
64
+ optional :preferred_channel, enum: -> { PreludeSDK::NotifySendBatchParams::PreferredChannel }
65
+
66
+ # @!attribute schedule_at
67
+ # Schedule delivery in RFC3339 format. Marketing sends may be adjusted to comply
68
+ # with local time windows.
69
+ #
70
+ # @return [Time, nil]
71
+ optional :schedule_at, Time
72
+
73
+ # @!attribute variables
74
+ # The variables to be replaced in the template.
75
+ #
76
+ # @return [Hash{Symbol=>String}, nil]
77
+ optional :variables, PreludeSDK::Internal::Type::HashOf[String]
78
+
79
+ # @!method initialize(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
80
+ # Some parameter documentations has been truncated, see
81
+ # {PreludeSDK::Models::NotifySendBatchParams} for more details.
82
+ #
83
+ # @param template_id [String] The template identifier configured by your Customer Success team.
84
+ #
85
+ # @param to [Array<String>] The list of recipients' phone numbers in E.164 format.
86
+ #
87
+ # @param callback_url [String] The URL where webhooks will be sent for delivery events.
88
+ #
89
+ # @param correlation_id [String] A user-defined identifier to correlate this request with your internal systems.
90
+ #
91
+ # @param document [PreludeSDK::Models::NotifySendBatchParams::Document] A document to attach to the message. Only supported on WhatsApp templates that h
92
+ #
93
+ # @param expires_at [Time] The message expiration date in RFC3339 format. Messages will not be sent after t
94
+ #
95
+ # @param from [String] The Sender ID. Must be approved for your account.
96
+ #
97
+ # @param locale [String] A BCP-47 formatted locale string.
98
+ #
99
+ # @param preferred_channel [Symbol, PreludeSDK::Models::NotifySendBatchParams::PreferredChannel] Preferred channel for delivery. If unavailable, automatic fallback applies.
100
+ #
101
+ # @param schedule_at [Time] Schedule delivery in RFC3339 format. Marketing sends may be adjusted to comply w
102
+ #
103
+ # @param variables [Hash{Symbol=>String}] The variables to be replaced in the template.
104
+ #
105
+ # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
106
+
107
+ class Document < PreludeSDK::Internal::Type::BaseModel
108
+ # @!attribute filename
109
+ # The filename to display for the document.
110
+ #
111
+ # @return [String]
112
+ required :filename, String
113
+
114
+ # @!attribute url
115
+ # The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
116
+ #
117
+ # @return [String]
118
+ required :url, String
119
+
120
+ # @!method initialize(filename:, url:)
121
+ # A document to attach to the message. Only supported on WhatsApp templates that
122
+ # have a document header.
123
+ #
124
+ # @param filename [String] The filename to display for the document.
125
+ #
126
+ # @param url [String] The URL of the document to attach. Must be a valid HTTP or HTTPS URL.
127
+ end
128
+
129
+ # Preferred channel for delivery. If unavailable, automatic fallback applies.
130
+ module PreferredChannel
131
+ extend PreludeSDK::Internal::Type::Enum
132
+
133
+ SMS = :sms
134
+ WHATSAPP = :whatsapp
135
+
136
+ # @!method self.values
137
+ # @return [Array<Symbol>]
138
+ end
139
+ end
140
+ end
141
+ end