diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5e1426a..54b56dc 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -18,7 +18,7 @@ jobs:
lint:
timeout-minutes: 15
name: lint
- runs-on: ${{ github.repository == 'stainless-sdks/cas-parser-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
+ runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
@@ -45,7 +45,7 @@ jobs:
permissions:
contents: read
id-token: write
- runs-on: ${{ github.repository == 'stainless-sdks/cas-parser-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
+ runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
@@ -88,7 +88,7 @@ jobs:
test:
timeout-minutes: 15
name: test
- runs-on: ${{ github.repository == 'stainless-sdks/cas-parser-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
+ runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 1bc5713..6538ca9 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.7.1"
+ ".": "0.8.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index fb087e4..93de6b1 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 21
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-904e3aa8081755d046016db9d84d13d140a4235c724e18e1cd7f8ebb7712883e.yml
-openapi_spec_hash: 453b8e667c364b064e04352ad4deccfa
+configured_endpoints: 20
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser/cas-parser-26d0931f3488af784c16303683cbf24225c727615fd32ee071144974e7c59670.yml
+openapi_spec_hash: 242a5f4d982645a25e0d66ef088940a5
config_hash: 5509bb7a961ae2e79114b24c381606d4
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c87a4a6..fcd8c11 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,14 @@
# Changelog
+## 0.8.0 (2026-07-26)
+
+Full Changelog: [v0.7.1...v0.8.0](https://github.com/CASParser/cas-parser-java/compare/v0.7.1...v0.8.0)
+
+### Features
+
+* **api:** api update ([e7a4124](https://github.com/CASParser/cas-parser-java/commit/e7a412436755222651c663b85e5015b65ae17b44))
+* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([33bd81b](https://github.com/CASParser/cas-parser-java/commit/33bd81b28c588c58043d7b3032ba5d8813c18e31))
+
## 0.7.1 (2026-05-18)
Full Changelog: [v0.7.0...v0.7.1](https://github.com/CASParser/cas-parser-java/compare/v0.7.0...v0.7.1)
diff --git a/README.md b/README.md
index 65d779b..e406e83 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.cas_parser.api/cas-parser-java/0.7.1)
-[](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.7.1)
+[](https://central.sonatype.com/artifact/com.cas_parser.api/cas-parser-java/0.8.0)
+[](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.8.0)
@@ -22,7 +22,7 @@ Use the Cas Parser MCP Server to enable AI assistants to interact with this API,
-The REST API documentation can be found on [casparser.in](https://casparser.in/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.7.1).
+The REST API documentation can be found on [casparser.in](https://casparser.in/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.8.0).
@@ -33,7 +33,7 @@ The REST API documentation can be found on [casparser.in](https://casparser.in/d
### Gradle
```kotlin
-implementation("com.cas_parser.api:cas-parser-java:0.7.1")
+implementation("com.cas_parser.api:cas-parser-java:0.8.0")
```
### Maven
@@ -42,7 +42,7 @@ implementation("com.cas_parser.api:cas-parser-java:0.7.1")
com.cas_parser.api
cas-parser-java
- 0.7.1
+ 0.8.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index d9e1075..264d238 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,7 +9,7 @@ repositories {
allprojects {
group = "com.cas_parser.api"
- version = "0.7.1" // x-release-please-version
+ version = "0.8.0" // x-release-please-version
}
subprojects {
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClient.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClient.kt
index 6c17b45..41b761e 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClient.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClient.kt
@@ -110,7 +110,6 @@ interface CasParserClient {
*/
fun inbox(): InboxService
- /** Endpoints for generating new CAS documents via email mailback (KFintech). */
fun kfintech(): KfintechService
/** Endpoints for parsing CAS PDF files from different sources. */
@@ -226,7 +225,6 @@ interface CasParserClient {
*/
fun inbox(): InboxService.WithRawResponse
- /** Endpoints for generating new CAS documents via email mailback (KFintech). */
fun kfintech(): KfintechService.WithRawResponse
/** Endpoints for parsing CAS PDF files from different sources. */
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsync.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsync.kt
index 575d503..8c613f7 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsync.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsync.kt
@@ -110,7 +110,6 @@ interface CasParserClientAsync {
*/
fun inbox(): InboxServiceAsync
- /** Endpoints for generating new CAS documents via email mailback (KFintech). */
fun kfintech(): KfintechServiceAsync
/** Endpoints for parsing CAS PDF files from different sources. */
@@ -230,7 +229,6 @@ interface CasParserClientAsync {
*/
fun inbox(): InboxServiceAsync.WithRawResponse
- /** Endpoints for generating new CAS documents via email mailback (KFintech). */
fun kfintech(): KfintechServiceAsync.WithRawResponse
/** Endpoints for parsing CAS PDF files from different sources. */
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsyncImpl.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsyncImpl.kt
index eed1327..35c5a95 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsyncImpl.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsyncImpl.kt
@@ -153,7 +153,6 @@ class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasPa
*/
override fun inbox(): InboxServiceAsync = inbox
- /** Endpoints for generating new CAS documents via email mailback (KFintech). */
override fun kfintech(): KfintechServiceAsync = kfintech
/** Endpoints for parsing CAS PDF files from different sources. */
@@ -306,7 +305,6 @@ class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasPa
*/
override fun inbox(): InboxServiceAsync.WithRawResponse = inbox
- /** Endpoints for generating new CAS documents via email mailback (KFintech). */
override fun kfintech(): KfintechServiceAsync.WithRawResponse = kfintech
/** Endpoints for parsing CAS PDF files from different sources. */
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientImpl.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientImpl.kt
index 75ee210..50bfe57 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientImpl.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientImpl.kt
@@ -147,7 +147,6 @@ class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserC
*/
override fun inbox(): InboxService = inbox
- /** Endpoints for generating new CAS documents via email mailback (KFintech). */
override fun kfintech(): KfintechService = kfintech
/** Endpoints for parsing CAS PDF files from different sources. */
@@ -300,7 +299,6 @@ class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserC
*/
override fun inbox(): InboxService.WithRawResponse = inbox
- /** Endpoints for generating new CAS documents via email mailback (KFintech). */
override fun kfintech(): KfintechService.WithRawResponse = kfintech
/** Endpoints for parsing CAS PDF files from different sources. */
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/kfintech/KfintechGenerateCasParams.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/kfintech/KfintechGenerateCasParams.kt
deleted file mode 100644
index b8a20e9..0000000
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/kfintech/KfintechGenerateCasParams.kt
+++ /dev/null
@@ -1,702 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.cas_parser.api.models.kfintech
-
-import com.cas_parser.api.core.ExcludeMissing
-import com.cas_parser.api.core.JsonField
-import com.cas_parser.api.core.JsonMissing
-import com.cas_parser.api.core.JsonValue
-import com.cas_parser.api.core.Params
-import com.cas_parser.api.core.checkRequired
-import com.cas_parser.api.core.http.Headers
-import com.cas_parser.api.core.http.QueryParams
-import com.cas_parser.api.errors.CasParserInvalidDataException
-import com.fasterxml.jackson.annotation.JsonAnyGetter
-import com.fasterxml.jackson.annotation.JsonAnySetter
-import com.fasterxml.jackson.annotation.JsonCreator
-import com.fasterxml.jackson.annotation.JsonProperty
-import java.util.Collections
-import java.util.Objects
-import java.util.Optional
-
-/**
- * Generate CAS via KFintech mailback. The CAS PDF will be sent to the investor's email.
- *
- * This is an async operation - the investor receives the CAS via email within a few minutes. For
- * instant CAS retrieval, use CDSL Fetch (`/v4/cdsl/fetch`).
- */
-class KfintechGenerateCasParams
-private constructor(
- private val body: Body,
- private val additionalHeaders: Headers,
- private val additionalQueryParams: QueryParams,
-) : Params {
-
- /**
- * Email address to receive the CAS document
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun email(): String = body.email()
-
- /**
- * Start date (YYYY-MM-DD)
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun fromDate(): String = body.fromDate()
-
- /**
- * Password for the PDF
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun password(): String = body.password()
-
- /**
- * End date (YYYY-MM-DD)
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun toDate(): String = body.toDate()
-
- /**
- * PAN number (optional)
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun panNo(): Optional = body.panNo()
-
- /**
- * Returns the raw JSON value of [email].
- *
- * Unlike [email], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _email(): JsonField = body._email()
-
- /**
- * Returns the raw JSON value of [fromDate].
- *
- * Unlike [fromDate], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _fromDate(): JsonField = body._fromDate()
-
- /**
- * Returns the raw JSON value of [password].
- *
- * Unlike [password], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _password(): JsonField = body._password()
-
- /**
- * Returns the raw JSON value of [toDate].
- *
- * Unlike [toDate], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _toDate(): JsonField = body._toDate()
-
- /**
- * Returns the raw JSON value of [panNo].
- *
- * Unlike [panNo], this method doesn't throw if the JSON field has an unexpected type.
- */
- fun _panNo(): JsonField = body._panNo()
-
- fun _additionalBodyProperties(): Map = body._additionalProperties()
-
- /** Additional headers to send with the request. */
- fun _additionalHeaders(): Headers = additionalHeaders
-
- /** Additional query param to send with the request. */
- fun _additionalQueryParams(): QueryParams = additionalQueryParams
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [KfintechGenerateCasParams].
- *
- * The following fields are required:
- * ```java
- * .email()
- * .fromDate()
- * .password()
- * .toDate()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [KfintechGenerateCasParams]. */
- class Builder internal constructor() {
-
- private var body: Body.Builder = Body.builder()
- private var additionalHeaders: Headers.Builder = Headers.builder()
- private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
-
- @JvmSynthetic
- internal fun from(kfintechGenerateCasParams: KfintechGenerateCasParams) = apply {
- body = kfintechGenerateCasParams.body.toBuilder()
- additionalHeaders = kfintechGenerateCasParams.additionalHeaders.toBuilder()
- additionalQueryParams = kfintechGenerateCasParams.additionalQueryParams.toBuilder()
- }
-
- /**
- * Sets the entire request body.
- *
- * This is generally only useful if you are already constructing the body separately.
- * Otherwise, it's more convenient to use the top-level setters instead:
- * - [email]
- * - [fromDate]
- * - [password]
- * - [toDate]
- * - [panNo]
- * - etc.
- */
- fun body(body: Body) = apply { this.body = body.toBuilder() }
-
- /** Email address to receive the CAS document */
- fun email(email: String) = apply { body.email(email) }
-
- /**
- * Sets [Builder.email] to an arbitrary JSON value.
- *
- * You should usually call [Builder.email] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun email(email: JsonField) = apply { body.email(email) }
-
- /** Start date (YYYY-MM-DD) */
- fun fromDate(fromDate: String) = apply { body.fromDate(fromDate) }
-
- /**
- * Sets [Builder.fromDate] to an arbitrary JSON value.
- *
- * You should usually call [Builder.fromDate] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun fromDate(fromDate: JsonField) = apply { body.fromDate(fromDate) }
-
- /** Password for the PDF */
- fun password(password: String) = apply { body.password(password) }
-
- /**
- * Sets [Builder.password] to an arbitrary JSON value.
- *
- * You should usually call [Builder.password] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun password(password: JsonField) = apply { body.password(password) }
-
- /** End date (YYYY-MM-DD) */
- fun toDate(toDate: String) = apply { body.toDate(toDate) }
-
- /**
- * Sets [Builder.toDate] to an arbitrary JSON value.
- *
- * You should usually call [Builder.toDate] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun toDate(toDate: JsonField) = apply { body.toDate(toDate) }
-
- /** PAN number (optional) */
- fun panNo(panNo: String) = apply { body.panNo(panNo) }
-
- /**
- * Sets [Builder.panNo] to an arbitrary JSON value.
- *
- * You should usually call [Builder.panNo] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun panNo(panNo: JsonField) = apply { body.panNo(panNo) }
-
- fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
- body.additionalProperties(additionalBodyProperties)
- }
-
- fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
- body.putAdditionalProperty(key, value)
- }
-
- fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
- apply {
- body.putAllAdditionalProperties(additionalBodyProperties)
- }
-
- fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) }
-
- fun removeAllAdditionalBodyProperties(keys: Set) = apply {
- body.removeAllAdditionalProperties(keys)
- }
-
- fun additionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.clear()
- putAllAdditionalHeaders(additionalHeaders)
- }
-
- fun additionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.clear()
- putAllAdditionalHeaders(additionalHeaders)
- }
-
- fun putAdditionalHeader(name: String, value: String) = apply {
- additionalHeaders.put(name, value)
- }
-
- fun putAdditionalHeaders(name: String, values: Iterable) = apply {
- additionalHeaders.put(name, values)
- }
-
- fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.putAll(additionalHeaders)
- }
-
- fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.putAll(additionalHeaders)
- }
-
- fun replaceAdditionalHeaders(name: String, value: String) = apply {
- additionalHeaders.replace(name, value)
- }
-
- fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
- additionalHeaders.replace(name, values)
- }
-
- fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
- this.additionalHeaders.replaceAll(additionalHeaders)
- }
-
- fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
- this.additionalHeaders.replaceAll(additionalHeaders)
- }
-
- fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
-
- fun removeAllAdditionalHeaders(names: Set) = apply {
- additionalHeaders.removeAll(names)
- }
-
- fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.clear()
- putAllAdditionalQueryParams(additionalQueryParams)
- }
-
- fun additionalQueryParams(additionalQueryParams: Map>) = apply {
- this.additionalQueryParams.clear()
- putAllAdditionalQueryParams(additionalQueryParams)
- }
-
- fun putAdditionalQueryParam(key: String, value: String) = apply {
- additionalQueryParams.put(key, value)
- }
-
- fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
- additionalQueryParams.put(key, values)
- }
-
- fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.putAll(additionalQueryParams)
- }
-
- fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
- apply {
- this.additionalQueryParams.putAll(additionalQueryParams)
- }
-
- fun replaceAdditionalQueryParams(key: String, value: String) = apply {
- additionalQueryParams.replace(key, value)
- }
-
- fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
- additionalQueryParams.replace(key, values)
- }
-
- fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
- this.additionalQueryParams.replaceAll(additionalQueryParams)
- }
-
- fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
- apply {
- this.additionalQueryParams.replaceAll(additionalQueryParams)
- }
-
- fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
-
- fun removeAllAdditionalQueryParams(keys: Set) = apply {
- additionalQueryParams.removeAll(keys)
- }
-
- /**
- * Returns an immutable instance of [KfintechGenerateCasParams].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .email()
- * .fromDate()
- * .password()
- * .toDate()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): KfintechGenerateCasParams =
- KfintechGenerateCasParams(
- body.build(),
- additionalHeaders.build(),
- additionalQueryParams.build(),
- )
- }
-
- fun _body(): Body = body
-
- override fun _headers(): Headers = additionalHeaders
-
- override fun _queryParams(): QueryParams = additionalQueryParams
-
- class Body
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val email: JsonField,
- private val fromDate: JsonField,
- private val password: JsonField,
- private val toDate: JsonField,
- private val panNo: JsonField,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("email") @ExcludeMissing email: JsonField = JsonMissing.of(),
- @JsonProperty("from_date")
- @ExcludeMissing
- fromDate: JsonField = JsonMissing.of(),
- @JsonProperty("password")
- @ExcludeMissing
- password: JsonField = JsonMissing.of(),
- @JsonProperty("to_date") @ExcludeMissing toDate: JsonField = JsonMissing.of(),
- @JsonProperty("pan_no") @ExcludeMissing panNo: JsonField = JsonMissing.of(),
- ) : this(email, fromDate, password, toDate, panNo, mutableMapOf())
-
- /**
- * Email address to receive the CAS document
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun email(): String = email.getRequired("email")
-
- /**
- * Start date (YYYY-MM-DD)
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun fromDate(): String = fromDate.getRequired("from_date")
-
- /**
- * Password for the PDF
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun password(): String = password.getRequired("password")
-
- /**
- * End date (YYYY-MM-DD)
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun toDate(): String = toDate.getRequired("to_date")
-
- /**
- * PAN number (optional)
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun panNo(): Optional = panNo.getOptional("pan_no")
-
- /**
- * Returns the raw JSON value of [email].
- *
- * Unlike [email], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("email") @ExcludeMissing fun _email(): JsonField = email
-
- /**
- * Returns the raw JSON value of [fromDate].
- *
- * Unlike [fromDate], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("from_date") @ExcludeMissing fun _fromDate(): JsonField = fromDate
-
- /**
- * Returns the raw JSON value of [password].
- *
- * Unlike [password], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("password") @ExcludeMissing fun _password(): JsonField = password
-
- /**
- * Returns the raw JSON value of [toDate].
- *
- * Unlike [toDate], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("to_date") @ExcludeMissing fun _toDate(): JsonField = toDate
-
- /**
- * Returns the raw JSON value of [panNo].
- *
- * Unlike [panNo], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("pan_no") @ExcludeMissing fun _panNo(): JsonField = panNo
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [Body].
- *
- * The following fields are required:
- * ```java
- * .email()
- * .fromDate()
- * .password()
- * .toDate()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [Body]. */
- class Builder internal constructor() {
-
- private var email: JsonField? = null
- private var fromDate: JsonField? = null
- private var password: JsonField? = null
- private var toDate: JsonField? = null
- private var panNo: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(body: Body) = apply {
- email = body.email
- fromDate = body.fromDate
- password = body.password
- toDate = body.toDate
- panNo = body.panNo
- additionalProperties = body.additionalProperties.toMutableMap()
- }
-
- /** Email address to receive the CAS document */
- fun email(email: String) = email(JsonField.of(email))
-
- /**
- * Sets [Builder.email] to an arbitrary JSON value.
- *
- * You should usually call [Builder.email] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun email(email: JsonField) = apply { this.email = email }
-
- /** Start date (YYYY-MM-DD) */
- fun fromDate(fromDate: String) = fromDate(JsonField.of(fromDate))
-
- /**
- * Sets [Builder.fromDate] to an arbitrary JSON value.
- *
- * You should usually call [Builder.fromDate] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun fromDate(fromDate: JsonField) = apply { this.fromDate = fromDate }
-
- /** Password for the PDF */
- fun password(password: String) = password(JsonField.of(password))
-
- /**
- * Sets [Builder.password] to an arbitrary JSON value.
- *
- * You should usually call [Builder.password] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun password(password: JsonField) = apply { this.password = password }
-
- /** End date (YYYY-MM-DD) */
- fun toDate(toDate: String) = toDate(JsonField.of(toDate))
-
- /**
- * Sets [Builder.toDate] to an arbitrary JSON value.
- *
- * You should usually call [Builder.toDate] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun toDate(toDate: JsonField) = apply { this.toDate = toDate }
-
- /** PAN number (optional) */
- fun panNo(panNo: String) = panNo(JsonField.of(panNo))
-
- /**
- * Sets [Builder.panNo] to an arbitrary JSON value.
- *
- * You should usually call [Builder.panNo] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun panNo(panNo: JsonField) = apply { this.panNo = panNo }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [Body].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .email()
- * .fromDate()
- * .password()
- * .toDate()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): Body =
- Body(
- checkRequired("email", email),
- checkRequired("fromDate", fromDate),
- checkRequired("password", password),
- checkRequired("toDate", toDate),
- panNo,
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- /**
- * Validates that the types of all values in this object match their expected types
- * recursively.
- *
- * This method is _not_ forwards compatible with new types from the API for existing fields.
- *
- * @throws CasParserInvalidDataException if any value type in this object doesn't match its
- * expected type.
- */
- fun validate(): Body = apply {
- if (validated) {
- return@apply
- }
-
- email()
- fromDate()
- password()
- toDate()
- panNo()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: CasParserInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (if (email.asKnown().isPresent) 1 else 0) +
- (if (fromDate.asKnown().isPresent) 1 else 0) +
- (if (password.asKnown().isPresent) 1 else 0) +
- (if (toDate.asKnown().isPresent) 1 else 0) +
- (if (panNo.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is Body &&
- email == other.email &&
- fromDate == other.fromDate &&
- password == other.password &&
- toDate == other.toDate &&
- panNo == other.panNo &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(email, fromDate, password, toDate, panNo, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Body{email=$email, fromDate=$fromDate, password=$password, toDate=$toDate, panNo=$panNo, additionalProperties=$additionalProperties}"
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is KfintechGenerateCasParams &&
- body == other.body &&
- additionalHeaders == other.additionalHeaders &&
- additionalQueryParams == other.additionalQueryParams
- }
-
- override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams)
-
- override fun toString() =
- "KfintechGenerateCasParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
-}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/kfintech/KfintechGenerateCasResponse.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/kfintech/KfintechGenerateCasResponse.kt
deleted file mode 100644
index e1d5883..0000000
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/kfintech/KfintechGenerateCasResponse.kt
+++ /dev/null
@@ -1,194 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.cas_parser.api.models.kfintech
-
-import com.cas_parser.api.core.ExcludeMissing
-import com.cas_parser.api.core.JsonField
-import com.cas_parser.api.core.JsonMissing
-import com.cas_parser.api.core.JsonValue
-import com.cas_parser.api.errors.CasParserInvalidDataException
-import com.fasterxml.jackson.annotation.JsonAnyGetter
-import com.fasterxml.jackson.annotation.JsonAnySetter
-import com.fasterxml.jackson.annotation.JsonCreator
-import com.fasterxml.jackson.annotation.JsonProperty
-import java.util.Collections
-import java.util.Objects
-import java.util.Optional
-
-class KfintechGenerateCasResponse
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(
- private val msg: JsonField,
- private val status: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("msg") @ExcludeMissing msg: JsonField = JsonMissing.of(),
- @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(),
- ) : this(msg, status, mutableMapOf())
-
- /**
- * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun msg(): Optional = msg.getOptional("msg")
-
- /**
- * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun status(): Optional = status.getOptional("status")
-
- /**
- * Returns the raw JSON value of [msg].
- *
- * Unlike [msg], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("msg") @ExcludeMissing fun _msg(): JsonField = msg
-
- /**
- * Returns the raw JSON value of [status].
- *
- * Unlike [status], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
-
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- /**
- * Returns a mutable builder for constructing an instance of [KfintechGenerateCasResponse].
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [KfintechGenerateCasResponse]. */
- class Builder internal constructor() {
-
- private var msg: JsonField = JsonMissing.of()
- private var status: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(kfintechGenerateCasResponse: KfintechGenerateCasResponse) = apply {
- msg = kfintechGenerateCasResponse.msg
- status = kfintechGenerateCasResponse.status
- additionalProperties = kfintechGenerateCasResponse.additionalProperties.toMutableMap()
- }
-
- fun msg(msg: String) = msg(JsonField.of(msg))
-
- /**
- * Sets [Builder.msg] to an arbitrary JSON value.
- *
- * You should usually call [Builder.msg] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun msg(msg: JsonField) = apply { this.msg = msg }
-
- fun status(status: String) = status(JsonField.of(status))
-
- /**
- * Sets [Builder.status] to an arbitrary JSON value.
- *
- * You should usually call [Builder.status] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun status(status: JsonField) = apply { this.status = status }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- /**
- * Returns an immutable instance of [KfintechGenerateCasResponse].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): KfintechGenerateCasResponse =
- KfintechGenerateCasResponse(msg, status, additionalProperties.toMutableMap())
- }
-
- private var validated: Boolean = false
-
- /**
- * Validates that the types of all values in this object match their expected types recursively.
- *
- * This method is _not_ forwards compatible with new types from the API for existing fields.
- *
- * @throws CasParserInvalidDataException if any value type in this object doesn't match its
- * expected type.
- */
- fun validate(): KfintechGenerateCasResponse = apply {
- if (validated) {
- return@apply
- }
-
- msg()
- status()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: CasParserInvalidDataException) {
- false
- }
-
- /**
- * Returns a score indicating how many valid values are contained in this object recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int =
- (if (msg.asKnown().isPresent) 1 else 0) + (if (status.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is KfintechGenerateCasResponse &&
- msg == other.msg &&
- status == other.status &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy { Objects.hash(msg, status, additionalProperties) }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "KfintechGenerateCasResponse{msg=$msg, status=$status, additionalProperties=$additionalProperties}"
-}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/async/KfintechServiceAsync.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/async/KfintechServiceAsync.kt
index e2bfdc7..87250f5 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/async/KfintechServiceAsync.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/async/KfintechServiceAsync.kt
@@ -3,14 +3,8 @@
package com.cas_parser.api.services.async
import com.cas_parser.api.core.ClientOptions
-import com.cas_parser.api.core.RequestOptions
-import com.cas_parser.api.core.http.HttpResponseFor
-import com.cas_parser.api.models.kfintech.KfintechGenerateCasParams
-import com.cas_parser.api.models.kfintech.KfintechGenerateCasResponse
-import java.util.concurrent.CompletableFuture
import java.util.function.Consumer
-/** Endpoints for generating new CAS documents via email mailback (KFintech). */
interface KfintechServiceAsync {
/**
@@ -25,22 +19,6 @@ interface KfintechServiceAsync {
*/
fun withOptions(modifier: Consumer): KfintechServiceAsync
- /**
- * Generate CAS via KFintech mailback. The CAS PDF will be sent to the investor's email.
- *
- * This is an async operation - the investor receives the CAS via email within a few minutes.
- * For instant CAS retrieval, use CDSL Fetch (`/v4/cdsl/fetch`).
- */
- fun generateCas(
- params: KfintechGenerateCasParams
- ): CompletableFuture = generateCas(params, RequestOptions.none())
-
- /** @see generateCas */
- fun generateCas(
- params: KfintechGenerateCasParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture
-
/**
* A view of [KfintechServiceAsync] that provides access to raw HTTP responses for each method.
*/
@@ -54,20 +32,5 @@ interface KfintechServiceAsync {
fun withOptions(
modifier: Consumer
): KfintechServiceAsync.WithRawResponse
-
- /**
- * Returns a raw HTTP response for `post /v4/kfintech/generate`, but is otherwise the same
- * as [KfintechServiceAsync.generateCas].
- */
- fun generateCas(
- params: KfintechGenerateCasParams
- ): CompletableFuture> =
- generateCas(params, RequestOptions.none())
-
- /** @see generateCas */
- fun generateCas(
- params: KfintechGenerateCasParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): CompletableFuture>
}
}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/async/KfintechServiceAsyncImpl.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/async/KfintechServiceAsyncImpl.kt
index df04e64..0ddee52 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/async/KfintechServiceAsyncImpl.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/async/KfintechServiceAsyncImpl.kt
@@ -3,24 +3,8 @@
package com.cas_parser.api.services.async
import com.cas_parser.api.core.ClientOptions
-import com.cas_parser.api.core.RequestOptions
-import com.cas_parser.api.core.handlers.errorBodyHandler
-import com.cas_parser.api.core.handlers.errorHandler
-import com.cas_parser.api.core.handlers.jsonHandler
-import com.cas_parser.api.core.http.HttpMethod
-import com.cas_parser.api.core.http.HttpRequest
-import com.cas_parser.api.core.http.HttpResponse
-import com.cas_parser.api.core.http.HttpResponse.Handler
-import com.cas_parser.api.core.http.HttpResponseFor
-import com.cas_parser.api.core.http.json
-import com.cas_parser.api.core.http.parseable
-import com.cas_parser.api.core.prepareAsync
-import com.cas_parser.api.models.kfintech.KfintechGenerateCasParams
-import com.cas_parser.api.models.kfintech.KfintechGenerateCasResponse
-import java.util.concurrent.CompletableFuture
import java.util.function.Consumer
-/** Endpoints for generating new CAS documents via email mailback (KFintech). */
class KfintechServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) :
KfintechServiceAsync {
@@ -33,55 +17,14 @@ class KfintechServiceAsyncImpl internal constructor(private val clientOptions: C
override fun withOptions(modifier: Consumer): KfintechServiceAsync =
KfintechServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
- override fun generateCas(
- params: KfintechGenerateCasParams,
- requestOptions: RequestOptions,
- ): CompletableFuture =
- // post /v4/kfintech/generate
- withRawResponse().generateCas(params, requestOptions).thenApply { it.parse() }
-
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
KfintechServiceAsync.WithRawResponse {
- private val errorHandler: Handler =
- errorHandler(errorBodyHandler(clientOptions.jsonMapper))
-
override fun withOptions(
modifier: Consumer
): KfintechServiceAsync.WithRawResponse =
KfintechServiceAsyncImpl.WithRawResponseImpl(
clientOptions.toBuilder().apply(modifier::accept).build()
)
-
- private val generateCasHandler: Handler =
- jsonHandler(clientOptions.jsonMapper)
-
- override fun generateCas(
- params: KfintechGenerateCasParams,
- requestOptions: RequestOptions,
- ): CompletableFuture> {
- val request =
- HttpRequest.builder()
- .method(HttpMethod.POST)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments("v4", "kfintech", "generate")
- .body(json(clientOptions.jsonMapper, params._body()))
- .build()
- .prepareAsync(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- return request
- .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
- .thenApply { response ->
- errorHandler.handle(response).parseable {
- response
- .use { generateCasHandler.handle(it) }
- .also {
- if (requestOptions.responseValidation!!) {
- it.validate()
- }
- }
- }
- }
- }
}
}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/blocking/KfintechService.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/blocking/KfintechService.kt
index b4ac124..53bbb3a 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/blocking/KfintechService.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/blocking/KfintechService.kt
@@ -3,14 +3,8 @@
package com.cas_parser.api.services.blocking
import com.cas_parser.api.core.ClientOptions
-import com.cas_parser.api.core.RequestOptions
-import com.cas_parser.api.core.http.HttpResponseFor
-import com.cas_parser.api.models.kfintech.KfintechGenerateCasParams
-import com.cas_parser.api.models.kfintech.KfintechGenerateCasResponse
-import com.google.errorprone.annotations.MustBeClosed
import java.util.function.Consumer
-/** Endpoints for generating new CAS documents via email mailback (KFintech). */
interface KfintechService {
/**
@@ -25,21 +19,6 @@ interface KfintechService {
*/
fun withOptions(modifier: Consumer): KfintechService
- /**
- * Generate CAS via KFintech mailback. The CAS PDF will be sent to the investor's email.
- *
- * This is an async operation - the investor receives the CAS via email within a few minutes.
- * For instant CAS retrieval, use CDSL Fetch (`/v4/cdsl/fetch`).
- */
- fun generateCas(params: KfintechGenerateCasParams): KfintechGenerateCasResponse =
- generateCas(params, RequestOptions.none())
-
- /** @see generateCas */
- fun generateCas(
- params: KfintechGenerateCasParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): KfintechGenerateCasResponse
-
/** A view of [KfintechService] that provides access to raw HTTP responses for each method. */
interface WithRawResponse {
@@ -49,21 +28,5 @@ interface KfintechService {
* The original service is not modified.
*/
fun withOptions(modifier: Consumer): KfintechService.WithRawResponse
-
- /**
- * Returns a raw HTTP response for `post /v4/kfintech/generate`, but is otherwise the same
- * as [KfintechService.generateCas].
- */
- @MustBeClosed
- fun generateCas(
- params: KfintechGenerateCasParams
- ): HttpResponseFor = generateCas(params, RequestOptions.none())
-
- /** @see generateCas */
- @MustBeClosed
- fun generateCas(
- params: KfintechGenerateCasParams,
- requestOptions: RequestOptions = RequestOptions.none(),
- ): HttpResponseFor
}
}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/blocking/KfintechServiceImpl.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/blocking/KfintechServiceImpl.kt
index aeccbb9..eaf5058 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/blocking/KfintechServiceImpl.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/services/blocking/KfintechServiceImpl.kt
@@ -3,23 +3,8 @@
package com.cas_parser.api.services.blocking
import com.cas_parser.api.core.ClientOptions
-import com.cas_parser.api.core.RequestOptions
-import com.cas_parser.api.core.handlers.errorBodyHandler
-import com.cas_parser.api.core.handlers.errorHandler
-import com.cas_parser.api.core.handlers.jsonHandler
-import com.cas_parser.api.core.http.HttpMethod
-import com.cas_parser.api.core.http.HttpRequest
-import com.cas_parser.api.core.http.HttpResponse
-import com.cas_parser.api.core.http.HttpResponse.Handler
-import com.cas_parser.api.core.http.HttpResponseFor
-import com.cas_parser.api.core.http.json
-import com.cas_parser.api.core.http.parseable
-import com.cas_parser.api.core.prepare
-import com.cas_parser.api.models.kfintech.KfintechGenerateCasParams
-import com.cas_parser.api.models.kfintech.KfintechGenerateCasResponse
import java.util.function.Consumer
-/** Endpoints for generating new CAS documents via email mailback (KFintech). */
class KfintechServiceImpl internal constructor(private val clientOptions: ClientOptions) :
KfintechService {
@@ -32,52 +17,14 @@ class KfintechServiceImpl internal constructor(private val clientOptions: Client
override fun withOptions(modifier: Consumer): KfintechService =
KfintechServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build())
- override fun generateCas(
- params: KfintechGenerateCasParams,
- requestOptions: RequestOptions,
- ): KfintechGenerateCasResponse =
- // post /v4/kfintech/generate
- withRawResponse().generateCas(params, requestOptions).parse()
-
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
KfintechService.WithRawResponse {
- private val errorHandler: Handler =
- errorHandler(errorBodyHandler(clientOptions.jsonMapper))
-
override fun withOptions(
modifier: Consumer
): KfintechService.WithRawResponse =
KfintechServiceImpl.WithRawResponseImpl(
clientOptions.toBuilder().apply(modifier::accept).build()
)
-
- private val generateCasHandler: Handler =
- jsonHandler(clientOptions.jsonMapper)
-
- override fun generateCas(
- params: KfintechGenerateCasParams,
- requestOptions: RequestOptions,
- ): HttpResponseFor {
- val request =
- HttpRequest.builder()
- .method(HttpMethod.POST)
- .baseUrl(clientOptions.baseUrl())
- .addPathSegments("v4", "kfintech", "generate")
- .body(json(clientOptions.jsonMapper, params._body()))
- .build()
- .prepare(clientOptions, params)
- val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
- val response = clientOptions.httpClient.execute(request, requestOptions)
- return errorHandler.handle(response).parseable {
- response
- .use { generateCasHandler.handle(it) }
- .also {
- if (requestOptions.responseValidation!!) {
- it.validate()
- }
- }
- }
- }
}
}
diff --git a/cas-parser-java-core/src/test/kotlin/com/cas_parser/api/models/kfintech/KfintechGenerateCasParamsTest.kt b/cas-parser-java-core/src/test/kotlin/com/cas_parser/api/models/kfintech/KfintechGenerateCasParamsTest.kt
deleted file mode 100644
index bed6b13..0000000
--- a/cas-parser-java-core/src/test/kotlin/com/cas_parser/api/models/kfintech/KfintechGenerateCasParamsTest.kt
+++ /dev/null
@@ -1,58 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.cas_parser.api.models.kfintech
-
-import org.assertj.core.api.Assertions.assertThat
-import org.junit.jupiter.api.Test
-
-internal class KfintechGenerateCasParamsTest {
-
- @Test
- fun create() {
- KfintechGenerateCasParams.builder()
- .email("user@example.com")
- .fromDate("2023-01-01")
- .password("Abcdefghi12\$")
- .toDate("2023-12-31")
- .panNo("ABCDE1234F")
- .build()
- }
-
- @Test
- fun body() {
- val params =
- KfintechGenerateCasParams.builder()
- .email("user@example.com")
- .fromDate("2023-01-01")
- .password("Abcdefghi12\$")
- .toDate("2023-12-31")
- .panNo("ABCDE1234F")
- .build()
-
- val body = params._body()
-
- assertThat(body.email()).isEqualTo("user@example.com")
- assertThat(body.fromDate()).isEqualTo("2023-01-01")
- assertThat(body.password()).isEqualTo("Abcdefghi12\$")
- assertThat(body.toDate()).isEqualTo("2023-12-31")
- assertThat(body.panNo()).contains("ABCDE1234F")
- }
-
- @Test
- fun bodyWithoutOptionalFields() {
- val params =
- KfintechGenerateCasParams.builder()
- .email("user@example.com")
- .fromDate("2023-01-01")
- .password("Abcdefghi12\$")
- .toDate("2023-12-31")
- .build()
-
- val body = params._body()
-
- assertThat(body.email()).isEqualTo("user@example.com")
- assertThat(body.fromDate()).isEqualTo("2023-01-01")
- assertThat(body.password()).isEqualTo("Abcdefghi12\$")
- assertThat(body.toDate()).isEqualTo("2023-12-31")
- }
-}
diff --git a/cas-parser-java-core/src/test/kotlin/com/cas_parser/api/models/kfintech/KfintechGenerateCasResponseTest.kt b/cas-parser-java-core/src/test/kotlin/com/cas_parser/api/models/kfintech/KfintechGenerateCasResponseTest.kt
deleted file mode 100644
index 57b2d09..0000000
--- a/cas-parser-java-core/src/test/kotlin/com/cas_parser/api/models/kfintech/KfintechGenerateCasResponseTest.kt
+++ /dev/null
@@ -1,42 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.cas_parser.api.models.kfintech
-
-import com.cas_parser.api.core.jsonMapper
-import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
-import org.assertj.core.api.Assertions.assertThat
-import org.junit.jupiter.api.Test
-
-internal class KfintechGenerateCasResponseTest {
-
- @Test
- fun create() {
- val kfintechGenerateCasResponse =
- KfintechGenerateCasResponse.builder()
- .msg("CAS request submitted. Check email shortly.")
- .status("success")
- .build()
-
- assertThat(kfintechGenerateCasResponse.msg())
- .contains("CAS request submitted. Check email shortly.")
- assertThat(kfintechGenerateCasResponse.status()).contains("success")
- }
-
- @Test
- fun roundtrip() {
- val jsonMapper = jsonMapper()
- val kfintechGenerateCasResponse =
- KfintechGenerateCasResponse.builder()
- .msg("CAS request submitted. Check email shortly.")
- .status("success")
- .build()
-
- val roundtrippedKfintechGenerateCasResponse =
- jsonMapper.readValue(
- jsonMapper.writeValueAsString(kfintechGenerateCasResponse),
- jacksonTypeRef(),
- )
-
- assertThat(roundtrippedKfintechGenerateCasResponse).isEqualTo(kfintechGenerateCasResponse)
- }
-}
diff --git a/cas-parser-java-core/src/test/kotlin/com/cas_parser/api/services/async/KfintechServiceAsyncTest.kt b/cas-parser-java-core/src/test/kotlin/com/cas_parser/api/services/async/KfintechServiceAsyncTest.kt
deleted file mode 100644
index 0632267..0000000
--- a/cas-parser-java-core/src/test/kotlin/com/cas_parser/api/services/async/KfintechServiceAsyncTest.kt
+++ /dev/null
@@ -1,32 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.cas_parser.api.services.async
-
-import com.cas_parser.api.client.okhttp.CasParserOkHttpClientAsync
-import com.cas_parser.api.models.kfintech.KfintechGenerateCasParams
-import org.junit.jupiter.api.Disabled
-import org.junit.jupiter.api.Test
-
-internal class KfintechServiceAsyncTest {
-
- @Disabled("Mock server tests are disabled")
- @Test
- fun generateCas() {
- val client = CasParserOkHttpClientAsync.builder().apiKey("My API Key").build()
- val kfintechServiceAsync = client.kfintech()
-
- val responseFuture =
- kfintechServiceAsync.generateCas(
- KfintechGenerateCasParams.builder()
- .email("user@example.com")
- .fromDate("2023-01-01")
- .password("Abcdefghi12\$")
- .toDate("2023-12-31")
- .panNo("ABCDE1234F")
- .build()
- )
-
- val response = responseFuture.get()
- response.validate()
- }
-}
diff --git a/cas-parser-java-core/src/test/kotlin/com/cas_parser/api/services/blocking/KfintechServiceTest.kt b/cas-parser-java-core/src/test/kotlin/com/cas_parser/api/services/blocking/KfintechServiceTest.kt
deleted file mode 100644
index ddc39f7..0000000
--- a/cas-parser-java-core/src/test/kotlin/com/cas_parser/api/services/blocking/KfintechServiceTest.kt
+++ /dev/null
@@ -1,31 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.cas_parser.api.services.blocking
-
-import com.cas_parser.api.client.okhttp.CasParserOkHttpClient
-import com.cas_parser.api.models.kfintech.KfintechGenerateCasParams
-import org.junit.jupiter.api.Disabled
-import org.junit.jupiter.api.Test
-
-internal class KfintechServiceTest {
-
- @Disabled("Mock server tests are disabled")
- @Test
- fun generateCas() {
- val client = CasParserOkHttpClient.builder().apiKey("My API Key").build()
- val kfintechService = client.kfintech()
-
- val response =
- kfintechService.generateCas(
- KfintechGenerateCasParams.builder()
- .email("user@example.com")
- .fromDate("2023-01-01")
- .password("Abcdefghi12\$")
- .toDate("2023-12-31")
- .panNo("ABCDE1234F")
- .build()
- )
-
- response.validate()
- }
-}