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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +9 -9
- data/lib/prelude_sdk/client.rb +4 -0
- data/lib/prelude_sdk/models/notify_get_subscription_config_params.rb +14 -0
- data/lib/prelude_sdk/models/notify_get_subscription_config_response.rb +120 -0
- data/lib/prelude_sdk/models/notify_get_subscription_phone_number_params.rb +20 -0
- data/lib/prelude_sdk/models/notify_get_subscription_phone_number_response.rb +104 -0
- data/lib/prelude_sdk/models/notify_list_subscription_configs_params.rb +30 -0
- data/lib/prelude_sdk/models/notify_list_subscription_configs_response.rb +144 -0
- data/lib/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rb +37 -0
- data/lib/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rb +132 -0
- data/lib/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rb +49 -0
- data/lib/prelude_sdk/models/notify_list_subscription_phone_numbers_response.rb +132 -0
- data/lib/prelude_sdk/models/notify_send_batch_params.rb +110 -0
- data/lib/prelude_sdk/models/notify_send_batch_response.rb +201 -0
- data/lib/prelude_sdk/models/notify_send_params.rb +118 -0
- data/lib/prelude_sdk/models/notify_send_response.rb +94 -0
- data/lib/prelude_sdk/models.rb +15 -0
- data/lib/prelude_sdk/resources/notify.rb +247 -0
- data/lib/prelude_sdk/version.rb +1 -1
- data/lib/prelude_sdk.rb +16 -0
- data/manifest.yaml +1 -0
- data/rbi/prelude_sdk/client.rbi +3 -0
- data/rbi/prelude_sdk/models/notify_get_subscription_config_params.rbi +30 -0
- data/rbi/prelude_sdk/models/notify_get_subscription_config_response.rbi +224 -0
- data/rbi/prelude_sdk/models/notify_get_subscription_phone_number_params.rbi +38 -0
- data/rbi/prelude_sdk/models/notify_get_subscription_phone_number_response.rbi +199 -0
- data/rbi/prelude_sdk/models/notify_list_subscription_configs_params.rbi +60 -0
- data/rbi/prelude_sdk/models/notify_list_subscription_configs_response.rbi +286 -0
- data/rbi/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbi +66 -0
- data/rbi/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rbi +259 -0
- data/rbi/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbi +119 -0
- data/rbi/prelude_sdk/models/notify_list_subscription_phone_numbers_response.rbi +259 -0
- data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +191 -0
- data/rbi/prelude_sdk/models/notify_send_batch_response.rbi +360 -0
- data/rbi/prelude_sdk/models/notify_send_params.rbi +201 -0
- data/rbi/prelude_sdk/models/notify_send_response.rbi +128 -0
- data/rbi/prelude_sdk/models.rbi +19 -0
- data/rbi/prelude_sdk/resources/notify.rbi +218 -0
- data/sig/prelude_sdk/client.rbs +2 -0
- data/sig/prelude_sdk/models/notify_get_subscription_config_params.rbs +15 -0
- data/sig/prelude_sdk/models/notify_get_subscription_config_response.rbs +95 -0
- data/sig/prelude_sdk/models/notify_get_subscription_phone_number_params.rbs +23 -0
- data/sig/prelude_sdk/models/notify_get_subscription_phone_number_response.rbs +71 -0
- data/sig/prelude_sdk/models/notify_list_subscription_configs_params.rbs +32 -0
- data/sig/prelude_sdk/models/notify_list_subscription_configs_response.rbs +119 -0
- data/sig/prelude_sdk/models/notify_list_subscription_phone_number_events_params.rbs +36 -0
- data/sig/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rbs +95 -0
- data/sig/prelude_sdk/models/notify_list_subscription_phone_numbers_params.rbs +55 -0
- data/sig/prelude_sdk/models/notify_list_subscription_phone_numbers_response.rbs +95 -0
- data/sig/prelude_sdk/models/notify_send_batch_params.rbs +100 -0
- data/sig/prelude_sdk/models/notify_send_batch_response.rbs +187 -0
- data/sig/prelude_sdk/models/notify_send_params.rbs +100 -0
- data/sig/prelude_sdk/models/notify_send_response.rbs +73 -0
- data/sig/prelude_sdk/models.rbs +14 -0
- data/sig/prelude_sdk/resources/notify.rbs +68 -0
- metadata +47 -2
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module PreludeSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see PreludeSDK::Resources::Notify#send_
|
|
6
|
+
class NotifySendParams < 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 recipient's phone number in E.164 format.
|
|
18
|
+
#
|
|
19
|
+
# @return [String]
|
|
20
|
+
required :to, String
|
|
21
|
+
|
|
22
|
+
# @!attribute callback_url
|
|
23
|
+
# The URL where webhooks will be sent for message 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 message with your internal systems.
|
|
30
|
+
# It is returned in the response and any webhook events that refer to this
|
|
31
|
+
# message.
|
|
32
|
+
#
|
|
33
|
+
# @return [String, nil]
|
|
34
|
+
optional :correlation_id, String
|
|
35
|
+
|
|
36
|
+
# @!attribute expires_at
|
|
37
|
+
# The message expiration date in RFC3339 format. The message will not be sent if
|
|
38
|
+
# this time is reached.
|
|
39
|
+
#
|
|
40
|
+
# @return [Time, nil]
|
|
41
|
+
optional :expires_at, Time
|
|
42
|
+
|
|
43
|
+
# @!attribute from
|
|
44
|
+
# The Sender ID. Must be approved for your account.
|
|
45
|
+
#
|
|
46
|
+
# @return [String, nil]
|
|
47
|
+
optional :from, String
|
|
48
|
+
|
|
49
|
+
# @!attribute locale
|
|
50
|
+
# A BCP-47 formatted locale string with the language the text message will be sent
|
|
51
|
+
# to. If there's no locale set, the language will be determined by the country
|
|
52
|
+
# code of the phone number. If the language specified doesn't exist, the default
|
|
53
|
+
# set on the template will be used.
|
|
54
|
+
#
|
|
55
|
+
# @return [String, nil]
|
|
56
|
+
optional :locale, String
|
|
57
|
+
|
|
58
|
+
# @!attribute preferred_channel
|
|
59
|
+
# The preferred channel to be used in priority for message delivery. If the
|
|
60
|
+
# channel is unavailable, the system will fallback to other available channels.
|
|
61
|
+
#
|
|
62
|
+
# @return [Symbol, PreludeSDK::Models::NotifySendParams::PreferredChannel, nil]
|
|
63
|
+
optional :preferred_channel, enum: -> { PreludeSDK::NotifySendParams::PreferredChannel }
|
|
64
|
+
|
|
65
|
+
# @!attribute schedule_at
|
|
66
|
+
# Schedule the message for future delivery in RFC3339 format. Marketing messages
|
|
67
|
+
# can be scheduled up to 90 days in advance and will be automatically adjusted for
|
|
68
|
+
# compliance with local time window restrictions.
|
|
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, 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::NotifySendParams} for more details.
|
|
82
|
+
#
|
|
83
|
+
# @param template_id [String] The template identifier configured by your Customer Success team.
|
|
84
|
+
#
|
|
85
|
+
# @param to [String] The recipient's phone number in E.164 format.
|
|
86
|
+
#
|
|
87
|
+
# @param callback_url [String] The URL where webhooks will be sent for message delivery events.
|
|
88
|
+
#
|
|
89
|
+
# @param correlation_id [String] A user-defined identifier to correlate this message with your internal systems.
|
|
90
|
+
#
|
|
91
|
+
# @param expires_at [Time] The message expiration date in RFC3339 format. The message will not be sent if t
|
|
92
|
+
#
|
|
93
|
+
# @param from [String] The Sender ID. Must be approved for your account.
|
|
94
|
+
#
|
|
95
|
+
# @param locale [String] A BCP-47 formatted locale string with the language the text message will be sent
|
|
96
|
+
#
|
|
97
|
+
# @param preferred_channel [Symbol, PreludeSDK::Models::NotifySendParams::PreferredChannel] The preferred channel to be used in priority for message delivery. If the channe
|
|
98
|
+
#
|
|
99
|
+
# @param schedule_at [Time] Schedule the message for future delivery in RFC3339 format. Marketing messages c
|
|
100
|
+
#
|
|
101
|
+
# @param variables [Hash{Symbol=>String}] The variables to be replaced in the template.
|
|
102
|
+
#
|
|
103
|
+
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}]
|
|
104
|
+
|
|
105
|
+
# The preferred channel to be used in priority for message delivery. If the
|
|
106
|
+
# channel is unavailable, the system will fallback to other available channels.
|
|
107
|
+
module PreferredChannel
|
|
108
|
+
extend PreludeSDK::Internal::Type::Enum
|
|
109
|
+
|
|
110
|
+
SMS = :sms
|
|
111
|
+
WHATSAPP = :whatsapp
|
|
112
|
+
|
|
113
|
+
# @!method self.values
|
|
114
|
+
# @return [Array<Symbol>]
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module PreludeSDK
|
|
4
|
+
module Models
|
|
5
|
+
# @see PreludeSDK::Resources::Notify#send_
|
|
6
|
+
class NotifySendResponse < PreludeSDK::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The message identifier.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute created_at
|
|
14
|
+
# The message creation date in RFC3339 format.
|
|
15
|
+
#
|
|
16
|
+
# @return [Time]
|
|
17
|
+
required :created_at, Time
|
|
18
|
+
|
|
19
|
+
# @!attribute expires_at
|
|
20
|
+
# The message expiration date in RFC3339 format.
|
|
21
|
+
#
|
|
22
|
+
# @return [Time]
|
|
23
|
+
required :expires_at, Time
|
|
24
|
+
|
|
25
|
+
# @!attribute template_id
|
|
26
|
+
# The template identifier.
|
|
27
|
+
#
|
|
28
|
+
# @return [String]
|
|
29
|
+
required :template_id, String
|
|
30
|
+
|
|
31
|
+
# @!attribute to
|
|
32
|
+
# The recipient's phone number in E.164 format.
|
|
33
|
+
#
|
|
34
|
+
# @return [String]
|
|
35
|
+
required :to, String
|
|
36
|
+
|
|
37
|
+
# @!attribute variables
|
|
38
|
+
# The variables to be replaced in the template.
|
|
39
|
+
#
|
|
40
|
+
# @return [Hash{Symbol=>String}]
|
|
41
|
+
required :variables, PreludeSDK::Internal::Type::HashOf[String]
|
|
42
|
+
|
|
43
|
+
# @!attribute callback_url
|
|
44
|
+
# The callback URL where webhooks will be sent.
|
|
45
|
+
#
|
|
46
|
+
# @return [String, nil]
|
|
47
|
+
optional :callback_url, String
|
|
48
|
+
|
|
49
|
+
# @!attribute correlation_id
|
|
50
|
+
# A user-defined identifier to correlate this message with your internal systems.
|
|
51
|
+
#
|
|
52
|
+
# @return [String, nil]
|
|
53
|
+
optional :correlation_id, String
|
|
54
|
+
|
|
55
|
+
# @!attribute from
|
|
56
|
+
# The Sender ID used for this message.
|
|
57
|
+
#
|
|
58
|
+
# @return [String, nil]
|
|
59
|
+
optional :from, String
|
|
60
|
+
|
|
61
|
+
# @!attribute schedule_at
|
|
62
|
+
# When the message will actually be sent in RFC3339 format with timezone offset.
|
|
63
|
+
# For marketing messages, this may differ from the requested schedule_at due to
|
|
64
|
+
# automatic compliance adjustments.
|
|
65
|
+
#
|
|
66
|
+
# @return [Time, nil]
|
|
67
|
+
optional :schedule_at, Time
|
|
68
|
+
|
|
69
|
+
# @!method initialize(id:, created_at:, expires_at:, template_id:, to:, variables:, callback_url: nil, correlation_id: nil, from: nil, schedule_at: nil)
|
|
70
|
+
# Some parameter documentations has been truncated, see
|
|
71
|
+
# {PreludeSDK::Models::NotifySendResponse} for more details.
|
|
72
|
+
#
|
|
73
|
+
# @param id [String] The message identifier.
|
|
74
|
+
#
|
|
75
|
+
# @param created_at [Time] The message creation date in RFC3339 format.
|
|
76
|
+
#
|
|
77
|
+
# @param expires_at [Time] The message expiration date in RFC3339 format.
|
|
78
|
+
#
|
|
79
|
+
# @param template_id [String] The template identifier.
|
|
80
|
+
#
|
|
81
|
+
# @param to [String] The recipient's phone number in E.164 format.
|
|
82
|
+
#
|
|
83
|
+
# @param variables [Hash{Symbol=>String}] The variables to be replaced in the template.
|
|
84
|
+
#
|
|
85
|
+
# @param callback_url [String] The callback URL where webhooks will be sent.
|
|
86
|
+
#
|
|
87
|
+
# @param correlation_id [String] A user-defined identifier to correlate this message with your internal systems.
|
|
88
|
+
#
|
|
89
|
+
# @param from [String] The Sender ID used for this message.
|
|
90
|
+
#
|
|
91
|
+
# @param schedule_at [Time] When the message will actually be sent in RFC3339 format with timezone offset. F
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
data/lib/prelude_sdk/models.rb
CHANGED
|
@@ -41,6 +41,21 @@ module PreludeSDK
|
|
|
41
41
|
|
|
42
42
|
LookupLookupParams = PreludeSDK::Models::LookupLookupParams
|
|
43
43
|
|
|
44
|
+
NotifyGetSubscriptionConfigParams = PreludeSDK::Models::NotifyGetSubscriptionConfigParams
|
|
45
|
+
|
|
46
|
+
NotifyGetSubscriptionPhoneNumberParams = PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberParams
|
|
47
|
+
|
|
48
|
+
NotifyListSubscriptionConfigsParams = PreludeSDK::Models::NotifyListSubscriptionConfigsParams
|
|
49
|
+
|
|
50
|
+
NotifyListSubscriptionPhoneNumberEventsParams =
|
|
51
|
+
PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsParams
|
|
52
|
+
|
|
53
|
+
NotifyListSubscriptionPhoneNumbersParams = PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersParams
|
|
54
|
+
|
|
55
|
+
NotifySendBatchParams = PreludeSDK::Models::NotifySendBatchParams
|
|
56
|
+
|
|
57
|
+
NotifySendParams = PreludeSDK::Models::NotifySendParams
|
|
58
|
+
|
|
44
59
|
TransactionalSendParams = PreludeSDK::Models::TransactionalSendParams
|
|
45
60
|
|
|
46
61
|
VerificationCheckParams = PreludeSDK::Models::VerificationCheckParams
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module PreludeSDK
|
|
4
|
+
module Resources
|
|
5
|
+
class Notify
|
|
6
|
+
# Retrieve a specific subscription management configuration by its ID.
|
|
7
|
+
#
|
|
8
|
+
# @overload get_subscription_config(config_id, request_options: {})
|
|
9
|
+
#
|
|
10
|
+
# @param config_id [String] The subscription configuration ID
|
|
11
|
+
#
|
|
12
|
+
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
13
|
+
#
|
|
14
|
+
# @return [PreludeSDK::Models::NotifyGetSubscriptionConfigResponse]
|
|
15
|
+
#
|
|
16
|
+
# @see PreludeSDK::Models::NotifyGetSubscriptionConfigParams
|
|
17
|
+
def get_subscription_config(config_id, params = {})
|
|
18
|
+
@client.request(
|
|
19
|
+
method: :get,
|
|
20
|
+
path: ["v2/notify/management/subscriptions/%1$s", config_id],
|
|
21
|
+
model: PreludeSDK::Models::NotifyGetSubscriptionConfigResponse,
|
|
22
|
+
options: params[:request_options]
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Retrieve the current subscription status for a specific phone number within a
|
|
27
|
+
# subscription configuration.
|
|
28
|
+
#
|
|
29
|
+
# @overload get_subscription_phone_number(phone_number, config_id:, request_options: {})
|
|
30
|
+
#
|
|
31
|
+
# @param phone_number [String] The phone number in E.164 format (e.g., +33612345678)
|
|
32
|
+
#
|
|
33
|
+
# @param config_id [String] The subscription configuration ID
|
|
34
|
+
#
|
|
35
|
+
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
36
|
+
#
|
|
37
|
+
# @return [PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse]
|
|
38
|
+
#
|
|
39
|
+
# @see PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberParams
|
|
40
|
+
def get_subscription_phone_number(phone_number, params)
|
|
41
|
+
parsed, options = PreludeSDK::NotifyGetSubscriptionPhoneNumberParams.dump_request(params)
|
|
42
|
+
config_id =
|
|
43
|
+
parsed.delete(:config_id) do
|
|
44
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
45
|
+
end
|
|
46
|
+
@client.request(
|
|
47
|
+
method: :get,
|
|
48
|
+
path: ["v2/notify/management/subscriptions/%1$s/phone_numbers/%2$s", config_id, phone_number],
|
|
49
|
+
model: PreludeSDK::Models::NotifyGetSubscriptionPhoneNumberResponse,
|
|
50
|
+
options: options
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Retrieve a paginated list of subscription management configurations for your
|
|
55
|
+
# account.
|
|
56
|
+
#
|
|
57
|
+
# Each configuration represents a subscription management setup with phone numbers
|
|
58
|
+
# for receiving opt-out/opt-in requests and a callback URL for webhook events.
|
|
59
|
+
#
|
|
60
|
+
# @overload list_subscription_configs(cursor: nil, limit: nil, request_options: {})
|
|
61
|
+
#
|
|
62
|
+
# @param cursor [String] Pagination cursor from the previous response
|
|
63
|
+
#
|
|
64
|
+
# @param limit [Integer] Maximum number of configurations to return per page
|
|
65
|
+
#
|
|
66
|
+
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
67
|
+
#
|
|
68
|
+
# @return [PreludeSDK::Models::NotifyListSubscriptionConfigsResponse]
|
|
69
|
+
#
|
|
70
|
+
# @see PreludeSDK::Models::NotifyListSubscriptionConfigsParams
|
|
71
|
+
def list_subscription_configs(params = {})
|
|
72
|
+
parsed, options = PreludeSDK::NotifyListSubscriptionConfigsParams.dump_request(params)
|
|
73
|
+
@client.request(
|
|
74
|
+
method: :get,
|
|
75
|
+
path: "v2/notify/management/subscriptions",
|
|
76
|
+
query: parsed,
|
|
77
|
+
model: PreludeSDK::Models::NotifyListSubscriptionConfigsResponse,
|
|
78
|
+
options: options
|
|
79
|
+
)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Retrieve a paginated list of subscription events (status changes) for a specific
|
|
83
|
+
# phone number within a subscription configuration.
|
|
84
|
+
#
|
|
85
|
+
# Events are ordered by timestamp in descending order (most recent first).
|
|
86
|
+
#
|
|
87
|
+
# @overload list_subscription_phone_number_events(phone_number, config_id:, cursor: nil, limit: nil, request_options: {})
|
|
88
|
+
#
|
|
89
|
+
# @param phone_number [String] Path param: The phone number in E.164 format (e.g., +33612345678)
|
|
90
|
+
#
|
|
91
|
+
# @param config_id [String] Path param: The subscription configuration ID
|
|
92
|
+
#
|
|
93
|
+
# @param cursor [String] Query param: Pagination cursor from the previous response
|
|
94
|
+
#
|
|
95
|
+
# @param limit [Integer] Query param: Maximum number of events to return per page
|
|
96
|
+
#
|
|
97
|
+
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
98
|
+
#
|
|
99
|
+
# @return [PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse]
|
|
100
|
+
#
|
|
101
|
+
# @see PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsParams
|
|
102
|
+
def list_subscription_phone_number_events(phone_number, params)
|
|
103
|
+
parsed, options = PreludeSDK::NotifyListSubscriptionPhoneNumberEventsParams.dump_request(params)
|
|
104
|
+
config_id =
|
|
105
|
+
parsed.delete(:config_id) do
|
|
106
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
107
|
+
end
|
|
108
|
+
@client.request(
|
|
109
|
+
method: :get,
|
|
110
|
+
path: [
|
|
111
|
+
"v2/notify/management/subscriptions/%1$s/phone_numbers/%2$s/events",
|
|
112
|
+
config_id,
|
|
113
|
+
phone_number
|
|
114
|
+
],
|
|
115
|
+
query: parsed,
|
|
116
|
+
model: PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse,
|
|
117
|
+
options: options
|
|
118
|
+
)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Retrieve a paginated list of phone numbers and their subscription statuses for a
|
|
122
|
+
# specific subscription configuration.
|
|
123
|
+
#
|
|
124
|
+
# You can optionally filter by subscription state (SUB or UNSUB).
|
|
125
|
+
#
|
|
126
|
+
# @overload list_subscription_phone_numbers(config_id, cursor: nil, limit: nil, state: nil, request_options: {})
|
|
127
|
+
#
|
|
128
|
+
# @param config_id [String] The subscription configuration ID
|
|
129
|
+
#
|
|
130
|
+
# @param cursor [String] Pagination cursor from the previous response
|
|
131
|
+
#
|
|
132
|
+
# @param limit [Integer] Maximum number of phone numbers to return per page
|
|
133
|
+
#
|
|
134
|
+
# @param state [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersParams::State] Filter by subscription state
|
|
135
|
+
#
|
|
136
|
+
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
137
|
+
#
|
|
138
|
+
# @return [PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse]
|
|
139
|
+
#
|
|
140
|
+
# @see PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersParams
|
|
141
|
+
def list_subscription_phone_numbers(config_id, params = {})
|
|
142
|
+
parsed, options = PreludeSDK::NotifyListSubscriptionPhoneNumbersParams.dump_request(params)
|
|
143
|
+
@client.request(
|
|
144
|
+
method: :get,
|
|
145
|
+
path: ["v2/notify/management/subscriptions/%1$s/phone_numbers", config_id],
|
|
146
|
+
query: parsed,
|
|
147
|
+
model: PreludeSDK::Models::NotifyListSubscriptionPhoneNumbersResponse,
|
|
148
|
+
options: options
|
|
149
|
+
)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Some parameter documentations has been truncated, see
|
|
153
|
+
# {PreludeSDK::Models::NotifySendParams} for more details.
|
|
154
|
+
#
|
|
155
|
+
# Send transactional and marketing messages to your users via SMS and WhatsApp
|
|
156
|
+
# with automatic compliance enforcement.
|
|
157
|
+
#
|
|
158
|
+
# @overload send_(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: {})
|
|
159
|
+
#
|
|
160
|
+
# @param template_id [String] The template identifier configured by your Customer Success team.
|
|
161
|
+
#
|
|
162
|
+
# @param to [String] The recipient's phone number in E.164 format.
|
|
163
|
+
#
|
|
164
|
+
# @param callback_url [String] The URL where webhooks will be sent for message delivery events.
|
|
165
|
+
#
|
|
166
|
+
# @param correlation_id [String] A user-defined identifier to correlate this message with your internal systems.
|
|
167
|
+
#
|
|
168
|
+
# @param expires_at [Time] The message expiration date in RFC3339 format. The message will not be sent if t
|
|
169
|
+
#
|
|
170
|
+
# @param from [String] The Sender ID. Must be approved for your account.
|
|
171
|
+
#
|
|
172
|
+
# @param locale [String] A BCP-47 formatted locale string with the language the text message will be sent
|
|
173
|
+
#
|
|
174
|
+
# @param preferred_channel [Symbol, PreludeSDK::Models::NotifySendParams::PreferredChannel] The preferred channel to be used in priority for message delivery. If the channe
|
|
175
|
+
#
|
|
176
|
+
# @param schedule_at [Time] Schedule the message for future delivery in RFC3339 format. Marketing messages c
|
|
177
|
+
#
|
|
178
|
+
# @param variables [Hash{Symbol=>String}] The variables to be replaced in the template.
|
|
179
|
+
#
|
|
180
|
+
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
181
|
+
#
|
|
182
|
+
# @return [PreludeSDK::Models::NotifySendResponse]
|
|
183
|
+
#
|
|
184
|
+
# @see PreludeSDK::Models::NotifySendParams
|
|
185
|
+
def send_(params)
|
|
186
|
+
parsed, options = PreludeSDK::NotifySendParams.dump_request(params)
|
|
187
|
+
@client.request(
|
|
188
|
+
method: :post,
|
|
189
|
+
path: "v2/notify",
|
|
190
|
+
body: parsed,
|
|
191
|
+
model: PreludeSDK::Models::NotifySendResponse,
|
|
192
|
+
options: options
|
|
193
|
+
)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Some parameter documentations has been truncated, see
|
|
197
|
+
# {PreludeSDK::Models::NotifySendBatchParams} for more details.
|
|
198
|
+
#
|
|
199
|
+
# Send the same message to multiple recipients in a single request.
|
|
200
|
+
#
|
|
201
|
+
# @overload send_batch(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: {})
|
|
202
|
+
#
|
|
203
|
+
# @param template_id [String] The template identifier configured by your Customer Success team.
|
|
204
|
+
#
|
|
205
|
+
# @param to [Array<String>] The list of recipients' phone numbers in E.164 format.
|
|
206
|
+
#
|
|
207
|
+
# @param callback_url [String] The URL where webhooks will be sent for delivery events.
|
|
208
|
+
#
|
|
209
|
+
# @param correlation_id [String] A user-defined identifier to correlate this request with your internal systems.
|
|
210
|
+
#
|
|
211
|
+
# @param expires_at [Time] The message expiration date in RFC3339 format. Messages will not be sent after t
|
|
212
|
+
#
|
|
213
|
+
# @param from [String] The Sender ID. Must be approved for your account.
|
|
214
|
+
#
|
|
215
|
+
# @param locale [String] A BCP-47 formatted locale string.
|
|
216
|
+
#
|
|
217
|
+
# @param preferred_channel [Symbol, PreludeSDK::Models::NotifySendBatchParams::PreferredChannel] Preferred channel for delivery. If unavailable, automatic fallback applies.
|
|
218
|
+
#
|
|
219
|
+
# @param schedule_at [Time] Schedule delivery in RFC3339 format. Marketing sends may be adjusted to comply w
|
|
220
|
+
#
|
|
221
|
+
# @param variables [Hash{Symbol=>String}] The variables to be replaced in the template.
|
|
222
|
+
#
|
|
223
|
+
# @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
224
|
+
#
|
|
225
|
+
# @return [PreludeSDK::Models::NotifySendBatchResponse]
|
|
226
|
+
#
|
|
227
|
+
# @see PreludeSDK::Models::NotifySendBatchParams
|
|
228
|
+
def send_batch(params)
|
|
229
|
+
parsed, options = PreludeSDK::NotifySendBatchParams.dump_request(params)
|
|
230
|
+
@client.request(
|
|
231
|
+
method: :post,
|
|
232
|
+
path: "v2/notify/batch",
|
|
233
|
+
body: parsed,
|
|
234
|
+
model: PreludeSDK::Models::NotifySendBatchResponse,
|
|
235
|
+
options: options
|
|
236
|
+
)
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# @api private
|
|
240
|
+
#
|
|
241
|
+
# @param client [PreludeSDK::Client]
|
|
242
|
+
def initialize(client:)
|
|
243
|
+
@client = client
|
|
244
|
+
end
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
end
|
data/lib/prelude_sdk/version.rb
CHANGED
data/lib/prelude_sdk.rb
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
# Standard libraries.
|
|
4
4
|
# rubocop:disable Lint/RedundantRequireStatement
|
|
5
5
|
require "English"
|
|
6
|
+
require "base64"
|
|
6
7
|
require "cgi"
|
|
7
8
|
require "date"
|
|
8
9
|
require "erb"
|
|
@@ -53,6 +54,20 @@ require_relative "prelude_sdk/internal/transport/pooled_net_requester"
|
|
|
53
54
|
require_relative "prelude_sdk/client"
|
|
54
55
|
require_relative "prelude_sdk/models/lookup_lookup_params"
|
|
55
56
|
require_relative "prelude_sdk/models/lookup_lookup_response"
|
|
57
|
+
require_relative "prelude_sdk/models/notify_get_subscription_config_params"
|
|
58
|
+
require_relative "prelude_sdk/models/notify_get_subscription_config_response"
|
|
59
|
+
require_relative "prelude_sdk/models/notify_get_subscription_phone_number_params"
|
|
60
|
+
require_relative "prelude_sdk/models/notify_get_subscription_phone_number_response"
|
|
61
|
+
require_relative "prelude_sdk/models/notify_list_subscription_configs_params"
|
|
62
|
+
require_relative "prelude_sdk/models/notify_list_subscription_configs_response"
|
|
63
|
+
require_relative "prelude_sdk/models/notify_list_subscription_phone_number_events_params"
|
|
64
|
+
require_relative "prelude_sdk/models/notify_list_subscription_phone_number_events_response"
|
|
65
|
+
require_relative "prelude_sdk/models/notify_list_subscription_phone_numbers_params"
|
|
66
|
+
require_relative "prelude_sdk/models/notify_list_subscription_phone_numbers_response"
|
|
67
|
+
require_relative "prelude_sdk/models/notify_send_batch_params"
|
|
68
|
+
require_relative "prelude_sdk/models/notify_send_batch_response"
|
|
69
|
+
require_relative "prelude_sdk/models/notify_send_params"
|
|
70
|
+
require_relative "prelude_sdk/models/notify_send_response"
|
|
56
71
|
require_relative "prelude_sdk/models/transactional_send_params"
|
|
57
72
|
require_relative "prelude_sdk/models/transactional_send_response"
|
|
58
73
|
require_relative "prelude_sdk/models/verification_check_params"
|
|
@@ -77,6 +92,7 @@ require_relative "prelude_sdk/models/watch_send_feedbacks_params"
|
|
|
77
92
|
require_relative "prelude_sdk/models/watch_send_feedbacks_response"
|
|
78
93
|
require_relative "prelude_sdk/models"
|
|
79
94
|
require_relative "prelude_sdk/resources/lookup"
|
|
95
|
+
require_relative "prelude_sdk/resources/notify"
|
|
80
96
|
require_relative "prelude_sdk/resources/transactional"
|
|
81
97
|
require_relative "prelude_sdk/resources/verification"
|
|
82
98
|
require_relative "prelude_sdk/resources/verification_management"
|
data/manifest.yaml
CHANGED
data/rbi/prelude_sdk/client.rbi
CHANGED
|
@@ -17,6 +17,9 @@ module PreludeSDK
|
|
|
17
17
|
sig { returns(PreludeSDK::Resources::Lookup) }
|
|
18
18
|
attr_reader :lookup
|
|
19
19
|
|
|
20
|
+
sig { returns(PreludeSDK::Resources::Notify) }
|
|
21
|
+
attr_reader :notify
|
|
22
|
+
|
|
20
23
|
sig { returns(PreludeSDK::Resources::Transactional) }
|
|
21
24
|
attr_reader :transactional
|
|
22
25
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module PreludeSDK
|
|
4
|
+
module Models
|
|
5
|
+
class NotifyGetSubscriptionConfigParams < 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::NotifyGetSubscriptionConfigParams,
|
|
13
|
+
PreludeSDK::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(request_options: PreludeSDK::RequestOptions::OrHash).returns(
|
|
19
|
+
T.attached_class
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
def self.new(request_options: {})
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
sig { override.returns({ request_options: PreludeSDK::RequestOptions }) }
|
|
26
|
+
def to_hash
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|