ark-email 0.14.0 → 0.15.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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +3 -3
  4. data/lib/ark_email/client.rb +4 -0
  5. data/lib/ark_email/models/dns_record.rb +49 -19
  6. data/lib/ark_email/models/domain_create_response.rb +117 -25
  7. data/lib/ark_email/models/domain_list_response.rb +12 -13
  8. data/lib/ark_email/models/domain_retrieve_response.rb +117 -25
  9. data/lib/ark_email/models/domain_verify_response.rb +117 -25
  10. data/lib/ark_email/models/track_domain.rb +6 -2
  11. data/lib/ark_email/models/usage_retrieve_params.rb +14 -0
  12. data/lib/ark_email/models/usage_retrieve_response.rb +270 -0
  13. data/lib/ark_email/models/webhook_create_params.rb +0 -2
  14. data/lib/ark_email/models/webhook_create_response.rb +0 -2
  15. data/lib/ark_email/models/webhook_list_deliveries_params.rb +0 -2
  16. data/lib/ark_email/models/webhook_list_deliveries_response.rb +0 -2
  17. data/lib/ark_email/models/webhook_retrieve_delivery_response.rb +0 -2
  18. data/lib/ark_email/models/webhook_retrieve_response.rb +0 -2
  19. data/lib/ark_email/models/webhook_test_params.rb +0 -2
  20. data/lib/ark_email/models/webhook_update_response.rb +0 -2
  21. data/lib/ark_email/models.rb +2 -0
  22. data/lib/ark_email/resources/usage.rb +51 -0
  23. data/lib/ark_email/version.rb +1 -1
  24. data/lib/ark_email.rb +3 -0
  25. data/rbi/ark_email/client.rbi +3 -0
  26. data/rbi/ark_email/models/dns_record.rbi +57 -22
  27. data/rbi/ark_email/models/domain_create_response.rbi +189 -28
  28. data/rbi/ark_email/models/domain_list_response.rbi +13 -19
  29. data/rbi/ark_email/models/domain_retrieve_response.rbi +191 -28
  30. data/rbi/ark_email/models/domain_verify_response.rbi +189 -28
  31. data/rbi/ark_email/models/track_domain.rbi +4 -2
  32. data/rbi/ark_email/models/usage_retrieve_params.rbi +27 -0
  33. data/rbi/ark_email/models/usage_retrieve_response.rbi +511 -0
  34. data/rbi/ark_email/models/webhook_create_params.rbi +0 -10
  35. data/rbi/ark_email/models/webhook_create_response.rbi +0 -10
  36. data/rbi/ark_email/models/webhook_list_deliveries_params.rbi +0 -10
  37. data/rbi/ark_email/models/webhook_list_deliveries_response.rbi +0 -10
  38. data/rbi/ark_email/models/webhook_retrieve_delivery_response.rbi +0 -10
  39. data/rbi/ark_email/models/webhook_retrieve_response.rbi +0 -10
  40. data/rbi/ark_email/models/webhook_test_params.rbi +0 -10
  41. data/rbi/ark_email/models/webhook_update_response.rbi +0 -10
  42. data/rbi/ark_email/models.rbi +2 -0
  43. data/rbi/ark_email/resources/usage.rbi +40 -0
  44. data/sig/ark_email/client.rbs +2 -0
  45. data/sig/ark_email/models/dns_record.rbs +5 -0
  46. data/sig/ark_email/models/domain_create_response.rbs +27 -20
  47. data/sig/ark_email/models/domain_list_response.rbs +4 -16
  48. data/sig/ark_email/models/domain_retrieve_response.rbs +27 -20
  49. data/sig/ark_email/models/domain_verify_response.rbs +27 -20
  50. data/sig/ark_email/models/usage_retrieve_params.rbs +15 -0
  51. data/sig/ark_email/models/usage_retrieve_response.rbs +212 -0
  52. data/sig/ark_email/models/webhook_create_params.rbs +0 -4
  53. data/sig/ark_email/models/webhook_create_response.rbs +0 -4
  54. data/sig/ark_email/models/webhook_list_deliveries_params.rbs +0 -4
  55. data/sig/ark_email/models/webhook_list_deliveries_response.rbs +0 -4
  56. data/sig/ark_email/models/webhook_retrieve_delivery_response.rbs +0 -4
  57. data/sig/ark_email/models/webhook_retrieve_response.rbs +0 -4
  58. data/sig/ark_email/models/webhook_test_params.rbs +0 -4
  59. data/sig/ark_email/models/webhook_update_response.rbs +0 -4
  60. data/sig/ark_email/models.rbs +2 -0
  61. data/sig/ark_email/resources/usage.rbs +11 -0
  62. metadata +11 -2
