sentdm 0.25.0 → 0.27.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 (133) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -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/inbound_message_event.rb +52 -0
  18. data/lib/sentdm/models/inbound_message_event_payload.rb +81 -0
  19. data/lib/sentdm/models/message_event.rb +53 -0
  20. data/lib/sentdm/models/message_event_payload.rb +92 -0
  21. data/lib/sentdm/models/message_send_response.rb +2 -6
  22. data/lib/sentdm/models/profile_detail.rb +13 -13
  23. data/lib/sentdm/models/profile_update_params.rb +2 -2
  24. data/lib/sentdm/models/profiles/{api_response_of_tcr_campaign_with_use_cases.rb → api_response_of_brand_campaign.rb} +5 -5
  25. data/lib/sentdm/models/profiles/{campaign_list_response.rb → api_response_of_list_of_brand_campaign.rb} +4 -6
  26. data/lib/sentdm/models/profiles/{tcr_campaign_with_use_cases.rb → brand_campaign.rb} +63 -111
  27. data/lib/sentdm/models/profiles/campaign_data.rb +13 -6
  28. data/lib/sentdm/models/profiles/campaign_use_case.rb +71 -0
  29. 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
  30. data/lib/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_body.rb → template_body.rb} +2 -3
  31. data/lib/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_button.rb → template_button.rb} +5 -6
  32. data/lib/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_button_props.rb → template_button_props.rb} +2 -3
  33. data/lib/sentdm/models/template_definition.rb +15 -19
  34. data/lib/sentdm/models/template_event.rb +52 -0
  35. data/lib/sentdm/models/template_event_payload.rb +88 -0
  36. data/lib/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_footer.rb → template_footer.rb} +1 -1
  37. data/lib/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_header.rb → template_header.rb} +2 -3
  38. data/lib/sentdm/models/webhook_list_events_response.rb +45 -3
  39. data/lib/sentdm/models.rb +44 -27
  40. data/lib/sentdm/resources/contacts.rb +30 -0
  41. data/lib/sentdm/resources/conversations.rb +82 -0
  42. data/lib/sentdm/resources/messages.rb +6 -1
  43. data/lib/sentdm/resources/profiles/campaigns.rb +6 -6
  44. data/lib/sentdm/resources/profiles.rb +34 -22
  45. data/lib/sentdm/resources/users.rb +3 -3
  46. data/lib/sentdm/version.rb +1 -1
  47. data/lib/sentdm.rb +28 -14
  48. data/rbi/sentdm/client.rbi +3 -0
  49. data/rbi/sentdm/models/api_response_of_contact_message_summary.rbi +79 -0
  50. data/rbi/sentdm/models/api_response_of_conversation_messages_list.rbi +79 -0
  51. data/rbi/sentdm/models/{sent_dm_services_common_contracts_poc_os_authentication_config.rbi → authentication_config.rbi} +2 -5
  52. data/rbi/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_business_info.rbi → brand_business_info.rbi} +12 -30
  53. data/rbi/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_compliance_info.rbi → brand_compliance_info.rbi} +2 -13
  54. data/rbi/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_contact_info.rbi → brand_contact_info.rbi} +2 -5
  55. data/rbi/sentdm/models/brands_brand_data.rbi +12 -51
  56. data/rbi/sentdm/models/contact_message_summary.rbi +144 -0
  57. data/rbi/sentdm/models/contact_retrieve_message_summary_params.rbi +49 -0
  58. data/rbi/sentdm/models/conversation_list_messages_params.rbi +65 -0
  59. data/rbi/sentdm/models/conversation_list_params.rbi +51 -0
  60. data/rbi/sentdm/models/conversation_messages_list.rbi +419 -0
  61. data/rbi/sentdm/models/inbound_message_event.rbi +88 -0
  62. data/rbi/sentdm/models/inbound_message_event_payload.rbi +122 -0
  63. data/rbi/sentdm/models/message_event.rbi +86 -0
  64. data/rbi/sentdm/models/message_event_payload.rbi +132 -0
  65. data/rbi/sentdm/models/message_send_response.rbi +2 -4
  66. data/rbi/sentdm/models/profile_detail.rbi +10 -12
  67. data/rbi/sentdm/models/profile_update_params.rbi +2 -2
  68. data/rbi/sentdm/models/profiles/{api_response_of_tcr_campaign_with_use_cases.rbi → api_response_of_brand_campaign.rbi} +8 -10
  69. data/rbi/sentdm/models/profiles/{campaign_list_response.rbi → api_response_of_list_of_brand_campaign.rbi} +5 -13
  70. data/rbi/sentdm/models/profiles/brand_campaign.rbi +299 -0
  71. data/rbi/sentdm/models/profiles/campaign_data.rbi +16 -18
  72. data/rbi/sentdm/models/profiles/campaign_use_case.rbi +110 -0
  73. 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
  74. data/rbi/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_body.rbi → template_body.rbi} +2 -7
  75. data/rbi/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_button.rbi → template_button.rbi} +6 -22
  76. data/rbi/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_button_props.rbi → template_button_props.rbi} +2 -5
  77. data/rbi/sentdm/models/template_definition.rbi +19 -87
  78. data/rbi/sentdm/models/template_event.rbi +84 -0
  79. data/rbi/sentdm/models/template_event_payload.rbi +131 -0
  80. data/rbi/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_footer.rbi → template_footer.rbi} +2 -5
  81. data/rbi/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_header.rbi → template_header.rbi} +2 -5
  82. data/rbi/sentdm/models/webhook_list_events_response.rbi +60 -4
  83. data/rbi/sentdm/models.rbi +48 -27
  84. data/rbi/sentdm/resources/contacts.rbi +20 -0
  85. data/rbi/sentdm/resources/conversations.rbi +61 -0
  86. data/rbi/sentdm/resources/messages.rbi +6 -1
  87. data/rbi/sentdm/resources/profiles/campaigns.rbi +3 -3
  88. data/rbi/sentdm/resources/profiles.rbi +32 -20
  89. data/rbi/sentdm/resources/users.rbi +3 -2
  90. data/sig/sentdm/client.rbs +2 -0
  91. data/sig/sentdm/models/api_response_of_contact_message_summary.rbs +39 -0
  92. data/sig/sentdm/models/api_response_of_conversation_messages_list.rbs +39 -0
  93. data/sig/sentdm/models/{sent_dm_services_common_contracts_poc_os_authentication_config.rbs → authentication_config.rbs} +2 -2
  94. data/sig/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_business_info.rbs → brand_business_info.rbs} +7 -7
  95. data/sig/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_compliance_info.rbs → brand_compliance_info.rbs} +2 -7
  96. data/sig/sentdm/models/{sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_contact_info.rbs → brand_contact_info.rbs} +2 -2
  97. data/sig/sentdm/models/brands_brand_data.rbs +12 -12
  98. data/sig/sentdm/models/contact_message_summary.rbs +84 -0
  99. data/sig/sentdm/models/contact_retrieve_message_summary_params.rbs +30 -0
  100. data/sig/sentdm/models/conversation_list_messages_params.rbs +38 -0
  101. data/sig/sentdm/models/conversation_list_params.rbs +34 -0
  102. data/sig/sentdm/models/conversation_messages_list.rbs +240 -0
  103. data/sig/sentdm/models/inbound_message_event.rbs +39 -0
  104. data/sig/sentdm/models/inbound_message_event_payload.rbs +69 -0
  105. data/sig/sentdm/models/message_event.rbs +39 -0
  106. data/sig/sentdm/models/message_event_payload.rbs +72 -0
  107. data/sig/sentdm/models/profile_detail.rbs +0 -5
  108. data/sig/sentdm/models/profiles/{campaign_list_response.rbs → api_response_of_brand_campaign.rbs} +6 -6
  109. data/sig/sentdm/models/profiles/{api_response_of_tcr_campaign_with_use_cases.rbs → api_response_of_list_of_brand_campaign.rbs} +6 -6
  110. data/sig/sentdm/models/profiles/brand_campaign.rbs +194 -0
  111. data/sig/sentdm/models/profiles/campaign_data.rbs +12 -7
  112. data/sig/sentdm/models/profiles/campaign_use_case.rbs +66 -0
  113. 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
  114. data/sig/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_body.rbs → template_body.rbs} +2 -2
  115. data/sig/sentdm/models/template_button.rbs +28 -0
  116. data/sig/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_button_props.rbs → template_button_props.rbs} +2 -2
  117. data/sig/sentdm/models/template_definition.rbs +20 -20
  118. data/sig/sentdm/models/template_event.rbs +39 -0
  119. data/sig/sentdm/models/template_event_payload.rbs +76 -0
  120. data/sig/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_footer.rbs → template_footer.rbs} +2 -2
  121. data/sig/sentdm/models/{sent_dm_services_common_contracts_poc_os_template_header.rbs → template_header.rbs} +2 -2
  122. data/sig/sentdm/models/webhook_list_events_response.rbs +18 -5
  123. data/sig/sentdm/models.rbs +44 -18
  124. data/sig/sentdm/resources/contacts.rbs +6 -0
  125. data/sig/sentdm/resources/conversations.rbs +22 -0
  126. data/sig/sentdm/resources/profiles/campaigns.rbs +3 -3
  127. metadata +86 -44
  128. data/lib/sentdm/models/profiles/base_dto.rb +0 -32
  129. data/rbi/sentdm/models/profiles/base_dto.rbi +0 -53
  130. data/rbi/sentdm/models/profiles/tcr_campaign_with_use_cases.rbi +0 -425
  131. data/sig/sentdm/models/profiles/base_dto.rbs +0 -27
  132. data/sig/sentdm/models/profiles/tcr_campaign_with_use_cases.rbs +0 -306
  133. data/sig/sentdm/models/sent_dm_services_common_contracts_poc_os_template_button.rbs +0 -32
