sentdm 0.4.0 → 0.7.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 (140) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -0
  3. data/README.md +13 -9
  4. data/lib/sentdm/client.rb +5 -8
  5. data/lib/sentdm/internal/type/base_model.rb +5 -5
  6. data/lib/sentdm/models/{api_response_contact.rb → api_response_of_contact.rb} +4 -4
  7. data/lib/sentdm/models/base_dto.rb +30 -0
  8. data/lib/sentdm/models/billing_contact_info.rb +47 -0
  9. data/lib/sentdm/models/brands_brand_data.rb +38 -0
  10. data/lib/sentdm/models/contact_delete_params.rb +1 -1
  11. data/lib/sentdm/models/contact_list_response.rb +3 -3
  12. data/lib/sentdm/models/{contact.rb → contact_response.rb} +1 -1
  13. data/lib/sentdm/models/{mutation_request.rb → mutation_request_base.rb} +2 -2
  14. data/lib/sentdm/models/number_lookup_params.rb +26 -0
  15. data/lib/sentdm/models/number_lookup_response.rb +104 -0
  16. data/lib/sentdm/models/payment_details.rb +44 -0
  17. data/lib/sentdm/models/{profile_complete_params.rb → profile_complete_setup_params.rb} +3 -3
  18. data/lib/sentdm/models/{profile_complete_response.rb → profile_complete_setup_response.rb} +1 -1
  19. data/lib/sentdm/models/profile_create_params.rb +9 -91
  20. data/lib/sentdm/models/profile_delete_params.rb +1 -1
  21. data/lib/sentdm/models/profile_detail.rb +369 -3
  22. data/lib/sentdm/models/profile_update_params.rb +9 -91
  23. data/lib/sentdm/models/{brands/api_response_tcr_campaign_with_use_cases.rb → profiles/api_response_of_tcr_campaign_with_use_cases.rb} +6 -5
  24. data/lib/sentdm/models/profiles/campaign_create_params.rb +57 -0
  25. data/lib/sentdm/models/{brands → profiles}/campaign_data.rb +5 -5
  26. data/lib/sentdm/models/profiles/campaign_delete_params.rb +50 -0
  27. data/lib/sentdm/models/profiles/campaign_list_params.rb +28 -0
  28. data/lib/sentdm/models/profiles/campaign_list_response.rb +47 -0
  29. data/lib/sentdm/models/profiles/campaign_update_params.rb +64 -0
  30. data/lib/sentdm/models/{brands → profiles}/messaging_use_case_us.rb +1 -1
  31. data/lib/sentdm/models/{brands → profiles}/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data.rb +4 -4
  32. data/lib/sentdm/models/{brands → profiles}/tcr_campaign_with_use_cases.rb +15 -15
  33. data/lib/sentdm/models/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_business_info.rb +119 -0
  34. data/lib/sentdm/models/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_compliance_info.rb +77 -0
  35. data/lib/sentdm/models/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_contact_info.rb +58 -0
  36. data/lib/sentdm/models/user_remove_params.rb +1 -1
  37. data/lib/sentdm/models/webhook_rotate_secret_params.rb +1 -1
  38. data/lib/sentdm/models.rb +23 -8
  39. data/lib/sentdm/resources/contacts.rb +6 -6
  40. data/lib/sentdm/resources/numbers.rb +44 -0
  41. data/lib/sentdm/resources/profiles/campaigns.rb +160 -0
  42. data/lib/sentdm/resources/profiles.rb +16 -11
  43. data/lib/sentdm/version.rb +1 -1
  44. data/lib/sentdm.rb +26 -16
  45. data/rbi/sentdm/client.rbi +4 -6
  46. data/rbi/sentdm/models/{api_response_contact.rbi → api_response_of_contact.rbi} +6 -6
  47. data/rbi/sentdm/models/base_dto.rbi +49 -0
  48. data/rbi/sentdm/models/billing_contact_info.rbi +65 -0
  49. data/rbi/sentdm/models/brands_brand_data.rbi +104 -0
  50. data/rbi/sentdm/models/contact_delete_params.rbi +1 -1
  51. data/rbi/sentdm/models/contact_list_response.rbi +4 -4
  52. data/rbi/sentdm/models/{contact.rbi → contact_response.rbi} +4 -2
  53. data/rbi/sentdm/models/{mutation_request.rbi → mutation_request_base.rbi} +2 -2
  54. data/rbi/sentdm/models/number_lookup_params.rbi +46 -0
  55. data/rbi/sentdm/models/number_lookup_response.rbi +166 -0
  56. data/rbi/sentdm/models/payment_details.rbi +59 -0
  57. data/rbi/sentdm/models/{profile_complete_params.rbi → profile_complete_setup_params.rbi} +2 -2
  58. data/rbi/sentdm/models/{profile_complete_response.rbi → profile_complete_setup_response.rbi} +1 -1
  59. data/rbi/sentdm/models/profile_create_params.rbi +12 -146
  60. data/rbi/sentdm/models/profile_delete_params.rbi +1 -1
  61. data/rbi/sentdm/models/profile_detail.rbi +562 -4
  62. data/rbi/sentdm/models/profile_update_params.rbi +12 -146
  63. data/rbi/sentdm/models/{brands/api_response_tcr_campaign_with_use_cases.rbi → profiles/api_response_of_tcr_campaign_with_use_cases.rbi} +7 -7
  64. data/rbi/sentdm/models/profiles/campaign_create_params.rbi +88 -0
  65. data/rbi/sentdm/models/{brands → profiles}/campaign_data.rbi +5 -5
  66. data/rbi/sentdm/models/profiles/campaign_delete_params.rbi +95 -0
  67. data/rbi/sentdm/models/profiles/campaign_list_params.rbi +51 -0
  68. data/rbi/sentdm/models/profiles/campaign_list_response.rbi +84 -0
  69. data/rbi/sentdm/models/profiles/campaign_update_params.rbi +94 -0
  70. data/rbi/sentdm/models/{brands → profiles}/messaging_use_case_us.rbi +20 -16
  71. data/rbi/sentdm/models/{brands → profiles}/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data.rbi +6 -5
  72. data/rbi/sentdm/models/{brands → profiles}/tcr_campaign_with_use_cases.rbi +37 -29
  73. data/rbi/sentdm/models/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_business_info.rbi +183 -0
  74. data/rbi/sentdm/models/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_compliance_info.rbi +99 -0
  75. data/rbi/sentdm/models/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_contact_info.rbi +81 -0
  76. data/rbi/sentdm/models/user_remove_params.rbi +1 -1
  77. data/rbi/sentdm/models/webhook_rotate_secret_params.rbi +1 -1
  78. data/rbi/sentdm/models.rbi +23 -8
  79. data/rbi/sentdm/resources/contacts.rbi +3 -3
  80. data/rbi/sentdm/resources/numbers.rbi +32 -0
  81. data/rbi/sentdm/resources/profiles/campaigns.rbi +127 -0
  82. data/rbi/sentdm/resources/profiles.rbi +11 -11
  83. data/sig/sentdm/client.rbs +2 -4
  84. data/sig/sentdm/models/{api_response_contact.rbs → api_response_of_contact.rbs} +6 -6
  85. data/sig/sentdm/models/base_dto.rbs +25 -0
  86. data/sig/sentdm/models/billing_contact_info.rbs +30 -0
  87. data/sig/sentdm/models/brands_brand_data.rbs +30 -0
  88. data/sig/sentdm/models/contact_delete_params.rbs +1 -1
  89. data/sig/sentdm/models/contact_list_response.rbs +7 -5
  90. data/sig/sentdm/models/{contact.rbs → contact_response.rbs} +2 -2
  91. data/sig/sentdm/models/{mutation_request.rbs → mutation_request_base.rbs} +2 -2
  92. data/sig/sentdm/models/number_lookup_params.rbs +30 -0
  93. data/sig/sentdm/models/number_lookup_response.rbs +100 -0
  94. data/sig/sentdm/models/payment_details.rbs +30 -0
  95. data/sig/sentdm/models/{profile_complete_params.rbs → profile_complete_setup_params.rbs} +2 -2
  96. data/sig/sentdm/models/profile_complete_setup_response.rbs +5 -0
  97. data/sig/sentdm/models/profile_create_params.rbs +12 -66
  98. data/sig/sentdm/models/profile_delete_params.rbs +1 -1
  99. data/sig/sentdm/models/profile_detail.rbs +289 -4
  100. data/sig/sentdm/models/profile_update_params.rbs +12 -66
  101. data/sig/sentdm/models/profiles/api_response_of_tcr_campaign_with_use_cases.rbs +41 -0
  102. data/sig/sentdm/models/profiles/campaign_create_params.rbs +54 -0
  103. data/sig/sentdm/models/{brands → profiles}/campaign_data.rbs +5 -5
  104. data/sig/sentdm/models/profiles/campaign_delete_params.rbs +53 -0
  105. data/sig/sentdm/models/profiles/campaign_list_params.rbs +32 -0
  106. data/sig/sentdm/models/{brands/api_response_tcr_campaign_with_use_cases.rbs → profiles/campaign_list_response.rbs} +7 -7
  107. data/sig/sentdm/models/profiles/campaign_update_params.rbs +59 -0
  108. data/sig/sentdm/models/{brands → profiles}/messaging_use_case_us.rbs +2 -2
  109. data/sig/sentdm/models/{brands → profiles}/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data.rbs +5 -5
  110. data/sig/sentdm/models/{brands → profiles}/tcr_campaign_with_use_cases.rbs +29 -29
  111. data/sig/sentdm/models/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_business_info.rbs +89 -0
  112. data/sig/sentdm/models/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_compliance_info.rbs +55 -0
  113. data/sig/sentdm/models/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_brands_brand_contact_info.rbs +45 -0
  114. data/sig/sentdm/models/user_remove_params.rbs +1 -1
  115. data/sig/sentdm/models/webhook_rotate_secret_params.rbs +1 -1
  116. data/sig/sentdm/models.rbs +20 -8
  117. data/sig/sentdm/resources/contacts.rbs +3 -3
  118. data/sig/sentdm/resources/numbers.rbs +13 -0
  119. data/sig/sentdm/resources/profiles/campaigns.rbs +42 -0
  120. data/sig/sentdm/resources/profiles.rbs +9 -7
  121. metadata +79 -49
  122. data/lib/sentdm/models/brand_data.rb +0 -274
  123. data/lib/sentdm/models/brand_with_kyc.rb +0 -370
  124. data/lib/sentdm/models/brands/base_dto.rb +0 -32
  125. data/lib/sentdm/resources/brands/campaigns.rb +0 -16
  126. data/lib/sentdm/resources/brands.rb +0 -18
  127. data/lib/sentdm/resources/lookup.rb +0 -14
  128. data/rbi/sentdm/models/brand_data.rbi +0 -389
  129. data/rbi/sentdm/models/brand_with_kyc.rbi +0 -516
  130. data/rbi/sentdm/models/brands/base_dto.rbi +0 -53
  131. data/rbi/sentdm/resources/brands/campaigns.rbi +0 -14
  132. data/rbi/sentdm/resources/brands.rbi +0 -15
  133. data/rbi/sentdm/resources/lookup.rbi +0 -12
  134. data/sig/sentdm/models/brand_data.rbs +0 -210
  135. data/sig/sentdm/models/brand_with_kyc.rbs +0 -288
  136. data/sig/sentdm/models/brands/base_dto.rbs +0 -27
  137. data/sig/sentdm/models/profile_complete_response.rbs +0 -5
  138. data/sig/sentdm/resources/brands/campaigns.rbs +0 -9
  139. data/sig/sentdm/resources/brands.rbs +0 -9
  140. data/sig/sentdm/resources/lookup.rbs +0 -7
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Models
5
+ class SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandContactInfo < Sentdm::Internal::Type::BaseModel
6
+ # @!attribute name
7
+ # Primary contact name (required)
8
+ #
9
+ # @return [String]
10
+ required :name, String
11
+
12
+ # @!attribute business_name
13
+ # Business/brand name
14
+ #
15
+ # @return [String, nil]
16
+ optional :business_name, String, api_name: :businessName, nil?: true
17
+
18
+ # @!attribute email
19
+ # Contact email address
20
+ #
21
+ # @return [String, nil]
22
+ optional :email, String, nil?: true
23
+
24
+ # @!attribute phone
25
+ # Contact phone number in E.164 format
26
+ #
27
+ # @return [String, nil]
28
+ optional :phone, String, nil?: true
29
+
30
+ # @!attribute phone_country_code
31
+ # Contact phone country code (e.g., "1" for US)
32
+ #
33
+ # @return [String, nil]
34
+ optional :phone_country_code, String, api_name: :phoneCountryCode, nil?: true
35
+
36
+ # @!attribute role
37
+ # Contact's role in the business
38
+ #
39
+ # @return [String, nil]
40
+ optional :role, String, nil?: true
41
+
42
+ # @!method initialize(name:, business_name: nil, email: nil, phone: nil, phone_country_code: nil, role: nil)
43
+ # Contact information for brand KYC
44
+ #
45
+ # @param name [String] Primary contact name (required)
46
+ #
47
+ # @param business_name [String, nil] Business/brand name
48
+ #
49
+ # @param email [String, nil] Contact email address
50
+ #
51
+ # @param phone [String, nil] Contact phone number in E.164 format
52
+ #
53
+ # @param phone_country_code [String, nil] Contact phone country code (e.g., "1" for US)
54
+ #
55
+ # @param role [String, nil] Contact's role in the business
56
+ end
57
+ end
58
+ end
@@ -32,7 +32,7 @@ module Sentdm
32
32
  #