@@ -61,47 +61,70 @@ module ArkEmail
61
61
  )
62
62
  end
63
63
 
64
- # Domain ID
65
- sig { returns(String) }
64
+ # Unique domain identifier
65
+ sig { returns(Integer) }
66
66
  attr_accessor :id
67
67
 
68
+ # Timestamp when the domain was added
68
69
  sig { returns(Time) }
69
70
  attr_accessor :created_at
70
71
 
72
+ # DNS records that must be added to your domain's DNS settings. Null if records
73
+ # are not yet generated.
74
+ #
75
+ # **Important:** The `name` field contains the relative hostname that you should
76
+ # enter in your DNS provider. Most DNS providers auto-append the zone name, so you
77
+ # only need to enter the relative part.
78
+ #
79
+ # For subdomains like `mail.example.com`, the zone is `example.com`, so:
80
+ #
81
+ # - SPF `name` would be `mail` (not `@`)
82
+ # - DKIM `name` would be `ark-xyz._domainkey.mail`
83
+ # - Return Path `name` would be `psrp.mail`
71
84
  sig do
72
- returns(ArkEmail::Models::DomainRetrieveResponse::Data::DNSRecords)
85
+ returns(
86
+ T.nilable(
87
+ ArkEmail::Models::DomainRetrieveResponse::Data::DNSRecords
88
+ )
89
+ )
73
90
  end
74
91
  attr_reader :dns_records
75
92
 
76
93
  sig do
77
94
  params(
78
95
  dns_records:
79
- ArkEmail::Models::DomainRetrieveResponse::Data::DNSRecords::OrHash
96
+ T.nilable(
97
+ ArkEmail::Models::DomainRetrieveResponse::Data::DNSRecords::OrHash
98
+ )
80
99
  ).void
81
100
  end
82
101
  attr_writer :dns_records
83
102
 
84
- # Domain name
103
+ # The domain name used for sending emails
85
104
  sig { returns(String) }
86
105
  attr_accessor :name
87
106
 
107
+ # UUID of the domain
88
108
  sig { returns(String) }
89
109
  attr_accessor :uuid
90
110
 
91
- # Whether DNS is verified
111
+ # Whether all DNS records (SPF, DKIM, Return Path) are correctly configured.
112
+ # Domain must be verified before sending emails.
92
113
  sig { returns(T::Boolean) }
93
114
  attr_accessor :verified
94
115
 
95
- # When the domain was verified (null if not verified)
116
+ # Timestamp when the domain ownership was verified, or null if not yet verified
96
117
  sig { returns(T.nilable(Time)) }
97
118
  attr_accessor :verified_at
98
119
 
99
120
  sig do
100
121
  params(
101
- id: String,
122
+ id: Integer,
102
123
  created_at: Time,
103
124
  dns_records:
104
- ArkEmail::Models::DomainRetrieveResponse::Data::DNSRecords::OrHash,
125
+ T.nilable(
126
+ ArkEmail::Models::DomainRetrieveResponse::Data::DNSRecords::OrHash
127
+ ),
105
128
  name: String,
106
129
  uuid: String,
107
130
  verified: T::Boolean,
@@ -109,16 +132,31 @@ module ArkEmail
109
132
  ).returns(T.attached_class)
110
133
  end