@@ -22,13 +22,7 @@ module Sentdm
22
22
  attr_accessor :type
23
23
 
24
24
  # List of use cases with sample messages
25
- sig do
26
- returns(
27
- T::Array[
28
- Sentdm::Profiles::SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData
29
- ]
30
- )
31
- end
25
+ sig { returns(T::Array[Sentdm::Profiles::CampaignUseCaseData]) }
32
26
  attr_accessor :use_cases
33
27
 
34
28
  # Comma-separated keywords that trigger help message (e.g., "HELP, INFO, SUPPORT")
@@ -67,16 +61,18 @@ module Sentdm
67
61
  sig { returns(T.nilable(String)) }
68
62
  attr_accessor :terms_and_conditions_link
69
63
 
64
+ # Expected messaging volume for this campaign. Numeric string (e.g. "1999",
65
+ # "5000"). Values below 2000 bill at the low-volume tier.
66
+ sig { returns(T.nilable(String)) }
67
+ attr_accessor :volume
68
+
70
69
  # Campaign data for create or update operation
71
70
  sig do
72
71
  params(
73
72
  description: String,
74
73
  name: String,
75
74
  type: String,
76
- use_cases:
77
- T::Array[
78
- Sentdm::Profiles::SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData::OrHash
79
- ],
75
+ use_cases: T::Array[Sentdm::Profiles::CampaignUseCaseData::OrHash],
80
76
  help_keywords: T.nilable(String),
81
77
  help_message: T.nilable(String),
82
78
  message_flow: T.nilable(String),
@@ -85,7 +81,8 @@ module Sentdm
85
81
  optout_keywords: T.nilable(String),
86
82
  optout_message: T.nilable(String),
87
83
  privacy_policy_link: T.nilable(String),
88
- terms_and_conditions_link: T.nilable(String)
84
+ terms_and_conditions_link: T.nilable(String),
85
+ volume: T.nilable(String)
89
86
  ).returns(T.attached_class)
