sentdm 0.24.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -0
  3. data/README.md +7 -11
  4. data/lib/sentdm/client.rb +4 -0
  5. data/lib/sentdm/models/api_response_of_contact_message_summary.rb +43 -0
  6. data/lib/sentdm/models/api_response_of_conversation_messages_list.rb +43 -0
  7. data/lib/sentdm/models/{sent_dm_services_common_contracts_poc_os_authentication_config.rb → authentication_config.rb} +2 -3
  8. data/lib/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_business_info.rb → brand_business_info.rb} +5 -7
  9. data/lib/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_compliance_info.rb → brand_compliance_info.rb} +2 -10
  10. data/lib/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_contact_info.rb → brand_contact_info.rb} +1 -1
  11. data/lib/sentdm/models/brands_brand_data.rb +9 -13
  12. data/lib/sentdm/models/contact_message_summary.rb +76 -0
  13. data/lib/sentdm/models/contact_retrieve_message_summary_params.rb +26 -0
  14. data/lib/sentdm/models/conversation_list_messages_params.rb +38 -0
  15. data/lib/sentdm/models/conversation_list_params.rb +32 -0
  16. data/lib/sentdm/models/conversation_messages_list.rb +245 -0
  17. data/lib/sentdm/models/message_send_response.rb +2 -6
  18. data/lib/sentdm/models/profile_detail.rb +3 -11
  19. data/lib/sentdm/models/profile_update_params.rb +2 -2
  20. data/lib/sentdm/models/profiles/{api_response_of_tcr_campaign_with_use_cases.rb → api_response_of_brand_campaign.rb} +5 -5
  21. data/lib/sentdm/models/profiles/{campaign_list_response.rb → api_response_of_list_of_brand_campaign.rb} +4 -6
  22. data/lib/sentdm/models/profiles/{tcr_campaign_with_use_cases.rb → brand_campaign.rb} +63 -111
  23. data/lib/sentdm/models/profiles/campaign_data.rb +13 -6
  24. data/lib/sentdm/models/profiles/campaign_use_case.rb +71 -0
  25. data/lib/sentdm/models/profiles/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data.rb → campaign_use_case_data.rb} +1 -1
  26. data/lib/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_body.rb → template_body.rb} +2 -3
  27. data/lib/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_button.rb → template_button.rb} +5 -6
  28. data/lib/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_button_props.rb → template_button_props.rb} +2 -3
  29. data/lib/sentdm/models/template_definition.rb +15 -19
  30. data/lib/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_footer.rb → template_footer.rb} +1 -1
  31. data/lib/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_header.rb → template_header.rb} +2 -3
  32. data/lib/sentdm/models.rb +32 -27
  33. data/lib/sentdm/resources/contacts.rb +30 -0
  34. data/lib/sentdm/resources/conversations.rb +82 -0
  35. data/lib/sentdm/resources/messages.rb +4 -1
  36. data/lib/sentdm/resources/profiles/campaigns.rb +6 -6
  37. data/lib/sentdm/resources/profiles.rb +31 -19
  38. data/lib/sentdm/version.rb +1 -1
  39. data/lib/sentdm.rb +22 -14
  40. data/rbi/sentdm/client.rbi +3 -0
  41. data/rbi/sentdm/models/api_response_of_contact_message_summary.rbi +79 -0
  42. data/rbi/sentdm/models/api_response_of_conversation_messages_list.rbi +79 -0
  43. data/rbi/sentdm/models/{sent_dm_services_common_contracts_poc_os_authentication_config.rbi → authentication_config.rbi} +2 -5
  44. data/rbi/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_business_info.rbi → brand_business_info.rbi} +12 -30
  45. data/rbi/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_compliance_info.rbi → brand_compliance_info.rbi} +2 -13
  46. data/rbi/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_contact_info.rbi → brand_contact_info.rbi} +2 -5
  47. data/rbi/sentdm/models/brands_brand_data.rbi +12 -51
  48. data/rbi/sentdm/models/contact_message_summary.rbi +144 -0
  49. data/rbi/sentdm/models/contact_retrieve_message_summary_params.rbi +49 -0
  50. data/rbi/sentdm/models/conversation_list_messages_params.rbi +65 -0
  51. data/rbi/sentdm/models/conversation_list_params.rbi +51 -0
  52. data/rbi/sentdm/models/conversation_messages_list.rbi +419 -0
  53. data/rbi/sentdm/models/message_send_response.rbi +2 -4
  54. data/rbi/sentdm/models/profile_detail.rbi +2 -10
  55. data/rbi/sentdm/models/profile_update_params.rbi +2 -2
  56. data/rbi/sentdm/models/profiles/{api_response_of_tcr_campaign_with_use_cases.rbi → api_response_of_brand_campaign.rbi} +8 -10
  57. data/rbi/sentdm/models/profiles/{campaign_list_response.rbi → api_response_of_list_of_brand_campaign.rbi} +5 -13
  58. data/rbi/sentdm/models/profiles/brand_campaign.rbi +299 -0
  59. data/rbi/sentdm/models/profiles/campaign_data.rbi +16 -18
  60. data/rbi/sentdm/models/profiles/campaign_use_case.rbi +110 -0
  61. data/rbi/sentdm/models/profiles/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data.rbi → campaign_use_case_data.rbi} +2 -2
  62. data/rbi/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_body.rbi → template_body.rbi} +2 -7
  63. data/rbi/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_button.rbi → template_button.rbi} +6 -22
  64. data/rbi/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_button_props.rbi → template_button_props.rbi} +2 -5
  65. data/rbi/sentdm/models/template_definition.rbi +19 -87
  66. data/rbi/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_footer.rbi → template_footer.rbi} +2 -5
  67. data/rbi/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_header.rbi → template_header.rbi} +2 -5
  68. data/rbi/sentdm/models.rbi +36 -27
  69. data/rbi/sentdm/resources/contacts.rbi +20 -0
  70. data/rbi/sentdm/resources/conversations.rbi +61 -0
  71. data/rbi/sentdm/resources/messages.rbi +4 -1
  72. data/rbi/sentdm/resources/profiles/campaigns.rbi +3 -3
  73. data/rbi/sentdm/resources/profiles.rbi +29 -18
  74. data/sig/sentdm/client.rbs +2 -0
  75. data/sig/sentdm/models/api_response_of_contact_message_summary.rbs +39 -0
  76. data/sig/sentdm/models/api_response_of_conversation_messages_list.rbs +39 -0
  77. data/sig/sentdm/models/{sent_dm_services_common_contracts_poc_os_authentication_config.rbs → authentication_config.rbs} +2 -2
  78. data/sig/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_business_info.rbs → brand_business_info.rbs} +7 -7
  79. data/sig/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_compliance_info.rbs → brand_compliance_info.rbs} +2 -7
  80. data/sig/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_contact_info.rbs → brand_contact_info.rbs} +2 -2
  81. data/sig/sentdm/models/brands_brand_data.rbs +12 -12
  82. data/sig/sentdm/models/contact_message_summary.rbs +84 -0
  83. data/sig/sentdm/models/contact_retrieve_message_summary_params.rbs +30 -0
  84. data/sig/sentdm/models/conversation_list_messages_params.rbs +38 -0
  85. data/sig/sentdm/models/conversation_list_params.rbs +34 -0
  86. data/sig/sentdm/models/conversation_messages_list.rbs +240 -0
  87. data/sig/sentdm/models/profile_detail.rbs +0 -5
  88. data/sig/sentdm/models/profiles/{campaign_list_response.rbs → api_response_of_brand_campaign.rbs} +6 -6
  89. data/sig/sentdm/models/profiles/{api_response_of_tcr_campaign_with_use_cases.rbs → api_response_of_list_of_brand_campaign.rbs} +6 -6
  90. data/sig/sentdm/models/profiles/brand_campaign.rbs +194 -0
  91. data/sig/sentdm/models/profiles/campaign_data.rbs +12 -7
  92. data/sig/sentdm/models/profiles/campaign_use_case.rbs +66 -0
  93. data/sig/sentdm/models/profiles/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data.rbs → campaign_use_case_data.rbs} +2 -2
  94. data/sig/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_body.rbs → template_body.rbs} +2 -2
  95. data/sig/sentdm/models/template_button.rbs +28 -0
  96. data/sig/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_button_props.rbs → template_button_props.rbs} +2 -2
  97. data/sig/sentdm/models/template_definition.rbs +20 -20
  98. data/sig/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_footer.rbs → template_footer.rbs} +2 -2
  99. data/sig/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_header.rbs → template_header.rbs} +2 -2
  100. data/sig/sentdm/models.rbs +32 -18
  101. data/sig/sentdm/resources/contacts.rbs +6 -0
  102. data/sig/sentdm/resources/conversations.rbs +22 -0
  103. data/sig/sentdm/resources/profiles/campaigns.rbs +3 -3
  104. metadata +68 -44
  105. data/lib/sentdm/models/profiles/base_dto.rb +0 -32
  106. data/rbi/sentdm/models/profiles/base_dto.rbi +0 -53
  107. data/rbi/sentdm/models/profiles/tcr_campaign_with_use_cases.rbi +0 -425
  108. data/sig/sentdm/models/profiles/base_dto.rbs +0 -27
  109. data/sig/sentdm/models/profiles/tcr_campaign_with_use_cases.rbs +0 -306
  110. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button.rbs +0 -32