33
33
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
34
34
 
35
- class Body < Sentdm::Models::MutationRequest
35
+ class Body < Sentdm::Models::MutationRequestBase
36
36
  # @!method initialize
37
37
  # Request to remove a user from an organization
38
38
  end
@@ -34,7 +34,7 @@ module Sentdm
34
34
  # @param x_profile_id [String]
35
35
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}]
36
36
 
37
- class Body < Sentdm::Models::MutationRequest
37
+ class Body < Sentdm::Models::MutationRequestBase
38
38
  # @!method initialize
39
39
  end
40
40
  end
data/lib/sentdm/models.rb CHANGED
@@ -43,7 +43,7 @@ module Sentdm
43
43
 
44
44
  APIMeta = Sentdm::Models::APIMeta
45
45
 
46
- APIResponseContact = Sentdm::Models::APIResponseContact
46
+ APIResponseOfContact = Sentdm::Models::APIResponseOfContact
47
47
 
48
48
  APIResponseOfProfileDetail = Sentdm::Models::APIResponseOfProfileDetail
49
49
 
@@ -53,13 +53,11 @@ module Sentdm
53
53
 
54
54
  APIResponseWebhook = Sentdm::Models::APIResponseWebhook
55
55
 
56
- BrandData = Sentdm::Models::BrandData
56
+ BaseDto = Sentdm::Models::BaseDto
57
57
 