111
134
  def self.new(
112
- # Domain ID
135
+ # Unique domain identifier
113
136
  id:,
137
+ # Timestamp when the domain was added
114
138
  created_at:,
139
+ # DNS records that must be added to your domain's DNS settings. Null if records
140
+ # are not yet generated.
141
+ #
142
+ # **Important:** The `name` field contains the relative hostname that you should
143
+ # enter in your DNS provider. Most DNS providers auto-append the zone name, so you
144
+ # only need to enter the relative part.
145
+ #
146
+ # For subdomains like `mail.example.com`, the zone is `example.com`, so:
147
+ #
148
+ # - SPF `name` would be `mail` (not `@`)
149
+ # - DKIM `name` would be `ark-xyz._domainkey.mail`
150
+ # - Return Path `name` would be `psrp.mail`
115
151
  dns_records:,
116
- # Domain name
152
+ # The domain name used for sending emails
117
153
  name:,
154
+ # UUID of the domain
118
155
  uuid:,
119
- # Whether DNS is verified
156
+ # Whether all DNS records (SPF, DKIM, Return Path) are correctly configured.
157
+ # Domain must be verified before sending emails.
120
158
  verified:,
121
- # When the domain was verified (null if not verified)
159
+ # Timestamp when the domain ownership was verified, or null if not yet verified
122
160
  verified_at: nil
123
161
  )
124
162
  end
@@ -126,10 +164,12 @@ module ArkEmail
126
164
  sig do