90
87
  end
91
88
  def self.new(
@@ -114,7 +111,10 @@ module Sentdm
114
111
  # URL to privacy policy
115
112
  privacy_policy_link: nil,
116
113
  # URL to terms and conditions
117
- terms_and_conditions_link: nil
114
+ terms_and_conditions_link: nil,
115
+ # Expected messaging volume for this campaign. Numeric string (e.g. "1999",
116
+ # "5000"). Values below 2000 bill at the low-volume tier.
117
+ volume: nil
118
118
  )
119
119
  end
120
120
 
@@ -124,10 +124,7 @@ module Sentdm
124
124
  description: String,
125
125
  name: String,
126
126
  type: String,
127
- use_cases:
128
- T::Array[
129
- Sentdm::Profiles::SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData
130
- ],
127
+ use_cases: T::Array[Sentdm::Profiles::CampaignUseCaseData],
131
128
  help_keywords: T.nilable(String),
132
129
  help_message: T.nilable(String),
133
130
  message_flow: T.nilable(String),
@@ -136,7 +133,8 @@ module Sentdm
136
133
  optout_keywords: T.nilable(String),
137
134
  optout_message: T.nilable(String),
138
135
  privacy_policy_link: T.nilable(String),
139
- terms_and_conditions_link: T.nilable(String)
136
+ terms_and_conditions_link: T.nilable(String),
137
+ volume: T.nilable(String)
140
138
  }