58
- Brands = Sentdm::Models::Brands
58
+ BillingContactInfo = Sentdm::Models::BillingContactInfo
59
59
 
60
- BrandWithKYC = Sentdm::Models::BrandWithKYC
61
-
62
- Contact = Sentdm::Models::Contact
60
+ BrandsBrandData = Sentdm::Models::BrandsBrandData
63
61
 
64
62
  ContactCreateParams = Sentdm::Models::ContactCreateParams
65
63
 
@@ -67,6 +65,8 @@ module Sentdm
67
65
 
68
66
  ContactListParams = Sentdm::Models::ContactListParams
69
67
 
68
+ ContactResponse = Sentdm::Models::ContactResponse
69
+
70
70
  ContactRetrieveParams = Sentdm::Models::ContactRetrieveParams
71
71
 
72
72
  ContactUpdateParams = Sentdm::Models::ContactUpdateParams
@@ -81,11 +81,15 @@ module Sentdm
81
81
 
82
82
  MessageSendParams = Sentdm::Models::MessageSendParams
83
83
 
84
- MutationRequest = Sentdm::Models::MutationRequest
84
+ MutationRequestBase = Sentdm::Models::MutationRequestBase
85
+
86
+ NumberLookupParams = Sentdm::Models::NumberLookupParams
85
87
 