data/lib/sentdm/models.rb CHANGED
@@ -43,6 +43,10 @@ module Sentdm
43
43
 
44
44
  APIResponseOfContact = Sentdm::Models::APIResponseOfContact
45
45
 
46
+ APIResponseOfContactMessageSummary = Sentdm::Models::APIResponseOfContactMessageSummary
47
+
48
+ APIResponseOfConversationMessagesList = Sentdm::Models::APIResponseOfConversationMessagesList
49
+
46
50
  APIResponseOfProfileDetail = Sentdm::Models::APIResponseOfProfileDetail
47
51
 
48
52
  APIResponseOfUser = Sentdm::Models::APIResponseOfUser
@@ -51,8 +55,16 @@ module Sentdm
51
55
 
52
56
  APIResponseWebhook = Sentdm::Models::APIResponseWebhook
53
57
 
58
+ AuthenticationConfig = Sentdm::Models::AuthenticationConfig
59
+
54
60
  BillingContactInfo = Sentdm::Models::BillingContactInfo
55
61
 
62
+ BrandBusinessInfo = Sentdm::Models::BrandBusinessInfo
63
+
64
+ BrandComplianceInfo = Sentdm::Models::BrandComplianceInfo
65
+
66
+ BrandContactInfo = Sentdm::Models::BrandContactInfo
67
+
56
68
  BrandsBrandData = Sentdm::Models::BrandsBrandData