141
139
  )
142
140
  end
@@ -0,0 +1,110 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ module Profiles
6
+ class CampaignUseCase < Sentdm::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(Sentdm::Profiles::CampaignUseCase, Sentdm::Internal::AnyHash)
10
+ end
11
+
12
+ sig { returns(T.nilable(String)) }
13
+ attr_reader :id
14
+
15
+ sig { params(id: String).void }
16
+ attr_writer :id
17
+
18
+ sig { returns(T.nilable(String)) }
19
+ attr_reader :campaign_id
20
+
21
+ sig { params(campaign_id: String).void }
22
+ attr_writer :campaign_id
23
+
24
+ sig { returns(T.nilable(Time)) }
25
+ attr_reader :created_at
26
+
27
+ sig { params(created_at: Time).void }
28
+ attr_writer :created_at
29
+
30
+ sig { returns(T.nilable(String)) }
31
+ attr_reader :customer_id
32
+
33
+ sig { params(customer_id: String).void }
34
+ attr_writer :customer_id
35
+
36
+ sig do
37
+ returns(T.nilable(Sentdm::Profiles::MessagingUseCaseUs::TaggedSymbol))
38
+ end
39
+ attr_reader :messaging_use_case_us
40
+
41
+ sig do
42
+ params(
43
+ messaging_use_case_us:
44
+ Sentdm::Profiles::MessagingUseCaseUs::OrSymbol
45
+ ).void
46
+ end
47
+ attr_writer :messaging_use_case_us
48
+
49
+ # Sample messages submitted to the registry for this use case.
50
+ sig { returns(T.nilable(T::Array[String])) }
51
+ attr_reader :sample_messages
52
+
53
+ sig { params(sample_messages: T::Array[String]).void }
54
+ attr_writer :sample_messages
55
+
56
+ sig { returns(T.nilable(Time)) }
57
+ attr_accessor :updated_at
58
+
59
+ # Customer-facing use-case representation for the public v3 campaign contract.
60
+ # Exists for the same reason as BrandCampaignV3Response: nesting the
61
+ # TcrCampaignUseCase database entity in a public response means any column added
62
+ # to that table silently becomes part of the customer-facing contract. This DTO is
63
+ # an explicit allowlist, so a new column stays invisible until it is added here on
64
+ # purpose. This mirrors exactly the fields the entity already serialized, so it
65
+ # removes nothing from the current response shape. It only closes the future-leak
66
+ # path.
67
+ sig do
68
+ params(
69
+ id: String,
70
+ campaign_id: String,
71
+ created_at: Time,
72
+ customer_id: String,
73
+ messaging_use_case_us:
74
+ Sentdm::Profiles::MessagingUseCaseUs::OrSymbol,
75
+ sample_messages: T::Array[String],
76
+ updated_at: T.nilable(Time)
77
+ ).returns(T.attached_class)
78
+ end
79
+ def self.new(
80
+ id: nil,
81
+ campaign_id: nil,
82
+ created_at: nil,
83
+ customer_id: nil,
84
+ messaging_use_case_us: nil,
85
+ # Sample messages submitted to the registry for this use case.
86
+ sample_messages: nil,
87
+ updated_at: nil
88
+ )
89
+ end
90
+
91
+ sig do
92
+ override.returns(
93
+ {
94
+ id: String,
95
+ campaign_id: String,
96
+ created_at: Time,
97
+ customer_id: String,
98
+ messaging_use_case_us:
99
+ Sentdm::Profiles::MessagingUseCaseUs::TaggedSymbol,
100
+ sample_messages: T::Array[String],
101
+ updated_at: T.nilable(Time)
102
+ }
103
+ )
104
+ end
105
+ def to_hash
106
+ end
107
+ end
108
+ end
109
+ end
110
+ end
@@ -3,11 +3,11 @@
3
3
  module Sentdm
4
4
  module Models
5
5
  module Profiles
6
- class SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData < Sentdm::Internal::Type::BaseModel
6
+ class CampaignUseCaseData < Sentdm::Internal::Type::BaseModel
7
7
  OrHash =
8
8
  T.type_alias do
9
9
  T.any(
10
- Sentdm::Profiles::SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData,
10
+ Sentdm::Profiles::CampaignUseCaseData,
11
11
  Sentdm::Internal::AnyHash
12
12
  )
