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,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Internal
|
|
5
|
+
extend Sentdm::Internal::Util::SorbetRuntimeSupport
|
|
6
|
+
|
|
7
|
+
OMIT =
|
|
8
|
+
Object.new.tap do
|
|
9
|
+
_1.define_singleton_method(:inspect) { "#<#{Sentdm::Internal}::OMIT>" }
|
|
10
|
+
end
|
|
11
|
+
.freeze
|
|
12
|
+
|
|
13
|
+
define_sorbet_constant!(:AnyHash) do
|
|
14
|
+
T.type_alias { T::Hash[Symbol, T.anything] }
|
|
15
|
+
end
|
|
16
|
+
define_sorbet_constant!(:FileInput) do
|
|
17
|
+
T.type_alias { T.any(Pathname, StringIO, IO, String, Sentdm::FilePart) }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
# @see Sentdm::Resources::Contacts#retrieve_by_phone
|
|
6
|
+
class ContactListItem < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The unique identifier of the contact
|
|
9
|
+
#
|
|
10
|
+
# @return [String, nil]
|
|
11
|
+
optional :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute available_channels
|
|
14
|
+
# Comma-separated list of available messaging channels for this contact (e.g.,
|
|
15
|
+
# "sms,whatsapp")
|
|
16
|
+
#
|
|
17
|
+
# @return [String, nil]
|
|
18
|
+
optional :available_channels, String, api_name: :availableChannels
|
|
19
|
+
|
|
20
|
+
# @!attribute country_code
|
|
21
|
+
# The country calling code (e.g., 1 for US/Canada)
|
|
22
|
+
#
|
|
23
|
+
# @return [String, nil]
|
|
24
|
+
optional :country_code, String, api_name: :countryCode
|
|
25
|
+
|
|
26
|
+
# @!attribute default_channel
|
|
27
|
+
# The default messaging channel to use for this contact (e.g., "sms" or
|
|
28
|
+
# "whatsapp")
|
|
29
|
+
#
|
|
30
|
+
# @return [String, nil]
|
|
31
|
+
optional :default_channel, String, api_name: :defaultChannel
|
|
32
|
+
|
|
33
|
+
# @!attribute format_e164
|
|
34
|
+
# The phone number formatted in E.164 standard (e.g., +1234567890)
|
|
35
|
+
#
|
|
36
|
+
# @return [String, nil]
|
|
37
|
+
optional :format_e164, String, api_name: :formatE164
|
|
38
|
+
|
|
39
|
+
# @!attribute format_international
|
|
40
|
+
# The phone number formatted for international dialing (e.g., +1 234-567-890)
|
|
41
|
+
#
|
|
42
|
+
# @return [String, nil]
|
|
43
|
+
optional :format_international, String, api_name: :formatInternational
|
|
44
|
+
|
|
45
|
+
# @!attribute format_national
|
|
46
|
+
# The phone number formatted for national dialing (e.g., (234) 567-890)
|
|
47
|
+
#
|
|
48
|
+
# @return [String, nil]
|
|
49
|
+
optional :format_national, String, api_name: :formatNational
|
|
50
|
+
|
|
51
|
+
# @!attribute format_rfc
|
|
52
|
+
# The phone number formatted according to RFC 3966 (e.g., tel:+1-234-567-890)
|
|
53
|
+
#
|
|
54
|
+
# @return [String, nil]
|
|
55
|
+
optional :format_rfc, String, api_name: :formatRfc
|
|
56
|
+
|
|
57
|
+
# @!attribute phone_number
|
|
58
|
+
# The phone number in its original format
|
|
59
|
+
#
|
|
60
|
+
# @return [String, nil]
|
|
61
|
+
optional :phone_number, String, api_name: :phoneNumber
|
|
62
|
+
|
|
63
|
+
# @!attribute region_code
|
|
64
|
+
# The ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
|
|
65
|
+
#
|
|
66
|
+
# @return [String, nil]
|
|
67
|
+
optional :region_code, String, api_name: :regionCode
|
|
68
|
+
|
|
69
|
+
# @!method initialize(id: nil, available_channels: nil, country_code: nil, default_channel: nil, format_e164: nil, format_international: nil, format_national: nil, format_rfc: nil, phone_number: nil, region_code: nil)
|
|
70
|
+
# Some parameter documentations has been truncated, see
|
|
71
|
+
# {Sentdm::Models::ContactListItem} for more details.
|
|
72
|
+
#
|
|
73
|
+
# Represents a contact in the customer's contact list
|
|
74
|
+
#
|
|
75
|
+
# @param id [String] The unique identifier of the contact
|
|
76
|
+
#
|
|
77
|
+
# @param available_channels [String] Comma-separated list of available messaging channels for this contact (e.g., "sm
|
|
78
|
+
#
|
|
79
|
+
# @param country_code [String] The country calling code (e.g., 1 for US/Canada)
|
|
80
|
+
#
|
|
81
|
+
# @param default_channel [String] The default messaging channel to use for this contact (e.g., "sms" or "whatsapp"
|
|
82
|
+
#
|
|
83
|
+
# @param format_e164 [String] The phone number formatted in E.164 standard (e.g., +1234567890)
|
|
84
|
+
#
|
|
85
|
+
# @param format_international [String] The phone number formatted for international dialing (e.g., +1 234-567-890)
|
|
86
|
+
#
|
|
87
|
+
# @param format_national [String] The phone number formatted for national dialing (e.g., (234) 567-890)
|
|
88
|
+
#
|
|
89
|
+
# @param format_rfc [String] The phone number formatted according to RFC 3966 (e.g., tel:+1-234-567-890)
|
|
90
|
+
#
|
|
91
|
+
# @param phone_number [String] The phone number in its original format
|
|
92
|
+
#
|
|
93
|
+
# @param region_code [String] The ISO 3166-1 alpha-2 country code (e.g., US, CA, GB)
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
# @see Sentdm::Resources::Contacts#list
|
|
6
|
+
class ContactListParams < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute page
|
|
11
|
+
# The page number (zero-indexed). Default is 0.
|
|
12
|
+
#
|
|
13
|
+
# @return [Integer]
|
|
14
|
+
required :page, Integer
|
|
15
|
+
|
|
16
|
+
# @!attribute page_size
|
|
17
|
+
# The number of items per page. Default is 20.
|
|
18
|
+
#
|
|
19
|
+
# @return [Integer]
|
|
20
|
+
required :page_size, Integer
|
|
21
|
+
|
|
22
|
+
# @!method initialize(page:, page_size:, request_options: {})
|
|
23
|
+
# @param page [Integer] The page number (zero-indexed). Default is 0.
|
|
24
|
+
#
|
|
25
|
+
# @param page_size [Integer] The number of items per page. Default is 20.
|
|
26
|
+
#
|
|
27
|
+
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
# @see Sentdm::Resources::Contacts#list
|
|
6
|
+
class ContactListResponse < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute items
|
|
8
|
+
#
|
|
9
|
+
# @return [Array<Sentdm::Models::ContactListItem>, nil]
|
|
10
|
+
optional :items, -> { Sentdm::Internal::Type::ArrayOf[Sentdm::ContactListItem] }
|
|
11
|
+
|
|
12
|
+
# @!attribute page
|
|
13
|
+
#
|
|
14
|
+
# @return [Integer, nil]
|
|
15
|
+
optional :page, Integer
|
|
16
|
+
|
|
17
|
+
# @!attribute page_size
|
|
18
|
+
#
|
|
19
|
+
# @return [Integer, nil]
|
|
20
|
+
optional :page_size, Integer, api_name: :pageSize
|
|
21
|
+
|
|
22
|
+
# @!attribute total_count
|
|
23
|
+
#
|
|
24
|
+
# @return [Integer, nil]
|
|
25
|
+
optional :total_count, Integer, api_name: :totalCount
|
|
26
|
+
|
|
27
|
+
# @!attribute total_pages
|
|
28
|
+
#
|
|
29
|
+
# @return [Integer, nil]
|
|
30
|
+
optional :total_pages, Integer, api_name: :totalPages
|
|
31
|
+
|
|
32
|
+
# @!method initialize(items: nil, page: nil, page_size: nil, total_count: nil, total_pages: nil)
|
|
33
|
+
# @param items [Array<Sentdm::Models::ContactListItem>]
|
|
34
|
+
# @param page [Integer]
|
|
35
|
+
# @param page_size [Integer]
|
|
36
|
+
# @param total_count [Integer]
|
|
37
|
+
# @param total_pages [Integer]
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
# @see Sentdm::Resources::Contacts#retrieve_by_phone
|
|
6
|
+
class ContactRetrieveByPhoneParams < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute phone_number
|
|
11
|
+
# The phone number in international format (e.g., +1234567890)
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :phone_number, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(phone_number:, request_options: {})
|
|
17
|
+
# @param phone_number [String] The phone number in international format (e.g., +1234567890)
|
|
18
|
+
#
|
|
19
|
+
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
# @see Sentdm::Resources::Contacts#retrieve_id
|
|
6
|
+
class ContactRetrieveIDParams < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
# The unique identifier (GUID) of the resource to retrieve
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :id, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(id:, request_options: {})
|
|
17
|
+
# @param id [String] The unique identifier (GUID) of the resource to retrieve
|
|
18
|
+
#
|
|
19
|
+
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
# @see Sentdm::Resources::Messages#retrieve
|
|
6
|
+
class MessageRetrieveParams < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!method initialize(request_options: {})
|
|
11
|
+
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
# @see Sentdm::Resources::Messages#retrieve
|
|
6
|
+
class MessageRetrieveResponse < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The unique identifier of the message
|
|
9
|
+
#
|
|
10
|
+
# @return [String, nil]
|
|
11
|
+
optional :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute channel
|
|
14
|
+
# The messaging channel used (e.g., SMS, WhatsApp)
|
|
15
|
+
#
|
|
16
|
+
# @return [String, nil]
|
|
17
|
+
optional :channel, String
|
|
18
|
+
|
|
19
|
+
# @!attribute contact_id
|
|
20
|
+
# The unique identifier of the contact who received the message
|
|
21
|
+
#
|
|
22
|
+
# @return [String, nil]
|
|
23
|
+
optional :contact_id, String, api_name: :contactId
|
|
24
|
+
|
|
25
|
+
# @!attribute corrected_price
|
|
26
|
+
# The final price charged for sending this message
|
|
27
|
+
#
|
|
28
|
+
# @return [Float, nil]
|
|
29
|
+
optional :corrected_price, Float, api_name: :correctedPrice, nil?: true
|
|
30
|
+
|
|
31
|
+
# @!attribute created_at
|
|
32
|
+
# The date and time when the message was created
|
|
33
|
+
#
|
|
34
|
+
# @return [Time, nil]
|
|
35
|
+
optional :created_at, Time, api_name: :createdAt
|
|
36
|
+
|
|
37
|
+
# @!attribute customer_id
|
|
38
|
+
# The unique identifier of the customer who sent the message
|
|
39
|
+
#
|
|
40
|
+
# @return [String, nil]
|
|
41
|
+
optional :customer_id, String, api_name: :customerId
|
|
42
|
+
|
|
43
|
+
# @!attribute events
|
|
44
|
+
# A chronological list of status change events for this message. Each event
|
|
45
|
+
# includes a status and timestamp, following industry standards (Twilio, SendGrid,
|
|
46
|
+
# Mailgun). Events are ordered chronologically from oldest to newest.
|
|
47
|
+
#
|
|
48
|
+
# @return [Array<Sentdm::Models::MessageRetrieveResponse::Event>, nil]
|
|
49
|
+
optional :events,
|
|
50
|
+
-> { Sentdm::Internal::Type::ArrayOf[Sentdm::Models::MessageRetrieveResponse::Event] },
|
|
51
|
+
nil?: true
|
|
52
|
+
|
|
53
|
+
# @!attribute message_body
|
|
54
|
+
# The message body content with variables substituted
|
|
55
|
+
#
|
|
56
|
+
# @return [Sentdm::Models::MessageRetrieveResponse::MessageBody, nil]
|
|
57
|
+
optional :message_body,
|
|
58
|
+
-> { Sentdm::Models::MessageRetrieveResponse::MessageBody },
|
|
59
|
+
api_name: :messageBody,
|
|
60
|
+
nil?: true
|
|
61
|
+
|
|
62
|
+
# @!attribute phone_number
|
|
63
|
+
# The phone number of the recipient (E.164 format)
|
|
64
|
+
#
|
|
65
|
+
# @return [String, nil]
|
|
66
|
+
optional :phone_number, String, api_name: :phoneNumber
|
|
67
|
+
|
|
68
|
+
# @!attribute phone_number_international
|
|
69
|
+
# The phone number in international format
|
|
70
|
+
#
|
|
71
|
+
# @return [String, nil]
|
|
72
|
+
optional :phone_number_international, String, api_name: :phoneNumberInternational
|
|
73
|
+
|
|
74
|
+
# @!attribute region_code
|
|
75
|
+
# The region code of the phone number (e.g., US, GB, DE)
|
|
76
|
+
#
|
|
77
|
+
# @return [String, nil]
|
|
78
|
+
optional :region_code, String, api_name: :regionCode
|
|
79
|
+
|
|
80
|
+
# @!attribute status
|
|
81
|
+
# The delivery status of the message (e.g., sent, delivered, failed, read)
|
|
82
|
+
#
|
|
83
|
+
# @return [String, nil]
|
|
84
|
+
optional :status, String
|
|
85
|
+
|
|
86
|
+
# @!attribute template_category
|
|
87
|
+
# The category of the template (e.g., MARKETING, UTILITY, AUTHENTICATION)
|
|
88
|
+
#
|
|
89
|
+
# @return [String, nil]
|
|
90
|
+
optional :template_category, String, api_name: :templateCategory
|
|
91
|
+
|
|
92
|
+
# @!attribute template_id
|
|
93
|
+
# The unique identifier of the template used for this message (null if no template
|
|
94
|
+
# was used)
|
|
95
|
+
#
|
|
96
|
+
# @return [String, nil]
|
|
97
|
+
optional :template_id, String, api_name: :templateId, nil?: true
|
|
98
|
+
|
|
99
|
+
# @!attribute template_name
|
|
100
|
+
# The display name of the template
|
|
101
|
+
#
|
|
102
|
+
# @return [String, nil]
|
|
103
|
+
optional :template_name, String, api_name: :templateName
|
|
104
|
+
|
|
105
|
+
# @!method initialize(id: nil, channel: nil, contact_id: nil, corrected_price: nil, created_at: nil, customer_id: nil, events: nil, message_body: nil, phone_number: nil, phone_number_international: nil, region_code: nil, status: nil, template_category: nil, template_id: nil, template_name: nil)
|
|
106
|
+
# Some parameter documentations has been truncated, see
|
|
107
|
+
# {Sentdm::Models::MessageRetrieveResponse} for more details.
|
|
108
|
+
#
|
|
109
|
+
# Represents a sent message with comprehensive delivery and template information
|
|
110
|
+
# (v2)
|
|
111
|
+
#
|
|
112
|
+
# @param id [String] The unique identifier of the message
|
|
113
|
+
#
|
|
114
|
+
# @param channel [String] The messaging channel used (e.g., SMS, WhatsApp)
|
|
115
|
+
#
|
|
116
|
+
# @param contact_id [String] The unique identifier of the contact who received the message
|
|
117
|
+
#
|
|
118
|
+
# @param corrected_price [Float, nil] The final price charged for sending this message
|
|
119
|
+
#
|
|
120
|
+
# @param created_at [Time] The date and time when the message was created
|
|
121
|
+
#
|
|
122
|
+
# @param customer_id [String] The unique identifier of the customer who sent the message
|
|
123
|
+
#
|
|
124
|
+
# @param events [Array<Sentdm::Models::MessageRetrieveResponse::Event>, nil] A chronological list of status change events for this message.
|
|
125
|
+
#
|
|
126
|
+
# @param message_body [Sentdm::Models::MessageRetrieveResponse::MessageBody, nil] The message body content with variables substituted
|
|
127
|
+
#
|
|
128
|
+
# @param phone_number [String] The phone number of the recipient (E.164 format)
|
|
129
|
+
#
|
|
130
|
+
# @param phone_number_international [String] The phone number in international format
|
|
131
|
+
#
|
|
132
|
+
# @param region_code [String] The region code of the phone number (e.g., US, GB, DE)
|
|
133
|
+
#
|
|
134
|
+
# @param status [String] The delivery status of the message (e.g., sent, delivered, failed, read)
|
|
135
|
+
#
|
|
136
|
+
# @param template_category [String] The category of the template (e.g., MARKETING, UTILITY, AUTHENTICATION)
|
|
137
|
+
#
|
|
138
|
+
# @param template_id [String, nil] The unique identifier of the template used for this message (null if no template
|
|
139
|
+
#
|
|
140
|
+
# @param template_name [String] The display name of the template
|
|
141
|
+
|
|
142
|
+
class Event < Sentdm::Internal::Type::BaseModel
|
|
143
|
+
# @!attribute description
|
|
144
|
+
# Optional human-readable description of the event Useful for error messages or
|
|
145
|
+
# additional context
|
|
146
|
+
#
|
|
147
|
+
# @return [String, nil]
|
|
148
|
+
optional :description, String, nil?: true
|
|
149
|
+
|
|
150
|
+
# @!attribute status
|
|
151
|
+
# The status of the message at this point in time Examples: "queued", "sent",
|
|
152
|
+
# "delivered", "read", "failed"
|
|
153
|
+
#
|
|
154
|
+
# @return [String, nil]
|
|
155
|
+
optional :status, String
|
|
156
|
+
|
|
157
|
+
# @!attribute timestamp
|
|
158
|
+
# When this status change occurred (ISO 8601 format)
|
|
159
|
+
#
|
|
160
|
+
# @return [Time, nil]
|
|
161
|
+
optional :timestamp, Time
|
|
162
|
+
|
|
163
|
+
# @!method initialize(description: nil, status: nil, timestamp: nil)
|
|
164
|
+
# Some parameter documentations has been truncated, see
|
|
165
|
+
# {Sentdm::Models::MessageRetrieveResponse::Event} for more details.
|
|
166
|
+
#
|
|
167
|
+
# Represents a status change event in a message's lifecycle Follows industry
|
|
168
|
+
# standards (Twilio, SendGrid, Mailgun pattern)
|
|
169
|
+
#
|
|
170
|
+
# @param description [String, nil] Optional human-readable description of the event
|
|
171
|
+
#
|
|
172
|
+
# @param status [String] The status of the message at this point in time
|
|
173
|
+
#
|
|
174
|
+
# @param timestamp [Time] When this status change occurred (ISO 8601 format)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# @see Sentdm::Models::MessageRetrieveResponse#message_body
|
|
178
|
+
class MessageBody < Sentdm::Internal::Type::BaseModel
|
|
179
|
+
# @!attribute buttons
|
|
180
|
+
#
|
|
181
|
+
# @return [Array<Sentdm::Models::MessageRetrieveResponse::MessageBody::Button>, nil]
|
|
182
|
+
optional :buttons,
|
|
183
|
+
-> { Sentdm::Internal::Type::ArrayOf[Sentdm::Models::MessageRetrieveResponse::MessageBody::Button] },
|
|
184
|
+
nil?: true
|
|
185
|
+
|
|
186
|
+
# @!attribute content
|
|
187
|
+
#
|
|
188
|
+
# @return [String, nil]
|
|
189
|
+
optional :content, String
|
|
190
|
+
|
|
191
|
+
# @!attribute footer
|
|
192
|
+
#
|
|
193
|
+
# @return [String, nil]
|
|
194
|
+
optional :footer, String, nil?: true
|
|
195
|
+
|
|
196
|
+
# @!attribute header
|
|
197
|
+
#
|
|
198
|
+
# @return [String, nil]
|
|
199
|
+
optional :header, String, nil?: true
|
|
200
|
+
|
|
201
|
+
# @!method initialize(buttons: nil, content: nil, footer: nil, header: nil)
|
|
202
|
+
# The message body content with variables substituted
|
|
203
|
+
#
|
|
204
|
+
# @param buttons [Array<Sentdm::Models::MessageRetrieveResponse::MessageBody::Button>, nil]
|
|
205
|
+
# @param content [String]
|
|
206
|
+
# @param footer [String, nil]
|
|
207
|
+
# @param header [String, nil]
|
|
208
|
+
|
|
209
|
+
class Button < Sentdm::Internal::Type::BaseModel
|
|
210
|
+
# @!attribute type
|
|
211
|
+
#
|
|
212
|
+
# @return [String, nil]
|
|
213
|
+
optional :type, String
|
|
214
|
+
|
|
215
|
+
# @!attribute value
|
|
216
|
+
#
|
|
217
|
+
# @return [String, nil]
|
|
218
|
+
optional :value, String
|
|
219
|
+
|
|
220
|
+
# @!method initialize(type: nil, value: nil)
|
|
221
|
+
# @param type [String]
|
|
222
|
+
# @param value [String]
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
# @see Sentdm::Resources::Messages#send_quick_message
|
|
6
|
+
class MessageSendQuickMessageParams < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute custom_message
|
|
11
|
+
# The custom message content to include in the template
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :custom_message, String, api_name: :customMessage
|
|
15
|
+
|
|
16
|
+
# @!attribute phone_number
|
|
17
|
+
# The phone number to send the message to, in international format (e.g.,
|
|
18
|
+
# +1234567890)
|
|
19
|
+
#
|
|
20
|
+
# @return [String]
|
|
21
|
+
required :phone_number, String, api_name: :phoneNumber
|
|
22
|
+
|
|
23
|
+
# @!method initialize(custom_message:, phone_number:, request_options: {})
|
|
24
|
+
# Some parameter documentations has been truncated, see
|
|
25
|
+
# {Sentdm::Models::MessageSendQuickMessageParams} for more details.
|
|
26
|
+
#
|
|
27
|
+
# @param custom_message [String] The custom message content to include in the template
|
|
28
|
+
#
|
|
29
|
+
# @param phone_number [String] The phone number to send the message to, in international format (e.g., +1234567
|
|
30
|
+
#
|
|
31
|
+
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
# @see Sentdm::Resources::Messages#send_to_contact
|
|
6
|
+
class MessageSendToContactParams < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute contact_id
|
|
11
|
+
# The unique identifier of the contact to send the message to
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :contact_id, String, api_name: :contactId
|
|
15
|
+
|
|
16
|
+
# @!attribute template_id
|
|
17
|
+
# The unique identifier of the template to use for the message
|
|
18
|
+
#
|
|
19
|
+
# @return [String]
|
|
20
|
+
required :template_id, String, api_name: :templateId
|
|
21
|
+
|
|
22
|
+
# @!attribute template_variables
|
|
23
|
+
# Optional key-value pairs of template variables to replace in the template body.
|
|
24
|
+
# For example, if your template contains "Hello {{name}}", you would provide {
|
|
25
|
+
# "name": "John Doe" }
|
|
26
|
+
#
|
|
27
|
+
# @return [Hash{Symbol=>String}, nil]
|
|
28
|
+
optional :template_variables,
|
|
29
|
+
Sentdm::Internal::Type::HashOf[String],
|
|
30
|
+
api_name: :templateVariables,
|
|
31
|
+
nil?: true
|
|
32
|
+
|
|
33
|
+
# @!method initialize(contact_id:, template_id:, template_variables: nil, request_options: {})
|
|
34
|
+
# Some parameter documentations has been truncated, see
|
|
35
|
+
# {Sentdm::Models::MessageSendToContactParams} for more details.
|
|
36
|
+
#
|
|
37
|
+
# @param contact_id [String] The unique identifier of the contact to send the message to
|
|
38
|
+
#
|
|
39
|
+
# @param template_id [String] The unique identifier of the template to use for the message
|
|
40
|
+
#
|
|
41
|
+
# @param template_variables [Hash{Symbol=>String}, nil] Optional key-value pairs of template variables to replace in the template body.
|
|
42
|
+
#
|
|
43
|
+
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
# @see Sentdm::Resources::Messages#send_to_phone
|
|
6
|
+
class MessageSendToPhoneParams < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute phone_number
|
|
11
|
+
# The phone number to send the message to, in international format (e.g.,
|
|
12
|
+
# +1234567890)
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :phone_number, String, api_name: :phoneNumber
|
|
16
|
+
|
|
17
|
+
# @!attribute template_id
|
|
18
|
+
# The unique identifier of the template to use for the message
|
|
19
|
+
#
|
|
20
|
+
# @return [String]
|
|
21
|
+
required :template_id, String, api_name: :templateId
|
|
22
|
+
|
|
23
|
+
# @!attribute template_variables
|
|
24
|
+
# Optional key-value pairs of template variables to replace in the template body.
|
|
25
|
+
# For example, if your template contains "Hello {{name}}", you would provide {
|
|
26
|
+
# "name": "John Doe" }
|
|
27
|
+
#
|
|
28
|
+
# @return [Hash{Symbol=>String}, nil]
|
|
29
|
+
optional :template_variables,
|
|
30
|
+
Sentdm::Internal::Type::HashOf[String],
|
|
31
|
+
api_name: :templateVariables,
|
|
32
|
+
nil?: true
|
|
33
|
+
|
|
34
|
+
# @!method initialize(phone_number:, template_id:, template_variables: nil, request_options: {})
|
|
35
|
+
# Some parameter documentations has been truncated, see
|
|
36
|
+
# {Sentdm::Models::MessageSendToPhoneParams} for more details.
|
|
37
|
+
#
|
|
38
|
+
# @param phone_number [String] The phone number to send the message to, in international format (e.g., +1234567
|
|
39
|
+
#
|
|
40
|
+
# @param template_id [String] The unique identifier of the template to use for the message
|
|
41
|
+
#
|
|
42
|
+
# @param template_variables [Hash{Symbol=>String}, nil] Optional key-value pairs of template variables to replace in the template body.
|
|
43
|
+
#
|
|
44
|
+
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sentdm
|
|
4
|
+
module Models
|
|
5
|
+
# @see Sentdm::Resources::NumberLookup#retrieve
|
|
6
|
+
class NumberLookupRetrieveParams < Sentdm::Internal::Type::BaseModel
|
|
7
|
+
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Sentdm::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute phone_number
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :phone_number, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(phone_number:, request_options: {})
|
|
16
|
+
# @param phone_number [String]
|
|
17
|
+
# @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|