57
69
 
58
70
  ContactCreateParams = Sentdm::Models::ContactCreateParams
@@ -61,12 +73,22 @@ module Sentdm
61
73
 
62
74
  ContactListParams = Sentdm::Models::ContactListParams
63
75
 
76
+ ContactMessageSummary = Sentdm::Models::ContactMessageSummary
77
+
64
78
  ContactResponse = Sentdm::Models::ContactResponse
65
79
 
80
+ ContactRetrieveMessageSummaryParams = Sentdm::Models::ContactRetrieveMessageSummaryParams
81
+
66
82
  ContactRetrieveParams = Sentdm::Models::ContactRetrieveParams
67
83
 
68
84
  ContactUpdateParams = Sentdm::Models::ContactUpdateParams
69
85
 
86
+ ConversationListMessagesParams = Sentdm::Models::ConversationListMessagesParams
87
+
88
+ ConversationListParams = Sentdm::Models::ConversationListParams
89
+
90
+ ConversationMessagesList = Sentdm::Models::ConversationMessagesList
91
+
70
92
  DestinationCountry = Sentdm::Models::DestinationCountry
71
93
 
72
94
  ErrorDetail = Sentdm::Models::ErrorDetail
@@ -105,47 +127,30 @@ module Sentdm
105
127
 
106
128
  ProfileUpdateParams = Sentdm::Models::ProfileUpdateParams
107
129
 
108
- SentDmServicesCommonContractsPocOsAuthenticationConfig =
109
- Sentdm::Models::SentDmServicesCommonContractsPocOsAuthenticationConfig
110
-
111
- SentDmServicesCommonContractsPocOsTemplateBody =
112
- Sentdm::Models::SentDmServicesCommonContractsPocOsTemplateBody
113
-
114
- SentDmServicesCommonContractsPocOsTemplateButton =
115
- Sentdm::Models::SentDmServicesCommonContractsPocOsTemplateButton
116
-
117
- SentDmServicesCommonContractsPocOsTemplateButtonProps =
118
- Sentdm::Models::SentDmServicesCommonContractsPocOsTemplateButtonProps
119
-
120
- SentDmServicesCommonContractsPocOsTemplateFooter =
121
- Sentdm::Models::SentDmServicesCommonContractsPocOsTemplateFooter
122
-
123
- SentDmServicesCommonContractsPocOsTemplateHeader =
124
- Sentdm::Models::SentDmServicesCommonContractsPocOsTemplateHeader
125
-
126
- SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandBusinessInfo =
127
- Sentdm::Models::SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandBusinessInfo
128
-
129
- SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandComplianceInfo =
130
- Sentdm::Models::SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandComplianceInfo
131
-
132
- SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandContactInfo =
133
- Sentdm::Models::SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandContactInfo
134
-
135
130
  TcrBrandRelationship = Sentdm::Models::TcrBrandRelationship
136
131
 
137
132
  TcrVertical = Sentdm::Models::TcrVertical
138
133
 
139
134
  Template = Sentdm::Models::Template
140
135
 
136
+ TemplateBody = Sentdm::Models::TemplateBody
137
+
141
138
  TemplateBodyContent = Sentdm::Models::TemplateBodyContent
142
139
 
140
+ TemplateButton = Sentdm::Models::TemplateButton
141
+
142
+ TemplateButtonProps = Sentdm::Models::TemplateButtonProps
143
+
143
144
  TemplateCreateParams = Sentdm::Models::TemplateCreateParams
144
145
 
145
146
  TemplateDefinition = Sentdm::Models::TemplateDefinition
146
147
 
147
148
  TemplateDeleteParams = Sentdm::Models::TemplateDeleteParams
148
149
 