13
13
  end
@@ -2,14 +2,9 @@
2
2
 
3
3
  module Sentdm
4
4
  module Models
5
- class SentDmServicesCommonContractsPocOsTemplateBody < Sentdm::Internal::Type::BaseModel
5
+ class TemplateBody < Sentdm::Internal::Type::BaseModel
6
6
  OrHash =
7
- T.type_alias do
8
- T.any(
9
- Sentdm::SentDmServicesCommonContractsPocOsTemplateBody,
10
- Sentdm::Internal::AnyHash
11
- )
12
- end
7
+ T.type_alias { T.any(Sentdm::TemplateBody, Sentdm::Internal::AnyHash) }
13
8
 
14
9
  # Content that will be used for all channels (SMS and WhatsApp) unless
15
10
  # channel-specific content is provided
@@ -2,27 +2,17 @@
2
2
 
3
3
  module Sentdm
4
4
  module Models
5
- class SentDmServicesCommonContractsPocOsTemplateButton < Sentdm::Internal::Type::BaseModel
5
+ class TemplateButton < Sentdm::Internal::Type::BaseModel
6
6
  OrHash =
7
7
  T.type_alias do
8
- T.any(
9
- Sentdm::SentDmServicesCommonContractsPocOsTemplateButton,
10
- Sentdm::Internal::AnyHash
11
- )
8
+ T.any(Sentdm::TemplateButton, Sentdm::Internal::AnyHash)
12
9
  end
13
10
 
14
11
  # Properties specific to the button type
15
- sig do
16
- returns(Sentdm::SentDmServicesCommonContractsPocOsTemplateButtonProps)
17
- end
12
+ sig { returns(Sentdm::TemplateButtonProps) }
18
13
  attr_reader :props
19
14
 
20
- sig do
21
- params(
22
- props:
23
- Sentdm::SentDmServicesCommonContractsPocOsTemplateButtonProps::OrHash
24
- ).void
25
- end
15
+ sig { params(props: Sentdm::TemplateButtonProps::OrHash).void }
26
16
  attr_writer :props
27
17
 
28
18
  # The type of button (e.g., QUICK_REPLY, URL, PHONE_NUMBER, VOICE_CALL, COPY_CODE)
@@ -39,8 +29,7 @@ module Sentdm
39
29
  # Interactive button in a message template
40
30
  sig do
41
31
  params(
42
- props:
43
- Sentdm::SentDmServicesCommonContractsPocOsTemplateButtonProps::OrHash,
32
+ props: Sentdm::TemplateButtonProps::OrHash,
44
33
  type: String,
45
34
  id: Integer
46
35
  ).returns(T.attached_class)
@@ -57,12 +46,7 @@ module Sentdm
57
46
 
58
47
  sig do
59
48
  override.returns(
60
- {
61
- props:
62
- Sentdm::SentDmServicesCommonContractsPocOsTemplateButtonProps,
63
- type: String,
64
- id: Integer
65
- }
49
+ { props: Sentdm::TemplateButtonProps, type: String, id: Integer }
66
50
  )
67
51
  end
68
52
  def to_hash
@@ -2,13 +2,10 @@
2
2
 
3
3
  module Sentdm
4
4
  module Models
5
- class SentDmServicesCommonContractsPocOsTemplateButtonProps < Sentdm::Internal::Type::BaseModel
5
+ class TemplateButtonProps < Sentdm::Internal::Type::BaseModel
6
6
  OrHash =
7
7
  T.type_alias do
8
- T.any(
9
- Sentdm::SentDmServicesCommonContractsPocOsTemplateButtonProps,
10
- Sentdm::Internal::AnyHash
11
- )
8
+ T.any(Sentdm::TemplateButtonProps, Sentdm::Internal::AnyHash)
12
9
  end
13
10
 
14
11
  sig { returns(Integer) }
@@ -9,44 +9,25 @@ module Sentdm
9
9
  end
10
10
 
11
11
  # Body section of a message template with channel-specific content
12
- sig { returns(Sentdm::SentDmServicesCommonContractsPocOsTemplateBody) }
12
+ sig { returns(Sentdm::TemplateBody) }
13
13
  attr_reader :body
14
14
 
