sentdm 0.0.2
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 +7 -0
- data/.ignore +2 -0
- data/CHANGELOG.md +11 -0
- data/README.md +240 -0
- data/SECURITY.md +27 -0
- data/lib/sentdm/client.rb +115 -0
- data/lib/sentdm/errors.rb +228 -0
- data/lib/sentdm/file_part.rb +58 -0
- data/lib/sentdm/internal/transport/base_client.rb +573 -0
- data/lib/sentdm/internal/transport/pooled_net_requester.rb +210 -0
- data/lib/sentdm/internal/type/array_of.rb +168 -0
- data/lib/sentdm/internal/type/base_model.rb +531 -0
- data/lib/sentdm/internal/type/base_page.rb +55 -0
- data/lib/sentdm/internal/type/boolean.rb +77 -0
- data/lib/sentdm/internal/type/converter.rb +327 -0
- data/lib/sentdm/internal/type/enum.rb +131 -0
- data/lib/sentdm/internal/type/file_input.rb +111 -0
- data/lib/sentdm/internal/type/hash_of.rb +188 -0
- data/lib/sentdm/internal/type/request_parameters.rb +42 -0
- data/lib/sentdm/internal/type/union.rb +237 -0
- data/lib/sentdm/internal/type/unknown.rb +81 -0
- data/lib/sentdm/internal/util.rb +920 -0
- data/lib/sentdm/internal.rb +20 -0
- data/lib/sentdm/models/contact_list_item.rb +96 -0
- data/lib/sentdm/models/contact_list_params.rb +30 -0
- data/lib/sentdm/models/contact_list_response.rb +40 -0
- data/lib/sentdm/models/contact_retrieve_by_phone_params.rb +22 -0
- data/lib/sentdm/models/contact_retrieve_id_params.rb +22 -0
- data/lib/sentdm/models/message_retrieve_params.rb +14 -0
- data/lib/sentdm/models/message_retrieve_response.rb +227 -0
- data/lib/sentdm/models/message_send_quick_message_params.rb +34 -0
- data/lib/sentdm/models/message_send_to_contact_params.rb +46 -0
- data/lib/sentdm/models/message_send_to_phone_params.rb +47 -0
- data/lib/sentdm/models/number_lookup_retrieve_params.rb +20 -0
- data/lib/sentdm/models/number_lookup_retrieve_response.rb +83 -0
- data/lib/sentdm/models/organization_list_params.rb +14 -0
- data/lib/sentdm/models/organization_list_response.rb +57 -0
- data/lib/sentdm/models/organization_retrieve_profiles_params.rb +14 -0
- data/lib/sentdm/models/organization_retrieve_profiles_response.rb +22 -0
- data/lib/sentdm/models/organizations/customer_user.rb +96 -0
- data/lib/sentdm/models/organizations/user_delete_params.rb +22 -0
- data/lib/sentdm/models/organizations/user_invite_params.rb +40 -0
- data/lib/sentdm/models/organizations/user_list_params.rb +28 -0
- data/lib/sentdm/models/organizations/user_list_response.rb +36 -0
- data/lib/sentdm/models/organizations/user_retrieve_params.rb +22 -0
- data/lib/sentdm/models/organizations/user_update_role_params.rb +28 -0
- data/lib/sentdm/models/profile_summary.rb +45 -0
- data/lib/sentdm/models/template_body_content.rb +27 -0
- data/lib/sentdm/models/template_create_params.rb +53 -0
- data/lib/sentdm/models/template_definition.rb +310 -0
- data/lib/sentdm/models/template_delete_params.rb +14 -0
- data/lib/sentdm/models/template_list_params.rb +54 -0
- data/lib/sentdm/models/template_list_response.rb +40 -0
- data/lib/sentdm/models/template_response.rb +100 -0
- data/lib/sentdm/models/template_retrieve_params.rb +14 -0
- data/lib/sentdm/models/template_variable.rb +74 -0
- data/lib/sentdm/models.rb +83 -0
- data/lib/sentdm/request_options.rb +77 -0
- data/lib/sentdm/resources/contacts.rb +88 -0
- data/lib/sentdm/resources/messages.rb +130 -0
- data/lib/sentdm/resources/number_lookup.rb +37 -0
- data/lib/sentdm/resources/organizations/users.rb +150 -0
- data/lib/sentdm/resources/organizations.rb +58 -0
- data/lib/sentdm/resources/templates.rb +131 -0
- data/lib/sentdm/version.rb +5 -0
- data/lib/sentdm.rb +94 -0
- data/manifest.yaml +17 -0
- data/rbi/sentdm/client.rbi +80 -0
- data/rbi/sentdm/errors.rbi +205 -0
- data/rbi/sentdm/file_part.rbi +37 -0
- data/rbi/sentdm/internal/transport/base_client.rbi +297 -0
- data/rbi/sentdm/internal/transport/pooled_net_requester.rbi +82 -0
- data/rbi/sentdm/internal/type/array_of.rbi +104 -0
- data/rbi/sentdm/internal/type/base_model.rbi +299 -0
- data/rbi/sentdm/internal/type/base_page.rbi +42 -0
- data/rbi/sentdm/internal/type/boolean.rbi +58 -0
- data/rbi/sentdm/internal/type/converter.rbi +204 -0
- data/rbi/sentdm/internal/type/enum.rbi +82 -0
- data/rbi/sentdm/internal/type/file_input.rbi +59 -0
- data/rbi/sentdm/internal/type/hash_of.rbi +104 -0
- data/rbi/sentdm/internal/type/request_parameters.rbi +29 -0
- data/rbi/sentdm/internal/type/union.rbi +126 -0
- data/rbi/sentdm/internal/type/unknown.rbi +58 -0
- data/rbi/sentdm/internal/util.rbi +484 -0
- data/rbi/sentdm/internal.rbi +16 -0
- data/rbi/sentdm/models/contact_list_item.rbi +144 -0
- data/rbi/sentdm/models/contact_list_params.rbi +51 -0
- data/rbi/sentdm/models/contact_list_response.rbi +74 -0
- data/rbi/sentdm/models/contact_retrieve_by_phone_params.rbi +40 -0
- data/rbi/sentdm/models/contact_retrieve_id_params.rbi +40 -0
- data/rbi/sentdm/models/message_retrieve_params.rbi +27 -0
- data/rbi/sentdm/models/message_retrieve_response.rbi +376 -0
- data/rbi/sentdm/models/message_send_quick_message_params.rbi +56 -0
- data/rbi/sentdm/models/message_send_to_contact_params.rbi +63 -0
- data/rbi/sentdm/models/message_send_to_phone_params.rbi +65 -0
- data/rbi/sentdm/models/number_lookup_retrieve_params.rbi +35 -0
- data/rbi/sentdm/models/number_lookup_retrieve_response.rbi +132 -0
- data/rbi/sentdm/models/organization_list_params.rbi +27 -0
- data/rbi/sentdm/models/organization_list_response.rbi +131 -0
- data/rbi/sentdm/models/organization_retrieve_profiles_params.rbi +30 -0
- data/rbi/sentdm/models/organization_retrieve_profiles_response.rbi +47 -0
- data/rbi/sentdm/models/organizations/customer_user.rbi +129 -0
- data/rbi/sentdm/models/organizations/user_delete_params.rbi +40 -0
- data/rbi/sentdm/models/organizations/user_invite_params.rbi +73 -0
- data/rbi/sentdm/models/organizations/user_list_params.rbi +48 -0
- data/rbi/sentdm/models/organizations/user_list_response.rbi +71 -0
- data/rbi/sentdm/models/organizations/user_retrieve_params.rbi +40 -0
- data/rbi/sentdm/models/organizations/user_update_role_params.rbi +51 -0
- data/rbi/sentdm/models/profile_summary.rbi +74 -0
- data/rbi/sentdm/models/template_body_content.rbi +46 -0
- data/rbi/sentdm/models/template_create_params.rbi +81 -0
- data/rbi/sentdm/models/template_definition.rbi +497 -0
- data/rbi/sentdm/models/template_delete_params.rbi +27 -0
- data/rbi/sentdm/models/template_list_params.rbi +75 -0
- data/rbi/sentdm/models/template_list_response.rbi +74 -0
- data/rbi/sentdm/models/template_response.rbi +149 -0
- data/rbi/sentdm/models/template_retrieve_params.rbi +27 -0
- data/rbi/sentdm/models/template_variable.rbi +120 -0
- data/rbi/sentdm/models.rbi +46 -0
- data/rbi/sentdm/request_options.rbi +55 -0
- data/rbi/sentdm/resources/contacts.rbi +63 -0
- data/rbi/sentdm/resources/messages.rbi +97 -0
- data/rbi/sentdm/resources/number_lookup.rbi +24 -0
- data/rbi/sentdm/resources/organizations/users.rbi +95 -0
- data/rbi/sentdm/resources/organizations.rbi +37 -0
- data/rbi/sentdm/resources/templates.rbi +103 -0
- data/rbi/sentdm/version.rbi +5 -0
- data/sig/sentdm/client.rbs +41 -0
- data/sig/sentdm/errors.rbs +117 -0
- data/sig/sentdm/file_part.rbs +21 -0
- data/sig/sentdm/internal/transport/base_client.rbs +133 -0
- data/sig/sentdm/internal/transport/pooled_net_requester.rbs +48 -0
- data/sig/sentdm/internal/type/array_of.rbs +48 -0
- data/sig/sentdm/internal/type/base_model.rbs +102 -0
- data/sig/sentdm/internal/type/base_page.rbs +24 -0
- data/sig/sentdm/internal/type/boolean.rbs +26 -0
- data/sig/sentdm/internal/type/converter.rbs +79 -0
- data/sig/sentdm/internal/type/enum.rbs +32 -0
- data/sig/sentdm/internal/type/file_input.rbs +25 -0
- data/sig/sentdm/internal/type/hash_of.rbs +48 -0
- data/sig/sentdm/internal/type/request_parameters.rbs +17 -0
- data/sig/sentdm/internal/type/union.rbs +52 -0
- data/sig/sentdm/internal/type/unknown.rbs +26 -0
- data/sig/sentdm/internal/util.rbs +185 -0
- data/sig/sentdm/internal.rbs +9 -0
- data/sig/sentdm/models/contact_list_item.rbs +85 -0
- data/sig/sentdm/models/contact_list_params.rbs +28 -0
- data/sig/sentdm/models/contact_list_response.rbs +52 -0
- data/sig/sentdm/models/contact_retrieve_by_phone_params.rbs +23 -0
- data/sig/sentdm/models/contact_retrieve_id_params.rbs +20 -0
- data/sig/sentdm/models/message_retrieve_params.rbs +15 -0
- data/sig/sentdm/models/message_retrieve_response.rbs +188 -0
- data/sig/sentdm/models/message_send_quick_message_params.rbs +28 -0
- data/sig/sentdm/models/message_send_to_contact_params.rbs +36 -0
- data/sig/sentdm/models/message_send_to_phone_params.rbs +36 -0
- data/sig/sentdm/models/number_lookup_retrieve_params.rbs +23 -0
- data/sig/sentdm/models/number_lookup_retrieve_response.rbs +78 -0
- data/sig/sentdm/models/organization_list_params.rbs +15 -0
- data/sig/sentdm/models/organization_list_response.rbs +76 -0
- data/sig/sentdm/models/organization_retrieve_profiles_params.rbs +15 -0
- data/sig/sentdm/models/organization_retrieve_profiles_response.rbs +28 -0
- data/sig/sentdm/models/organizations/customer_user.rbs +91 -0
- data/sig/sentdm/models/organizations/user_delete_params.rbs +25 -0
- data/sig/sentdm/models/organizations/user_invite_params.rbs +44 -0
- data/sig/sentdm/models/organizations/user_list_params.rbs +30 -0
- data/sig/sentdm/models/organizations/user_list_response.rbs +47 -0
- data/sig/sentdm/models/organizations/user_retrieve_params.rbs +25 -0
- data/sig/sentdm/models/organizations/user_update_role_params.rbs +32 -0
- data/sig/sentdm/models/profile_summary.rbs +51 -0
- data/sig/sentdm/models/template_body_content.rbs +32 -0
- data/sig/sentdm/models/template_create_params.rbs +43 -0
- data/sig/sentdm/models/template_definition.rbs +258 -0
- data/sig/sentdm/models/template_delete_params.rbs +15 -0
- data/sig/sentdm/models/template_list_params.rbs +46 -0
- data/sig/sentdm/models/template_list_response.rbs +52 -0
- data/sig/sentdm/models/template_response.rbs +92 -0
- data/sig/sentdm/models/template_retrieve_params.rbs +15 -0
- data/sig/sentdm/models/template_variable.rbs +87 -0
- data/sig/sentdm/models.rbs +43 -0
- data/sig/sentdm/request_options.rbs +34 -0
- data/sig/sentdm/resources/contacts.rbs +23 -0
- data/sig/sentdm/resources/messages.rbs +32 -0
- data/sig/sentdm/resources/number_lookup.rbs +12 -0
- data/sig/sentdm/resources/organizations/users.rbs +44 -0
- data/sig/sentdm/resources/organizations.rbs +18 -0
- data/sig/sentdm/resources/templates.rbs +31 -0
- data/sig/sentdm/version.rbs +3 -0
- metadata +259 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class TemplateResponse < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Sentdm::TemplateResponse, Sentdm::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The unique identifier of the template
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
attr_reader :id
|
|
14
|
+
|
|
15
|
+
sig { params(id: String).void }
|
|
16
|
+
attr_writer :id
|
|
17
|
+
|
|
18
|
+
# The template category (e.g., MARKETING, UTILITY, AUTHENTICATION)
|
|
19
|
+
sig { returns(T.nilable(String)) }
|
|
20
|
+
attr_reader :category
|
|
21
|
+
|
|
22
|
+
sig { params(category: String).void }
|
|
23
|
+
attr_writer :category
|
|
24
|
+
|
|
25
|
+
# The date and time when the template was created
|
|
26
|
+
sig { returns(T.nilable(Time)) }
|
|
27
|
+
attr_reader :created_at
|
|
28
|
+
|
|
29
|
+
sig { params(created_at: Time).void }
|
|
30
|
+
attr_writer :created_at
|
|
31
|
+
|
|
32
|
+
# The complete template definition including header, body, footer, and buttons
|
|
33
|
+
sig { returns(T.nilable(Sentdm::TemplateDefinition)) }
|
|
34
|
+
attr_reader :definition
|
|
35
|
+
|
|
36
|
+
sig { params(definition: Sentdm::TemplateDefinition::OrHash).void }
|
|
37
|
+
attr_writer :definition
|
|
38
|
+
|
|
39
|
+
# The display name of the template (auto-generated if not provided)
|
|
40
|
+
sig { returns(T.nilable(String)) }
|
|
41
|
+
attr_reader :display_name
|
|
42
|
+
|
|
43
|
+
sig { params(display_name: String).void }
|
|
44
|
+
attr_writer :display_name
|
|
45
|
+
|
|
46
|
+
# Indicates whether the template is published and available for use
|
|
47
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
48
|
+
attr_reader :is_published
|
|
49
|
+
|
|
50
|
+
sig { params(is_published: T::Boolean).void }
|
|
51
|
+
attr_writer :is_published
|
|
52
|
+
|
|
53
|
+
# The template language code (e.g., en_US, es_ES)
|
|
54
|
+
sig { returns(T.nilable(String)) }
|
|
55
|
+
attr_reader :language
|
|
56
|
+
|
|
57
|
+
sig { params(language: String).void }
|
|
58
|
+
attr_writer :language
|
|
59
|
+
|
|
60
|
+
# The approval status of the template (e.g., APPROVED, PENDING, REJECTED, DRAFT)
|
|
61
|
+
sig { returns(T.nilable(String)) }
|
|
62
|
+
attr_reader :status
|
|
63
|
+
|
|
64
|
+
sig { params(status: String).void }
|
|
65
|
+
attr_writer :status
|
|
66
|
+
|
|
67
|
+
# The date and time when the template was last updated
|
|
68
|
+
sig { returns(T.nilable(Time)) }
|
|
69
|
+
attr_accessor :updated_at
|
|
70
|
+
|
|
71
|
+
# The WhatsApp Business API template ID from Meta
|
|
72
|
+
sig { returns(T.nilable(String)) }
|
|
73
|
+
attr_reader :whatsapp_template_id
|
|
74
|
+
|
|
75
|
+
sig { params(whatsapp_template_id: String).void }
|
|
76
|
+
attr_writer :whatsapp_template_id
|
|
77
|
+
|
|
78
|
+
# The WhatsApp template name as registered with Meta
|
|
79
|
+
sig { returns(T.nilable(String)) }
|
|
80
|
+
attr_reader :whatsapp_template_name
|
|
81
|
+
|
|
82
|
+
sig { params(whatsapp_template_name: String).void }
|
|
83
|
+
attr_writer :whatsapp_template_name
|
|
84
|
+
|
|
85
|
+
# Represents a message template with comprehensive metadata including definition
|
|
86
|
+
# structure
|
|
87
|
+
sig do
|
|
88
|
+
params(
|
|
89
|
+
id: String,
|
|
90
|
+
category: String,
|
|
91
|
+
created_at: Time,
|
|
92
|
+
definition: Sentdm::TemplateDefinition::OrHash,
|
|
93
|
+
display_name: String,
|
|
94
|
+
is_published: T::Boolean,
|
|
95
|
+
language: String,
|
|
96
|
+
status: String,
|
|
97
|
+
updated_at: T.nilable(Time),
|
|
98
|
+
whatsapp_template_id: String,
|
|
99
|
+
whatsapp_template_name: String
|
|
100
|
+
).returns(T.attached_class)
|
|
101
|
+
end
|
|
102
|
+
def self.new(
|
|
103
|
+
# The unique identifier of the template
|
|
104
|
+
id: nil,
|
|
105
|
+
# The template category (e.g., MARKETING, UTILITY, AUTHENTICATION)
|
|
106
|
+
category: nil,
|
|
107
|
+
# The date and time when the template was created
|
|
108
|
+
created_at: nil,
|
|
109
|
+
# The complete template definition including header, body, footer, and buttons
|
|
110
|
+
definition: nil,
|
|
111
|
+
# The display name of the template (auto-generated if not provided)
|
|
112
|
+
display_name: nil,
|
|
113
|
+
# Indicates whether the template is published and available for use
|
|
114
|
+
is_published: nil,
|
|
115
|
+
# The template language code (e.g., en_US, es_ES)
|
|
116
|
+
language: nil,
|
|
117
|
+
# The approval status of the template (e.g., APPROVED, PENDING, REJECTED, DRAFT)
|
|
118
|
+
status: nil,
|
|
119
|
+
# The date and time when the template was last updated
|
|
120
|
+
updated_at: nil,
|
|
121
|
+
# The WhatsApp Business API template ID from Meta
|
|
122
|
+
whatsapp_template_id: nil,
|
|
123
|
+
# The WhatsApp template name as registered with Meta
|
|
124
|
+
whatsapp_template_name: nil
|
|
125
|
+
)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
sig do
|
|
129
|
+
override.returns(
|
|
130
|
+
{
|
|
131
|
+
id: String,
|
|
132
|
+
category: String,
|
|
133
|
+
created_at: Time,
|
|
134
|
+
definition: Sentdm::TemplateDefinition,
|
|
135
|
+
display_name: String,
|
|
136
|
+
is_published: T::Boolean,
|
|
137
|
+
language: String,
|
|
138
|
+
status: String,
|
|
139
|
+
updated_at: T.nilable(Time),
|
|
140
|
+
whatsapp_template_id: String,
|
|
141
|
+
whatsapp_template_name: String
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
end
|
|
145
|
+
def to_hash
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class TemplateRetrieveParams < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Sentdm::TemplateRetrieveParams, Sentdm::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig do
|
|
15
|
+
params(request_options: Sentdm::RequestOptions::OrHash).returns(
|
|
16
|
+
T.attached_class
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
def self.new(request_options: {})
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
sig { override.returns({ request_options: Sentdm::RequestOptions }) }
|
|
23
|
+
def to_hash
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
class TemplateVariable < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Sentdm::TemplateVariable, Sentdm::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(T.nilable(Integer)) }
|
|
12
|
+
attr_reader :id
|
|
13
|
+
|
|
14
|
+
sig { params(id: Integer).void }
|
|
15
|
+
attr_writer :id
|
|
16
|
+
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_reader :name
|
|
19
|
+
|
|
20
|
+
sig { params(name: String).void }
|
|
21
|
+
attr_writer :name
|
|
22
|
+
|
|
23
|
+
sig { returns(T.nilable(Sentdm::TemplateVariable::Props)) }
|
|
24
|
+
attr_reader :props
|
|
25
|
+
|
|
26
|
+
sig { params(props: Sentdm::TemplateVariable::Props::OrHash).void }
|
|
27
|
+
attr_writer :props
|
|
28
|
+
|
|
29
|
+
sig { returns(T.nilable(String)) }
|
|
30
|
+
attr_reader :type
|
|
31
|
+
|
|
32
|
+
sig { params(type: String).void }
|
|
33
|
+
attr_writer :type
|
|
34
|
+
|
|
35
|
+
sig do
|
|
36
|
+
params(
|
|
37
|
+
id: Integer,
|
|
38
|
+
name: String,
|
|
39
|
+
props: Sentdm::TemplateVariable::Props::OrHash,
|
|
40
|
+
type: String
|
|
41
|
+
).returns(T.attached_class)
|
|
42
|
+
end
|
|
43
|
+
def self.new(id: nil, name: nil, props: nil, type: nil)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
sig do
|
|
47
|
+
override.returns(
|
|
48
|
+
{
|
|
49
|
+
id: Integer,
|
|
50
|
+
name: String,
|
|
51
|
+
props: Sentdm::TemplateVariable::Props,
|
|
52
|
+
type: String
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
def to_hash
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
class Props < Sentdm::Internal::Type::BaseModel
|
|
60
|
+
OrHash =
|
|
61
|
+
T.type_alias do
|
|
62
|
+
T.any(Sentdm::TemplateVariable::Props, Sentdm::Internal::AnyHash)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
sig { returns(T.nilable(String)) }
|
|
66
|
+
attr_accessor :alt
|
|
67
|
+
|
|
68
|
+
sig { returns(T.nilable(String)) }
|
|
69
|
+
attr_accessor :media_type
|
|
70
|
+
|
|
71
|
+
sig { returns(T.nilable(String)) }
|
|
72
|
+
attr_accessor :sample
|
|
73
|
+
|
|
74
|
+
sig { returns(T.nilable(String)) }
|
|
75
|
+
attr_accessor :short_url
|
|
76
|
+
|
|
77
|
+
sig { returns(T.nilable(String)) }
|
|
78
|
+
attr_accessor :url
|
|
79
|
+
|
|
80
|
+
sig { returns(T.nilable(String)) }
|
|
81
|
+
attr_accessor :variable_type
|
|
82
|
+
|
|
83
|
+
sig do
|
|
84
|
+
params(
|
|
85
|
+
alt: T.nilable(String),
|
|
86
|
+
media_type: T.nilable(String),
|
|
87
|
+
sample: T.nilable(String),
|
|
88
|
+
short_url: T.nilable(String),
|
|
89
|
+
url: T.nilable(String),
|
|
90
|
+
variable_type: T.nilable(String)
|
|
91
|
+
).returns(T.attached_class)
|
|
92
|
+
end
|
|
93
|
+
def self.new(
|
|
94
|
+
alt: nil,
|
|
95
|
+
media_type: nil,
|
|
96
|
+
sample: nil,
|
|
97
|
+
short_url: nil,
|
|
98
|
+
url: nil,
|
|
99
|
+
variable_type: nil
|
|
100
|
+
)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
sig do
|
|
104
|
+
override.returns(
|
|
105
|
+
{
|
|
106
|
+
alt: T.nilable(String),
|
|
107
|
+
media_type: T.nilable(String),
|
|
108
|
+
sample: T.nilable(String),
|
|
109
|
+
short_url: T.nilable(String),
|
|
110
|
+
url: T.nilable(String),
|
|
111
|
+
variable_type: T.nilable(String)
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
end
|
|
115
|
+
def to_hash
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
ContactListItem = Sentdm::Models::ContactListItem
|
|
5
|
+
|
|
6
|
+
ContactListParams = Sentdm::Models::ContactListParams
|
|
7
|
+
|
|
8
|
+
ContactRetrieveByPhoneParams = Sentdm::Models::ContactRetrieveByPhoneParams
|
|
9
|
+
|
|
10
|
+
ContactRetrieveIDParams = Sentdm::Models::ContactRetrieveIDParams
|
|
11
|
+
|
|
12
|
+
MessageRetrieveParams = Sentdm::Models::MessageRetrieveParams
|
|
13
|
+
|
|
14
|
+
MessageSendQuickMessageParams = Sentdm::Models::MessageSendQuickMessageParams
|
|
15
|
+
|
|
16
|
+
MessageSendToContactParams = Sentdm::Models::MessageSendToContactParams
|
|
17
|
+
|
|
18
|
+
MessageSendToPhoneParams = Sentdm::Models::MessageSendToPhoneParams
|
|
19
|
+
|
|
20
|
+
NumberLookupRetrieveParams = Sentdm::Models::NumberLookupRetrieveParams
|
|
21
|
+
|
|
22
|
+
OrganizationListParams = Sentdm::Models::OrganizationListParams
|
|
23
|
+
|
|
24
|
+
OrganizationRetrieveProfilesParams =
|
|
25
|
+
Sentdm::Models::OrganizationRetrieveProfilesParams
|
|
26
|
+
|
|
27
|
+
Organizations = Sentdm::Models::Organizations
|
|
28
|
+
|
|
29
|
+
ProfileSummary = Sentdm::Models::ProfileSummary
|
|
30
|
+
|
|
31
|
+
TemplateBodyContent = Sentdm::Models::TemplateBodyContent
|
|
32
|
+
|
|
33
|
+
TemplateCreateParams = Sentdm::Models::TemplateCreateParams
|
|
34
|
+
|
|
35
|
+
TemplateDefinition = Sentdm::Models::TemplateDefinition
|
|
36
|
+
|
|
37
|
+
TemplateDeleteParams = Sentdm::Models::TemplateDeleteParams
|
|
38
|
+
|
|
39
|
+
TemplateListParams = Sentdm::Models::TemplateListParams
|
|
40
|
+
|
|
41
|
+
TemplateResponse = Sentdm::Models::TemplateResponse
|
|
42
|
+
|
|
43
|
+
TemplateRetrieveParams = Sentdm::Models::TemplateRetrieveParams
|
|
44
|
+
|
|
45
|
+
TemplateVariable = Sentdm::Models::TemplateVariable
|
|
46
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
# Specify HTTP behaviour to use for a specific request. These options supplement
|
|
5
|
+
# or override those provided at the client level.
|
|
6
|
+
#
|
|
7
|
+
# When making a request, you can pass an actual {RequestOptions} instance, or
|
|
8
|
+
# simply pass a Hash with symbol keys matching the attributes on this class.
|
|
9
|
+
class RequestOptions < Sentdm::Internal::Type::BaseModel
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias { T.any(Sentdm::RequestOptions, Sentdm::Internal::AnyHash) }
|
|
12
|
+
|
|
13
|
+
# @api private
|
|
14
|
+
sig { params(opts: Sentdm::RequestOptions::OrHash).void }
|
|
15
|
+
def self.validate!(opts)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Idempotency key to send with request and all associated retries. Will only be
|
|
19
|
+
# sent for write requests.
|
|
20
|
+
sig { returns(T.nilable(String)) }
|
|
21
|
+
attr_accessor :idempotency_key
|
|
22
|
+
|
|
23
|
+
# Extra query params to send with the request. These are `.merge`’d into any
|
|
24
|
+
# `query` given at the client level.
|
|
25
|
+
sig do
|
|
26
|
+
returns(
|
|
27
|
+
T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])
|
|
28
|
+
)
|
|
29
|
+
end
|
|
30
|
+
attr_accessor :extra_query
|
|
31
|
+
|
|
32
|
+
# Extra headers to send with the request. These are `.merged`’d into any
|
|
33
|
+
# `extra_headers` given at the client level.
|
|
34
|
+
sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) }
|
|
35
|
+
attr_accessor :extra_headers
|
|
36
|
+
|
|
37
|
+
# Extra data to send with the request. These are deep merged into any data
|
|
38
|
+
# generated as part of the normal request.
|
|
39
|
+
sig { returns(T.nilable(T.anything)) }
|
|
40
|
+
attr_accessor :extra_body
|
|
41
|
+
|
|
42
|
+
# Maximum number of retries to attempt after a failed initial request.
|
|
43
|
+
sig { returns(T.nilable(Integer)) }
|
|
44
|
+
attr_accessor :max_retries
|
|
45
|
+
|
|
46
|
+
# Request timeout in seconds.
|
|
47
|
+
sig { returns(T.nilable(Float)) }
|
|
48
|
+
attr_accessor :timeout
|
|
49
|
+
|
|
50
|
+
# Returns a new instance of RequestOptions.
|
|
51
|
+
sig { params(values: Sentdm::Internal::AnyHash).returns(T.attached_class) }
|
|
52
|
+
def self.new(values = {})
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Resources
|
|
5
|
+
class Contacts
|
|
6
|
+
# Retrieves a paginated list of contacts for the authenticated customer. Supports
|
|
7
|
+
# server-side pagination with configurable page size. The customer ID is extracted
|
|
8
|
+
# from the authentication token.
|
|
9
|
+
sig do
|
|
10
|
+
params(
|
|
11
|
+
page: Integer,
|
|
12
|
+
page_size: Integer,
|
|
13
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
14
|
+
).returns(Sentdm::Models::ContactListResponse)
|
|
15
|
+
end
|
|
16
|
+
def list(
|
|
17
|
+
# The page number (zero-indexed). Default is 0.
|
|
18
|
+
page:,
|
|
19
|
+
# The number of items per page. Default is 20.
|
|
20
|
+
page_size:,
|
|
21
|
+
request_options: {}
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Retrieves a contact by their phone number for the authenticated customer. Phone
|
|
26
|
+
# number should be in international format (e.g., +1234567890). The customer ID is
|
|
27
|
+
# extracted from the authentication token.
|
|
28
|
+
sig do
|
|
29
|
+
params(
|
|
30
|
+
phone_number: String,
|
|
31
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
32
|
+
).returns(Sentdm::ContactListItem)
|
|
33
|
+
end
|
|
34
|
+
def retrieve_by_phone(
|
|
35
|
+
# The phone number in international format (e.g., +1234567890)
|
|
36
|
+
phone_number:,
|
|
37
|
+
request_options: {}
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Retrieves a specific contact by their unique identifier for the authenticated
|
|
42
|
+
# customer. The customer ID is extracted from the authentication token. Returns
|
|
43
|
+
# detailed contact information including phone number and creation timestamp.
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
id: String,
|
|
47
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
48
|
+
).returns(Sentdm::ContactListItem)
|
|
49
|
+
end
|
|
50
|
+
def retrieve_id(
|
|
51
|
+
# The unique identifier (GUID) of the resource to retrieve
|
|
52
|
+
id:,
|
|
53
|
+
request_options: {}
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# @api private
|
|
58
|
+
sig { params(client: Sentdm::Client).returns(T.attached_class) }
|
|
59
|
+
def self.new(client:)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Resources
|
|
5
|
+
class Messages
|
|
6
|
+
# Retrieves comprehensive details about a specific message using the message ID.
|
|
7
|
+
# Returns complete message data including delivery status, channel information,
|
|
8
|
+
# template details, contact information, and pricing. The customer ID is extracted
|
|
9
|
+
# from the authentication token to ensure the message belongs to the authenticated
|
|
10
|
+
# customer.
|
|
11
|
+
sig do
|
|
12
|
+
params(
|
|
13
|
+
id: String,
|
|
14
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
15
|
+
).returns(Sentdm::Models::MessageRetrieveResponse)
|
|
16
|
+
end
|
|
17
|
+
def retrieve(id, request_options: {})
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Sends a message to a phone number using the default template. This endpoint is
|
|
21
|
+
# rate limited to 5 messages per customer per day. The customer ID is extracted
|
|
22
|
+
# from the authentication token.
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
custom_message: String,
|
|
26
|
+
phone_number: String,
|
|
27
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
28
|
+
).void
|
|
29
|
+
end
|
|
30
|
+
def send_quick_message(
|
|
31
|
+
# The custom message content to include in the template
|
|
32
|
+
custom_message:,
|
|
33
|
+
# The phone number to send the message to, in international format (e.g.,
|
|
34
|
+
# +1234567890)
|
|
35
|
+
phone_number:,
|
|
36
|
+
request_options: {}
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Sends a message to a specific contact using a template. The message can be sent
|
|
41
|
+
# via SMS or WhatsApp depending on the contact's capabilities. Optionally specify
|
|
42
|
+
# a webhook URL to receive delivery status updates. The customer ID is extracted
|
|
43
|
+
# from the authentication token.
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
contact_id: String,
|
|
47
|
+
template_id: String,
|
|
48
|
+
template_variables: T.nilable(T::Hash[Symbol, String]),
|
|
49
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
50
|
+
).void
|
|
51
|
+
end
|
|
52
|
+
def send_to_contact(
|
|
53
|
+
# The unique identifier of the contact to send the message to
|
|
54
|
+
contact_id:,
|
|
55
|
+
# The unique identifier of the template to use for the message
|
|
56
|
+
template_id:,
|
|
57
|
+
# Optional key-value pairs of template variables to replace in the template body.
|
|
58
|
+
# For example, if your template contains "Hello {{name}}", you would provide {
|
|
59
|
+
# "name": "John Doe" }
|
|
60
|
+
template_variables: nil,
|
|
61
|
+
request_options: {}
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Sends a message to a phone number using a template. The phone number doesn't
|
|
66
|
+
# need to be a pre-existing contact. The message can be sent via SMS or WhatsApp.
|
|
67
|
+
# Optionally specify a webhook URL to receive delivery status updates. The
|
|
68
|
+
# customer ID is extracted from the authentication token.
|
|
69
|
+
sig do
|
|
70
|
+
params(
|
|
71
|
+
phone_number: String,
|
|
72
|
+
template_id: String,
|
|
73
|
+
template_variables: T.nilable(T::Hash[Symbol, String]),
|
|
74
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
75
|
+
).void
|
|
76
|
+
end
|
|
77
|
+
def send_to_phone(
|
|
78
|
+
# The phone number to send the message to, in international format (e.g.,
|
|
79
|
+
# +1234567890)
|
|
80
|
+
phone_number:,
|
|
81
|
+
# The unique identifier of the template to use for the message
|
|
82
|
+
template_id:,
|
|
83
|
+
# Optional key-value pairs of template variables to replace in the template body.
|
|
84
|
+
# For example, if your template contains "Hello {{name}}", you would provide {
|
|
85
|
+
# "name": "John Doe" }
|
|
86
|
+
template_variables: nil,
|
|
87
|
+
request_options: {}
|
|
88
|
+
)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# @api private
|
|
92
|
+
sig { params(client: Sentdm::Client).returns(T.attached_class) }
|
|
93
|
+
def self.new(client:)
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Resources
|
|
5
|
+
class NumberLookup
|
|
6
|
+
# Retrieves detailed information about a phone number including validation,
|
|
7
|
+
# formatting, country information, and available messaging channels. The customer
|
|
8
|
+
# ID is extracted from the authentication token.
|
|
9
|
+
sig do
|
|
10
|
+
params(
|
|
11
|
+
phone_number: String,
|
|
12
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
13
|
+
).returns(Sentdm::Models::NumberLookupRetrieveResponse)
|
|
14
|
+
end
|
|
15
|
+
def retrieve(phone_number:, request_options: {})
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# @api private
|
|
19
|
+
sig { params(client: Sentdm::Client).returns(T.attached_class) }
|
|
20
|
+
def self.new(client:)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Resources
|
|
5
|
+
class Organizations
|
|
6
|
+
class Users
|
|
7
|
+
# Retrieves a specific user by their ID. Requires appropriate permissions. The
|
|
8
|
+
# customerId can be either an organization ID or a profile ID.
|
|
9
|
+
sig do
|
|
10
|
+
params(
|
|
11
|
+
user_id: String,
|
|
12
|
+
customer_id: String,
|
|
13
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
14
|
+
).returns(Sentdm::Organizations::CustomerUser)
|
|
15
|
+
end
|
|
16
|
+
def retrieve(user_id, customer_id:, request_options: {})
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Retrieves all users associated with an organization or sender profile. Requires
|
|
20
|
+
# appropriate permissions. Supports pagination.
|
|
21
|
+
sig do
|
|
22
|
+
params(
|
|
23
|
+
customer_id: String,
|
|
24
|
+
page: Integer,
|
|
25
|
+
page_size: Integer,
|
|
26
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
27
|
+
).returns(Sentdm::Models::Organizations::UserListResponse)
|
|
28
|
+
end
|
|
29
|
+
def list(customer_id, page:, page_size:, request_options: {})
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Removes a user from an organization or sender profile. Requires admin
|
|
33
|
+
# permissions. This action permanently deletes the user association.
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
user_id: String,
|
|
37
|
+
customer_id: String,
|
|
38
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
39
|
+
).void
|
|
40
|
+
end
|
|
41
|
+
def delete(user_id, customer_id:, request_options: {})
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Invites a user to an organization or sender profile with a specified role.
|
|
45
|
+
# Requires appropriate permissions. The customerId can be either an organization
|
|
46
|
+
# ID or a profile ID.
|
|
47
|
+
sig do
|
|
48
|
+
params(
|
|
49
|
+
customer_id: String,
|
|
50
|
+
email: String,
|
|
51
|
+
invited_by: T.nilable(String),
|
|
52
|
+
name: String,
|
|
53
|
+
role: String,
|
|
54
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
55
|
+
).returns(Sentdm::Organizations::CustomerUser)
|
|
56
|
+
end
|
|
57
|
+
def invite(
|
|
58
|
+
customer_id,
|
|
59
|
+
email: nil,
|
|
60
|
+
invited_by: nil,
|
|
61
|
+
name: nil,
|
|
62
|
+
role: nil,
|
|
63
|
+
request_options: {}
|
|
64
|
+
)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Updates a user's role within an organization or sender profile. Requires admin
|
|
68
|
+
# permissions. Valid roles are: admin, billing, developer.
|
|
69
|
+
sig do
|
|
70
|
+
params(
|
|
71
|
+
user_id: String,
|
|
72
|
+
customer_id: String,
|
|
73
|
+
role: String,
|
|
74
|
+
request_options: Sentdm::RequestOptions::OrHash
|
|
75
|
+
).returns(Sentdm::Organizations::CustomerUser)
|
|
76
|
+
end
|
|
77
|
+
def update_role(
|
|
78
|
+
# Path param
|
|
79
|
+
user_id,
|
|
80
|
+
# Path param
|
|
81
|
+
customer_id:,
|
|
82
|
+
# Body param
|
|
83
|
+
role: nil,
|
|
84
|
+
request_options: {}
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# @api private
|
|
89
|
+
sig { params(client: Sentdm::Client).returns(T.attached_class) }
|
|
90
|
+
def self.new(client:)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|