150
+ TemplateFooter = Sentdm::Models::TemplateFooter
151
+
152
+ TemplateHeader = Sentdm::Models::TemplateHeader
153
+
149
154
  TemplateListParams = Sentdm::Models::TemplateListParams
150
155
 
151
156
  TemplateRetrieveParams = Sentdm::Models::TemplateRetrieveParams
@@ -176,6 +176,36 @@ module Sentdm
176
176
  )
177
177
  end
178
178
 
179
+ # Some parameter documentations has been truncated, see
180
+ # {Sentdm::Models::ContactRetrieveMessageSummaryParams} for more details.
181
+ #
182
+ # Returns aggregate message counts, time bounds, channels used, and per-channel
183
+ # success/fail scores (each as a percentage 0-100 of messages on that channel) for
184
+ # one of your contacts. Successful terminal states: SENT/DELIVERED/READ for
185
+ # outbound, RECEIVED for inbound. Fail: FAILED.
186
+ #
187
+ # @overload retrieve_message_summary(contact_id, x_profile_id: nil, request_options: {})
188
+ #
189
+ # @param contact_id [String]
190
+ #
191
+ # @param x_profile_id [String] Profile UUID to scope the request to a child profile. Only organization API keys
192
+ #
193
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
194
+ #
195
+ # @return [Sentdm::Models::APIResponseOfContactMessageSummary]
196
+ #
197
+ # @see Sentdm::Models::ContactRetrieveMessageSummaryParams
198
+ def retrieve_message_summary(contact_id, params = {})
199
+ parsed, options = Sentdm::ContactRetrieveMessageSummaryParams.dump_request(params)
200
+ @client.request(
201
+ method: :get,
202
+ path: ["v3/contacts/%1$s/message-summary", contact_id],
203
+ headers: parsed.transform_keys(x_profile_id: "x-profile-id"),
204
+ model: Sentdm::APIResponseOfContactMessageSummary,
205
+ options: options
206
+ )
207
+ end
208
+
179
209
  # @api private
180
210
  #
181
211
  # @param client [Sentdm::Client]
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Resources
5
+ class Conversations
6
+ # Some parameter documentations has been truncated, see
7
+ # {Sentdm::Models::ConversationListParams} for more details.
8
+ #
9
+ # Retrieves a paginated list of the authenticated customer's messages across all
10
+ # conversations, ordered by created date (most recent first).
11
+ #
12
+ # @overload list(page:, page_size:, x_profile_id: nil, request_options: {})
13
+ #
14
+ # @param page [Integer] Query param
15
+ #
16
+ # @param page_size [Integer] Query param
17
+ #
18
+ # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
19
+ #
20
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
21
+ #
22
+ # @return [Sentdm::Models::APIResponseOfConversationMessagesList]
23
+ #
24
+ # @see Sentdm::Models::ConversationListParams
25
+ def list(params)
26
+ query_params = [:page, :page_size]
27
+ parsed, options = Sentdm::ConversationListParams.dump_request(params)
28
+ query = Sentdm::Internal::Util.encode_query_params(parsed.slice(*query_params))
29
+ @client.request(
30
+ method: :get,
31
+ path: "v3/conversations",
32
+ query: query,
33
+ headers: parsed.except(*query_params).transform_keys(x_profile_id: "x-profile-id"),
34
+ model: Sentdm::APIResponseOfConversationMessagesList,
35
+ options: options
36
+ )
37
+ end
38
+
39
+ # Some parameter documentations has been truncated, see
40
+ # {Sentdm::Models::ConversationListMessagesParams} for more details.
41
+ #
42
+ # Retrieves a paginated list of the messages in a single conversation (scoped to
43
+ # the authenticated customer), ordered by created date (most recent first).
44
+ #
45
+ # @overload list_messages(id, page:, page_size:, x_profile_id: nil, request_options: {})
46
+ #
47
+ # @param id [String] Path param: Conversation id from the route.
48
+ #
49
+ # @param page [Integer] Query param
50
+ #
51
+ # @param page_size [Integer] Query param
52
+ #
53
+ # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
54
+ #
55
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
56
+ #
57
+ # @return [Sentdm::Models::APIResponseOfConversationMessagesList]
58
+ #
59
+ # @see Sentdm::Models::ConversationListMessagesParams
60
+ def list_messages(id, params)
61
+ query_params = [:page, :page_size]
62
+ parsed, options = Sentdm::ConversationListMessagesParams.dump_request(params)
63
+ query = Sentdm::Internal::Util.encode_query_params(parsed.slice(*query_params))
64
+ @client.request(
65
+ method: :get,
66
+ path: ["v3/conversations/%1$s", id],
67
+ query: query,
68
+ headers: parsed.except(*query_params).transform_keys(x_profile_id: "x-profile-id"),
69
+ model: Sentdm::APIResponseOfConversationMessagesList,
70
+ options: options
71
+ )
72
+ end
73
+
74
+ # @api private
75
+ #
76
+ # @param client [Sentdm::Client]
77
+ def initialize(client:)
78
+ @client = client
79
+ end
80
+ end
81
+ end
82
+ end
@@ -67,7 +67,10 @@ module Sentdm
67
67
  # multi-channel broadcast — when multiple channels are specified (e.g. ["sms",