15
- sig do
16
- params(
17
- body: Sentdm::SentDmServicesCommonContractsPocOsTemplateBody::OrHash
18
- ).void
19
- end
15
+ sig { params(body: Sentdm::TemplateBody::OrHash).void }
20
16
  attr_writer :body
21
17
 
22
18
  # Configuration for AUTHENTICATION category templates
23
- sig do
24
- returns(
25
- T.nilable(
26
- Sentdm::SentDmServicesCommonContractsPocOsAuthenticationConfig
27
- )
28
- )
29
- end
19
+ sig { returns(T.nilable(Sentdm::AuthenticationConfig)) }
30
20
  attr_reader :authentication_config
31
21
 
32
22
  sig do
33
23
  params(
34
- authentication_config:
35
- T.nilable(
36
- Sentdm::SentDmServicesCommonContractsPocOsAuthenticationConfig::OrHash
37
- )
24
+ authentication_config: T.nilable(Sentdm::AuthenticationConfig::OrHash)
38
25
  ).void
39
26
  end
40
27
  attr_writer :authentication_config
41
28
 
42
29
  # Optional list of interactive buttons (e.g., quick replies, URLs, phone numbers)
43
- sig do
44
- returns(
45
- T.nilable(
46
- T::Array[Sentdm::SentDmServicesCommonContractsPocOsTemplateButton]
47
- )
48
- )
49
- end
30
+ sig { returns(T.nilable(T::Array[Sentdm::TemplateButton])) }
50
31
  attr_accessor :buttons
51
32
 
52
33
  # The version of the template definition format
@@ -54,65 +35,30 @@ module Sentdm
54
35
  attr_accessor :definition_version
55
36
 
56
37
  # Footer section of a message template
57
- sig do
58
- returns(
59
- T.nilable(Sentdm::SentDmServicesCommonContractsPocOsTemplateFooter)
60
- )
61
- end
38
+ sig { returns(T.nilable(Sentdm::TemplateFooter)) }
62
39
  attr_reader :footer
63
40
 
64
- sig do
65
- params(
66
- footer:
67
- T.nilable(
68
- Sentdm::SentDmServicesCommonContractsPocOsTemplateFooter::OrHash
69
- )
70
- ).void
71
- end
41
+ sig { params(footer: T.nilable(Sentdm::TemplateFooter::OrHash)).void }
72
42
  attr_writer :footer
73
43
 
74
44
  # Header section of a message template
75
- sig do
76
- returns(
77
- T.nilable(Sentdm::SentDmServicesCommonContractsPocOsTemplateHeader)
78
- )
79
- end
45
+ sig { returns(T.nilable(Sentdm::TemplateHeader)) }
80
46
  attr_reader :header
81
47
 
82
- sig do
83
- params(
84
- header:
85
- T.nilable(
86
- Sentdm::SentDmServicesCommonContractsPocOsTemplateHeader::OrHash
87
- )
88
- ).void
89
- end
48
+ sig { params(header: T.nilable(Sentdm::TemplateHeader::OrHash)).void }
90
49
  attr_writer :header
91
50
 
92
51
  # Complete definition of a message template including header, body, footer, and
93
52
  # buttons
94
53
  sig do
95
54
  params(
96
- body: Sentdm::SentDmServicesCommonContractsPocOsTemplateBody::OrHash,
55
+ body: Sentdm::TemplateBody::OrHash,
97
56
  authentication_config:
98
- T.nilable(
99
- Sentdm::SentDmServicesCommonContractsPocOsAuthenticationConfig::OrHash
100
- ),
101
- buttons:
102
- T.nilable(
103
- T::Array[
104
- Sentdm::SentDmServicesCommonContractsPocOsTemplateButton::OrHash
105
- ]
106
- ),
57
+ T.nilable(Sentdm::AuthenticationConfig::OrHash),
58
+ buttons: T.nilable(T::Array[Sentdm::TemplateButton::OrHash]),
107
59
  definition_version: T.nilable(String),
108
- footer:
109
- T.nilable(
110
- Sentdm::SentDmServicesCommonContractsPocOsTemplateFooter::OrHash
111
- ),
112
- header:
113
- T.nilable(
114
- Sentdm::SentDmServicesCommonContractsPocOsTemplateHeader::OrHash
115
- )
60
+ footer: T.nilable(Sentdm::TemplateFooter::OrHash),
61
+ header: T.nilable(Sentdm::TemplateHeader::OrHash)
116
62
  ).returns(T.attached_class)
117
63
  end