86
88
  PaginationMeta = Sentdm::Models::PaginationMeta
87
89
 
88
- ProfileCompleteParams = Sentdm::Models::ProfileCompleteParams
90
+ PaymentDetails = Sentdm::Models::PaymentDetails
91
+
92
+ ProfileCompleteSetupParams = Sentdm::Models::ProfileCompleteSetupParams
89
93
 
90
94
  ProfileCreateParams = Sentdm::Models::ProfileCreateParams
91
95
 
@@ -97,6 +101,8 @@ module Sentdm
97
101
 
98
102
  ProfileRetrieveParams = Sentdm::Models::ProfileRetrieveParams
99
103
 
104
+ Profiles = Sentdm::Models::Profiles
105
+
100
106
  ProfileSettings = Sentdm::Models::ProfileSettings
101
107
 
102
108
  ProfileUpdateParams = Sentdm::Models::ProfileUpdateParams
@@ -119,6 +125,15 @@ module Sentdm
119
125
  SentDmServicesCommonContractsPocOsTemplateHeader =
120
126
  Sentdm::Models::SentDmServicesCommonContractsPocOsTemplateHeader
121
127
 
128
+ SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandBusinessInfo =
129
+ Sentdm::Models::SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandBusinessInfo
130
+
131
+ SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandComplianceInfo =
132
+ Sentdm::Models::SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandComplianceInfo
133
+
134
+ SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandContactInfo =
135
+ Sentdm::Models::SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandContactInfo
136
+
122
137
  TcrBrandRelationship = Sentdm::Models::TcrBrandRelationship
123
138
 
124
139
  TcrVertical = Sentdm::Models::TcrVertical
@@ -22,7 +22,7 @@ module Sentdm
22
22
  #
23
23
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
24
24
  #
25
- # @return [Sentdm::Models::APIResponseContact]
25
+ # @return [Sentdm::Models::APIResponseOfContact]
26
26
  #
27
27
  # @see Sentdm::Models::ContactCreateParams
28
28
  def create(params = {})
@@ -33,7 +33,7 @@ module Sentdm
33
33
  path: "v3/contacts",
34
34
  headers: parsed.slice(*header_params.keys).transform_keys(header_params),
35
35
  body: parsed.except(*header_params.keys),
36
- model: Sentdm::APIResponseContact,
36
+ model: Sentdm::APIResponseOfContact,
37
37
  options: options
38
38
  )
39
39
  end
@@ -53,7 +53,7 @@ module Sentdm
53
53
  #
54
54
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
55
55
  #
56
- # @return [Sentdm::Models::APIResponseContact]
56
+ # @return [Sentdm::Models::APIResponseOfContact]
57
57
  #
58
58
  # @see Sentdm::Models::ContactRetrieveParams
59
59
  def retrieve(id, params = {})
@@ -62,7 +62,7 @@ module Sentdm
62
62
  method: :get,
63
63
  path: ["v3/contacts/%1$s", id],
64
64
  headers: parsed.transform_keys(x_profile_id: "x-profile-id"),
65
- model: Sentdm::APIResponseContact,
65
+ model: Sentdm::APIResponseOfContact,
66
66
  options: options
67
67
  )
68
68
  end
@@ -89,7 +89,7 @@ module Sentdm
89
89
  #
90
90
  # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
91
91
  #
92
- # @return [Sentdm::Models::APIResponseContact]
92
+ # @return [Sentdm::Models::APIResponseOfContact]
93
93
  #
94
94
  # @see Sentdm::Models::ContactUpdateParams
95
95
  def update(id, params = {})
@@ -100,7 +100,7 @@ module Sentdm
100
100
  path: ["v3/contacts/%1$s", id],
101
101
  headers: parsed.slice(*header_params.keys).transform_keys(header_params),
102
102
  body: parsed.except(*header_params.keys),
103
- model: Sentdm::APIResponseContact,
103
+ model: Sentdm::APIResponseOfContact,
104
104
  options: options
105
105
  )
106
106
  end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Resources