127
165
  override.returns(
128
166
  {
129
- id: String,
167
+ id: Integer,
130
168
  created_at: Time,
131
169
  dns_records:
132
- ArkEmail::Models::DomainRetrieveResponse::Data::DNSRecords,
170
+ T.nilable(
171
+ ArkEmail::Models::DomainRetrieveResponse::Data::DNSRecords
172
+ ),
133
173
  name: String,
134
174
  uuid: String,
135
175
  verified: T::Boolean,
@@ -149,40 +189,163 @@ module ArkEmail
149
189
  )
150
190
  end
151
191
 
152
- sig { returns(ArkEmail::DNSRecord) }
192
+ # A DNS record that needs to be configured in your domain's DNS settings.
193
+ #
194
+ # The `name` field contains the relative hostname to enter in your DNS provider
195
+ # (which auto-appends the zone). The `fullName` field contains the complete
196
+ # fully-qualified domain name (FQDN) for reference.
197
+ #
198
+ # **Example for subdomain `mail.example.com`:**
199
+ #
200
+ # - `name`: `"mail"` (what you enter in DNS provider)
201
+ # - `fullName`: `"mail.example.com"` (the complete hostname)
202
+ #
203
+ # **Example for root domain `example.com`:**
204
+ #
205
+ # - `name`: `"@"` (DNS shorthand for apex/root)
206
+ # - `fullName`: `"example.com"`
207
+ sig { returns(T.nilable(ArkEmail::DNSRecord)) }
153
208
  attr_reader :dkim
154
209
 
155
- sig { params(dkim: ArkEmail::DNSRecord::OrHash).void }
210
+ sig { params(dkim: T.nilable(ArkEmail::DNSRecord::OrHash)).void }
156
211
  attr_writer :dkim
157
212
 
158
- sig { returns(ArkEmail::DNSRecord) }
213
+ # A DNS record that needs to be configured in your domain's DNS settings.
214
+ #
215
+ # The `name` field contains the relative hostname to enter in your DNS provider
216
+ # (which auto-appends the zone). The `fullName` field contains the complete
217
+ # fully-qualified domain name (FQDN) for reference.
218
+ #
219
+ # **Example for subdomain `mail.example.com`:**
220
+ #
221
+ # - `name`: `"mail"` (what you enter in DNS provider)
222
+ # - `fullName`: `"mail.example.com"` (the complete hostname)
223
+ #
224
+ # **Example for root domain `example.com`:**
225
+ #
226
+ # - `name`: `"@"` (DNS shorthand for apex/root)
227
+ # - `fullName`: `"example.com"`
228
+ sig { returns(T.nilable(ArkEmail::DNSRecord)) }
159
229
  attr_reader :return_path
160
230
 
161
- sig { params(return_path: ArkEmail::DNSRecord::OrHash).void }
231
+ sig do
232
+ params(return_path: T.nilable(ArkEmail::DNSRecord::OrHash)).void
233
+ end
162
234
  attr_writer :return_path
163
235
 
164
- sig { returns(ArkEmail::DNSRecord) }
236
+ # A DNS record that needs to be configured in your domain's DNS settings.
237
+ #
238
+ # The `name` field contains the relative hostname to enter in your DNS provider
239
+ # (which auto-appends the zone). The `fullName` field contains the complete
240
+ # fully-qualified domain name (FQDN) for reference.
241
+ #
242
+ # **Example for subdomain `mail.example.com`:**
243
+ #
244
+ # - `name`: `"mail"` (what you enter in DNS provider)
245
+ # - `fullName`: `"mail.example.com"` (the complete hostname)
246
+ #
247
+ # **Example for root domain `example.com`:**
248
+ #
249
+ # - `name`: `"@"` (DNS shorthand for apex/root)
250
+ # - `fullName`: `"example.com"`
251
+ sig { returns(T.nilable(ArkEmail::DNSRecord)) }
165
252
  attr_reader :spf
166
253
 
167
- sig { params(spf: ArkEmail::DNSRecord::OrHash).void }
254
+ sig { params(spf: T.nilable(ArkEmail::DNSRecord::OrHash)).void }
168
255
  attr_writer :spf
169
256
 
257
+ # The DNS zone (registrable domain) where records should be added. This is the
258
+ # root domain that your DNS provider manages. For `mail.example.com`, the zone is
259
+ # `example.com`. For `example.co.uk`, the zone is `example.co.uk`.
260
+ sig { returns(T.nilable(String)) }
261
+ attr_reader :zone
262
+
263
+ sig { params(zone: String).void }
264
+ attr_writer :zone
265
+
266
+ # DNS records that must be added to your domain's DNS settings. Null if records
267
+ # are not yet generated.
268
+ #
269
+ # **Important:** The `name` field contains the relative hostname that you should
270
+ # enter in your DNS provider. Most DNS providers auto-append the zone name, so you
271
+ # only need to enter the relative part.
272
+ #
273
+ # For subdomains like `mail.example.com`, the zone is `example.com`, so:
274
+ #
275
+ # - SPF `name` would be `mail` (not `@`)
276
+ # - DKIM `name` would be `ark-xyz._domainkey.mail`
277
+ # - Return Path `name` would be `psrp.mail`
170
278
  sig do
171
279
  params(
172
- dkim: ArkEmail::DNSRecord::OrHash,
173
- return_path: ArkEmail::DNSRecord::OrHash,
174
- spf: ArkEmail::DNSRecord::OrHash
280
+ dkim: T.nilable(ArkEmail::DNSRecord::OrHash),
281
+ return_path: T.nilable(ArkEmail::DNSRecord::OrHash),
282
+ spf: T.nilable(ArkEmail::DNSRecord::OrHash),
283
+ zone: String
175
284
  ).returns(T.attached_class)
176
285
  end
177
- def self.new(dkim:, return_path:, spf:)
286
+ def self.new(
287
+ # A DNS record that needs to be configured in your domain's DNS settings.
288
+ #
289
+ # The `name` field contains the relative hostname to enter in your DNS provider
290
+ # (which auto-appends the zone). The `fullName` field contains the complete
291
+ # fully-qualified domain name (FQDN) for reference.
292
+ #
293
+ # **Example for subdomain `mail.example.com`:**
294
+ #
295
+ # - `name`: `"mail"` (what you enter in DNS provider)
296
+ # - `fullName`: `"mail.example.com"` (the complete hostname)
297
+ #
298
+ # **Example for root domain `example.com`:**
299
+ #
300
+ # - `name`: `"@"` (DNS shorthand for apex/root)
301
+ # - `fullName`: `"example.com"`
302
+ dkim: nil,
303
+ # A DNS record that needs to be configured in your domain's DNS settings.
304
+ #
305
+ # The `name` field contains the relative hostname to enter in your DNS provider
306
+ # (which auto-appends the zone). The `fullName` field contains the complete
307
+ # fully-qualified domain name (FQDN) for reference.
308
+ #
309
+ # **Example for subdomain `mail.example.com`:**
310
+ #
311
+ # - `name`: `"mail"` (what you enter in DNS provider)
312
+ # - `fullName`: `"mail.example.com"` (the complete hostname)
313
+ #
314
+ # **Example for root domain `example.com`:**
315
+ #
316
+ # - `name`: `"@"` (DNS shorthand for apex/root)
317
+ # - `fullName`: `"example.com"`
318
+ return_path: nil,
319
+ # A DNS record that needs to be configured in your domain's DNS settings.
320
+ #
321
+ # The `name` field contains the relative hostname to enter in your DNS provider
322
+ # (which auto-appends the zone). The `fullName` field contains the complete
323
+ # fully-qualified domain name (FQDN) for reference.
324
+ #
325
+ # **Example for subdomain `mail.example.com`:**
326
+ #
327
+ # - `name`: `"mail"` (what you enter in DNS provider)
328
+ # - `fullName`: `"mail.example.com"` (the complete hostname)
329
+ #
330
+ # **Example for root domain `example.com`:**
331
+ #
332
+ # - `name`: `"@"` (DNS shorthand for apex/root)
333
+ # - `fullName`: `"example.com"`
334
+ spf: nil,
335
+ # The DNS zone (registrable domain) where records should be added. This is the
336
+ # root domain that your DNS provider manages. For `mail.example.com`, the zone is
337
+ # `example.com`. For `example.co.uk`, the zone is `example.co.uk`.
338
+ zone: nil
339
+ )
178
340
  end
179
341
 
180
342
  sig do
181
343
  override.returns(
182
344
  {
183
- dkim: ArkEmail::DNSRecord,
184
- return_path: ArkEmail::DNSRecord,
185
- spf: ArkEmail::DNSRecord
345
+ dkim: T.nilable(ArkEmail::DNSRecord),
346
+ return_path: T.nilable(ArkEmail::DNSRecord),
347
+ spf: T.nilable(ArkEmail::DNSRecord),
348
+ zone: String
186
349
  }
187
350
  )
188
351
  end
@@ -59,47 +59,68 @@ module ArkEmail
59
59
  )