118
64
  def self.new(
@@ -134,26 +80,12 @@ module Sentdm
134
80
  sig do
135
81
  override.returns(
136
82
  {
137
- body: Sentdm::SentDmServicesCommonContractsPocOsTemplateBody,
138
- authentication_config:
139
- T.nilable(
140
- Sentdm::SentDmServicesCommonContractsPocOsAuthenticationConfig
141
- ),
142
- buttons:
143
- T.nilable(
144
- T::Array[
145
- Sentdm::SentDmServicesCommonContractsPocOsTemplateButton
146
- ]
147
- ),
83
+ body: Sentdm::TemplateBody,
84
+ authentication_config: T.nilable(Sentdm::AuthenticationConfig),
85
+ buttons: T.nilable(T::Array[Sentdm::TemplateButton]),
148
86
  definition_version: T.nilable(String),
149
- footer:
150
- T.nilable(
151
- Sentdm::SentDmServicesCommonContractsPocOsTemplateFooter
152
- ),
153
- header:
154
- T.nilable(
155
- Sentdm::SentDmServicesCommonContractsPocOsTemplateHeader
156
- )
87
+ footer: T.nilable(Sentdm::TemplateFooter),
88
+ header: T.nilable(Sentdm::TemplateHeader)
157
89
  }
158
90
  )
159
91
  end
@@ -0,0 +1,84 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class TemplateEvent < Sentdm::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias { T.any(Sentdm::TemplateEvent, Sentdm::Internal::AnyHash) }
8
+
9
+ # The specific event within the family, for example message.delivered or
10
+ # message.received. Absent on events that have no subtype, so treat it as
11
+ # optional.
12
+ sig { returns(T.nilable(String)) }
13
+ attr_accessor :event
14
+
15
+ # The event family, for example message or templates. Route on this first, then on
16
+ # event for the specific change.
17
+ sig { returns(T.nilable(String)) }
18
+ attr_reader :field
19
+
20
+ sig { params(field: String).void }
21
+ attr_writer :field
22
+
23
+ # Body of a template status event. Delivered when a template's review outcome
24
+ # changes, so you can react without polling.
25
+ sig { returns(T.nilable(Sentdm::TemplateEventPayload)) }
26
+ attr_reader :payload
27
+
28
+ sig do
29
+ params(payload: T.nilable(Sentdm::TemplateEventPayload::OrHash)).void
30
+ end
31
+ attr_writer :payload
32
+
33
+ # When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
34
+ # time, not the time the underlying change happened. Use the timestamp inside the
35
+ # payload for the latter.
36
+ sig { returns(T.nilable(String)) }
37
+ attr_reader :timestamp
38
+
39
+ sig { params(timestamp: String).void }
40
+ attr_writer :timestamp
41
+
42
+ # The envelope Sent POSTs to a subscribed webhook endpoint. Every event shares
43
+ # this shape and varies only in Payload.
44
+ sig do
45
+ params(
46
+ event: T.nilable(String),
47
+ field: String,
48
+ payload: T.nilable(Sentdm::TemplateEventPayload::OrHash),
49
+ timestamp: String
50
+ ).returns(T.attached_class)
51
+ end
52
+ def self.new(
53
+ # The specific event within the family, for example message.delivered or
54
+ # message.received. Absent on events that have no subtype, so treat it as
55
+ # optional.
56
+ event: nil,
57
+ # The event family, for example message or templates. Route on this first, then on
58
+ # event for the specific change.
59
+ field: nil,
60
+ # Body of a template status event. Delivered when a template's review outcome
61
+ # changes, so you can react without polling.
62
+ payload: nil,
63
+ # When Sent emitted the event, in UTC (yyyy-MM-ddTHH:mm:ssZ). This is the emission
64
+ # time, not the time the underlying change happened. Use the timestamp inside the
65
+ # payload for the latter.
66
+ timestamp: nil
67
+ )
68
+ end
69
+
70
+ sig do
71
+ override.returns(
72
+ {
73
+ event: T.nilable(String),
74
+ field: String,
75
+ payload: T.nilable(Sentdm::TemplateEventPayload),
76
+ timestamp: String
77
+ }
78
+ )
79
+ end
80
+ def to_hash
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,131 @@
1
+ # typed: strong
2
+
3
+ module Sentdm
4
+ module Models
5
+ class TemplateEventPayload < Sentdm::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Sentdm::TemplateEventPayload, Sentdm::Internal::AnyHash)
9
+ end
10
+
11
+ # The account the template belongs to.
12
+ sig { returns(T.nilable(String)) }
13
+ attr_reader :account_id
14
+
15
+ sig { params(account_id: String).void }
16
+ attr_writer :account_id
17
+
18
+ # The template's category, for example UTILITY, MARKETING, or 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 channel the template applies to.
26
+ sig { returns(T.nilable(String)) }
27
+ attr_reader :channel
28
+
29
+ sig { params(channel: String).void }
30
+ attr_writer :channel
31
+
32
+ # The template's language code, for example en_US.
33
+ sig { returns(T.nilable(String)) }
34
+ attr_reader :language
35
+
36
+ sig { params(language: String).void }
37
+ attr_writer :language
38
+
39
+ # Why the template reached Status, when a reason was given. Populated on a
40
+ # rejection.
41
+ sig { returns(T.nilable(String)) }
42
+ attr_accessor :reason
43
+
44
+ # The review status the template just reached, for example APPROVED or REJECTED.
45
+ sig { returns(T.nilable(String)) }
46
+ attr_reader :status
47
+
48
+ sig { params(status: String).void }
49
+ attr_writer :status
50
+
51
+ # The template in Sent.
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :template_id
54
+
55
+ sig { params(template_id: String).void }
56
+ attr_writer :template_id
57
+
58
+ # The template's display name.
59
+ sig { returns(T.nilable(String)) }
60
+ attr_reader :template_name
61
+
62
+ sig { params(template_name: String).void }
63
+ attr_writer :template_name
64
+
65
+ # The template's identifier with Meta, assigned when the template is submitted for
66
+ # review.
67
+ sig { returns(T.nilable(String)) }
68
+ attr_reader :whatsapp_template_id
69
+
70
+ sig { params(whatsapp_template_id: String).void }
71
+ attr_writer :whatsapp_template_id
72
+
73
+ # Body of a template status event. Delivered when a template's review outcome
74
+ # changes, so you can react without polling.
75
+ sig do
76
+ params(
77
+ account_id: String,
78
+ category: String,
79
+ channel: String,
80
+ language: String,
81
+ reason: T.nilable(String),
82
+ status: String,
83
+ template_id: String,
84
+ template_name: String,
85
+ whatsapp_template_id: String
86
+ ).returns(T.attached_class)
87
+ end
88
+ def self.new(
89
+ # The account the template belongs to.
90
+ account_id: nil,
91
+ # The template's category, for example UTILITY, MARKETING, or AUTHENTICATION.
92
+ category: nil,
93
+ # The channel the template applies to.
94
+ channel: nil,
95
+ # The template's language code, for example en_US.
96
+ language: nil,
97
+ # Why the template reached Status, when a reason was given. Populated on a
98
+ # rejection.
99
+ reason: nil,
100
+ # The review status the template just reached, for example APPROVED or REJECTED.
101
+ status: nil,
102
+ # The template in Sent.
103
+ template_id: nil,
104
+ # The template's display name.
105
+ template_name: nil,
106
+ # The template's identifier with Meta, assigned when the template is submitted for
107
+ # review.
108
+ whatsapp_template_id: nil
109
+ )
110
+ end
111
+
112
+ sig do
113
+ override.returns(
114
+ {
115
+ account_id: String,
116
+ category: String,
117
+ channel: String,
118
+ language: String,
119
+ reason: T.nilable(String),
120
+ status: String,
121
+ template_id: String,
122
+ template_name: String,
123
+ whatsapp_template_id: String
124
+ }
125
+ )
126
+ end
127
+ def to_hash
128
+ end
129
+ end
130
+ end
131
+ end
@@ -2,13 +2,10 @@
2
2
 
3
3
  module Sentdm
4
4
  module Models
5
- class SentDmServicesCommonContractsPocOsTemplateFooter < Sentdm::Internal::Type::BaseModel
5
+ class TemplateFooter < Sentdm::Internal::Type::BaseModel
6
6
  OrHash =
7
7
  T.type_alias do
8
- T.any(
9
- Sentdm::SentDmServicesCommonContractsPocOsTemplateFooter,
10
- Sentdm::Internal::AnyHash
11
- )
8
+ T.any(Sentdm::TemplateFooter, Sentdm::Internal::AnyHash)
12
9
  end
13
10
 
14
11
  # The footer template text with optional variable placeholders