Skip to content

Commit cfdb276

Browse files
feat(api): api update
1 parent 8d2cb43 commit cfdb276

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-6a9d3b677dcfb856dc571865c34b3fe401e4d7f0d799edfc743acb9a55800bd0.yml
3-
openapi_spec_hash: 037703a6c741e4310fda3f57c22fa51e
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-e6762e83ef7cdff129d03d0ab8c130db2fb5d1d820142847c27d72b40a0e9f53.yml
3+
openapi_spec_hash: f38fb40a2b28bae4b0c9c4228c1c0e0d
44
config_hash: 41c337f5cda03b13880617490f82bad0

cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/inbox/InboxListCasFilesResponse.kt

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ private constructor(
232232
private val messageDate: JsonField<LocalDate>,
233233
private val messageId: JsonField<String>,
234234
private val originalFilename: JsonField<String>,
235+
private val senderEmail: JsonField<String>,
235236
private val size: JsonField<Long>,
236237
private val url: JsonField<String>,
237238
private val additionalProperties: MutableMap<String, JsonValue>,
@@ -257,6 +258,9 @@ private constructor(
257258
@JsonProperty("original_filename")
258259
@ExcludeMissing
259260
originalFilename: JsonField<String> = JsonMissing.of(),
261+
@JsonProperty("sender_email")
262+
@ExcludeMissing
263+
senderEmail: JsonField<String> = JsonMissing.of(),
260264
@JsonProperty("size") @ExcludeMissing size: JsonField<Long> = JsonMissing.of(),
261265
@JsonProperty("url") @ExcludeMissing url: JsonField<String> = JsonMissing.of(),
262266
) : this(
@@ -266,6 +270,7 @@ private constructor(
266270
messageDate,
267271
messageId,
268272
originalFilename,
273+
senderEmail,
269274
size,
270275
url,
271276
mutableMapOf(),
@@ -319,6 +324,14 @@ private constructor(
319324
*/
320325
fun originalFilename(): Optional<String> = originalFilename.getOptional("original_filename")
321326

327+
/**
328+
* Email address of the CAS authority who sent this
329+
*
330+
* @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
331+
* the server responded with an unexpected value).
332+
*/
333+
fun senderEmail(): Optional<String> = senderEmail.getOptional("sender_email")
334+
322335
/**
323336
* File size in bytes
324337
*
@@ -382,6 +395,15 @@ private constructor(
382395
@ExcludeMissing
383396
fun _originalFilename(): JsonField<String> = originalFilename
384397

398+
/**
399+
* Returns the raw JSON value of [senderEmail].
400+
*
401+
* Unlike [senderEmail], this method doesn't throw if the JSON field has an unexpected type.
402+
*/
403+
@JsonProperty("sender_email")
404+
@ExcludeMissing
405+
fun _senderEmail(): JsonField<String> = senderEmail
406+
385407
/**
386408
* Returns the raw JSON value of [size].
387409
*
@@ -423,6 +445,7 @@ private constructor(
423445
private var messageDate: JsonField<LocalDate> = JsonMissing.of()
424446
private var messageId: JsonField<String> = JsonMissing.of()
425447
private var originalFilename: JsonField<String> = JsonMissing.of()
448+
private var senderEmail: JsonField<String> = JsonMissing.of()
426449
private var size: JsonField<Long> = JsonMissing.of()
427450
private var url: JsonField<String> = JsonMissing.of()
428451
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
@@ -435,6 +458,7 @@ private constructor(
435458
messageDate = file.messageDate
436459
messageId = file.messageId
437460
originalFilename = file.originalFilename
461+
senderEmail = file.senderEmail
438462
size = file.size
439463
url = file.url
440464
additionalProperties = file.additionalProperties.toMutableMap()
@@ -517,6 +541,20 @@ private constructor(
517541
this.originalFilename = originalFilename
518542
}
519543

544+
/** Email address of the CAS authority who sent this */
545+
fun senderEmail(senderEmail: String) = senderEmail(JsonField.of(senderEmail))
546+
547+
/**
548+
* Sets [Builder.senderEmail] to an arbitrary JSON value.
549+
*
550+
* You should usually call [Builder.senderEmail] with a well-typed [String] value
551+
* instead. This method is primarily for setting the field to an undocumented or not yet
552+
* supported value.
553+
*/
554+
fun senderEmail(senderEmail: JsonField<String>) = apply {
555+
this.senderEmail = senderEmail
556+
}
557+
520558
/** File size in bytes */
521559
fun size(size: Long) = size(JsonField.of(size))
522560

@@ -573,6 +611,7 @@ private constructor(
573611
messageDate,
574612
messageId,
575613
originalFilename,
614+
senderEmail,
576615
size,
577616
url,
578617
additionalProperties.toMutableMap(),
@@ -592,6 +631,7 @@ private constructor(
592631
messageDate()
593632
messageId()
594633
originalFilename()
634+
senderEmail()
595635
size()
596636
url()
597637
validated = true
@@ -619,6 +659,7 @@ private constructor(
619659
(if (messageDate.asKnown().isPresent) 1 else 0) +
620660
(if (messageId.asKnown().isPresent) 1 else 0) +
621661
(if (originalFilename.asKnown().isPresent) 1 else 0) +
662+
(if (senderEmail.asKnown().isPresent) 1 else 0) +
622663
(if (size.asKnown().isPresent) 1 else 0) +
623664
(if (url.asKnown().isPresent) 1 else 0)
624665

@@ -777,6 +818,7 @@ private constructor(
777818
messageDate == other.messageDate &&
778819
messageId == other.messageId &&
779820
originalFilename == other.originalFilename &&
821+
senderEmail == other.senderEmail &&
780822
size == other.size &&
781823
url == other.url &&
782824
additionalProperties == other.additionalProperties
@@ -790,6 +832,7 @@ private constructor(
790832
messageDate,
791833
messageId,
792834
originalFilename,
835+
senderEmail,
793836
size,
794837
url,
795838
additionalProperties,
@@ -799,7 +842,7 @@ private constructor(
799842
override fun hashCode(): Int = hashCode
800843

801844
override fun toString() =
802-
"File{casType=$casType, expiresIn=$expiresIn, filename=$filename, messageDate=$messageDate, messageId=$messageId, originalFilename=$originalFilename, size=$size, url=$url, additionalProperties=$additionalProperties}"
845+
"File{casType=$casType, expiresIn=$expiresIn, filename=$filename, messageDate=$messageDate, messageId=$messageId, originalFilename=$originalFilename, senderEmail=$senderEmail, size=$size, url=$url, additionalProperties=$additionalProperties}"
803846
}
804847

805848
override fun equals(other: Any?): Boolean {

cas-parser-java-core/src/test/kotlin/com/cas_parser/api/models/inbox/InboxListCasFilesResponseTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ internal class InboxListCasFilesResponseTest {
2424
.messageDate(LocalDate.parse("2025-01-15"))
2525
.messageId("18d4a2b3c4d5e6f7")
2626
.originalFilename("CDSL_CAS_Statement.pdf")
27+
.senderEmail("eCAS@cdslstatement.com")
2728
.size(245000L)
2829
.url(
2930
"https://cdn.casparser.in/email-cas/user123/cdsl_20250115_a1b2c3d4.pdf"
@@ -43,6 +44,7 @@ internal class InboxListCasFilesResponseTest {
4344
.messageDate(LocalDate.parse("2025-01-15"))
4445
.messageId("18d4a2b3c4d5e6f7")
4546
.originalFilename("CDSL_CAS_Statement.pdf")
47+
.senderEmail("eCAS@cdslstatement.com")
4648
.size(245000L)
4749
.url("https://cdn.casparser.in/email-cas/user123/cdsl_20250115_a1b2c3d4.pdf")
4850
.build()
@@ -64,6 +66,7 @@ internal class InboxListCasFilesResponseTest {
6466
.messageDate(LocalDate.parse("2025-01-15"))
6567
.messageId("18d4a2b3c4d5e6f7")
6668
.originalFilename("CDSL_CAS_Statement.pdf")
69+
.senderEmail("eCAS@cdslstatement.com")
6770
.size(245000L)
6871
.url(
6972
"https://cdn.casparser.in/email-cas/user123/cdsl_20250115_a1b2c3d4.pdf"

0 commit comments

Comments
 (0)