68
68
  # "whatsapp"]), a separate message is created for each (recipient, channel) pair.
69
69
  # Returns immediately with per-recipient message IDs for async tracking via
70
- # webhooks or the GET /messages/{id} endpoint.
70
+ # webhooks or the GET /messages/{id} endpoint. Account-level preconditions such as
71
+ # insufficient balance do not reject the request: the send is accepted with 202
72
+ # and the affected messages are reported as BLOCKED on GET /messages/{id} and the
73
+ # message status webhook.
71
74
  #
72
75
  # @overload send_(channel: nil, sandbox: nil, template: nil, text: nil, to: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
73
76
  #
@@ -25,7 +25,7 @@ module Sentdm
25
25
  #
26
26
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
27
27
  #
28
- # @return [Sentdm::Models::Profiles::APIResponseOfTcrCampaignWithUseCases]
28
+ # @return [Sentdm::Models::Profiles::APIResponseOfBrandCampaign]
29
29
  #
30
30
  # @see Sentdm::Models::Profiles::CampaignCreateParams
31
31
  def create(profile_id, params)
@@ -36,7 +36,7 @@ module Sentdm
36
36
  path: ["v3/profiles/%1$s/campaigns", profile_id],
37
37
  headers: parsed.slice(*header_params.keys).transform_keys(header_params),
38
38
  body: parsed.except(*header_params.keys),
39
- model: Sentdm::Profiles::APIResponseOfTcrCampaignWithUseCases,
39
+ model: Sentdm::Profiles::APIResponseOfBrandCampaign,
40
40
  options: options
41
41
  )
42
42
  end
@@ -63,7 +63,7 @@ module Sentdm
63
63
  #
64
64
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
65
65
  #
66
- # @return [Sentdm::Models::Profiles::APIResponseOfTcrCampaignWithUseCases]
66
+ # @return [Sentdm::Models::Profiles::APIResponseOfBrandCampaign]
67
67
  #
68
68
  # @see Sentdm::Models::Profiles::CampaignUpdateParams
69
69
  def update(campaign_id, params)
@@ -78,7 +78,7 @@ module Sentdm
78
78
  path: ["v3/profiles/%1$s/campaigns/%2$s", profile_id, campaign_id],
79
79
  headers: parsed.slice(*header_params.keys).transform_keys(header_params),
80
80
  body: parsed.except(*header_params.keys),
81
- model: Sentdm::Profiles::APIResponseOfTcrCampaignWithUseCases,
81
+ model: Sentdm::Profiles::APIResponseOfBrandCampaign,
82
82
  options: options
83
83
  )
84
84
  end
@@ -97,7 +97,7 @@ module Sentdm
97
97
  #
98
98
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
99
99
  #
100
- # @return [Sentdm::Models::Profiles::CampaignListResponse]
100
+ # @return [Sentdm::Models::Profiles::APIResponseOfListOfBrandCampaign]
101
101
  #
102
102
  # @see Sentdm::Models::Profiles::CampaignListParams
103
103
  def list(profile_id, params = {})
@@ -106,7 +106,7 @@ module Sentdm
106
106
  method: :get,
107
107
  path: ["v3/profiles/%1$s/campaigns", profile_id],
108
108
  headers: parsed.transform_keys(x_profile_id: "x-profile-id"),
109
- model: Sentdm::Models::Profiles::CampaignListResponse,
109
+ model: Sentdm::Profiles::APIResponseOfListOfBrandCampaign,
110
110
  options: options
111
111
  )
112
112
  end
@@ -191,7 +191,7 @@ module Sentdm
191
191
  #
192
192
  # @param sending_phone_number [String, nil] Body param: Direct phone number for SMS sending (optional)
193
193
  #
194
- # @param sending_phone_number_profile_id [String, nil] Body param: Reference to another profile to use for SMS/Telnyx configuration (op
194
+ # @param sending_phone_number_profile_id [String, nil] Body param: Reference to another profile to use for SMS configuration (optional)
195
195
  #
196
196
  # @param sending_whatsapp_number_profile_id [String, nil] Body param: Reference to another profile to use for WhatsApp configuration (opti
197
197
  #
@@ -284,24 +284,36 @@ module Sentdm
284
284
  # Some parameter documentations has been truncated, see
285
285
  # {Sentdm::Models::ProfileCompleteParams} for more details.
286
286
  #
