ark-email 0.13.0 → 0.14.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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +1 -1
  4. data/lib/ark_email/client.rb +4 -0
  5. data/lib/ark_email/models/email_retrieve_params.rb +4 -1
  6. data/lib/ark_email/models/email_retrieve_response.rb +177 -1
  7. data/lib/ark_email/models/log_entry.rb +298 -0
  8. data/lib/ark_email/models/log_entry_detail.rb +102 -0
  9. data/lib/ark_email/models/log_list_params.rb +106 -0
  10. data/lib/ark_email/models/log_retrieve_params.rb +14 -0
  11. data/lib/ark_email/models/log_retrieve_response.rb +33 -0
  12. data/lib/ark_email/models.rb +8 -0
  13. data/lib/ark_email/resources/logs.rb +120 -0
  14. data/lib/ark_email/version.rb +1 -1
  15. data/lib/ark_email.rb +6 -0
  16. data/rbi/ark_email/client.rbi +3 -0
  17. data/rbi/ark_email/models/email_retrieve_params.rbi +8 -2
  18. data/rbi/ark_email/models/email_retrieve_response.rbi +379 -0
  19. data/rbi/ark_email/models/log_entry.rbi +431 -0
  20. data/rbi/ark_email/models/log_entry_detail.rbi +192 -0
  21. data/rbi/ark_email/models/log_list_params.rbi +163 -0
  22. data/rbi/ark_email/models/log_retrieve_params.rbi +27 -0
  23. data/rbi/ark_email/models/log_retrieve_response.rbi +59 -0
  24. data/rbi/ark_email/models.rbi +8 -0
  25. data/rbi/ark_email/resources/emails.rbi +4 -1
  26. data/rbi/ark_email/resources/logs.rbi +104 -0
  27. data/sig/ark_email/client.rbs +2 -0
  28. data/sig/ark_email/models/email_retrieve_response.rbs +179 -0
  29. data/sig/ark_email/models/log_entry.rbs +209 -0
  30. data/sig/ark_email/models/log_entry_detail.rbs +97 -0
  31. data/sig/ark_email/models/log_list_params.rbs +97 -0
  32. data/sig/ark_email/models/log_retrieve_params.rbs +15 -0
  33. data/sig/ark_email/models/log_retrieve_response.rbs +26 -0
  34. data/sig/ark_email/models.rbs +8 -0
  35. data/sig/ark_email/resources/logs.rbs +25 -0
  36. metadata +20 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d3a8978fdd41f199bc7e58a28af1391a16974818d5c90d9df9f5813a71791d4
4
- data.tar.gz: a6b629b835da4d3c4d22f0f8c24815b4c66fff403fa277c75b37ad3b96a0055b
3
+ metadata.gz: 8ac63cc3ace8940ad2ecb1f1d70c585a7a18c45210c94df63bbb6b430c3a3b99
4
+ data.tar.gz: a6c0ec440d80966702b9e0603b5c5831261b1d0fcb95ea819648be26621aa564
5
5
  SHA512:
6
- metadata.gz: '015863b0e54d3d1d11984029639548ccfb21338f48272c326eab7c423e863a29fd52f13ed019ca7eca4d459f8f96f71bcb16d30a226dd7d8bebe0279fe3dda02'
7
- data.tar.gz: 5ca9ed7396673028c3bbf88e82686a397c4f05809538961c47c1c6ba8b1d23e9b5705f8ff8238031c003ed4fcc1dafa28917f9bb61053fd76559bf5608b0450c
6
+ metadata.gz: 461156e2cf732613233c7b14eac670447d14515584bfdd1184949109cddcef392565907d1242e5c0e12def831a4eb967ca3c4f533480f9f296c67c9097bd1ab4
7
+ data.tar.gz: 00333d40915c51936ecddfd10d2d365eda6675a4f7d3aa480720daeec944f8e05c6e6020f4e569d6033e7df5c4f3c2784eb6a39bee2e7a202079bc53f146b54d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.14.0 (2026-01-25)
4
+
5
+ Full Changelog: [v0.13.0...v0.14.0](https://github.com/ArkHQ-io/ark-ruby/compare/v0.13.0...v0.14.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** manual updates ([6dca604](https://github.com/ArkHQ-io/ark-ruby/commit/6dca6047d8ad0da294e0da824a5495d606483c88))
10
+ * **api:** update email details to include attachments ([a74ec7c](https://github.com/ArkHQ-io/ark-ruby/commit/a74ec7c9330db27a2a2fc35e4364f70544ba8b43))
11
+
3
12
  ## 0.13.0 (2026-01-23)
4
13
 
5
14
  Full Changelog: [v0.12.0...v0.13.0](https://github.com/ArkHQ-io/ark-ruby/compare/v0.12.0...v0.13.0)
data/README.md CHANGED
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
26
26
  <!-- x-release-please-start-version -->
27
27
 
28
28
  ```ruby
29
- gem "ark-email", "~> 0.13.0"
29
+ gem "ark-email", "~> 0.14.0"
30
30
  ```
31
31
 
32
32
  <!-- x-release-please-end -->
@@ -39,6 +39,9 @@ module ArkEmail
39
39
  # @return [ArkEmail::Resources::Tracking]
40
40
  attr_reader :tracking
41
41
 
42
+ # @return [ArkEmail::Resources::Logs]
43
+ attr_reader :logs
44
+
42
45
  # @api private
43
46
  #
44
47
  # @return [Hash{String=>String}]
@@ -97,6 +100,7 @@ module ArkEmail
97
100
  @suppressions = ArkEmail::Resources::Suppressions.new(client: self)
98
101
  @webhooks = ArkEmail::Resources::Webhooks.new(client: self)
99
102
  @tracking = ArkEmail::Resources::Tracking.new(client: self)
103
+ @logs = ArkEmail::Resources::Logs.new(client: self)
100
104
  end
101
105
  end
102
106
  end
@@ -10,10 +10,13 @@ module ArkEmail
10
10
  # @!attribute expand
11
11
  # Comma-separated list of fields to include:
12
12
  #
13
+ # - `full` - Include all expanded fields in a single request
13
14
  # - `content` - HTML and plain text body
14
15
  # - `headers` - Email headers
15
16
  # - `deliveries` - Delivery attempt history
16
- # - `activity` - Opens and clicks
17
+ # - `activity` - Opens and clicks tracking data
18
+ # - `attachments` - File attachments with content (base64 encoded)
19
+ # - `raw` - Complete raw MIME message (base64 encoded)
17
20
  #
18
21
  # @return [String, nil]
19
22
  optional :expand, String
@@ -89,6 +89,19 @@ module ArkEmail
89
89
  # @return [String]
90
90
  required :to, String
91
91
 
92
+ # @!attribute activity
93
+ # Opens and clicks tracking data (included if expand=activity)
94
+ #
95
+ # @return [ArkEmail::Models::EmailRetrieveResponse::Data::Activity, nil]
96
+ optional :activity, -> { ArkEmail::Models::EmailRetrieveResponse::Data::Activity }
97
+
98
+ # @!attribute attachments
99
+ # File attachments (included if expand=attachments)
100
+ #
101
+ # @return [Array<ArkEmail::Models::EmailRetrieveResponse::Data::Attachment>, nil]
102
+ optional :attachments,
103
+ -> { ArkEmail::Internal::Type::ArrayOf[ArkEmail::Models::EmailRetrieveResponse::Data::Attachment] }
104
+
92
105
  # @!attribute deliveries
93
106
  # Delivery attempt history (included if expand=deliveries)
94
107
  #
@@ -120,6 +133,13 @@ module ArkEmail
120
133
  # @return [String, nil]
121
134
  optional :plain_body, String, api_name: :plainBody
122
135
 
136
+ # @!attribute raw_message
137
+ # Complete raw MIME message, base64 encoded (included if expand=raw). Decode this
138
+ # to get the original RFC 2822 formatted email.
139
+ #
140
+ # @return [String, nil]
141
+ optional :raw_message, String, api_name: :rawMessage
142
+
123
143
  # @!attribute spam
124
144
  # Whether the message was flagged as spam
125
145
  #
@@ -138,7 +158,7 @@ module ArkEmail
138
158
  # @return [String, nil]
139
159
  optional :tag, String
140
160
 
141
- # @!method initialize(id:, token:, from:, scope:, status:, subject:, timestamp:, timestamp_iso:, to:, deliveries: nil, headers: nil, html_body: nil, message_id: nil, plain_body: nil, spam: nil, spam_score: nil, tag: nil)
161
+ # @!method initialize(id:, token:, from:, scope:, status:, subject:, timestamp:, timestamp_iso:, to:, activity: nil, attachments: nil, deliveries: nil, headers: nil, html_body: nil, message_id: nil, plain_body: nil, raw_message: nil, spam: nil, spam_score: nil, tag: nil)
142
162
  # Some parameter documentations has been truncated, see
143
163
  # {ArkEmail::Models::EmailRetrieveResponse::Data} for more details.
144
164
  #
@@ -160,6 +180,10 @@ module ArkEmail
160
180
  #
161
181
  # @param to [String] Recipient address
162
182
  #
183
+ # @param activity [ArkEmail::Models::EmailRetrieveResponse::Data::Activity] Opens and clicks tracking data (included if expand=activity)
184
+ #
185
+ # @param attachments [Array<ArkEmail::Models::EmailRetrieveResponse::Data::Attachment>] File attachments (included if expand=attachments)
186
+ #
163
187
  # @param deliveries [Array<ArkEmail::Models::EmailRetrieveResponse::Data::Delivery>] Delivery attempt history (included if expand=deliveries)
164
188
  #
165
189
  # @param headers [Hash{Symbol=>String}] Email headers (included if expand=headers)
@@ -170,6 +194,8 @@ module ArkEmail
170
194
  #
171
195
  # @param plain_body [String] Plain text body (included if expand=content)
172
196
  #
197
+ # @param raw_message [String] Complete raw MIME message, base64 encoded (included if expand=raw).
198
+ #
173
199
  # @param spam [Boolean] Whether the message was flagged as spam
174
200
  #
175
201
  # @param spam_score [Float] Spam score (if applicable)
@@ -213,6 +239,156 @@ module ArkEmail
213
239
  # @return [Array<Symbol>]
214
240
  end
215
241
 
242
+ # @see ArkEmail::Models::EmailRetrieveResponse::Data#activity
243
+ class Activity < ArkEmail::Internal::Type::BaseModel
244
+ # @!attribute clicks
245
+ # List of link click events
246
+ #
247
+ # @return [Array<ArkEmail::Models::EmailRetrieveResponse::Data::Activity::Click>, nil]
248
+ optional :clicks,
249
+ -> { ArkEmail::Internal::Type::ArrayOf[ArkEmail::Models::EmailRetrieveResponse::Data::Activity::Click] }
250
+
251
+ # @!attribute opens
252
+ # List of email open events
253
+ #
254
+ # @return [Array<ArkEmail::Models::EmailRetrieveResponse::Data::Activity::Open>, nil]
255
+ optional :opens,
256
+ -> { ArkEmail::Internal::Type::ArrayOf[ArkEmail::Models::EmailRetrieveResponse::Data::Activity::Open] }
257
+
258
+ # @!method initialize(clicks: nil, opens: nil)
259
+ # Opens and clicks tracking data (included if expand=activity)
260
+ #
261
+ # @param clicks [Array<ArkEmail::Models::EmailRetrieveResponse::Data::Activity::Click>] List of link click events
262
+ #
263
+ # @param opens [Array<ArkEmail::Models::EmailRetrieveResponse::Data::Activity::Open>] List of email open events
264
+
265
+ class Click < ArkEmail::Internal::Type::BaseModel
266
+ # @!attribute ip_address
267
+ # IP address of the clicker
268
+ #
269
+ # @return [String, nil]
270
+ optional :ip_address, String, api_name: :ipAddress
271
+
272
+ # @!attribute timestamp
273
+ # Unix timestamp of the click event
274
+ #
275
+ # @return [Float, nil]
276
+ optional :timestamp, Float
277
+
278
+ # @!attribute timestamp_iso
279
+ # ISO 8601 timestamp of the click event
280
+ #
281
+ # @return [Time, nil]
282
+ optional :timestamp_iso, Time, api_name: :timestampIso
283
+
284
+ # @!attribute url
285
+ # URL that was clicked
286
+ #
287
+ # @return [String, nil]
288
+ optional :url, String
289
+
290
+ # @!attribute user_agent
291
+ # User agent of the email client
292
+ #
293
+ # @return [String, nil]
294
+ optional :user_agent, String, api_name: :userAgent
295
+
296
+ # @!method initialize(ip_address: nil, timestamp: nil, timestamp_iso: nil, url: nil, user_agent: nil)
297
+ # @param ip_address [String] IP address of the clicker
298
+ #
299
+ # @param timestamp [Float] Unix timestamp of the click event
300
+ #
301
+ # @param timestamp_iso [Time] ISO 8601 timestamp of the click event
302
+ #
303
+ # @param url [String] URL that was clicked
304
+ #
305
+ # @param user_agent [String] User agent of the email client
306
+ end
307
+
308
+ class Open < ArkEmail::Internal::Type::BaseModel
309
+ # @!attribute ip_address
310
+ # IP address of the opener
311
+ #
312
+ # @return [String, nil]
313
+ optional :ip_address, String, api_name: :ipAddress
314
+
315
+ # @!attribute timestamp
316
+ # Unix timestamp of the open event
317
+ #
318
+ # @return [Float, nil]
319
+ optional :timestamp, Float
320
+
321
+ # @!attribute timestamp_iso
322
+ # ISO 8601 timestamp of the open event
323
+ #
324
+ # @return [Time, nil]
325
+ optional :timestamp_iso, Time, api_name: :timestampIso
326
+
327
+ # @!attribute user_agent
328
+ # User agent of the email client
329
+ #
330
+ # @return [String, nil]
331
+ optional :user_agent, String, api_name: :userAgent
332
+
333
+ # @!method initialize(ip_address: nil, timestamp: nil, timestamp_iso: nil, user_agent: nil)
334
+ # @param ip_address [String] IP address of the opener
335
+ #
336
+ # @param timestamp [Float] Unix timestamp of the open event
337
+ #
338
+ # @param timestamp_iso [Time] ISO 8601 timestamp of the open event
339
+ #
340
+ # @param user_agent [String] User agent of the email client
341
+ end
342
+ end
343
+
344
+ class Attachment < ArkEmail::Internal::Type::BaseModel
345
+ # @!attribute content_type
346
+ # MIME type of the attachment
347
+ #
348
+ # @return [String]
349
+ required :content_type, String, api_name: :contentType
350
+
351
+ # @!attribute data
352
+ # Base64 encoded attachment content. Decode this to get the raw file bytes.
353
+ #
354
+ # @return [String]
355
+ required :data, String
356
+
357
+ # @!attribute filename
358
+ # Original filename of the attachment
359
+ #
360
+ # @return [String]
361
+ required :filename, String
362
+
363
+ # @!attribute hash_
364
+ # SHA256 hash of the attachment content for verification
365
+ #
366
+ # @return [String]
367
+ required :hash_, String, api_name: :hash
368
+
369
+ # @!attribute size
370
+ # Size of the attachment in bytes
371
+ #
372
+ # @return [Integer]
373
+ required :size, Integer
374
+
375
+ # @!method initialize(content_type:, data:, filename:, hash_:, size:)
376
+ # Some parameter documentations has been truncated, see
377
+ # {ArkEmail::Models::EmailRetrieveResponse::Data::Attachment} for more details.
378
+ #
379
+ # An email attachment retrieved from a sent message
380
+ #
381
+ # @param content_type [String] MIME type of the attachment
382
+ #
383
+ # @param data [String] Base64 encoded attachment content. Decode this to get the raw file bytes.
384
+ #
385
+ # @param filename [String] Original filename of the attachment
386
+ #
387
+ # @param hash_ [String] SHA256 hash of the attachment content for verification
388
+ #
389
+ # @param size [Integer] Size of the attachment in bytes
390
+ end
391
+
216
392
  class Delivery < ArkEmail::Internal::Type::BaseModel
217
393
  # @!attribute id
218
394
  # Delivery attempt ID
@@ -0,0 +1,298 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ArkEmail
4
+ module Models
5
+ # @see ArkEmail::Resources::Logs#list
6
+ class LogEntry < ArkEmail::Internal::Type::BaseModel
7
+ # @!attribute context
8
+ # Request context information
9
+ #
10
+ # @return [ArkEmail::Models::LogEntry::Context]
11
+ required :context, -> { ArkEmail::LogEntry::Context }
12
+
13
+ # @!attribute credential
14
+ # API credential information
15
+ #
16
+ # @return [ArkEmail::Models::LogEntry::Credential]
17
+ required :credential, -> { ArkEmail::LogEntry::Credential }
18
+
19
+ # @!attribute duration_ms
20
+ # Request duration in milliseconds
21
+ #
22
+ # @return [Integer]
23
+ required :duration_ms, Integer, api_name: :durationMs
24
+
25
+ # @!attribute endpoint
26
+ # Semantic endpoint name
27
+ #
28
+ # @return [String]
29
+ required :endpoint, String
30
+
31
+ # @!attribute method_
32
+ # HTTP method
33
+ #
34
+ # @return [Symbol, ArkEmail::Models::LogEntry::Method]
35
+ required :method_, enum: -> { ArkEmail::LogEntry::Method }, api_name: :method
36
+
37
+ # @!attribute path
38
+ # Request path
39
+ #
40
+ # @return [String]
41
+ required :path, String
42
+
43
+ # @!attribute rate_limit
44
+ # Rate limit state at time of request
45
+ #
46
+ # @return [ArkEmail::Models::LogEntry::RateLimit]
47
+ required :rate_limit, -> { ArkEmail::LogEntry::RateLimit }, api_name: :rateLimit
48
+
49
+ # @!attribute request_id
50
+ # Unique request identifier
51
+ #
52
+ # @return [String]
53
+ required :request_id, String, api_name: :requestId
54
+
55
+ # @!attribute status_code
56
+ # HTTP response status code
57
+ #
58
+ # @return [Integer]
59
+ required :status_code, Integer, api_name: :statusCode
60
+
61
+ # @!attribute timestamp
62
+ # When the request was made (ISO 8601)
63
+ #
64
+ # @return [Time]
65
+ required :timestamp, Time
66
+
67
+ # @!attribute email
68
+ # Email-specific data (for email endpoints)
69
+ #
70
+ # @return [ArkEmail::Models::LogEntry::Email, nil]
71
+ optional :email, -> { ArkEmail::LogEntry::Email }, nil?: true
72
+
73
+ # @!attribute error
74
+ # Error details (null if request succeeded)
75
+ #
76
+ # @return [ArkEmail::Models::LogEntry::Error, nil]
77
+ optional :error, -> { ArkEmail::LogEntry::Error }, nil?: true
78
+
79
+ # @!attribute sdk
80
+ # SDK information (null if not using an SDK)
81
+ #
82
+ # @return [ArkEmail::Models::LogEntry::SDK, nil]
83
+ optional :sdk, -> { ArkEmail::LogEntry::SDK }, nil?: true
84
+
85
+ # @!method initialize(context:, credential:, duration_ms:, endpoint:, method_:, path:, rate_limit:, request_id:, status_code:, timestamp:, email: nil, error: nil, sdk: nil)
86
+ # API request log entry (list view)
87
+ #
88
+ # @param context [ArkEmail::Models::LogEntry::Context] Request context information
89
+ #
90
+ # @param credential [ArkEmail::Models::LogEntry::Credential] API credential information
91
+ #
92
+ # @param duration_ms [Integer] Request duration in milliseconds
93
+ #
94
+ # @param endpoint [String] Semantic endpoint name
95
+ #
96
+ # @param method_ [Symbol, ArkEmail::Models::LogEntry::Method] HTTP method
97
+ #
98
+ # @param path [String] Request path
99
+ #
100
+ # @param rate_limit [ArkEmail::Models::LogEntry::RateLimit] Rate limit state at time of request
101
+ #
102
+ # @param request_id [String] Unique request identifier
103
+ #
104
+ # @param status_code [Integer] HTTP response status code
105
+ #
106
+ # @param timestamp [Time] When the request was made (ISO 8601)
107
+ #
108
+ # @param email [ArkEmail::Models::LogEntry::Email, nil] Email-specific data (for email endpoints)
109
+ #
110
+ # @param error [ArkEmail::Models::LogEntry::Error, nil] Error details (null if request succeeded)
111
+ #
112
+ # @param sdk [ArkEmail::Models::LogEntry::SDK, nil] SDK information (null if not using an SDK)
113
+
114
+ # @see ArkEmail::Models::LogEntry#context
115
+ class Context < ArkEmail::Internal::Type::BaseModel
116
+ # @!attribute idempotency_key
117
+ # Idempotency key if provided
118
+ #
119
+ # @return [String, nil]
120
+ optional :idempotency_key, String, api_name: :idempotencyKey, nil?: true
121
+
122
+ # @!attribute ip_address
123
+ # Client IP address
124
+ #
125
+ # @return [String, nil]
126
+ optional :ip_address, String, api_name: :ipAddress, nil?: true
127
+
128
+ # @!attribute query_params
129
+ # Query parameters
130
+ #
131
+ # @return [Hash{Symbol=>Object}, nil]
132
+ optional :query_params,
133
+ ArkEmail::Internal::Type::HashOf[ArkEmail::Internal::Type::Unknown],
134
+ api_name: :queryParams,
135
+ nil?: true
136
+
137
+ # @!attribute user_agent
138
+ # User-Agent header
139
+ #
140
+ # @return [String, nil]
141
+ optional :user_agent, String, api_name: :userAgent, nil?: true
142
+
143
+ # @!method initialize(idempotency_key: nil, ip_address: nil, query_params: nil, user_agent: nil)
144
+ # Request context information
145
+ #
146
+ # @param idempotency_key [String, nil] Idempotency key if provided
147
+ #
148
+ # @param ip_address [String, nil] Client IP address
149
+ #
150
+ # @param query_params [Hash{Symbol=>Object}, nil] Query parameters
151
+ #
152
+ # @param user_agent [String, nil] User-Agent header
153
+ end
154
+
155
+ # @see ArkEmail::Models::LogEntry#credential
156
+ class Credential < ArkEmail::Internal::Type::BaseModel
157
+ # @!attribute id
158
+ # Credential ID
159
+ #
160
+ # @return [String]
161
+ required :id, String
162
+
163
+ # @!attribute key_prefix
164
+ # API key prefix (first 8 characters)
165
+ #
166
+ # @return [String, nil]
167
+ optional :key_prefix, String, api_name: :keyPrefix, nil?: true
168
+
169
+ # @!method initialize(id:, key_prefix: nil)
170
+ # API credential information
171
+ #
172
+ # @param id [String] Credential ID
173
+ #
174
+ # @param key_prefix [String, nil] API key prefix (first 8 characters)
175
+ end
176
+
177
+ # HTTP method
178
+ #
179
+ # @see ArkEmail::Models::LogEntry#method_
180
+ module Method
181
+ extend ArkEmail::Internal::Type::Enum
182
+
183
+ GET = :GET
184
+ POST = :POST
185
+ PUT = :PUT
186
+ PATCH = :PATCH
187
+ DELETE = :DELETE
188
+
189
+ # @!method self.values
190
+ # @return [Array<Symbol>]
191
+ end
192
+
193
+ # @see ArkEmail::Models::LogEntry#rate_limit
194
+ class RateLimit < ArkEmail::Internal::Type::BaseModel
195
+ # @!attribute limit
196
+ # Rate limit ceiling
197
+ #
198
+ # @return [Integer, nil]
199
+ optional :limit, Integer, nil?: true
200
+
201
+ # @!attribute limited
202
+ # Whether the request was rate limited
203
+ #
204
+ # @return [Boolean, nil]
205
+ optional :limited, ArkEmail::Internal::Type::Boolean
206
+
207
+ # @!attribute remaining
208
+ # Remaining requests in window
209
+ #
210
+ # @return [Integer, nil]
211
+ optional :remaining, Integer, nil?: true
212
+
213
+ # @!attribute reset
214
+ # Unix timestamp when limit resets
215
+ #
216
+ # @return [Integer, nil]
217
+ optional :reset, Integer, nil?: true
218
+
219
+ # @!method initialize(limit: nil, limited: nil, remaining: nil, reset: nil)
220
+ # Rate limit state at time of request
221
+ #
222
+ # @param limit [Integer, nil] Rate limit ceiling
223
+ #
224
+ # @param limited [Boolean] Whether the request was rate limited
225
+ #
226
+ # @param remaining [Integer, nil] Remaining requests in window
227
+ #
228
+ # @param reset [Integer, nil] Unix timestamp when limit resets
229
+ end
230
+
231
+ # @see ArkEmail::Models::LogEntry#email
232
+ class Email < ArkEmail::Internal::Type::BaseModel
233
+ # @!attribute id
234
+ # Email message ID
235
+ #
236
+ # @return [String, nil]
237
+ optional :id, String
238
+
239
+ # @!attribute recipient_count
240
+ # Number of recipients
241
+ #
242
+ # @return [Integer, nil]
243
+ optional :recipient_count, Integer, api_name: :recipientCount, nil?: true
244
+
245
+ # @!method initialize(id: nil, recipient_count: nil)
246
+ # Email-specific data (for email endpoints)
247
+ #
248
+ # @param id [String] Email message ID
249
+ #
250
+ # @param recipient_count [Integer, nil] Number of recipients
251
+ end
252
+
253
+ # @see ArkEmail::Models::LogEntry#error
254
+ class Error < ArkEmail::Internal::Type::BaseModel
255
+ # @!attribute code
256
+ # Error code
257
+ #
258
+ # @return [String, nil]
259
+ optional :code, String
260
+
261
+ # @!attribute message
262
+ # Error message
263
+ #
264
+ # @return [String, nil]
265
+ optional :message, String, nil?: true
266
+
267
+ # @!method initialize(code: nil, message: nil)
268
+ # Error details (null if request succeeded)
269
+ #
270
+ # @param code [String] Error code
271
+ #
272
+ # @param message [String, nil] Error message
273
+ end
274
+
275
+ # @see ArkEmail::Models::LogEntry#sdk
276
+ class SDK < ArkEmail::Internal::Type::BaseModel
277
+ # @!attribute name
278
+ # SDK name
279
+ #
280
+ # @return [String, nil]
281
+ optional :name, String
282
+
283
+ # @!attribute version
284
+ # SDK version
285
+ #
286
+ # @return [String, nil]
287
+ optional :version, String, nil?: true
288
+
289
+ # @!method initialize(name: nil, version: nil)
290
+ # SDK information (null if not using an SDK)
291
+ #
292
+ # @param name [String] SDK name
293
+ #
294
+ # @param version [String, nil] SDK version
295
+ end
296
+ end
297
+ end
298
+ end
@@ -0,0 +1,102 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ArkEmail
4
+ module Models
5
+ class LogEntryDetail < ArkEmail::Models::LogEntry
6
+ # @!attribute request
7
+ # Request body information
8
+ #
9
+ # @return [ArkEmail::Models::LogEntryDetail::Request, nil]
10
+ optional :request, -> { ArkEmail::LogEntryDetail::Request }
11
+
12
+ # @!attribute response
13
+ # Response body information
14
+ #
15
+ # @return [ArkEmail::Models::LogEntryDetail::Response, nil]
16
+ optional :response, -> { ArkEmail::LogEntryDetail::Response }
17
+
18
+ # @!method initialize(request: nil, response: nil)
19
+ # Full API request log entry with bodies
20
+ #
21
+ # @param request [ArkEmail::Models::LogEntryDetail::Request] Request body information
22
+ #
23
+ # @param response [ArkEmail::Models::LogEntryDetail::Response] Response body information
24
+
25
+ class Request < ArkEmail::Internal::Type::BaseModel
26
+ # @!attribute body
27
+ # Decrypted request body (JSON or string). Bodies over 25KB are truncated.
28
+ #
29
+ # @return [Hash{Symbol=>Object}, String, nil]
30
+ optional :body, union: -> { ArkEmail::LogEntryDetail::Request::Body }, nil?: true
31
+
32
+ # @!attribute body_size
33
+ # Original request body size in bytes
34
+ #
35
+ # @return [Integer, nil]
36
+ optional :body_size, Integer, api_name: :bodySize, nil?: true
37
+
38
+ # @!method initialize(body: nil, body_size: nil)
39
+ # Request body information
40
+ #
41
+ # @param body [Hash{Symbol=>Object}, String, nil] Decrypted request body (JSON or string). Bodies over 25KB are truncated.
42
+ #
43
+ # @param body_size [Integer, nil] Original request body size in bytes
44
+
45
+ # Decrypted request body (JSON or string). Bodies over 25KB are truncated.
46
+ #
47
+ # @see ArkEmail::Models::LogEntryDetail::Request#body
48
+ module Body
49
+ extend ArkEmail::Internal::Type::Union
50
+
51
+ variant -> { ArkEmail::Models::LogEntryDetail::Request::Body::UnionMember0Map }
52
+
53
+ variant String
54
+
55
+ # @!method self.variants
56
+ # @return [Array(Hash{Symbol=>Object}, String)]
57
+
58
+ # @type [ArkEmail::Internal::Type::Converter]
59
+ UnionMember0Map = ArkEmail::Internal::Type::HashOf[ArkEmail::Internal::Type::Unknown]
60
+ end
61
+ end
62
+
63
+ class Response < ArkEmail::Internal::Type::BaseModel
64
+ # @!attribute body
65
+ # Decrypted response body (JSON or string). Bodies over 25KB are truncated.
66
+ #
67
+ # @return [Hash{Symbol=>Object}, String, nil]
68
+ optional :body, union: -> { ArkEmail::LogEntryDetail::Response::Body }, nil?: true
69
+
70
+ # @!attribute body_size
71
+ # Response body size in bytes
72
+ #
73
+ # @return [Integer, nil]
74
+ optional :body_size, Integer, api_name: :bodySize, nil?: true
75
+
76
+ # @!method initialize(body: nil, body_size: nil)
77
+ # Response body information
78
+ #
79
+ # @param body [Hash{Symbol=>Object}, String, nil] Decrypted response body (JSON or string). Bodies over 25KB are truncated.
80
+ #
81
+ # @param body_size [Integer, nil] Response body size in bytes
82
+
83
+ # Decrypted response body (JSON or string). Bodies over 25KB are truncated.
84
+ #
85
+ # @see ArkEmail::Models::LogEntryDetail::Response#body
86
+ module Body
87
+ extend ArkEmail::Internal::Type::Union
88
+
89
+ variant -> { ArkEmail::Models::LogEntryDetail::Response::Body::UnionMember0Map }
90
+
91
+ variant String
92
+
93
+ # @!method self.variants
94
+ # @return [Array(Hash{Symbol=>Object}, String)]
95
+
96
+ # @type [ArkEmail::Internal::Type::Converter]
97
+ UnionMember0Map = ArkEmail::Internal::Type::HashOf[ArkEmail::Internal::Type::Unknown]
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end