5
+ # Manage and lookup phone numbers
6
+ class Numbers
7
+ # Some parameter documentations has been truncated, see
8
+ # {Sentdm::Models::NumberLookupParams} for more details.
9
+ #
10
+ # Retrieves detailed information about a phone number including carrier, line
11
+ # type, porting status, and VoIP detection. Uses the customer's messaging provider
12
+ # for rich data, with fallback to the internal index.
13
+ #
14
+ # @overload lookup(phone_number, x_profile_id: nil, request_options: {})
15
+ #
16
+ # @param phone_number [String]
17
+ #
18
+ # @param x_profile_id [String] Profile UUID to scope the request to a child profile. Only organization API keys
19
+ #
20
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
21
+ #
22
+ # @return [Sentdm::Models::NumberLookupResponse]
23
+ #
24
+ # @see Sentdm::Models::NumberLookupParams
25
+ def lookup(phone_number, params = {})
26
+ parsed, options = Sentdm::NumberLookupParams.dump_request(params)
27
+ @client.request(
28
+ method: :get,
29
+ path: ["v3/numbers/lookup/%1$s", phone_number],
30
+ headers: parsed.transform_keys(x_profile_id: "x-profile-id"),
31
+ model: Sentdm::Models::NumberLookupResponse,
32
+ options: options
33
+ )
34
+ end
35
+
36
+ # @api private
37
+ #
38
+ # @param client [Sentdm::Client]
39
+ def initialize(client:)
40
+ @client = client
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,160 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sentdm
4
+ module Resources
5
+ class Profiles
6
+ # Manage organization profiles
7
+ class Campaigns
8
+ # Some parameter documentations has been truncated, see
9
+ # {Sentdm::Models::Profiles::CampaignCreateParams} for more details.
10
+ #
11
+ # Creates a new campaign scoped under the brand of the specified profile. Each
12
+ # campaign must include at least one use case with sample messages.
13
+ #
14
+ # @overload create(profile_id, campaign:, sandbox: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
15
+ #
16
+ # @param profile_id [String] Path param: Profile ID from route
17
+ #
18
+ # @param campaign [Sentdm::Models::Profiles::CampaignData] Body param: Campaign data
19
+ #
20
+ # @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
21
+ #
22
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
23
+ #
24
+ # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
25
+ #
26
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
27
+ #
28
+ # @return [Sentdm::Models::Profiles::APIResponseOfTcrCampaignWithUseCases]
29
+ #
30
+ # @see Sentdm::Models::Profiles::CampaignCreateParams
31
+ def create(profile_id, params)
32
+ parsed, options = Sentdm::Profiles::CampaignCreateParams.dump_request(params)
33
+ header_params = {idempotency_key: "idempotency-key", x_profile_id: "x-profile-id"}
34
+ @client.request(
35
+ method: :post,
36
+ path: ["v3/profiles/%1$s/campaigns", profile_id],
37
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
38
+ body: parsed.except(*header_params.keys),
39
+ model: Sentdm::Profiles::APIResponseOfTcrCampaignWithUseCases,
40
+ options: options
41
+ )
42
+ end
43
+
44
+ # Some parameter documentations has been truncated, see
45
+ # {Sentdm::Models::Profiles::CampaignUpdateParams} for more details.
46
+ #
47
+ # Updates an existing campaign under the brand of the specified profile. Cannot
48
+ # update campaigns that have already been submitted to TCR.
49
+ #
50
+ # @overload update(campaign_id, profile_id:, campaign:, sandbox: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
51
+ #
52
+ # @param campaign_id [String] Path param: Campaign ID from route
53
+ #
54
+ # @param profile_id [String] Path param: Profile ID from route
55
+ #
56
+ # @param campaign [Sentdm::Models::Profiles::CampaignData] Body param: Campaign data
57
+ #
58
+ # @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
59
+ #
60
+ # @param idempotency_key [String] Header param: Unique key to ensure idempotent request processing. Must be 1-255
61
+ #
62
+ # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
63
+ #
64
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
65
+ #
66
+ # @return [Sentdm::Models::Profiles::APIResponseOfTcrCampaignWithUseCases]
67
+ #
68
+ # @see Sentdm::Models::Profiles::CampaignUpdateParams
69
+ def update(campaign_id, params)
70
+ parsed, options = Sentdm::Profiles::CampaignUpdateParams.dump_request(params)
71
+ profile_id =
72
+ parsed.delete(:profile_id) do
73
+ raise ArgumentError.new("missing required path argument #{_1}")
74
+ end
75
+ header_params = {idempotency_key: "idempotency-key", x_profile_id: "x-profile-id"}
76
+ @client.request(
77
+ method: :put,
78
+ path: ["v3/profiles/%1$s/campaigns/%2$s", profile_id, campaign_id],
79
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
80
+ body: parsed.except(*header_params.keys),
81
+ model: Sentdm::Profiles::APIResponseOfTcrCampaignWithUseCases,
82
+ options: options
83
+ )
84
+ end
85
+
86
+ # Some parameter documentations has been truncated, see
87
+ # {Sentdm::Models::Profiles::CampaignListParams} for more details.
88
+ #
89
+ # Retrieves all campaigns linked to the profile's brand, including use cases and
90
+ # sample messages. Returns inherited campaigns if inherit_tcr_campaign=true.
91
+ #
92
+ # @overload list(profile_id, x_profile_id: nil, request_options: {})
93
+ #
94
+ # @param profile_id [String] Profile ID from route
95
+ #
96
+ # @param x_profile_id [String] Profile UUID to scope the request to a child profile. Only organization API keys
97
+ #
98
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
99
+ #
100
+ # @return [Sentdm::Models::Profiles::CampaignListResponse]
101
+ #
102
+ # @see Sentdm::Models::Profiles::CampaignListParams
103
+ def list(profile_id, params = {})
104
+ parsed, options = Sentdm::Profiles::CampaignListParams.dump_request(params)
105
+ @client.request(
106
+ method: :get,
107
+ path: ["v3/profiles/%1$s/campaigns", profile_id],
108
+ headers: parsed.transform_keys(x_profile_id: "x-profile-id"),
109
+ model: Sentdm::Models::Profiles::CampaignListResponse,
110
+ options: options
111
+ )
112
+ end
113
+
114
+ # Some parameter documentations has been truncated, see
115
+ # {Sentdm::Models::Profiles::CampaignDeleteParams} for more details.
116
+ #
117
+ # Deletes a campaign by ID from the brand of the specified profile. The profile
118
+ # must belong to the authenticated organization.
119
+ #
120
+ # @overload delete(campaign_id, profile_id:, body:, x_profile_id: nil, request_options: {})
121
+ #
122
+ # @param campaign_id [String] Path param: Campaign ID from route parameter
123
+ #
124
+ # @param profile_id [String] Path param: Profile ID from route parameter
125
+ #
126
+ # @param body [Sentdm::Models::Profiles::CampaignDeleteParams::Body] Body param: Request to delete a campaign from a brand
127
+ #
128
+ # @param x_profile_id [String] Header param: Profile UUID to scope the request to a child profile. Only organiz
129
+ #
130
+ # @param request_options [Sentdm::RequestOptions, Hash{Symbol=>Object}, nil]
131
+ #
132
+ # @return [nil]
133
+ #
134
+ # @see Sentdm::Models::Profiles::CampaignDeleteParams
135
+ def delete(campaign_id, params)
136
+ parsed, options = Sentdm::Profiles::CampaignDeleteParams.dump_request(params)
137
+ profile_id =
138
+ parsed.delete(:profile_id) do
139
+ raise ArgumentError.new("missing required path argument #{_1}")
140
+ end
141
+ @client.request(
142
+ method: :delete,
143
+ path: ["v3/profiles/%1$s/campaigns/%2$s", profile_id, campaign_id],
144
+ headers: parsed.except(:body).transform_keys(x_profile_id: "x-profile-id"),
145
+ body: parsed[:body],
146
+ model: NilClass,
147
+ options: options
148
+ )
149
+ end
150
+
151
+ # @api private
152
+ #
153
+ # @param client [Sentdm::Client]
154
+ def initialize(client:)
155
+ @client = client
156
+ end
157
+ end
158
+ end
159
+ end
160
+ end
@@ -4,6 +4,10 @@ module Sentdm
4
4
  module Resources