60
60
  end
61
61
 
62
- # Domain ID
63
- sig { returns(String) }
62
+ # Unique domain identifier
63
+ sig { returns(Integer) }
64
64
  attr_accessor :id
65
65
 
66
+ # Timestamp when the domain was added
66
67
  sig { returns(Time) }
67
68
  attr_accessor :created_at
68
69
 
70
+ # DNS records that must be added to your domain's DNS settings. Null if records
71
+ # are not yet generated.
72
+ #
73
+ # **Important:** The `name` field contains the relative hostname that you should
74
+ # enter in your DNS provider. Most DNS providers auto-append the zone name, so you
75
+ # only need to enter the relative part.
76
+ #
77
+ # For subdomains like `mail.example.com`, the zone is `example.com`, so:
78
+ #
79
+ # - SPF `name` would be `mail` (not `@`)
80
+ # - DKIM `name` would be `ark-xyz._domainkey.mail`
81
+ # - Return Path `name` would be `psrp.mail`
69
82
  sig do
70
- returns(ArkEmail::Models::DomainVerifyResponse::Data::DNSRecords)
83
+ returns(
84
+ T.nilable(ArkEmail::Models::DomainVerifyResponse::Data::DNSRecords)
85
+ )
71
86
  end
72
87
  attr_reader :dns_records
73
88
 
74
89
  sig do
75
90
  params(
76
91
  dns_records:
77
- ArkEmail::Models::DomainVerifyResponse::Data::DNSRecords::OrHash
92
+ T.nilable(
93
+ ArkEmail::Models::DomainVerifyResponse::Data::DNSRecords::OrHash
94
+ )
78
95
  ).void
79
96
  end
80
97
  attr_writer :dns_records
81
98
 
82
- # Domain name
99
+ # The domain name used for sending emails
83
100
  sig { returns(String) }
84
101
  attr_accessor :name
85
102
 
103
+ # UUID of the domain
86
104
  sig { returns(String) }
87
105
  attr_accessor :uuid
88
106
 
89
- # Whether DNS is verified
107
+ # Whether all DNS records (SPF, DKIM, Return Path) are correctly configured.
108
+ # Domain must be verified before sending emails.
90
109
  sig { returns(T::Boolean) }
91
110
  attr_accessor :verified
92
111
 
93
- # When the domain was verified (null if not verified)
112
+ # Timestamp when the domain ownership was verified, or null if not yet verified
94
113
  sig { returns(T.nilable(Time)) }
95
114
  attr_accessor :verified_at
96
115
 
97
116
  sig do