287
- # Final step in profile compliance workflow. Validates all prerequisites (general
288
- # data, brand, campaigns), connects profile to Telnyx/WhatsApp, and sets status
289
- # based on configuration. The process runs in the background and calls the
290
- # provided webhook URL when finished.
291
- #
292
- # Prerequisites:
293
- # - Profile must be completed
294
- # - If inheritTcrBrand=false: Profile must have existing brand
295
- # - If inheritTcrBrand=true: Parent must have existing brand
296
- # - If TCR application: Must have at least one campaign (own or inherited)
297
- # - If inheritTcrCampaign=false: Profile should have campaigns
298
- # - If inheritTcrCampaign=true: Parent must have campaigns
299
- #
300
- # Status Logic:
301
- # - If both SMS and WhatsApp channels are missing SUBMITTED
302
- # - If TCR application and not inheriting brand/campaigns → SUBMITTED
303
- # - If non-TCR with destination country (IsMain=true) SUBMITTED
304
- # - Otherwise COMPLETED
287
+ # Final step in the profile compliance workflow. Validates all prerequisites (KYC,
288
+ # brand, campaigns, required documents), connects the profile to the SMS and
289
+ # WhatsApp channels, and sets its status based on configuration. Prerequisites are
290
+ # always validated first: if any fail the call returns 400. If they pass and the
291
+ # profile is already completed, the call returns 200 and does nothing. Otherwise
292
+ # it returns 202 and calls the provided webhook URL when background processing
293
+ # finishes.
294
+ #
295
+ # Prerequisites:
296
+ #
297
+ # - Profile must have a name, short name, and description (short name max 50
298
+ # characters, description max 5000)
299
+ # - webHookUrl must be supplied on the request
300
+ # - A KYC form submission is required
301
+ # - A brand is required, either on the profile or inherited from the parent
302
+ # organization
303
+ # - TCR applications must have at least one campaign, own or inherited
304
+ # - Destination countries marked as main must have their required compliance
305
+ # documents uploaded
306
+ #
307
+ # Resulting status:
308
+ #
309
+ # - If either the SMS or WhatsApp channel is unconfigured, the profile is
310
+ # SUBMITTED
311
+ # - For a TCR application that inherits both its brand and its campaigns, the
312
+ # profile is COMPLETED
313
+ # - For a TCR application that owns either its brand or its campaigns, the profile
314
+ # is COMPLETED once both have been submitted to TCR, and SUBMITTED until then
315
+ # - For a non-TCR application, the profile is SUBMITTED when a main destination
316
+ # country is set, and COMPLETED otherwise
305
317
  #
306
318
  # @overload complete(profile_id, web_hook_url:, sandbox: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
307
319
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sentdm
4
- VERSION = "0.24.0"
4
+ VERSION = "0.26.0"
5
5
  end
data/lib/sentdm.rb CHANGED
@@ -53,22 +53,32 @@ require_relative "sentdm/internal/transport/base_client"
53
53
  require_relative "sentdm/internal/transport/pooled_net_requester"
54
54
  require_relative "sentdm/client"
55
55
  require_relative "sentdm/models/mutation_request"
56
- require_relative "sentdm/models/profiles/base_dto"
57
56
  require_relative "sentdm/models/api_meta"
58
57
  require_relative "sentdm/models/api_response_of_contact"
58
+ require_relative "sentdm/models/api_response_of_contact_message_summary"
59
+ require_relative "sentdm/models/api_response_of_conversation_messages_list"
59
60
  require_relative "sentdm/models/api_response_of_profile_detail"
60
61
  require_relative "sentdm/models/api_response_of_user"
61
62
  require_relative "sentdm/models/api_response_template"
62
63
  require_relative "sentdm/models/api_response_webhook"
64
+ require_relative "sentdm/models/authentication_config"
63
65
  require_relative "sentdm/models/billing_contact_info"
66
+ require_relative "sentdm/models/brand_business_info"
67
+ require_relative "sentdm/models/brand_compliance_info"
68
+ require_relative "sentdm/models/brand_contact_info"
64
69
  require_relative "sentdm/models/brands_brand_data"
65
70
  require_relative "sentdm/models/contact_create_params"
66
71
  require_relative "sentdm/models/contact_delete_params"
67
72
  require_relative "sentdm/models/contact_list_params"
68
73
  require_relative "sentdm/models/contact_list_response"
74
+ require_relative "sentdm/models/contact_message_summary"
69
75
  require_relative "sentdm/models/contact_response"
76
+ require_relative "sentdm/models/contact_retrieve_message_summary_params"
70
77
  require_relative "sentdm/models/contact_retrieve_params"
71
78
  require_relative "sentdm/models/contact_update_params"
79
+ require_relative "sentdm/models/conversation_list_messages_params"
80
+ require_relative "sentdm/models/conversation_list_params"
81
+ require_relative "sentdm/models/conversation_messages_list"
72
82
  require_relative "sentdm/models/destination_country"
73
83
  require_relative "sentdm/models/error_detail"
74
84
  require_relative "sentdm/models/me_retrieve_params"