5
5
  # Manage organization profiles
6
6
  class Profiles
7
+ # Manage organization profiles
8
+ # @return [Sentdm::Resources::Profiles::Campaigns]
9
+ attr_reader :campaigns
10
+
7
11
  # Some parameter documentations has been truncated, see
8
12
  # {Sentdm::Models::ProfileCreateParams} for more details.
9
13
  #
@@ -50,11 +54,11 @@ module Sentdm
50
54
  #
51
55
  # @param allow_template_sharing [Boolean] Body param: Whether templates are shared across profiles (default: false)
52
56
  #
53
- # @param billing_contact [Sentdm::Models::ProfileCreateParams::BillingContact, nil] Body param: Billing contact for this profile. Required when billing_model is "pr
57
+ # @param billing_contact [Sentdm::Models::BillingContactInfo, nil] Body param: Billing contact for this profile. Required when billing_model is "pr
54
58
  #
55
59
  # @param billing_model [String, nil] Body param: Billing model: profile, organization, or profile_and_organization (d
56
60
  #
57
- # @param brand [Sentdm::Models::BrandData, nil] Body param: Brand and KYC information for this profile (optional).
61
+ # @param brand [Sentdm::Models::BrandsBrandData, nil] Body param: Brand and KYC information for this profile (optional).
58
62
  #
59
63
  # @param description [String, nil] Body param: Profile description (optional)
60
64
  #
@@ -70,7 +74,7 @@ module Sentdm
70
74
  #
71
75
  # @param name [String] Body param: Profile name (required)
72
76
  #
73
- # @param payment_details [Sentdm::Models::ProfileCreateParams::PaymentDetails, nil] Body param: Payment card details for this profile (optional).
77
+ # @param payment_details [Sentdm::Models::PaymentDetails, nil] Body param: Payment card details for this profile (optional).
74
78
  #
75
79
  # @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
76
80
  #
@@ -161,11 +165,11 @@ module Sentdm
161
165
  #
162
166
  # @param allow_template_sharing [Boolean, nil] Body param: Whether templates are shared across profiles (optional)
163
167
  #
164
- # @param billing_contact [Sentdm::Models::ProfileUpdateParams::BillingContact, nil] Body param: Billing contact for this profile. Required when billing_model is "pr
168
+ # @param billing_contact [Sentdm::Models::BillingContactInfo, nil] Body param: Billing contact for this profile. Required when billing_model is "pr
165
169
  #
166
170
  # @param billing_model [String, nil] Body param: Billing model: profile, organization, or profile_and_organization (o
167
171
  #
168
- # @param brand [Sentdm::Models::BrandData, nil] Body param: Brand and KYC information for this profile (optional).
172
+ # @param brand [Sentdm::Models::BrandsBrandData, nil] Body param: Brand and KYC information for this profile (optional).
169
173
  #
170
174
  # @param description [String, nil] Body param: Profile description (optional)
171
175
  #
@@ -181,7 +185,7 @@ module Sentdm
181
185
  #
182
186
  # @param name [String, nil] Body param: Profile name (optional)
183
187
  #
184
- # @param payment_details [Sentdm::Models::ProfileUpdateParams::PaymentDetails, nil] Body param: Payment card details for this profile (optional).
188
+ # @param payment_details [Sentdm::Models::PaymentDetails, nil] Body param: Payment card details for this profile (optional).
185
189
  #
186
190
  # @param sandbox [Boolean] Body param: Sandbox flag - when true, the operation is simulated without side ef
187
191
  #