98
117
  params(
99
- id: String,
118
+ id: Integer,
100
119
  created_at: Time,
101
120
  dns_records:
102
- ArkEmail::Models::DomainVerifyResponse::Data::DNSRecords::OrHash,
121
+ T.nilable(
122
+ ArkEmail::Models::DomainVerifyResponse::Data::DNSRecords::OrHash
123
+ ),
103
124
  name: String,
104
125
  uuid: String,
105
126
  verified: T::Boolean,
@@ -107,16 +128,31 @@ module ArkEmail
107
128
  ).returns(T.attached_class)
108
129
  end
109
130
  def self.new(
110
- # Domain ID
131
+ # Unique domain identifier
111
132
  id:,
133
+ # Timestamp when the domain was added
112
134
  created_at:,
135
+ # DNS records that must be added to your domain's DNS settings. Null if records
136
+ # are not yet generated.
137
+ #
138
+ # **Important:** The `name` field contains the relative hostname that you should
139
+ # enter in your DNS provider. Most DNS providers auto-append the zone name, so you
140
+ # only need to enter the relative part.
141
+ #
142
+ # For subdomains like `mail.example.com`, the zone is `example.com`, so:
143
+ #
144
+ # - SPF `name` would be `mail` (not `@`)
145
+ # - DKIM `name` would be `ark-xyz._domainkey.mail`
146
+ # - Return Path `name` would be `psrp.mail`
113
147
  dns_records:,
114
- # Domain name
148
+ # The domain name used for sending emails
115
149
  name:,
150
+ # UUID of the domain
116
151
  uuid:,
117
- # Whether DNS is verified
152
+ # Whether all DNS records (SPF, DKIM, Return Path) are correctly configured.
153
+ # Domain must be verified before sending emails.
118
154
  verified:,
119
- # When the domain was verified (null if not verified)
155
+ # Timestamp when the domain ownership was verified, or null if not yet verified
120
156
  verified_at: nil
121
157
  )
122
158
  end
@@ -124,10 +160,12 @@ module ArkEmail
124
160
  sig do