@@ -91,34 +101,31 @@ require_relative "sentdm/models/profile_detail"
91
101
  require_relative "sentdm/models/profile_list_params"
92
102
  require_relative "sentdm/models/profile_list_response"
93
103
  require_relative "sentdm/models/profile_retrieve_params"
94
- require_relative "sentdm/models/profiles/api_response_of_tcr_campaign_with_use_cases"
104
+ require_relative "sentdm/models/profiles/api_response_of_brand_campaign"
105
+ require_relative "sentdm/models/profiles/api_response_of_list_of_brand_campaign"
106
+ require_relative "sentdm/models/profiles/brand_campaign"
95
107
  require_relative "sentdm/models/profiles/campaign_create_params"
96
108
  require_relative "sentdm/models/profiles/campaign_data"
97
109
  require_relative "sentdm/models/profiles/campaign_delete_params"
98
110
  require_relative "sentdm/models/profiles/campaign_list_params"
99
- require_relative "sentdm/models/profiles/campaign_list_response"
100
111
  require_relative "sentdm/models/profiles/campaign_update_params"
112
+ require_relative "sentdm/models/profiles/campaign_use_case"
113
+ require_relative "sentdm/models/profiles/campaign_use_case_data"
101
114
  require_relative "sentdm/models/profiles/messaging_use_case_us"
102
- require_relative "sentdm/models/profiles/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data"
103
- require_relative "sentdm/models/profiles/tcr_campaign_with_use_cases"
104
115
  require_relative "sentdm/models/profile_settings"
105
116
  require_relative "sentdm/models/profile_update_params"
106
- require_relative "sentdm/models/sent_dm_services_common_contracts_poc_os_authentication_config"
107
- require_relative "sentdm/models/sent_dm_services_common_contracts_poc_os_template_body"
108
- require_relative "sentdm/models/sent_dm_services_common_contracts_poc_os_template_button"
109
- require_relative "sentdm/models/sent_dm_services_common_contracts_poc_os_template_button_props"
110
- require_relative "sentdm/models/sent_dm_services_common_contracts_poc_os_template_footer"
111
- require_relative "sentdm/models/sent_dm_services_common_contracts_poc_os_template_header"
112
- require_relative "sentdm/models/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_business_info"
113
- require_relative "sentdm/models/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_compliance_info"
114
- require_relative "sentdm/models/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_contact_info"
115
117
  require_relative "sentdm/models/tcr_brand_relationship"
116
118
  require_relative "sentdm/models/tcr_vertical"
117
119
  require_relative "sentdm/models/template"
120
+ require_relative "sentdm/models/template_body"
118
121
  require_relative "sentdm/models/template_body_content"
122
+ require_relative "sentdm/models/template_button"
123
+ require_relative "sentdm/models/template_button_props"
119
124
  require_relative "sentdm/models/template_create_params"
120
125
  require_relative "sentdm/models/template_definition"
121
126
  require_relative "sentdm/models/template_delete_params"
127
+ require_relative "sentdm/models/template_footer"
128
+ require_relative "sentdm/models/template_header"
122
129
  require_relative "sentdm/models/template_list_params"
123
130
  require_relative "sentdm/models/template_list_response"
124
131
  require_relative "sentdm/models/template_retrieve_params"
@@ -150,6 +157,7 @@ require_relative "sentdm/models/webhook_toggle_status_params"
150
157
  require_relative "sentdm/models/webhook_update_params"
151
158
  require_relative "sentdm/models"
152
159
  require_relative "sentdm/resources/contacts"
160
+ require_relative "sentdm/resources/conversations"
153
161
  require_relative "sentdm/resources/me"
154
162
  require_relative "sentdm/resources/messages"
155
163
  require_relative "sentdm/resources/numbers"
@@ -43,6 +43,9 @@ module Sentdm
43
43
  sig { returns(Sentdm::Resources::Contacts) }
44
44
  attr_reader :contacts
45
45
 
46
+ sig { returns(Sentdm::Resources::Conversations) }
47
+ attr_reader :conversations
48
+
46
49
  # Retrieve account details
47
50
  sig { returns(Sentdm::Resources::Me) }
48
51
  attr_reader :me