@@ -277,7 +281,7 @@ module Sentdm
277
281
  end
278
282
 
279
283
  # Some parameter documentations has been truncated, see
280
- # {Sentdm::Models::ProfileCompleteParams} for more details.
284
+ # {Sentdm::Models::ProfileCompleteSetupParams} for more details.
281
285
  #
282
286
  # Final step in profile compliance workflow. Validates all prerequisites (general
283
287
  # data, brand, campaigns), connects profile to Telnyx/WhatsApp, and sets status
@@ -298,7 +302,7 @@ module Sentdm
298
302
  # - If non-TCR with destination country (IsMain=true) → SUBMITTED
299
303
  # - Otherwise → COMPLETED
300
304
  #
301
- # @overload complete(profile_id, web_hook_url:, sandbox: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
305
+ # @overload complete_setup(profile_id, web_hook_url:, sandbox: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
302
306
  #
303
307
  # @param profile_id [String] Path param: Profile ID from route
304
308
  #
@@ -314,9 +318,9 @@ module Sentdm
314
318
  #
315
319
  # @return [Object]
316
320
  #
317
- # @see Sentdm::Models::ProfileCompleteParams
318
- def complete(profile_id, params)
319
- parsed, options = Sentdm::ProfileCompleteParams.dump_request(params)
321
+ # @see Sentdm::Models::ProfileCompleteSetupParams
322
+ def complete_setup(profile_id, params)
323
+ parsed, options = Sentdm::ProfileCompleteSetupParams.dump_request(params)
320
324
  header_params = {idempotency_key: "idempotency-key", x_profile_id: "x-profile-id"}