125
161
  override.returns(
126
162
  {
127
- id: String,
163
+ id: Integer,
128
164
  created_at: Time,
129
165
  dns_records:
130
- ArkEmail::Models::DomainVerifyResponse::Data::DNSRecords,
166
+ T.nilable(
167
+ ArkEmail::Models::DomainVerifyResponse::Data::DNSRecords
168
+ ),
131
169
  name: String,
132
170
  uuid: String,
133
171
  verified: T::Boolean,
@@ -147,40 +185,163 @@ module ArkEmail
147
185
  )
148
186
  end
149
187
 
150
- sig { returns(ArkEmail::DNSRecord) }
188
+ # A DNS record that needs to be configured in your domain's DNS settings.
189
+ #
190
+ # The `name` field contains the relative hostname to enter in your DNS provider
191
+ # (which auto-appends the zone). The `fullName` field contains the complete
192
+ # fully-qualified domain name (FQDN) for reference.
193
+ #
194
+ # **Example for subdomain `mail.example.com`:**
195
+ #
196
+ # - `name`: `"mail"` (what you enter in DNS provider)
197
+ # - `fullName`: `"mail.example.com"` (the complete hostname)
198
+ #
199
+ # **Example for root domain `example.com`:**
200
+ #
201
+ # - `name`: `"@"` (DNS shorthand for apex/root)
202
+ # - `fullName`: `"example.com"`
203
+ sig { returns(T.nilable(ArkEmail::DNSRecord)) }
151
204
  attr_reader :dkim
152
205
 
153
- sig { params(dkim: ArkEmail::DNSRecord::OrHash).void }
206
+ sig { params(dkim: T.nilable(ArkEmail::DNSRecord::OrHash)).void }
154
207
  attr_writer :dkim
155
208
 
156
- sig { returns(ArkEmail::DNSRecord) }
209
+ # A DNS record that needs to be configured in your domain's DNS settings.
210
+ #
211
+ # The `name` field contains the relative hostname to enter in your DNS provider
212
+ # (which auto-appends the zone). The `fullName` field contains the complete
213
+ # fully-qualified domain name (FQDN) for reference.
214
+ #
215
+ # **Example for subdomain `mail.example.com`:**
216
+ #
217
+ # - `name`: `"mail"` (what you enter in DNS provider)
218
+ # - `fullName`: `"mail.example.com"` (the complete hostname)
219
+ #
220
+ # **Example for root domain `example.com`:**
221
+ #
222
+ # - `name`: `"@"` (DNS shorthand for apex/root)
223
+ # - `fullName`: `"example.com"`
224
+ sig { returns(T.nilable(ArkEmail::DNSRecord)) }
157
225
  attr_reader :return_path
158
226
 
159
- sig { params(return_path: ArkEmail::DNSRecord::OrHash).void }
227
+ sig do
228
+ params(return_path: T.nilable(ArkEmail::DNSRecord::OrHash)).void
229
+ end
160
230
  attr_writer :return_path
161
231
 
162
- sig { returns(ArkEmail::DNSRecord) }
232
+ # A DNS record that needs to be configured in your domain's DNS settings.
233
+ #
234
+ # The `name` field contains the relative hostname to enter in your DNS provider
235
+ # (which auto-appends the zone). The `fullName` field contains the complete
236
+ # fully-qualified domain name (FQDN) for reference.
237
+ #
238
+ # **Example for subdomain `mail.example.com`:**
239
+ #
240
+ # - `name`: `"mail"` (what you enter in DNS provider)
241
+ # - `fullName`: `"mail.example.com"` (the complete hostname)
242
+ #
243
+ # **Example for root domain `example.com`:**
244
+ #
245
+ # - `name`: `"@"` (DNS shorthand for apex/root)
246
+ # - `fullName`: `"example.com"`
247
+ sig { returns(T.nilable(ArkEmail::DNSRecord)) }
163
248
  attr_reader :spf
164
249
 
165
- sig { params(spf: ArkEmail::DNSRecord::OrHash).void }
250
+ sig { params(spf: T.nilable(ArkEmail::DNSRecord::OrHash)).void }
166
251
  attr_writer :spf
167
252
 
253
+ # The DNS zone (registrable domain) where records should be added. This is the
254
+ # root domain that your DNS provider manages. For `mail.example.com`, the zone is
255
+ # `example.com`. For `example.co.uk`, the zone is `example.co.uk`.
256
+ sig { returns(T.nilable(String)) }
257
+ attr_reader :zone
258
+
259
+ sig { params(zone: String).void }
260
+ attr_writer :zone
261
+
262
+ # DNS records that must be added to your domain's DNS settings. Null if records
263
+ # are not yet generated.
264
+ #
265
+ # **Important:** The `name` field contains the relative hostname that you should
266
+ # enter in your DNS provider. Most DNS providers auto-append the zone name, so you
267
+ # only need to enter the relative part.
268
+ #
269
+ # For subdomains like `mail.example.com`, the zone is `example.com`, so:
270
+ #
271
+ # - SPF `name` would be `mail` (not `@`)
272
+ # - DKIM `name` would be `ark-xyz._domainkey.mail`
273
+ # - Return Path `name` would be `psrp.mail`
168
274
  sig do
169
275
  params(
170
- dkim: ArkEmail::DNSRecord::OrHash,
171
- return_path: ArkEmail::DNSRecord::OrHash,
172
- spf: ArkEmail::DNSRecord::OrHash
276
+ dkim: T.nilable(ArkEmail::DNSRecord::OrHash),
277
+ return_path: T.nilable(ArkEmail::DNSRecord::OrHash),
278
+ spf: T.nilable(ArkEmail::DNSRecord::OrHash),
279
+ zone: String
173
280
  ).returns(T.attached_class)
174
281
  end
175
- def self.new(dkim:, return_path:, spf:)
282
+ def self.new(
283
+ # A DNS record that needs to be configured in your domain's DNS settings.
284
+ #
285
+ # The `name` field contains the relative hostname to enter in your DNS provider
286
+ # (which auto-appends the zone). The `fullName` field contains the complete
287
+ # fully-qualified domain name (FQDN) for reference.
288
+ #
289
+ # **Example for subdomain `mail.example.com`:**
290
+ #
291
+ # - `name`: `"mail"` (what you enter in DNS provider)
292
+ # - `fullName`: `"mail.example.com"` (the complete hostname)
293
+ #
294
+ # **Example for root domain `example.com`:**
295
+ #
296
+ # - `name`: `"@"` (DNS shorthand for apex/root)
297
+ # - `fullName`: `"example.com"`
298
+ dkim: nil,
299
+ # A DNS record that needs to be configured in your domain's DNS settings.
300
+ #
301
+ # The `name` field contains the relative hostname to enter in your DNS provider
302
+ # (which auto-appends the zone). The `fullName` field contains the complete
303
+ # fully-qualified domain name (FQDN) for reference.
304
+ #
305
+ # **Example for subdomain `mail.example.com`:**
306
+ #
307
+ # - `name`: `"mail"` (what you enter in DNS provider)
308
+ # - `fullName`: `"mail.example.com"` (the complete hostname)
309
+ #
310
+ # **Example for root domain `example.com`:**
311
+ #
312
+ # - `name`: `"@"` (DNS shorthand for apex/root)
313
+ # - `fullName`: `"example.com"`
314
+ return_path: nil,
315
+ # A DNS record that needs to be configured in your domain's DNS settings.
316
+ #
317
+ # The `name` field contains the relative hostname to enter in your DNS provider
318
+ # (which auto-appends the zone). The `fullName` field contains the complete
319
+ # fully-qualified domain name (FQDN) for reference.
320
+ #
321
+ # **Example for subdomain `mail.example.com`:**
322
+ #
323
+ # - `name`: `"mail"` (what you enter in DNS provider)
324
+ # - `fullName`: `"mail.example.com"` (the complete hostname)
325
+ #
326
+ # **Example for root domain `example.com`:**
327
+ #
328
+ # - `name`: `"@"` (DNS shorthand for apex/root)
329
+ # - `fullName`: `"example.com"`
330
+ spf: nil,
331
+ # The DNS zone (registrable domain) where records should be added. This is the
332
+ # root domain that your DNS provider manages. For `mail.example.com`, the zone is
333
+ # `example.com`. For `example.co.uk`, the zone is `example.co.uk`.
334
+ zone: nil
335
+ )
176
336
  end
177
337
 
178
338
  sig do
179
339
  override.returns(
180
340
  {
181
- dkim: ArkEmail::DNSRecord,
182
- return_path: ArkEmail::DNSRecord,
183
- spf: ArkEmail::DNSRecord
341
+ dkim: T.nilable(ArkEmail::DNSRecord),
342
+ return_path: T.nilable(ArkEmail::DNSRecord),
343
+ spf: T.nilable(ArkEmail::DNSRecord),
344
+ zone: String
184
345
  }
185
346
  )
186
347
  end
@@ -16,7 +16,8 @@ module ArkEmail
16
16
  sig { returns(Time) }
17
17
  attr_accessor :created_at
18
18
 
19
- # Whether DNS is correctly configured
19
+ # Whether the tracking CNAME record is correctly configured. Must be true to use
20
+ # tracking features.
20
21
  sig { returns(T::Boolean) }
21
22
  attr_accessor :dns_ok
22
23
 
@@ -99,7 +100,8 @@ module ArkEmail
99
100
  id:,
100
101
  # When the track domain was created
101
102
  created_at:,
102
- # Whether DNS is correctly configured
103
+ # Whether the tracking CNAME record is correctly configured. Must be true to use
104
+ # tracking features.
103
105
  dns_ok:,
104
106
  # ID of the parent sending domain
105
107
  domain_id:,
@@ -0,0 +1,27 @@
1
+ # typed: strong
2
+
3
+ module ArkEmail
4
+ module Models
5
+ class UsageRetrieveParams < ArkEmail::Internal::Type::BaseModel
6
+ extend ArkEmail::Internal::Type::RequestParameters::Converter
7
+ include ArkEmail::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(ArkEmail::UsageRetrieveParams, ArkEmail::Internal::AnyHash)
12
+ end
13
+
14
+ sig do
15
+ params(request_options: ArkEmail::RequestOptions::OrHash).returns(
16
+ T.attached_class
17
+ )
18
+ end
19
+ def self.new(request_options: {})
20
+ end
21
+
22
+ sig { override.returns({ request_options: ArkEmail::RequestOptions }) }
23
+ def to_hash
24
+ end
25
+ end
26
+ end
27
+ end