@@ -0,0 +1,79 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class APIResponseOfContactMessageSummary < Sentdm::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Sentdm::APIResponseOfContactMessageSummary,
10
+ Sentdm::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The response data (null if error)
15
+ sig { returns(T.nilable(Sentdm::ContactMessageSummary)) }
16
+ attr_reader :data
17
+
18
+ sig do
19
+ params(data: T.nilable(Sentdm::ContactMessageSummary::OrHash)).void
20
+ end
21
+ attr_writer :data
22
+
23
+ # Error information
24
+ sig { returns(T.nilable(Sentdm::ErrorDetail)) }
25
+ attr_reader :error
26
+
27
+ sig { params(error: T.nilable(Sentdm::ErrorDetail::OrHash)).void }
28
+ attr_writer :error
29
+
30
+ # Request and response metadata
31
+ sig { returns(T.nilable(Sentdm::APIMeta)) }
32
+ attr_reader :meta
33
+
34
+ sig { params(meta: Sentdm::APIMeta::OrHash).void }
35
+ attr_writer :meta
36
+
37
+ # Indicates whether the request was successful
38
+ sig { returns(T.nilable(T::Boolean)) }
39
+ attr_reader :success
40
+
41
+ sig { params(success: T::Boolean).void }
42
+ attr_writer :success
43
+
44
+ # Standard API response envelope for all v3 endpoints
45
+ sig do
46
+ params(
47
+ data: T.nilable(Sentdm::ContactMessageSummary::OrHash),
48
+ error: T.nilable(Sentdm::ErrorDetail::OrHash),
49
+ meta: Sentdm::APIMeta::OrHash,
50
+ success: T::Boolean
51
+ ).returns(T.attached_class)
52
+ end
53
+ def self.new(
54
+ # The response data (null if error)
55
+ data: nil,
56
+ # Error information
57
+ error: nil,
58
+ # Request and response metadata
59
+ meta: nil,
60
+ # Indicates whether the request was successful
61
+ success: nil
62
+ )
63
+ end
64
+
65
+ sig do
66
+ override.returns(
67
+ {
68
+ data: T.nilable(Sentdm::ContactMessageSummary),
69
+ error: T.nilable(Sentdm::ErrorDetail),
70
+ meta: Sentdm::APIMeta,
71
+ success: T::Boolean
72
+ }
73
+ )
74
+ end
75
+ def to_hash
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,79 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class APIResponseOfConversationMessagesList < Sentdm::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Sentdm::APIResponseOfConversationMessagesList,
10
+ Sentdm::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # A paginated list of messages — used by both conversation read endpoints.
15
+ sig { returns(T.nilable(Sentdm::ConversationMessagesList)) }
16
+ attr_reader :data
17
+
18
+ sig do
19
+ params(data: T.nilable(Sentdm::ConversationMessagesList::OrHash)).void
20
+ end
21
+ attr_writer :data
22
+
23
+ # Error information
24
+ sig { returns(T.nilable(Sentdm::ErrorDetail)) }
25
+ attr_reader :error
26
+
27
+ sig { params(error: T.nilable(Sentdm::ErrorDetail::OrHash)).void }
28
+ attr_writer :error
29
+
30
+ # Request and response metadata
31
+ sig { returns(T.nilable(Sentdm::APIMeta)) }
32
+ attr_reader :meta
33
+
34
+ sig { params(meta: Sentdm::APIMeta::OrHash).void }
35
+ attr_writer :meta
36
+
37
+ # Indicates whether the request was successful
38
+ sig { returns(T.nilable(T::Boolean)) }
39
+ attr_reader :success
40
+
41
+ sig { params(success: T::Boolean).void }
42
+ attr_writer :success
43
+
44
+ # Standard API response envelope for all v3 endpoints
45
+ sig do
46
+ params(
47
+ data: T.nilable(Sentdm::ConversationMessagesList::OrHash),
48
+ error: T.nilable(Sentdm::ErrorDetail::OrHash),
49
+ meta: Sentdm::APIMeta::OrHash,
50
+ success: T::Boolean
51
+ ).returns(T.attached_class)
52
+ end
53
+ def self.new(
54
+ # A paginated list of messages — used by both conversation read endpoints.
55
+ data: nil,
56
+ # Error information
57
+ error: nil,
58
+ # Request and response metadata
59
+ meta: nil,
60
+ # Indicates whether the request was successful
61
+ success: nil
62
+ )
63
+ end
64
+
65
+ sig do
66
+ override.returns(
67
+ {
68
+ data: T.nilable(Sentdm::ConversationMessagesList),
69
+ error: T.nilable(Sentdm::ErrorDetail),
70
+ meta: Sentdm::APIMeta,
71
+ success: T::Boolean
72
+ }
73
+ )
74
+ end
75
+ def to_hash
76
+ end
77
+ end
78
+ end
79
+ end
@@ -2,13 +2,10 @@
2
2
 
3
3
  module Sentdm
4
4
  module Models
5
- class SentDmServicesCommonContractsPocOsAuthenticationConfig < Sentdm::Internal::Type::BaseModel
5
+ class AuthenticationConfig < Sentdm::Internal::Type::BaseModel
6
6
  OrHash =
7
7
  T.type_alias do
8
- T.any(
9
- Sentdm::SentDmServicesCommonContractsPocOsAuthenticationConfig,
10
- Sentdm::Internal::AnyHash
11
- )
8
+ T.any(Sentdm::AuthenticationConfig, Sentdm::Internal::AnyHash)
12
9
  end
13
10
 
14
11
  # Whether to add the security recommendation text: "For your security, do not