321
325
  @client.request(
322
326
  method: :post,
@@ -333,6 +337,7 @@ module Sentdm
333
337
  # @param client [Sentdm::Client]
334
338
  def initialize(client:)
335
339
  @client = client
340
+ @campaigns = Sentdm::Resources::Profiles::Campaigns.new(client: client)
336
341
  end
337
342
  end
338
343
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sentdm
4
- VERSION = "0.4.0"
4
+ VERSION = "0.7.0"
5
5
  end
data/lib/sentdm.rb CHANGED
@@ -52,27 +52,22 @@ require_relative "sentdm/errors"
52
52
  require_relative "sentdm/internal/transport/base_client"
53
53
  require_relative "sentdm/internal/transport/pooled_net_requester"
54
54
  require_relative "sentdm/client"
55
- require_relative "sentdm/models/brands/base_dto"
56
- require_relative "sentdm/models/mutation_request"
55
+ require_relative "sentdm/models/mutation_request_base"
56
+ require_relative "sentdm/models/base_dto"
57
57
  require_relative "sentdm/models/api_error"
58
58
  require_relative "sentdm/models/api_meta"
59
- require_relative "sentdm/models/api_response_contact"
59
+ require_relative "sentdm/models/api_response_of_contact"
60
60
  require_relative "sentdm/models/api_response_of_profile_detail"
61
61
  require_relative "sentdm/models/api_response_of_user"
62
62
  require_relative "sentdm/models/api_response_template"
63
63
  require_relative "sentdm/models/api_response_webhook"
64
- require_relative "sentdm/models/brand_data"
65
- require_relative "sentdm/models/brands/api_response_tcr_campaign_with_use_cases"
66
- require_relative "sentdm/models/brands/campaign_data"
67
- require_relative "sentdm/models/brands/messaging_use_case_us"
68
- require_relative "sentdm/models/brands/sent_dm_services_endpoints_customer_ap_iv3_contracts_requests_campaigns_campaign_use_case_data"
69
- require_relative "sentdm/models/brands/tcr_campaign_with_use_cases"
70
- require_relative "sentdm/models/brand_with_kyc"
71
- require_relative "sentdm/models/contact"
64
+ require_relative "sentdm/models/billing_contact_info"
65
+ require_relative "sentdm/models/brands_brand_data"
72
66
  require_relative "sentdm/models/contact_create_params"
73
67
  require_relative "sentdm/models/contact_delete_params"
74
68
  require_relative "sentdm/models/contact_list_params"
75
69
  require_relative "sentdm/models/contact_list_response"
70
+ require_relative "sentdm/models/contact_response"
76
71
  require_relative "sentdm/models/contact_retrieve_params"
77
72
  require_relative "sentdm/models/contact_update_params"
78
73
  require_relative "sentdm/models/destination_country"
@@ -84,15 +79,28 @@ require_relative "sentdm/models/message_retrieve_status_params"
84
79
  require_relative "sentdm/models/message_retrieve_status_response"
85
80
  require_relative "sentdm/models/message_send_params"
86
81
  require_relative "sentdm/models/message_send_response"
82
+ require_relative "sentdm/models/number_lookup_params"
83
+ require_relative "sentdm/models/number_lookup_response"
87
84
  require_relative "sentdm/models/pagination_meta"
88
- require_relative "sentdm/models/profile_complete_params"
89
- require_relative "sentdm/models/profile_complete_response"
85
+ require_relative "sentdm/models/payment_details"
86
+ require_relative "sentdm/models/profile_complete_setup_params"
87
+ require_relative "sentdm/models/profile_complete_setup_response"
90
88
  require_relative "sentdm/models/profile_create_params"
91
89
  require_relative "sentdm/models/profile_delete_params"
92
90
  require_relative "sentdm/models/profile_detail"
93
91
  require_relative "sentdm/models/profile_list_params"
94
92
  require_relative "sentdm/models/profile_list_response"
95
93
  require_relative "sentdm/models/profile_retrieve_params"
94
+ require_relative "sentdm/models/profiles/api_response_of_tcr_campaign_with_use_cases"
95
+ require_relative "sentdm/models/profiles/campaign_create_params"
96
+ require_relative "sentdm/models/profiles/campaign_data"
97
+ require_relative "sentdm/models/profiles/campaign_delete_params"
98
+ require_relative "sentdm/models/profiles/campaign_list_params"
99
+ require_relative "sentdm/models/profiles/campaign_list_response"
100
+ require_relative "sentdm/models/profiles/campaign_update_params"
101
+ 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"
96
104
  require_relative "sentdm/models/profile_settings"
97
105
  require_relative "sentdm/models/profile_update_params"
98
106
  require_relative "sentdm/models/sent_dm_services_common_contracts_poc_os_authentication_config"
@@ -101,6 +109,9 @@ require_relative "sentdm/models/sent_dm_services_common_contracts_poc_os_templat
101
109
  require_relative "sentdm/models/sent_dm_services_common_contracts_poc_os_template_button_props"
102
110
  require_relative "sentdm/models/sent_dm_services_common_contracts_poc_os_template_footer"
103
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"
104
115
  require_relative "sentdm/models/tcr_brand_relationship"
105
116
  require_relative "sentdm/models/tcr_vertical"
106
117
  require_relative "sentdm/models/template"
@@ -137,13 +148,12 @@ require_relative "sentdm/models/webhook_test_response"
137
148
  require_relative "sentdm/models/webhook_toggle_status_params"
138
149
  require_relative "sentdm/models/webhook_update_params"
139
150
  require_relative "sentdm/models"
140
- require_relative "sentdm/resources/brands"
141
- require_relative "sentdm/resources/brands/campaigns"
142
151
  require_relative "sentdm/resources/contacts"
143
- require_relative "sentdm/resources/lookup"
144
152
  require_relative "sentdm/resources/me"
145
153
  require_relative "sentdm/resources/messages"
154
+ require_relative "sentdm/resources/numbers"
146
155
  require_relative "sentdm/resources/profiles"
156
+ require_relative "sentdm/resources/profiles/campaigns"
147
157
  require_relative "sentdm/resources/templates"
148
158
  require_relative "sentdm/resources/users"
149
159
  require_relative "sentdm/resources/webhooks"
@@ -31,20 +31,18 @@ module Sentdm
31
31
  sig { returns(Sentdm::Resources::Profiles) }
32
32
  attr_reader :profiles
33
33
 
34
+ # Manage and lookup phone numbers
35
+ sig { returns(Sentdm::Resources::Numbers) }
36
+ attr_reader :numbers
37
+
34
38
  # Send and track SMS and WhatsApp messages
35
39
  sig { returns(Sentdm::Resources::Messages) }
36
40
  attr_reader :messages
37
41
 
38
- sig { returns(Sentdm::Resources::Lookup) }
39
- attr_reader :lookup
40
-
41
42
  # Create, update, and manage customer contact lists
42
43
  sig { returns(Sentdm::Resources::Contacts) }
43
44
  attr_reader :contacts
44
45
 
45
- sig { returns(Sentdm::Resources::Brands) }
46
- attr_reader :brands
47
-
48
46
  # Retrieve account details
49
47
  sig { returns(Sentdm::Resources::Me) }
50
48
  attr_reader :me
@@ -2,17 +2,17 @@
2
2
 
3
3
  module Sentdm
4
4
  module Models
5
- class APIResponseContact < Sentdm::Internal::Type::BaseModel
5
+ class APIResponseOfContact < Sentdm::Internal::Type::BaseModel
6
6
  OrHash =
7
7
  T.type_alias do
8
- T.any(Sentdm::APIResponseContact, Sentdm::Internal::AnyHash)
8
+ T.any(Sentdm::APIResponseOfContact, Sentdm::Internal::AnyHash)
9
9
  end
10
10
 
11
11
  # The response data (null if error)
12
- sig { returns(T.nilable(Sentdm::Contact)) }
12
+ sig { returns(T.nilable(Sentdm::ContactResponse)) }
13
13
  attr_reader :data
14
14
 
15
- sig { params(data: T.nilable(Sentdm::Contact::OrHash)).void }
15
+ sig { params(data: T.nilable(Sentdm::ContactResponse::OrHash)).void }
16
16
  attr_writer :data
17
17
 
18
18
  # Error details (null if successful)
@@ -39,7 +39,7 @@ module Sentdm
39
39
  # Standard API response envelope for all v3 endpoints
40
40
  sig do
41
41
  params(
42
- data: T.nilable(Sentdm::Contact::OrHash),
42
+ data: T.nilable(Sentdm::ContactResponse::OrHash),
43
43
  error: T.nilable(Sentdm::APIError::OrHash),
44
44
  meta: Sentdm::APIMeta::OrHash,
45
45
  success: T::Boolean
@@ -60,7 +60,7 @@ module Sentdm
60
60
  sig do
61
61
  override.returns(
62
62
  {
63
- data: T.nilable(Sentdm::Contact),
63
+ data: T.nilable(Sentdm::ContactResponse),
64
64
  error: T.nilable(Sentdm::APIError),
65
65
  meta: Sentdm::APIMeta,
66
66
  success: T::Boolean