diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 3d2ac0b..10f3091 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0"
+ ".": "0.2.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 2c90fa6..4d62cd0 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 4
+configured_endpoints: 17
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-56b0f699c5437d9e5326626d35dfc972c17d01f12cb416c7f4854c8ea6d0e95e.yml
openapi_spec_hash: 158f405c1880706266d83e6ff16b9d2f
-config_hash: cb5d75abef6264b5d86448caf7295afa
+config_hash: 1af2e938c93ea4ec25fc633469072c43
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c68f82c..d4e9764 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,19 @@
# Changelog
+## 0.2.0 (2026-02-14)
+
+Full Changelog: [v0.1.0...v0.2.0](https://github.com/CASParser/cas-parser-java/compare/v0.1.0...v0.2.0)
+
+### Features
+
+* **api:** manual updates ([b21f22f](https://github.com/CASParser/cas-parser-java/commit/b21f22fdb7949e53222c362d41cdde390036a7d7))
+
+
+### Chores
+
+* configure new SDK language ([2e9b4a1](https://github.com/CASParser/cas-parser-java/commit/2e9b4a178af20b81ed25065a309581afad0689da))
+* update SDK settings ([27c0e10](https://github.com/CASParser/cas-parser-java/commit/27c0e107ff02b981b34b1740d977ce4d99f3c771))
+
## 0.1.0 (2026-02-14)
Full Changelog: [v0.0.4...v0.1.0](https://github.com/CASParser/cas-parser-java/compare/v0.0.4...v0.1.0)
diff --git a/README.md b/README.md
index dc0b1dc..3d0bf3f 100644
--- a/README.md
+++ b/README.md
@@ -2,12 +2,12 @@
-[](https://central.sonatype.com/artifact/com.cas_parser.api/cas-parser-java/0.1.0)
-[](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.1.0)
+[](https://central.sonatype.com/artifact/com.cas_parser.api/cas-parser-java/0.2.0)
+[](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.2.0)
-The Cas Parser Java SDK provides convenient access to the [Cas Parser REST API](https://docs.casparser.in/reference) from applications written in Java.
+The Cas Parser Java SDK provides convenient access to the Cas Parser REST API from applications written in Java.
It is generated with [Stainless](https://www.stainless.com/).
@@ -15,14 +15,14 @@ It is generated with [Stainless](https://www.stainless.com/).
Use the Cas Parser MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
-[](https://cursor.com/en-US/install-mcp?name=cas-parser-node-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNhcy1wYXJzZXItbm9kZS1tY3AiXSwiZW52Ijp7IkNBU19QQVJTRVJfQVBJX0tFWSI6Ik15IEFQSSBLZXkifX0)
-[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cas-parser-node-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cas-parser-node-mcp%22%5D%2C%22env%22%3A%7B%22CAS_PARSER_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)
+[](https://cursor.com/en-US/install-mcp?name=cas-parser-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNhcy1wYXJzZXItbWNwIl0sImVudiI6eyJDQVNfUEFSU0VSX0FQSV9LRVkiOiJNeSBBUEkgS2V5In19)
+[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cas-parser-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cas-parser-mcp%22%5D%2C%22env%22%3A%7B%22CAS_PARSER_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)
> Note: You may need to set environment variables in your MCP client.
-The REST API documentation can be found on [docs.casparser.in](https://docs.casparser.in/reference). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.1.0).
+Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.2.0).
@@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.casparser.in](https://docs.casp
### Gradle
```kotlin
-implementation("com.cas_parser.api:cas-parser-java:0.1.0")
+implementation("com.cas_parser.api:cas-parser-java:0.2.0")
```
### Maven
@@ -42,7 +42,7 @@ implementation("com.cas_parser.api:cas-parser-java:0.1.0")
com.cas_parser.api
cas-parser-java
- 0.1.0
+ 0.2.0
```
@@ -57,18 +57,14 @@ This library requires Java 8 or later.
```java
import com.cas_parser.api.client.CasParserClient;
import com.cas_parser.api.client.okhttp.CasParserOkHttpClient;
-import com.cas_parser.api.models.casparser.CasParserSmartParseParams;
-import com.cas_parser.api.models.casparser.UnifiedResponse;
+import com.cas_parser.api.models.credits.CreditCheckParams;
+import com.cas_parser.api.models.credits.CreditCheckResponse;
// Configures using the `casparser.apiKey` and `casparser.baseUrl` system properties
// Or configures using the `CAS_PARSER_API_KEY` and `CAS_PARSER_BASE_URL` environment variables
CasParserClient client = CasParserOkHttpClient.fromEnv();
-CasParserSmartParseParams params = CasParserSmartParseParams.builder()
- .password("ABCDF")
- .pdfUrl("https://your-cas-pdf-url-here.com")
- .build();
-UnifiedResponse unifiedResponse = client.casParser().smartParse(params);
+CreditCheckResponse response = client.credits().check();
```
## Client configuration
@@ -141,7 +137,7 @@ The `withOptions()` method does not affect the original client or service.
To send a request to the Cas Parser API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.
-For example, `client.casParser().smartParse(...)` should be called with an instance of `CasParserSmartParseParams`, and it will return an instance of `UnifiedResponse`.
+For example, `client.credits().check(...)` should be called with an instance of `CreditCheckParams`, and it will return an instance of `CreditCheckResponse`.
## Immutability
@@ -158,19 +154,15 @@ The default client is synchronous. To switch to asynchronous execution, call the
```java
import com.cas_parser.api.client.CasParserClient;
import com.cas_parser.api.client.okhttp.CasParserOkHttpClient;
-import com.cas_parser.api.models.casparser.CasParserSmartParseParams;
-import com.cas_parser.api.models.casparser.UnifiedResponse;
+import com.cas_parser.api.models.credits.CreditCheckParams;
+import com.cas_parser.api.models.credits.CreditCheckResponse;
import java.util.concurrent.CompletableFuture;
// Configures using the `casparser.apiKey` and `casparser.baseUrl` system properties
// Or configures using the `CAS_PARSER_API_KEY` and `CAS_PARSER_BASE_URL` environment variables
CasParserClient client = CasParserOkHttpClient.fromEnv();
-CasParserSmartParseParams params = CasParserSmartParseParams.builder()
- .password("ABCDF")
- .pdfUrl("https://your-cas-pdf-url-here.com")
- .build();
-CompletableFuture unifiedResponse = client.async().casParser().smartParse(params);
+CompletableFuture response = client.async().credits().check();
```
Or create an asynchronous client from the beginning:
@@ -178,19 +170,15 @@ Or create an asynchronous client from the beginning:
```java
import com.cas_parser.api.client.CasParserClientAsync;
import com.cas_parser.api.client.okhttp.CasParserOkHttpClientAsync;
-import com.cas_parser.api.models.casparser.CasParserSmartParseParams;
-import com.cas_parser.api.models.casparser.UnifiedResponse;
+import com.cas_parser.api.models.credits.CreditCheckParams;
+import com.cas_parser.api.models.credits.CreditCheckResponse;
import java.util.concurrent.CompletableFuture;
// Configures using the `casparser.apiKey` and `casparser.baseUrl` system properties
// Or configures using the `CAS_PARSER_API_KEY` and `CAS_PARSER_BASE_URL` environment variables
CasParserClientAsync client = CasParserOkHttpClientAsync.fromEnv();
-CasParserSmartParseParams params = CasParserSmartParseParams.builder()
- .password("ABCDF")
- .pdfUrl("https://your-cas-pdf-url-here.com")
- .build();
-CompletableFuture unifiedResponse = client.casParser().smartParse(params);
+CompletableFuture response = client.credits().check();
```
The asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.
@@ -204,25 +192,21 @@ To access this data, prefix any HTTP method call on a client or service with `wi
```java
import com.cas_parser.api.core.http.Headers;
import com.cas_parser.api.core.http.HttpResponseFor;
-import com.cas_parser.api.models.casparser.CasParserSmartParseParams;
-import com.cas_parser.api.models.casparser.UnifiedResponse;
+import com.cas_parser.api.models.credits.CreditCheckParams;
+import com.cas_parser.api.models.credits.CreditCheckResponse;
-CasParserSmartParseParams params = CasParserSmartParseParams.builder()
- .password("ABCDF")
- .pdfUrl("https://you-cas-pdf-url-here.com")
- .build();
-HttpResponseFor unifiedResponse = client.casParser().withRawResponse().smartParse(params);
+HttpResponseFor response = client.credits().withRawResponse().check();
-int statusCode = unifiedResponse.statusCode();
-Headers headers = unifiedResponse.headers();
+int statusCode = response.statusCode();
+Headers headers = response.headers();
```
You can still deserialize the response into an instance of a Java class if needed:
```java
-import com.cas_parser.api.models.casparser.UnifiedResponse;
+import com.cas_parser.api.models.credits.CreditCheckResponse;
-UnifiedResponse parsedUnifiedResponse = unifiedResponse.parse();
+CreditCheckResponse parsedResponse = response.parse();
```
## Error handling
@@ -320,9 +304,9 @@ Requests time out after 1 minute by default.
To set a custom timeout, configure the method call using the `timeout` method:
```java
-import com.cas_parser.api.models.casparser.UnifiedResponse;
+import com.cas_parser.api.models.credits.CreditCheckResponse;
-UnifiedResponse unifiedResponse = client.casParser().smartParse(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());
+CreditCheckResponse response = client.credits().check(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());
```
Or configure the default for all method calls at the client level:
@@ -379,6 +363,21 @@ CasParserClient client = CasParserOkHttpClient.builder()
.build();
```
+### Environments
+
+The SDK sends requests to the production by default. To send requests to a different environment, configure the client like so:
+
+```java
+import com.cas_parser.api.client.CasParserClient;
+import com.cas_parser.api.client.okhttp.CasParserOkHttpClient;
+
+CasParserClient client = CasParserOkHttpClient.builder()
+ .fromEnv()
+ // Other options include `environment2`
+ .environment1()
+ .build();
+```
+
### Custom HTTP client
The SDK consists of three artifacts:
@@ -425,9 +424,9 @@ To set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQu
```java
import com.cas_parser.api.core.JsonValue;
-import com.cas_parser.api.models.casparser.CasParserSmartParseParams;
+import com.cas_parser.api.models.credits.CreditCheckParams;
-CasParserSmartParseParams params = CasParserSmartParseParams.builder()
+CreditCheckParams params = CreditCheckParams.builder()
.putAdditionalHeader("Secret-Header", "42")
.putAdditionalQueryParam("secret_query_param", "42")
.putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))
@@ -439,13 +438,9 @@ These can be accessed on the built object later using the `_additionalHeaders()`
To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/core/Values.kt) object to its setter:
```java
-import com.cas_parser.api.core.JsonValue;
-import com.cas_parser.api.models.casparser.CasParserSmartParseParams;
+import com.cas_parser.api.models.credits.CreditCheckParams;
-CasParserSmartParseParams params = CasParserSmartParseParams.builder()
- .password(JsonValue.from(42))
- .pdfUrl("https://your-cas-pdf-url-here.com")
- .build();
+CreditCheckParams params = CreditCheckParams.builder().build();
```
The most straightforward way to create a [`JsonValue`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/core/Values.kt) is using its `from(...)` method:
@@ -487,6 +482,22 @@ JsonValue complexValue = JsonValue.from(Map.of(
));
```
+Normally a `Builder` class's `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.
+
+To forcibly omit a required parameter or property, pass [`JsonMissing`](cas-parser-java-core/src/main/kotlin/com/cas_parser/api/core/Values.kt):
+
+```java
+import com.cas_parser.api.core.JsonMissing;
+import com.cas_parser.api.models.cdsl.fetch.FetchRequestOtpParams;
+import com.cas_parser.api.models.credits.CreditCheckParams;
+
+CreditCheckParams params = FetchRequestOtpParams.builder()
+ .dob("1990-01-15")
+ .pan("ABCDE1234F")
+ .boId(JsonMissing.of())
+ .build();
+```
+
### Response properties
To access undocumented response properties, call the `_additionalProperties()` method:
@@ -495,7 +506,7 @@ To access undocumented response properties, call the `_additionalProperties()` m
import com.cas_parser.api.core.JsonValue;
import java.util.Map;
-Map additionalProperties = client.casParser().smartParse(params)._additionalProperties();
+Map additionalProperties = client.credits().check(params)._additionalProperties();
JsonValue secretPropertyValue = additionalProperties.get("secretProperty");
String result = secretPropertyValue.accept(new JsonValue.Visitor<>() {
@@ -525,19 +536,19 @@ To access a property's raw JSON value, which may be undocumented, call its `_` p
import com.cas_parser.api.core.JsonField;
import java.util.Optional;
-JsonField password = client.casParser().smartParse(params)._password();
+JsonField field = client.credits().check(params)._field();
-if (password.isMissing()) {
+if (field.isMissing()) {
// The property is absent from the JSON response
-} else if (password.isNull()) {
+} else if (field.isNull()) {
// The property was set to literal null
} else {
// Check if value was provided as a string
// Other methods include `asNumber()`, `asBoolean()`, etc.
- Optional jsonString = password.asString();
+ Optional jsonString = field.asString();
// Try to deserialize into a custom type
- MyClass myObject = password.asUnknown().orElseThrow().convert(MyClass.class);
+ MyClass myObject = field.asUnknown().orElseThrow().convert(MyClass.class);
}
```
@@ -550,17 +561,17 @@ By default, the SDK will not throw an exception in this case. It will throw [`Ca
If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:
```java
-import com.cas_parser.api.models.casparser.UnifiedResponse;
+import com.cas_parser.api.models.credits.CreditCheckResponse;
-UnifiedResponse unifiedResponse = client.casParser().smartParse(params).validate();
+CreditCheckResponse response = client.credits().check(params).validate();
```
Or configure the method call to validate the response using the `responseValidation` method:
```java
-import com.cas_parser.api.models.casparser.UnifiedResponse;
+import com.cas_parser.api.models.credits.CreditCheckResponse;
-UnifiedResponse unifiedResponse = client.casParser().smartParse(RequestOptions.builder().responseValidation(true).build());
+CreditCheckResponse response = client.credits().check(RequestOptions.builder().responseValidation(true).build());
```
Or configure the default for all method calls at the client level:
diff --git a/build.gradle.kts b/build.gradle.kts
index 30b3cae..55b241b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,7 +9,7 @@ repositories {
allprojects {
group = "com.cas_parser.api"
- version = "0.1.0" // x-release-please-version
+ version = "0.2.0" // x-release-please-version
}
subprojects {
diff --git a/buildSrc/src/main/kotlin/cas-parser.publish.gradle.kts b/buildSrc/src/main/kotlin/cas-parser.publish.gradle.kts
index 26aec10..56f585c 100644
--- a/buildSrc/src/main/kotlin/cas-parser.publish.gradle.kts
+++ b/buildSrc/src/main/kotlin/cas-parser.publish.gradle.kts
@@ -11,7 +11,7 @@ configure {
pom {
name.set("CAS Parser - Track Portfolios from CDSL, NSDL, CAMS, KFintech")
description.set("API for parsing and analyzing CAS (Consolidated Account Statement) PDF files\nfrom NSDL, CDSL, and CAMS/KFintech, with a unified response format")
- url.set("https://docs.casparser.in/reference")
+ url.set("https://www.github.com/CASParser/cas-parser-java")
licenses {
license {
diff --git a/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt b/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt
index 93a7aeb..dc713f6 100644
--- a/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt
+++ b/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt
@@ -166,12 +166,22 @@ class CasParserOkHttpClient private constructor() {
* The base URL to use for every request.
*
* Defaults to the production environment: `https://portfolio-parser.api.casparser.in`.
+ *
+ * The following other environments, with dedicated builder methods, are available:
+ * - environment_1: `https://client-apis.casparser.in`
+ * - environment_2: `http://localhost:5000`
*/
fun baseUrl(baseUrl: String?) = apply { clientOptions.baseUrl(baseUrl) }
/** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */
fun baseUrl(baseUrl: Optional) = baseUrl(baseUrl.getOrNull())
+ /** Sets [baseUrl] to `https://client-apis.casparser.in`. */
+ fun environment1() = apply { clientOptions.environment1() }
+
+ /** Sets [baseUrl] to `http://localhost:5000`. */
+ fun environment2() = apply { clientOptions.environment2() }
+
/**
* Whether to call `validate` on every response before returning it.
*
diff --git a/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt b/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt
index f4858a0..5d4beab 100644
--- a/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt
+++ b/cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt
@@ -166,12 +166,22 @@ class CasParserOkHttpClientAsync private constructor() {
* The base URL to use for every request.
*
* Defaults to the production environment: `https://portfolio-parser.api.casparser.in`.
+ *
+ * The following other environments, with dedicated builder methods, are available:
+ * - environment_1: `https://client-apis.casparser.in`
+ * - environment_2: `http://localhost:5000`
*/
fun baseUrl(baseUrl: String?) = apply { clientOptions.baseUrl(baseUrl) }
/** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */
fun baseUrl(baseUrl: Optional) = baseUrl(baseUrl.getOrNull())
+ /** Sets [baseUrl] to `https://client-apis.casparser.in`. */
+ fun environment1() = apply { clientOptions.environment1() }
+
+ /** Sets [baseUrl] to `http://localhost:5000`. */
+ fun environment2() = apply { clientOptions.environment2() }
+
/**
* Whether to call `validate` on every response before returning it.
*
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 6a2e9fb..87a671b 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
@@ -3,8 +3,17 @@
package com.cas_parser.api.client
import com.cas_parser.api.core.ClientOptions
-import com.cas_parser.api.services.blocking.CasGeneratorService
-import com.cas_parser.api.services.blocking.CasParserService
+import com.cas_parser.api.services.blocking.AccessTokenService
+import com.cas_parser.api.services.blocking.CamsKfintechService
+import com.cas_parser.api.services.blocking.CdslService
+import com.cas_parser.api.services.blocking.ContractNoteService
+import com.cas_parser.api.services.blocking.CreditService
+import com.cas_parser.api.services.blocking.InboxService
+import com.cas_parser.api.services.blocking.KfintechService
+import com.cas_parser.api.services.blocking.LogService
+import com.cas_parser.api.services.blocking.NsdlService
+import com.cas_parser.api.services.blocking.SmartService
+import com.cas_parser.api.services.blocking.VerifyTokenService
import java.util.function.Consumer
/**
@@ -43,9 +52,27 @@ interface CasParserClient {
*/
fun withOptions(modifier: Consumer): CasParserClient
- fun casParser(): CasParserService
+ fun credits(): CreditService
- fun casGenerator(): CasGeneratorService
+ fun logs(): LogService
+
+ fun accessToken(): AccessTokenService
+
+ fun verifyToken(): VerifyTokenService
+
+ fun camsKfintech(): CamsKfintechService
+
+ fun cdsl(): CdslService
+
+ fun contractNote(): ContractNoteService
+
+ fun inbox(): InboxService
+
+ fun kfintech(): KfintechService
+
+ fun nsdl(): NsdlService
+
+ fun smart(): SmartService
/**
* Closes this client, relinquishing any underlying resources.
@@ -70,8 +97,26 @@ interface CasParserClient {
*/
fun withOptions(modifier: Consumer): CasParserClient.WithRawResponse
- fun casParser(): CasParserService.WithRawResponse
+ fun credits(): CreditService.WithRawResponse
+
+ fun logs(): LogService.WithRawResponse
+
+ fun accessToken(): AccessTokenService.WithRawResponse
+
+ fun verifyToken(): VerifyTokenService.WithRawResponse
+
+ fun camsKfintech(): CamsKfintechService.WithRawResponse
+
+ fun cdsl(): CdslService.WithRawResponse
+
+ fun contractNote(): ContractNoteService.WithRawResponse
+
+ fun inbox(): InboxService.WithRawResponse
+
+ fun kfintech(): KfintechService.WithRawResponse
+
+ fun nsdl(): NsdlService.WithRawResponse
- fun casGenerator(): CasGeneratorService.WithRawResponse
+ fun smart(): SmartService.WithRawResponse
}
}
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 24e7f4e..22f6ad3 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
@@ -3,8 +3,17 @@
package com.cas_parser.api.client
import com.cas_parser.api.core.ClientOptions
-import com.cas_parser.api.services.async.CasGeneratorServiceAsync
-import com.cas_parser.api.services.async.CasParserServiceAsync
+import com.cas_parser.api.services.async.AccessTokenServiceAsync
+import com.cas_parser.api.services.async.CamsKfintechServiceAsync
+import com.cas_parser.api.services.async.CdslServiceAsync
+import com.cas_parser.api.services.async.ContractNoteServiceAsync
+import com.cas_parser.api.services.async.CreditServiceAsync
+import com.cas_parser.api.services.async.InboxServiceAsync
+import com.cas_parser.api.services.async.KfintechServiceAsync
+import com.cas_parser.api.services.async.LogServiceAsync
+import com.cas_parser.api.services.async.NsdlServiceAsync
+import com.cas_parser.api.services.async.SmartServiceAsync
+import com.cas_parser.api.services.async.VerifyTokenServiceAsync
import java.util.function.Consumer
/**
@@ -43,9 +52,27 @@ interface CasParserClientAsync {
*/
fun withOptions(modifier: Consumer): CasParserClientAsync
- fun casParser(): CasParserServiceAsync
+ fun credits(): CreditServiceAsync
- fun casGenerator(): CasGeneratorServiceAsync
+ fun logs(): LogServiceAsync
+
+ fun accessToken(): AccessTokenServiceAsync
+
+ fun verifyToken(): VerifyTokenServiceAsync
+
+ fun camsKfintech(): CamsKfintechServiceAsync
+
+ fun cdsl(): CdslServiceAsync
+
+ fun contractNote(): ContractNoteServiceAsync
+
+ fun inbox(): InboxServiceAsync
+
+ fun kfintech(): KfintechServiceAsync
+
+ fun nsdl(): NsdlServiceAsync
+
+ fun smart(): SmartServiceAsync
/**
* Closes this client, relinquishing any underlying resources.
@@ -74,8 +101,26 @@ interface CasParserClientAsync {
modifier: Consumer
): CasParserClientAsync.WithRawResponse
- fun casParser(): CasParserServiceAsync.WithRawResponse
+ fun credits(): CreditServiceAsync.WithRawResponse
+
+ fun logs(): LogServiceAsync.WithRawResponse
+
+ fun accessToken(): AccessTokenServiceAsync.WithRawResponse
+
+ fun verifyToken(): VerifyTokenServiceAsync.WithRawResponse
+
+ fun camsKfintech(): CamsKfintechServiceAsync.WithRawResponse
+
+ fun cdsl(): CdslServiceAsync.WithRawResponse
+
+ fun contractNote(): ContractNoteServiceAsync.WithRawResponse
+
+ fun inbox(): InboxServiceAsync.WithRawResponse
+
+ fun kfintech(): KfintechServiceAsync.WithRawResponse
+
+ fun nsdl(): NsdlServiceAsync.WithRawResponse
- fun casGenerator(): CasGeneratorServiceAsync.WithRawResponse
+ fun smart(): SmartServiceAsync.WithRawResponse
}
}
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 d8b0b67..5f28136 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
@@ -4,10 +4,28 @@ package com.cas_parser.api.client
import com.cas_parser.api.core.ClientOptions
import com.cas_parser.api.core.getPackageVersion
-import com.cas_parser.api.services.async.CasGeneratorServiceAsync
-import com.cas_parser.api.services.async.CasGeneratorServiceAsyncImpl
-import com.cas_parser.api.services.async.CasParserServiceAsync
-import com.cas_parser.api.services.async.CasParserServiceAsyncImpl
+import com.cas_parser.api.services.async.AccessTokenServiceAsync
+import com.cas_parser.api.services.async.AccessTokenServiceAsyncImpl
+import com.cas_parser.api.services.async.CamsKfintechServiceAsync
+import com.cas_parser.api.services.async.CamsKfintechServiceAsyncImpl
+import com.cas_parser.api.services.async.CdslServiceAsync
+import com.cas_parser.api.services.async.CdslServiceAsyncImpl
+import com.cas_parser.api.services.async.ContractNoteServiceAsync
+import com.cas_parser.api.services.async.ContractNoteServiceAsyncImpl
+import com.cas_parser.api.services.async.CreditServiceAsync
+import com.cas_parser.api.services.async.CreditServiceAsyncImpl
+import com.cas_parser.api.services.async.InboxServiceAsync
+import com.cas_parser.api.services.async.InboxServiceAsyncImpl
+import com.cas_parser.api.services.async.KfintechServiceAsync
+import com.cas_parser.api.services.async.KfintechServiceAsyncImpl
+import com.cas_parser.api.services.async.LogServiceAsync
+import com.cas_parser.api.services.async.LogServiceAsyncImpl
+import com.cas_parser.api.services.async.NsdlServiceAsync
+import com.cas_parser.api.services.async.NsdlServiceAsyncImpl
+import com.cas_parser.api.services.async.SmartServiceAsync
+import com.cas_parser.api.services.async.SmartServiceAsyncImpl
+import com.cas_parser.api.services.async.VerifyTokenServiceAsync
+import com.cas_parser.api.services.async.VerifyTokenServiceAsyncImpl
import java.util.function.Consumer
class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasParserClientAsync {
@@ -27,12 +45,42 @@ class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasPa
WithRawResponseImpl(clientOptions)
}
- private val casParser: CasParserServiceAsync by lazy {
- CasParserServiceAsyncImpl(clientOptionsWithUserAgent)
+ private val credits: CreditServiceAsync by lazy {
+ CreditServiceAsyncImpl(clientOptionsWithUserAgent)
}
- private val casGenerator: CasGeneratorServiceAsync by lazy {
- CasGeneratorServiceAsyncImpl(clientOptionsWithUserAgent)
+ private val logs: LogServiceAsync by lazy { LogServiceAsyncImpl(clientOptionsWithUserAgent) }
+
+ private val accessToken: AccessTokenServiceAsync by lazy {
+ AccessTokenServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val verifyToken: VerifyTokenServiceAsync by lazy {
+ VerifyTokenServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val camsKfintech: CamsKfintechServiceAsync by lazy {
+ CamsKfintechServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val cdsl: CdslServiceAsync by lazy { CdslServiceAsyncImpl(clientOptionsWithUserAgent) }
+
+ private val contractNote: ContractNoteServiceAsync by lazy {
+ ContractNoteServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val inbox: InboxServiceAsync by lazy {
+ InboxServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val kfintech: KfintechServiceAsync by lazy {
+ KfintechServiceAsyncImpl(clientOptionsWithUserAgent)
+ }
+
+ private val nsdl: NsdlServiceAsync by lazy { NsdlServiceAsyncImpl(clientOptionsWithUserAgent) }
+
+ private val smart: SmartServiceAsync by lazy {
+ SmartServiceAsyncImpl(clientOptionsWithUserAgent)
}
override fun sync(): CasParserClient = sync
@@ -42,21 +90,75 @@ class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasPa
override fun withOptions(modifier: Consumer): CasParserClientAsync =
CasParserClientAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
- override fun casParser(): CasParserServiceAsync = casParser
+ override fun credits(): CreditServiceAsync = credits
+
+ override fun logs(): LogServiceAsync = logs
+
+ override fun accessToken(): AccessTokenServiceAsync = accessToken
+
+ override fun verifyToken(): VerifyTokenServiceAsync = verifyToken
+
+ override fun camsKfintech(): CamsKfintechServiceAsync = camsKfintech
+
+ override fun cdsl(): CdslServiceAsync = cdsl
- override fun casGenerator(): CasGeneratorServiceAsync = casGenerator
+ override fun contractNote(): ContractNoteServiceAsync = contractNote
+
+ override fun inbox(): InboxServiceAsync = inbox
+
+ override fun kfintech(): KfintechServiceAsync = kfintech
+
+ override fun nsdl(): NsdlServiceAsync = nsdl
+
+ override fun smart(): SmartServiceAsync = smart
override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
CasParserClientAsync.WithRawResponse {
- private val casParser: CasParserServiceAsync.WithRawResponse by lazy {
- CasParserServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ private val credits: CreditServiceAsync.WithRawResponse by lazy {
+ CreditServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val logs: LogServiceAsync.WithRawResponse by lazy {
+ LogServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
- private val casGenerator: CasGeneratorServiceAsync.WithRawResponse by lazy {
- CasGeneratorServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ private val accessToken: AccessTokenServiceAsync.WithRawResponse by lazy {
+ AccessTokenServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val verifyToken: VerifyTokenServiceAsync.WithRawResponse by lazy {
+ VerifyTokenServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val camsKfintech: CamsKfintechServiceAsync.WithRawResponse by lazy {
+ CamsKfintechServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val cdsl: CdslServiceAsync.WithRawResponse by lazy {
+ CdslServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val contractNote: ContractNoteServiceAsync.WithRawResponse by lazy {
+ ContractNoteServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val inbox: InboxServiceAsync.WithRawResponse by lazy {
+ InboxServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val kfintech: KfintechServiceAsync.WithRawResponse by lazy {
+ KfintechServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val nsdl: NsdlServiceAsync.WithRawResponse by lazy {
+ NsdlServiceAsyncImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val smart: SmartServiceAsync.WithRawResponse by lazy {
+ SmartServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
override fun withOptions(
@@ -66,8 +168,26 @@ class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasPa
clientOptions.toBuilder().apply(modifier::accept).build()
)
- override fun casParser(): CasParserServiceAsync.WithRawResponse = casParser
+ override fun credits(): CreditServiceAsync.WithRawResponse = credits
+
+ override fun logs(): LogServiceAsync.WithRawResponse = logs
+
+ override fun accessToken(): AccessTokenServiceAsync.WithRawResponse = accessToken
+
+ override fun verifyToken(): VerifyTokenServiceAsync.WithRawResponse = verifyToken
+
+ override fun camsKfintech(): CamsKfintechServiceAsync.WithRawResponse = camsKfintech
+
+ override fun cdsl(): CdslServiceAsync.WithRawResponse = cdsl
+
+ override fun contractNote(): ContractNoteServiceAsync.WithRawResponse = contractNote
+
+ override fun inbox(): InboxServiceAsync.WithRawResponse = inbox
+
+ override fun kfintech(): KfintechServiceAsync.WithRawResponse = kfintech
+
+ override fun nsdl(): NsdlServiceAsync.WithRawResponse = nsdl
- override fun casGenerator(): CasGeneratorServiceAsync.WithRawResponse = casGenerator
+ override fun smart(): SmartServiceAsync.WithRawResponse = smart
}
}
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 fe0f962..f4b18e8 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
@@ -4,10 +4,28 @@ package com.cas_parser.api.client
import com.cas_parser.api.core.ClientOptions
import com.cas_parser.api.core.getPackageVersion
-import com.cas_parser.api.services.blocking.CasGeneratorService
-import com.cas_parser.api.services.blocking.CasGeneratorServiceImpl
-import com.cas_parser.api.services.blocking.CasParserService
-import com.cas_parser.api.services.blocking.CasParserServiceImpl
+import com.cas_parser.api.services.blocking.AccessTokenService
+import com.cas_parser.api.services.blocking.AccessTokenServiceImpl
+import com.cas_parser.api.services.blocking.CamsKfintechService
+import com.cas_parser.api.services.blocking.CamsKfintechServiceImpl
+import com.cas_parser.api.services.blocking.CdslService
+import com.cas_parser.api.services.blocking.CdslServiceImpl
+import com.cas_parser.api.services.blocking.ContractNoteService
+import com.cas_parser.api.services.blocking.ContractNoteServiceImpl
+import com.cas_parser.api.services.blocking.CreditService
+import com.cas_parser.api.services.blocking.CreditServiceImpl
+import com.cas_parser.api.services.blocking.InboxService
+import com.cas_parser.api.services.blocking.InboxServiceImpl
+import com.cas_parser.api.services.blocking.KfintechService
+import com.cas_parser.api.services.blocking.KfintechServiceImpl
+import com.cas_parser.api.services.blocking.LogService
+import com.cas_parser.api.services.blocking.LogServiceImpl
+import com.cas_parser.api.services.blocking.NsdlService
+import com.cas_parser.api.services.blocking.NsdlServiceImpl
+import com.cas_parser.api.services.blocking.SmartService
+import com.cas_parser.api.services.blocking.SmartServiceImpl
+import com.cas_parser.api.services.blocking.VerifyTokenService
+import com.cas_parser.api.services.blocking.VerifyTokenServiceImpl
import java.util.function.Consumer
class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserClient {
@@ -27,14 +45,38 @@ class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserC
WithRawResponseImpl(clientOptions)
}
- private val casParser: CasParserService by lazy {
- CasParserServiceImpl(clientOptionsWithUserAgent)
+ private val credits: CreditService by lazy { CreditServiceImpl(clientOptionsWithUserAgent) }
+
+ private val logs: LogService by lazy { LogServiceImpl(clientOptionsWithUserAgent) }
+
+ private val accessToken: AccessTokenService by lazy {
+ AccessTokenServiceImpl(clientOptionsWithUserAgent)
+ }
+
+ private val verifyToken: VerifyTokenService by lazy {
+ VerifyTokenServiceImpl(clientOptionsWithUserAgent)
+ }
+
+ private val camsKfintech: CamsKfintechService by lazy {
+ CamsKfintechServiceImpl(clientOptionsWithUserAgent)
}
- private val casGenerator: CasGeneratorService by lazy {
- CasGeneratorServiceImpl(clientOptionsWithUserAgent)
+ private val cdsl: CdslService by lazy { CdslServiceImpl(clientOptionsWithUserAgent) }
+
+ private val contractNote: ContractNoteService by lazy {
+ ContractNoteServiceImpl(clientOptionsWithUserAgent)
+ }
+
+ private val inbox: InboxService by lazy { InboxServiceImpl(clientOptionsWithUserAgent) }
+
+ private val kfintech: KfintechService by lazy {
+ KfintechServiceImpl(clientOptionsWithUserAgent)
}
+ private val nsdl: NsdlService by lazy { NsdlServiceImpl(clientOptionsWithUserAgent) }
+
+ private val smart: SmartService by lazy { SmartServiceImpl(clientOptionsWithUserAgent) }
+
override fun async(): CasParserClientAsync = async
override fun withRawResponse(): CasParserClient.WithRawResponse = withRawResponse
@@ -42,21 +84,75 @@ class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserC
override fun withOptions(modifier: Consumer): CasParserClient =
CasParserClientImpl(clientOptions.toBuilder().apply(modifier::accept).build())
- override fun casParser(): CasParserService = casParser
+ override fun credits(): CreditService = credits
- override fun casGenerator(): CasGeneratorService = casGenerator
+ override fun logs(): LogService = logs
+
+ override fun accessToken(): AccessTokenService = accessToken
+
+ override fun verifyToken(): VerifyTokenService = verifyToken
+
+ override fun camsKfintech(): CamsKfintechService = camsKfintech
+
+ override fun cdsl(): CdslService = cdsl
+
+ override fun contractNote(): ContractNoteService = contractNote
+
+ override fun inbox(): InboxService = inbox
+
+ override fun kfintech(): KfintechService = kfintech
+
+ override fun nsdl(): NsdlService = nsdl
+
+ override fun smart(): SmartService = smart
override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
CasParserClient.WithRawResponse {
- private val casParser: CasParserService.WithRawResponse by lazy {
- CasParserServiceImpl.WithRawResponseImpl(clientOptions)
+ private val credits: CreditService.WithRawResponse by lazy {
+ CreditServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val logs: LogService.WithRawResponse by lazy {
+ LogServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val accessToken: AccessTokenService.WithRawResponse by lazy {
+ AccessTokenServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val verifyToken: VerifyTokenService.WithRawResponse by lazy {
+ VerifyTokenServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val camsKfintech: CamsKfintechService.WithRawResponse by lazy {
+ CamsKfintechServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val cdsl: CdslService.WithRawResponse by lazy {
+ CdslServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val contractNote: ContractNoteService.WithRawResponse by lazy {
+ ContractNoteServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val inbox: InboxService.WithRawResponse by lazy {
+ InboxServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val kfintech: KfintechService.WithRawResponse by lazy {
+ KfintechServiceImpl.WithRawResponseImpl(clientOptions)
+ }
+
+ private val nsdl: NsdlService.WithRawResponse by lazy {
+ NsdlServiceImpl.WithRawResponseImpl(clientOptions)
}
- private val casGenerator: CasGeneratorService.WithRawResponse by lazy {
- CasGeneratorServiceImpl.WithRawResponseImpl(clientOptions)
+ private val smart: SmartService.WithRawResponse by lazy {
+ SmartServiceImpl.WithRawResponseImpl(clientOptions)
}
override fun withOptions(
@@ -66,8 +162,26 @@ class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserC
clientOptions.toBuilder().apply(modifier::accept).build()
)
- override fun casParser(): CasParserService.WithRawResponse = casParser
+ override fun credits(): CreditService.WithRawResponse = credits
+
+ override fun logs(): LogService.WithRawResponse = logs
+
+ override fun accessToken(): AccessTokenService.WithRawResponse = accessToken
+
+ override fun verifyToken(): VerifyTokenService.WithRawResponse = verifyToken
+
+ override fun camsKfintech(): CamsKfintechService.WithRawResponse = camsKfintech
+
+ override fun cdsl(): CdslService.WithRawResponse = cdsl
+
+ override fun contractNote(): ContractNoteService.WithRawResponse = contractNote
+
+ override fun inbox(): InboxService.WithRawResponse = inbox
+
+ override fun kfintech(): KfintechService.WithRawResponse = kfintech
+
+ override fun nsdl(): NsdlService.WithRawResponse = nsdl
- override fun casGenerator(): CasGeneratorService.WithRawResponse = casGenerator
+ override fun smart(): SmartService.WithRawResponse = smart
}
}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/core/ClientOptions.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/core/ClientOptions.kt
index 1db211b..e3e4eaf 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/core/ClientOptions.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/core/ClientOptions.kt
@@ -107,6 +107,10 @@ private constructor(
* The base URL to use for every request.
*
* Defaults to the production environment: `https://portfolio-parser.api.casparser.in`.
+ *
+ * The following other environments, with dedicated builder methods, are available:
+ * - environment_1: `https://client-apis.casparser.in`
+ * - environment_2: `http://localhost:5000`
*/
fun baseUrl(): String = baseUrl ?: PRODUCTION_URL
@@ -116,6 +120,10 @@ private constructor(
const val PRODUCTION_URL = "https://portfolio-parser.api.casparser.in"
+ const val ENVIRONMENT_1_URL = "https://client-apis.casparser.in"
+
+ const val ENVIRONMENT_2_URL = "http://localhost:5000"
+
/**
* Returns a mutable builder for constructing an instance of [ClientOptions].
*
@@ -221,12 +229,22 @@ private constructor(
* The base URL to use for every request.
*
* Defaults to the production environment: `https://portfolio-parser.api.casparser.in`.
+ *
+ * The following other environments, with dedicated builder methods, are available:
+ * - environment_1: `https://client-apis.casparser.in`
+ * - environment_2: `http://localhost:5000`
*/
fun baseUrl(baseUrl: String?) = apply { this.baseUrl = baseUrl }
/** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */
fun baseUrl(baseUrl: Optional) = baseUrl(baseUrl.getOrNull())
+ /** Sets [baseUrl] to `https://client-apis.casparser.in`. */
+ fun environment1() = baseUrl(ENVIRONMENT_1_URL)
+
+ /** Sets [baseUrl] to `http://localhost:5000`. */
+ fun environment2() = baseUrl(ENVIRONMENT_2_URL)
+
/**
* Whether to call `validate` on every response before returning it.
*
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/accesstoken/AccessTokenCreateParams.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/accesstoken/AccessTokenCreateParams.kt
new file mode 100644
index 0000000..676dc4d
--- /dev/null
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/accesstoken/AccessTokenCreateParams.kt
@@ -0,0 +1,410 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.cas_parser.api.models.accesstoken
+
+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.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 a short-lived access token from your API key.
+ *
+ * **Use this endpoint from your backend** to create tokens that can be safely passed to
+ * frontend/SDK.
+ *
+ * Access tokens:
+ * - Are prefixed with `at_` for easy identification
+ * - Valid for up to 60 minutes
+ * - Can be used in place of API keys on all v4 endpoints
+ * - Cannot be used to generate other access tokens
+ */
+class AccessTokenCreateParams
+private constructor(
+ private val body: Body,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ /**
+ * Token validity in minutes (max 60)
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun expiryMinutes(): Optional = body.expiryMinutes()
+
+ /**
+ * Returns the raw JSON value of [expiryMinutes].
+ *
+ * Unlike [expiryMinutes], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _expiryMinutes(): JsonField = body._expiryMinutes()
+
+ 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 {
+
+ @JvmStatic fun none(): AccessTokenCreateParams = builder().build()
+
+ /** Returns a mutable builder for constructing an instance of [AccessTokenCreateParams]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AccessTokenCreateParams]. */
+ 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(accessTokenCreateParams: AccessTokenCreateParams) = apply {
+ body = accessTokenCreateParams.body.toBuilder()
+ additionalHeaders = accessTokenCreateParams.additionalHeaders.toBuilder()
+ additionalQueryParams = accessTokenCreateParams.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:
+ * - [expiryMinutes]
+ */
+ fun body(body: Body) = apply { this.body = body.toBuilder() }
+
+ /** Token validity in minutes (max 60) */
+ fun expiryMinutes(expiryMinutes: Long) = apply { body.expiryMinutes(expiryMinutes) }
+
+ /**
+ * Sets [Builder.expiryMinutes] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.expiryMinutes] with a well-typed [Long] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun expiryMinutes(expiryMinutes: JsonField) = apply {
+ body.expiryMinutes(expiryMinutes)
+ }
+
+ 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 [AccessTokenCreateParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): AccessTokenCreateParams =
+ AccessTokenCreateParams(
+ 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 expiryMinutes: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("expiry_minutes")
+ @ExcludeMissing
+ expiryMinutes: JsonField = JsonMissing.of()
+ ) : this(expiryMinutes, mutableMapOf())
+
+ /**
+ * Token validity in minutes (max 60)
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun expiryMinutes(): Optional = expiryMinutes.getOptional("expiry_minutes")
+
+ /**
+ * Returns the raw JSON value of [expiryMinutes].
+ *
+ * Unlike [expiryMinutes], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("expiry_minutes")
+ @ExcludeMissing
+ fun _expiryMinutes(): JsonField = expiryMinutes
+
+ @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]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Body]. */
+ class Builder internal constructor() {
+
+ private var expiryMinutes: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(body: Body) = apply {
+ expiryMinutes = body.expiryMinutes
+ additionalProperties = body.additionalProperties.toMutableMap()
+ }
+
+ /** Token validity in minutes (max 60) */
+ fun expiryMinutes(expiryMinutes: Long) = expiryMinutes(JsonField.of(expiryMinutes))
+
+ /**
+ * Sets [Builder.expiryMinutes] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.expiryMinutes] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun expiryMinutes(expiryMinutes: JsonField) = apply {
+ this.expiryMinutes = expiryMinutes
+ }
+
+ 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.
+ */
+ fun build(): Body = Body(expiryMinutes, additionalProperties.toMutableMap())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Body = apply {
+ if (validated) {
+ return@apply
+ }
+
+ expiryMinutes()
+ 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 (expiryMinutes.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Body &&
+ expiryMinutes == other.expiryMinutes &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(expiryMinutes, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Body{expiryMinutes=$expiryMinutes, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AccessTokenCreateParams &&
+ body == other.body &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams)
+
+ override fun toString() =
+ "AccessTokenCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/accesstoken/AccessTokenCreateResponse.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/accesstoken/AccessTokenCreateResponse.kt
new file mode 100644
index 0000000..a23d37b
--- /dev/null
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/accesstoken/AccessTokenCreateResponse.kt
@@ -0,0 +1,239 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.cas_parser.api.models.accesstoken
+
+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 AccessTokenCreateResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val accessToken: JsonField,
+ private val expiresIn: JsonField,
+ private val tokenType: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("access_token")
+ @ExcludeMissing
+ accessToken: JsonField = JsonMissing.of(),
+ @JsonProperty("expires_in") @ExcludeMissing expiresIn: JsonField = JsonMissing.of(),
+ @JsonProperty("token_type") @ExcludeMissing tokenType: JsonField = JsonMissing.of(),
+ ) : this(accessToken, expiresIn, tokenType, mutableMapOf())
+
+ /**
+ * The at_ prefixed access token
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun accessToken(): Optional = accessToken.getOptional("access_token")
+
+ /**
+ * Token validity in seconds
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun expiresIn(): Optional = expiresIn.getOptional("expires_in")
+
+ /**
+ * Always "api_key" - token is a drop-in replacement for x-api-key header
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun tokenType(): Optional = tokenType.getOptional("token_type")
+
+ /**
+ * Returns the raw JSON value of [accessToken].
+ *
+ * Unlike [accessToken], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("access_token")
+ @ExcludeMissing
+ fun _accessToken(): JsonField = accessToken
+
+ /**
+ * Returns the raw JSON value of [expiresIn].
+ *
+ * Unlike [expiresIn], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("expires_in") @ExcludeMissing fun _expiresIn(): JsonField = expiresIn
+
+ /**
+ * Returns the raw JSON value of [tokenType].
+ *
+ * Unlike [tokenType], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("token_type") @ExcludeMissing fun _tokenType(): JsonField = tokenType
+
+ @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 [AccessTokenCreateResponse].
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AccessTokenCreateResponse]. */
+ class Builder internal constructor() {
+
+ private var accessToken: JsonField = JsonMissing.of()
+ private var expiresIn: JsonField = JsonMissing.of()
+ private var tokenType: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(accessTokenCreateResponse: AccessTokenCreateResponse) = apply {
+ accessToken = accessTokenCreateResponse.accessToken
+ expiresIn = accessTokenCreateResponse.expiresIn
+ tokenType = accessTokenCreateResponse.tokenType
+ additionalProperties = accessTokenCreateResponse.additionalProperties.toMutableMap()
+ }
+
+ /** The at_ prefixed access token */
+ fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken))
+
+ /**
+ * Sets [Builder.accessToken] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.accessToken] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken }
+
+ /** Token validity in seconds */
+ fun expiresIn(expiresIn: Long) = expiresIn(JsonField.of(expiresIn))
+
+ /**
+ * Sets [Builder.expiresIn] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.expiresIn] with a well-typed [Long] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun expiresIn(expiresIn: JsonField) = apply { this.expiresIn = expiresIn }
+
+ /** Always "api_key" - token is a drop-in replacement for x-api-key header */
+ fun tokenType(tokenType: String) = tokenType(JsonField.of(tokenType))
+
+ /**
+ * Sets [Builder.tokenType] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.tokenType] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun tokenType(tokenType: JsonField) = apply { this.tokenType = tokenType }
+
+ 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 [AccessTokenCreateResponse].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): AccessTokenCreateResponse =
+ AccessTokenCreateResponse(
+ accessToken,
+ expiresIn,
+ tokenType,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): AccessTokenCreateResponse = apply {
+ if (validated) {
+ return@apply
+ }
+
+ accessToken()
+ expiresIn()
+ tokenType()
+ 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 (accessToken.asKnown().isPresent) 1 else 0) +
+ (if (expiresIn.asKnown().isPresent) 1 else 0) +
+ (if (tokenType.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AccessTokenCreateResponse &&
+ accessToken == other.accessToken &&
+ expiresIn == other.expiresIn &&
+ tokenType == other.tokenType &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(accessToken, expiresIn, tokenType, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "AccessTokenCreateResponse{accessToken=$accessToken, expiresIn=$expiresIn, tokenType=$tokenType, additionalProperties=$additionalProperties}"
+}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/casparser/CasParserCamsKfintechParams.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/camskfintech/CamsKfintechParseParams.kt
similarity index 94%
rename from cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/casparser/CasParserCamsKfintechParams.kt
rename to cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/camskfintech/CamsKfintechParseParams.kt
index 131d1dd..2b503a6 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/casparser/CasParserCamsKfintechParams.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/camskfintech/CamsKfintechParseParams.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.cas_parser.api.models.casparser
+package com.cas_parser.api.models.camskfintech
import com.cas_parser.api.core.ExcludeMissing
import com.cas_parser.api.core.JsonValue
@@ -22,7 +22,7 @@ import java.util.Optional
* and returns data in a unified format. Use this endpoint when you know the PDF is from CAMS or
* KFintech.
*/
-class CasParserCamsKfintechParams
+class CamsKfintechParseParams
private constructor(
private val body: Body,
private val additionalHeaders: Headers,
@@ -86,15 +86,13 @@ private constructor(
companion object {
- @JvmStatic fun none(): CasParserCamsKfintechParams = builder().build()
+ @JvmStatic fun none(): CamsKfintechParseParams = builder().build()
- /**
- * Returns a mutable builder for constructing an instance of [CasParserCamsKfintechParams].
- */
+ /** Returns a mutable builder for constructing an instance of [CamsKfintechParseParams]. */
@JvmStatic fun builder() = Builder()
}
- /** A builder for [CasParserCamsKfintechParams]. */
+ /** A builder for [CamsKfintechParseParams]. */
class Builder internal constructor() {
private var body: Body.Builder = Body.builder()
@@ -102,10 +100,10 @@ private constructor(
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
@JvmSynthetic
- internal fun from(casParserCamsKfintechParams: CasParserCamsKfintechParams) = apply {
- body = casParserCamsKfintechParams.body.toBuilder()
- additionalHeaders = casParserCamsKfintechParams.additionalHeaders.toBuilder()
- additionalQueryParams = casParserCamsKfintechParams.additionalQueryParams.toBuilder()
+ internal fun from(camsKfintechParseParams: CamsKfintechParseParams) = apply {
+ body = camsKfintechParseParams.body.toBuilder()
+ additionalHeaders = camsKfintechParseParams.additionalHeaders.toBuilder()
+ additionalQueryParams = camsKfintechParseParams.additionalQueryParams.toBuilder()
}
/**
@@ -270,12 +268,12 @@ private constructor(
}
/**
- * Returns an immutable instance of [CasParserCamsKfintechParams].
+ * Returns an immutable instance of [CamsKfintechParseParams].
*
* Further updates to this [Builder] will not mutate the returned instance.
*/
- fun build(): CasParserCamsKfintechParams =
- CasParserCamsKfintechParams(
+ fun build(): CamsKfintechParseParams =
+ CamsKfintechParseParams(
body.build(),
additionalHeaders.build(),
additionalQueryParams.build(),
@@ -492,7 +490,7 @@ private constructor(
return true
}
- return other is CasParserCamsKfintechParams &&
+ return other is CamsKfintechParseParams &&
body == other.body &&
additionalHeaders == other.additionalHeaders &&
additionalQueryParams == other.additionalQueryParams
@@ -501,5 +499,5 @@ private constructor(
override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams)
override fun toString() =
- "CasParserCamsKfintechParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+ "CamsKfintechParseParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/camskfintech/LinkedHolder.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/camskfintech/LinkedHolder.kt
new file mode 100644
index 0000000..9aa025d
--- /dev/null
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/camskfintech/LinkedHolder.kt
@@ -0,0 +1,189 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.cas_parser.api.models.camskfintech
+
+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 LinkedHolder
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val name: JsonField,
+ private val pan: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
+ @JsonProperty("pan") @ExcludeMissing pan: JsonField = JsonMissing.of(),
+ ) : this(name, pan, mutableMapOf())
+
+ /**
+ * Name of the account holder
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun name(): Optional = name.getOptional("name")
+
+ /**
+ * PAN of the account holder
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun pan(): Optional = pan.getOptional("pan")
+
+ /**
+ * Returns the raw JSON value of [name].
+ *
+ * Unlike [name], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
+
+ /**
+ * Returns the raw JSON value of [pan].
+ *
+ * Unlike [pan], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("pan") @ExcludeMissing fun _pan(): JsonField = pan
+
+ @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 [LinkedHolder]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [LinkedHolder]. */
+ class Builder internal constructor() {
+
+ private var name: JsonField = JsonMissing.of()
+ private var pan: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(linkedHolder: LinkedHolder) = apply {
+ name = linkedHolder.name
+ pan = linkedHolder.pan
+ additionalProperties = linkedHolder.additionalProperties.toMutableMap()
+ }
+
+ /** Name of the account holder */
+ fun name(name: String) = name(JsonField.of(name))
+
+ /**
+ * Sets [Builder.name] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.name] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun name(name: JsonField) = apply { this.name = name }
+
+ /** PAN of the account holder */
+ fun pan(pan: String) = pan(JsonField.of(pan))
+
+ /**
+ * Sets [Builder.pan] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.pan] with a well-typed [String] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun pan(pan: JsonField) = apply { this.pan = pan }
+
+ 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 [LinkedHolder].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): LinkedHolder = LinkedHolder(name, pan, additionalProperties.toMutableMap())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): LinkedHolder = apply {
+ if (validated) {
+ return@apply
+ }
+
+ name()
+ pan()
+ 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 (name.asKnown().isPresent) 1 else 0) + (if (pan.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is LinkedHolder &&
+ name == other.name &&
+ pan == other.pan &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(name, pan, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "LinkedHolder{name=$name, pan=$pan, additionalProperties=$additionalProperties}"
+}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/camskfintech/Transaction.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/camskfintech/Transaction.kt
new file mode 100644
index 0000000..64c2700
--- /dev/null
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/camskfintech/Transaction.kt
@@ -0,0 +1,1129 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.cas_parser.api.models.camskfintech
+
+import com.cas_parser.api.core.Enum
+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.time.LocalDate
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** Unified transaction schema for all holding types (MF folios, equities, bonds, etc.) */
+class Transaction
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val additionalInfo: JsonField,
+ private val amount: JsonField,
+ private val balance: JsonField,
+ private val date: JsonField,
+ private val description: JsonField,
+ private val dividendRate: JsonField,
+ private val nav: JsonField,
+ private val type: JsonField,
+ private val units: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("additional_info")
+ @ExcludeMissing
+ additionalInfo: JsonField = JsonMissing.of(),
+ @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(),
+ @JsonProperty("balance") @ExcludeMissing balance: JsonField = JsonMissing.of(),
+ @JsonProperty("date") @ExcludeMissing date: JsonField = JsonMissing.of(),
+ @JsonProperty("description")
+ @ExcludeMissing
+ description: JsonField = JsonMissing.of(),
+ @JsonProperty("dividend_rate")
+ @ExcludeMissing
+ dividendRate: JsonField = JsonMissing.of(),
+ @JsonProperty("nav") @ExcludeMissing nav: JsonField = JsonMissing.of(),
+ @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
+ @JsonProperty("units") @ExcludeMissing units: JsonField = JsonMissing.of(),
+ ) : this(
+ additionalInfo,
+ amount,
+ balance,
+ date,
+ description,
+ dividendRate,
+ nav,
+ type,
+ units,
+ mutableMapOf(),
+ )
+
+ /**
+ * Additional transaction-specific fields that vary by source
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun additionalInfo(): Optional = additionalInfo.getOptional("additional_info")
+
+ /**
+ * Transaction amount in currency (computed from units × price/NAV)
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun amount(): Optional = amount.getOptional("amount")
+
+ /**
+ * Balance units after transaction
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun balance(): Optional = balance.getOptional("balance")
+
+ /**
+ * Transaction date (YYYY-MM-DD)
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun date(): Optional = date.getOptional("date")
+
+ /**
+ * Transaction description/particulars
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun description(): Optional = description.getOptional("description")
+
+ /**
+ * Dividend rate (for DIVIDEND_PAYOUT transactions)
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun dividendRate(): Optional = dividendRate.getOptional("dividend_rate")
+
+ /**
+ * NAV/price per unit on transaction date
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun nav(): Optional = nav.getOptional("nav")
+
+ /**
+ * Transaction type. Possible values are PURCHASE, PURCHASE_SIP, REDEMPTION, SWITCH_IN,
+ * SWITCH_IN_MERGER, SWITCH_OUT, SWITCH_OUT_MERGER, DIVIDEND_PAYOUT, DIVIDEND_REINVEST,
+ * SEGREGATION, STAMP_DUTY_TAX, TDS_TAX, STT_TAX, MISC, REVERSAL, UNKNOWN.
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun type(): Optional = type.getOptional("type")
+
+ /**
+ * Number of units involved in transaction
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun units(): Optional = units.getOptional("units")
+
+ /**
+ * Returns the raw JSON value of [additionalInfo].
+ *
+ * Unlike [additionalInfo], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("additional_info")
+ @ExcludeMissing
+ fun _additionalInfo(): JsonField = additionalInfo
+
+ /**
+ * Returns the raw JSON value of [amount].
+ *
+ * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
+
+ /**
+ * Returns the raw JSON value of [balance].
+ *
+ * Unlike [balance], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("balance") @ExcludeMissing fun _balance(): JsonField = balance
+
+ /**
+ * Returns the raw JSON value of [date].
+ *
+ * Unlike [date], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("date") @ExcludeMissing fun _date(): JsonField = date
+
+ /**
+ * Returns the raw JSON value of [description].
+ *
+ * Unlike [description], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("description") @ExcludeMissing fun _description(): JsonField = description
+
+ /**
+ * Returns the raw JSON value of [dividendRate].
+ *
+ * Unlike [dividendRate], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("dividend_rate")
+ @ExcludeMissing
+ fun _dividendRate(): JsonField = dividendRate
+
+ /**
+ * Returns the raw JSON value of [nav].
+ *
+ * Unlike [nav], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("nav") @ExcludeMissing fun _nav(): JsonField = nav
+
+ /**
+ * Returns the raw JSON value of [type].
+ *
+ * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
+
+ /**
+ * Returns the raw JSON value of [units].
+ *
+ * Unlike [units], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("units") @ExcludeMissing fun _units(): JsonField = units
+
+ @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 [Transaction]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Transaction]. */
+ class Builder internal constructor() {
+
+ private var additionalInfo: JsonField = JsonMissing.of()
+ private var amount: JsonField = JsonMissing.of()
+ private var balance: JsonField = JsonMissing.of()
+ private var date: JsonField = JsonMissing.of()
+ private var description: JsonField = JsonMissing.of()
+ private var dividendRate: JsonField = JsonMissing.of()
+ private var nav: JsonField = JsonMissing.of()
+ private var type: JsonField = JsonMissing.of()
+ private var units: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(transaction: Transaction) = apply {
+ additionalInfo = transaction.additionalInfo
+ amount = transaction.amount
+ balance = transaction.balance
+ date = transaction.date
+ description = transaction.description
+ dividendRate = transaction.dividendRate
+ nav = transaction.nav
+ type = transaction.type
+ units = transaction.units
+ additionalProperties = transaction.additionalProperties.toMutableMap()
+ }
+
+ /** Additional transaction-specific fields that vary by source */
+ fun additionalInfo(additionalInfo: AdditionalInfo) =
+ additionalInfo(JsonField.of(additionalInfo))
+
+ /**
+ * Sets [Builder.additionalInfo] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.additionalInfo] with a well-typed [AdditionalInfo] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun additionalInfo(additionalInfo: JsonField) = apply {
+ this.additionalInfo = additionalInfo
+ }
+
+ /** Transaction amount in currency (computed from units × price/NAV) */
+ fun amount(amount: Float?) = amount(JsonField.ofNullable(amount))
+
+ /**
+ * Alias for [Builder.amount].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun amount(amount: Float) = amount(amount as Float?)
+
+ /** Alias for calling [Builder.amount] with `amount.orElse(null)`. */
+ fun amount(amount: Optional) = amount(amount.getOrNull())
+
+ /**
+ * Sets [Builder.amount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.amount] with a well-typed [Float] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun amount(amount: JsonField) = apply { this.amount = amount }
+
+ /** Balance units after transaction */
+ fun balance(balance: Float) = balance(JsonField.of(balance))
+
+ /**
+ * Sets [Builder.balance] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.balance] with a well-typed [Float] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun balance(balance: JsonField) = apply { this.balance = balance }
+
+ /** Transaction date (YYYY-MM-DD) */
+ fun date(date: LocalDate) = date(JsonField.of(date))
+
+ /**
+ * Sets [Builder.date] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.date] with a well-typed [LocalDate] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun date(date: JsonField) = apply { this.date = date }
+
+ /** Transaction description/particulars */
+ fun description(description: String) = description(JsonField.of(description))
+
+ /**
+ * Sets [Builder.description] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.description] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun description(description: JsonField) = apply { this.description = description }
+
+ /** Dividend rate (for DIVIDEND_PAYOUT transactions) */
+ fun dividendRate(dividendRate: Float?) = dividendRate(JsonField.ofNullable(dividendRate))
+
+ /**
+ * Alias for [Builder.dividendRate].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun dividendRate(dividendRate: Float) = dividendRate(dividendRate as Float?)
+
+ /** Alias for calling [Builder.dividendRate] with `dividendRate.orElse(null)`. */
+ fun dividendRate(dividendRate: Optional) = dividendRate(dividendRate.getOrNull())
+
+ /**
+ * Sets [Builder.dividendRate] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.dividendRate] with a well-typed [Float] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun dividendRate(dividendRate: JsonField) = apply {
+ this.dividendRate = dividendRate
+ }
+
+ /** NAV/price per unit on transaction date */
+ fun nav(nav: Float?) = nav(JsonField.ofNullable(nav))
+
+ /**
+ * Alias for [Builder.nav].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun nav(nav: Float) = nav(nav as Float?)
+
+ /** Alias for calling [Builder.nav] with `nav.orElse(null)`. */
+ fun nav(nav: Optional) = nav(nav.getOrNull())
+
+ /**
+ * Sets [Builder.nav] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.nav] with a well-typed [Float] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun nav(nav: JsonField) = apply { this.nav = nav }
+
+ /**
+ * Transaction type. Possible values are PURCHASE, PURCHASE_SIP, REDEMPTION, SWITCH_IN,
+ * SWITCH_IN_MERGER, SWITCH_OUT, SWITCH_OUT_MERGER, DIVIDEND_PAYOUT, DIVIDEND_REINVEST,
+ * SEGREGATION, STAMP_DUTY_TAX, TDS_TAX, STT_TAX, MISC, REVERSAL, UNKNOWN.
+ */
+ fun type(type: Type) = type(JsonField.of(type))
+
+ /**
+ * Sets [Builder.type] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.type] with a well-typed [Type] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun type(type: JsonField) = apply { this.type = type }
+
+ /** Number of units involved in transaction */
+ fun units(units: Float) = units(JsonField.of(units))
+
+ /**
+ * Sets [Builder.units] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.units] with a well-typed [Float] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun units(units: JsonField) = apply { this.units = units }
+
+ 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 [Transaction].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): Transaction =
+ Transaction(
+ additionalInfo,
+ amount,
+ balance,
+ date,
+ description,
+ dividendRate,
+ nav,
+ type,
+ units,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Transaction = apply {
+ if (validated) {
+ return@apply
+ }
+
+ additionalInfo().ifPresent { it.validate() }
+ amount()
+ balance()
+ date()
+ description()
+ dividendRate()
+ nav()
+ type().ifPresent { it.validate() }
+ units()
+ 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 =
+ (additionalInfo.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (amount.asKnown().isPresent) 1 else 0) +
+ (if (balance.asKnown().isPresent) 1 else 0) +
+ (if (date.asKnown().isPresent) 1 else 0) +
+ (if (description.asKnown().isPresent) 1 else 0) +
+ (if (dividendRate.asKnown().isPresent) 1 else 0) +
+ (if (nav.asKnown().isPresent) 1 else 0) +
+ (type.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (units.asKnown().isPresent) 1 else 0)
+
+ /** Additional transaction-specific fields that vary by source */
+ class AdditionalInfo
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val capitalWithdrawal: JsonField,
+ private val credit: JsonField,
+ private val debit: JsonField,
+ private val incomeDistribution: JsonField,
+ private val orderNo: JsonField,
+ private val price: JsonField,
+ private val stampDuty: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("capital_withdrawal")
+ @ExcludeMissing
+ capitalWithdrawal: JsonField = JsonMissing.of(),
+ @JsonProperty("credit") @ExcludeMissing credit: JsonField = JsonMissing.of(),
+ @JsonProperty("debit") @ExcludeMissing debit: JsonField = JsonMissing.of(),
+ @JsonProperty("income_distribution")
+ @ExcludeMissing
+ incomeDistribution: JsonField = JsonMissing.of(),
+ @JsonProperty("order_no") @ExcludeMissing orderNo: JsonField = JsonMissing.of(),
+ @JsonProperty("price") @ExcludeMissing price: JsonField = JsonMissing.of(),
+ @JsonProperty("stamp_duty")
+ @ExcludeMissing
+ stampDuty: JsonField = JsonMissing.of(),
+ ) : this(
+ capitalWithdrawal,
+ credit,
+ debit,
+ incomeDistribution,
+ orderNo,
+ price,
+ stampDuty,
+ mutableMapOf(),
+ )
+
+ /**
+ * Capital withdrawal amount (CDSL MF transactions)
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun capitalWithdrawal(): Optional =
+ capitalWithdrawal.getOptional("capital_withdrawal")
+
+ /**
+ * Units credited (demat transactions)
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun credit(): Optional = credit.getOptional("credit")
+
+ /**
+ * Units debited (demat transactions)
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun debit(): Optional = debit.getOptional("debit")
+
+ /**
+ * Income distribution amount (CDSL MF transactions)
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun incomeDistribution(): Optional =
+ incomeDistribution.getOptional("income_distribution")
+
+ /**
+ * Order/transaction reference number (demat transactions)
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun orderNo(): Optional = orderNo.getOptional("order_no")
+
+ /**
+ * Price per unit (NSDL/CDSL MF transactions)
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun price(): Optional = price.getOptional("price")
+
+ /**
+ * Stamp duty charged
+ *
+ * @throws CasParserInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun stampDuty(): Optional = stampDuty.getOptional("stamp_duty")
+
+ /**
+ * Returns the raw JSON value of [capitalWithdrawal].
+ *
+ * Unlike [capitalWithdrawal], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("capital_withdrawal")
+ @ExcludeMissing
+ fun _capitalWithdrawal(): JsonField = capitalWithdrawal
+
+ /**
+ * Returns the raw JSON value of [credit].
+ *
+ * Unlike [credit], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("credit") @ExcludeMissing fun _credit(): JsonField = credit
+
+ /**
+ * Returns the raw JSON value of [debit].
+ *
+ * Unlike [debit], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("debit") @ExcludeMissing fun _debit(): JsonField = debit
+
+ /**
+ * Returns the raw JSON value of [incomeDistribution].
+ *
+ * Unlike [incomeDistribution], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("income_distribution")
+ @ExcludeMissing
+ fun _incomeDistribution(): JsonField = incomeDistribution
+
+ /**
+ * Returns the raw JSON value of [orderNo].
+ *
+ * Unlike [orderNo], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("order_no") @ExcludeMissing fun _orderNo(): JsonField = orderNo
+
+ /**
+ * Returns the raw JSON value of [price].
+ *
+ * Unlike [price], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("price") @ExcludeMissing fun _price(): JsonField = price
+
+ /**
+ * Returns the raw JSON value of [stampDuty].
+ *
+ * Unlike [stampDuty], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("stamp_duty") @ExcludeMissing fun _stampDuty(): JsonField = stampDuty
+
+ @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 [AdditionalInfo]. */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AdditionalInfo]. */
+ class Builder internal constructor() {
+
+ private var capitalWithdrawal: JsonField = JsonMissing.of()
+ private var credit: JsonField = JsonMissing.of()
+ private var debit: JsonField = JsonMissing.of()
+ private var incomeDistribution: JsonField = JsonMissing.of()
+ private var orderNo: JsonField = JsonMissing.of()
+ private var price: JsonField = JsonMissing.of()
+ private var stampDuty: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(additionalInfo: AdditionalInfo) = apply {
+ capitalWithdrawal = additionalInfo.capitalWithdrawal
+ credit = additionalInfo.credit
+ debit = additionalInfo.debit
+ incomeDistribution = additionalInfo.incomeDistribution
+ orderNo = additionalInfo.orderNo
+ price = additionalInfo.price
+ stampDuty = additionalInfo.stampDuty
+ additionalProperties = additionalInfo.additionalProperties.toMutableMap()
+ }
+
+ /** Capital withdrawal amount (CDSL MF transactions) */
+ fun capitalWithdrawal(capitalWithdrawal: Float) =
+ capitalWithdrawal(JsonField.of(capitalWithdrawal))
+
+ /**
+ * Sets [Builder.capitalWithdrawal] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.capitalWithdrawal] with a well-typed [Float] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun capitalWithdrawal(capitalWithdrawal: JsonField) = apply {
+ this.capitalWithdrawal = capitalWithdrawal
+ }
+
+ /** Units credited (demat transactions) */
+ fun credit(credit: Float) = credit(JsonField.of(credit))
+
+ /**
+ * Sets [Builder.credit] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.credit] with a well-typed [Float] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun credit(credit: JsonField) = apply { this.credit = credit }
+
+ /** Units debited (demat transactions) */
+ fun debit(debit: Float) = debit(JsonField.of(debit))
+
+ /**
+ * Sets [Builder.debit] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.debit] with a well-typed [Float] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun debit(debit: JsonField) = apply { this.debit = debit }
+
+ /** Income distribution amount (CDSL MF transactions) */
+ fun incomeDistribution(incomeDistribution: Float) =
+ incomeDistribution(JsonField.of(incomeDistribution))
+
+ /**
+ * Sets [Builder.incomeDistribution] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.incomeDistribution] with a well-typed [Float] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun incomeDistribution(incomeDistribution: JsonField) = apply {
+ this.incomeDistribution = incomeDistribution
+ }
+
+ /** Order/transaction reference number (demat transactions) */
+ fun orderNo(orderNo: String) = orderNo(JsonField.of(orderNo))
+
+ /**
+ * Sets [Builder.orderNo] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.orderNo] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun orderNo(orderNo: JsonField) = apply { this.orderNo = orderNo }
+
+ /** Price per unit (NSDL/CDSL MF transactions) */
+ fun price(price: Float) = price(JsonField.of(price))
+
+ /**
+ * Sets [Builder.price] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.price] with a well-typed [Float] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun price(price: JsonField) = apply { this.price = price }
+
+ /** Stamp duty charged */
+ fun stampDuty(stampDuty: Float) = stampDuty(JsonField.of(stampDuty))
+
+ /**
+ * Sets [Builder.stampDuty] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.stampDuty] with a well-typed [Float] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun stampDuty(stampDuty: JsonField) = apply { this.stampDuty = stampDuty }
+
+ 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 [AdditionalInfo].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ */
+ fun build(): AdditionalInfo =
+ AdditionalInfo(
+ capitalWithdrawal,
+ credit,
+ debit,
+ incomeDistribution,
+ orderNo,
+ price,
+ stampDuty,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): AdditionalInfo = apply {
+ if (validated) {
+ return@apply
+ }
+
+ capitalWithdrawal()
+ credit()
+ debit()
+ incomeDistribution()
+ orderNo()
+ price()
+ stampDuty()
+ 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 (capitalWithdrawal.asKnown().isPresent) 1 else 0) +
+ (if (credit.asKnown().isPresent) 1 else 0) +
+ (if (debit.asKnown().isPresent) 1 else 0) +
+ (if (incomeDistribution.asKnown().isPresent) 1 else 0) +
+ (if (orderNo.asKnown().isPresent) 1 else 0) +
+ (if (price.asKnown().isPresent) 1 else 0) +
+ (if (stampDuty.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AdditionalInfo &&
+ capitalWithdrawal == other.capitalWithdrawal &&
+ credit == other.credit &&
+ debit == other.debit &&
+ incomeDistribution == other.incomeDistribution &&
+ orderNo == other.orderNo &&
+ price == other.price &&
+ stampDuty == other.stampDuty &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ capitalWithdrawal,
+ credit,
+ debit,
+ incomeDistribution,
+ orderNo,
+ price,
+ stampDuty,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "AdditionalInfo{capitalWithdrawal=$capitalWithdrawal, credit=$credit, debit=$debit, incomeDistribution=$incomeDistribution, orderNo=$orderNo, price=$price, stampDuty=$stampDuty, additionalProperties=$additionalProperties}"
+ }
+
+ /**
+ * Transaction type. Possible values are PURCHASE, PURCHASE_SIP, REDEMPTION, SWITCH_IN,
+ * SWITCH_IN_MERGER, SWITCH_OUT, SWITCH_OUT_MERGER, DIVIDEND_PAYOUT, DIVIDEND_REINVEST,
+ * SEGREGATION, STAMP_DUTY_TAX, TDS_TAX, STT_TAX, MISC, REVERSAL, UNKNOWN.
+ */
+ class Type @JsonCreator private constructor(private val value: JsonField) : Enum {
+
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that doesn't
+ * match any known member, and you want to know that value. For example, if the SDK is on an
+ * older version than the API, then the API may respond with new members that the SDK is
+ * unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ companion object {
+
+ @JvmField val PURCHASE = of("PURCHASE")
+
+ @JvmField val PURCHASE_SIP = of("PURCHASE_SIP")
+
+ @JvmField val REDEMPTION = of("REDEMPTION")
+
+ @JvmField val SWITCH_IN = of("SWITCH_IN")
+
+ @JvmField val SWITCH_IN_MERGER = of("SWITCH_IN_MERGER")
+
+ @JvmField val SWITCH_OUT = of("SWITCH_OUT")
+
+ @JvmField val SWITCH_OUT_MERGER = of("SWITCH_OUT_MERGER")
+
+ @JvmField val DIVIDEND_PAYOUT = of("DIVIDEND_PAYOUT")
+
+ @JvmField val DIVIDEND_REINVEST = of("DIVIDEND_REINVEST")
+
+ @JvmField val SEGREGATION = of("SEGREGATION")
+
+ @JvmField val STAMP_DUTY_TAX = of("STAMP_DUTY_TAX")
+
+ @JvmField val TDS_TAX = of("TDS_TAX")
+
+ @JvmField val STT_TAX = of("STT_TAX")
+
+ @JvmField val MISC = of("MISC")
+
+ @JvmField val REVERSAL = of("REVERSAL")
+
+ @JvmField val UNKNOWN = of("UNKNOWN")
+
+ @JvmStatic fun of(value: String) = Type(JsonField.of(value))
+ }
+
+ /** An enum containing [Type]'s known values. */
+ enum class Known {
+ PURCHASE,
+ PURCHASE_SIP,
+ REDEMPTION,
+ SWITCH_IN,
+ SWITCH_IN_MERGER,
+ SWITCH_OUT,
+ SWITCH_OUT_MERGER,
+ DIVIDEND_PAYOUT,
+ DIVIDEND_REINVEST,
+ SEGREGATION,
+ STAMP_DUTY_TAX,
+ TDS_TAX,
+ STT_TAX,
+ MISC,
+ REVERSAL,
+ UNKNOWN,
+ }
+
+ /**
+ * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Type] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example, if the
+ * SDK is on an older version than the API, then the API may respond with new members that
+ * the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ PURCHASE,
+ PURCHASE_SIP,
+ REDEMPTION,
+ SWITCH_IN,
+ SWITCH_IN_MERGER,
+ SWITCH_OUT,
+ SWITCH_OUT_MERGER,
+ DIVIDEND_PAYOUT,
+ DIVIDEND_REINVEST,
+ SEGREGATION,
+ STAMP_DUTY_TAX,
+ TDS_TAX,
+ STT_TAX,
+ MISC,
+ REVERSAL,
+ UNKNOWN,
+ /** An enum member indicating that [Type] was instantiated with an unknown value. */
+ _UNKNOWN,
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN]
+ * if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if you want
+ * to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ PURCHASE -> Value.PURCHASE
+ PURCHASE_SIP -> Value.PURCHASE_SIP
+ REDEMPTION -> Value.REDEMPTION
+ SWITCH_IN -> Value.SWITCH_IN
+ SWITCH_IN_MERGER -> Value.SWITCH_IN_MERGER
+ SWITCH_OUT -> Value.SWITCH_OUT
+ SWITCH_OUT_MERGER -> Value.SWITCH_OUT_MERGER
+ DIVIDEND_PAYOUT -> Value.DIVIDEND_PAYOUT
+ DIVIDEND_REINVEST -> Value.DIVIDEND_REINVEST
+ SEGREGATION -> Value.SEGREGATION
+ STAMP_DUTY_TAX -> Value.STAMP_DUTY_TAX
+ TDS_TAX -> Value.TDS_TAX
+ STT_TAX -> Value.STT_TAX
+ MISC -> Value.MISC
+ REVERSAL -> Value.REVERSAL
+ UNKNOWN -> Value.UNKNOWN
+ else -> Value._UNKNOWN
+ }
+
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and don't
+ * want to throw for the unknown case.
+ *
+ * @throws CasParserInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ PURCHASE -> Known.PURCHASE
+ PURCHASE_SIP -> Known.PURCHASE_SIP
+ REDEMPTION -> Known.REDEMPTION
+ SWITCH_IN -> Known.SWITCH_IN
+ SWITCH_IN_MERGER -> Known.SWITCH_IN_MERGER
+ SWITCH_OUT -> Known.SWITCH_OUT
+ SWITCH_OUT_MERGER -> Known.SWITCH_OUT_MERGER
+ DIVIDEND_PAYOUT -> Known.DIVIDEND_PAYOUT
+ DIVIDEND_REINVEST -> Known.DIVIDEND_REINVEST
+ SEGREGATION -> Known.SEGREGATION
+ STAMP_DUTY_TAX -> Known.STAMP_DUTY_TAX
+ TDS_TAX -> Known.TDS_TAX
+ STT_TAX -> Known.STT_TAX
+ MISC -> Known.MISC
+ REVERSAL -> Known.REVERSAL
+ UNKNOWN -> Known.UNKNOWN
+ else -> throw CasParserInvalidDataException("Unknown Type: $value")
+ }
+
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily for debugging
+ * and generally doesn't throw.
+ *
+ * @throws CasParserInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ CasParserInvalidDataException("Value is not a String")
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Type = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ 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 (value() == Value._UNKNOWN) 0 else 1
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Type && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Transaction &&
+ additionalInfo == other.additionalInfo &&
+ amount == other.amount &&
+ balance == other.balance &&
+ date == other.date &&
+ description == other.description &&
+ dividendRate == other.dividendRate &&
+ nav == other.nav &&
+ type == other.type &&
+ units == other.units &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ additionalInfo,
+ amount,
+ balance,
+ date,
+ description,
+ dividendRate,
+ nav,
+ type,
+ units,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Transaction{additionalInfo=$additionalInfo, amount=$amount, balance=$balance, date=$date, description=$description, dividendRate=$dividendRate, nav=$nav, type=$type, units=$units, additionalProperties=$additionalProperties}"
+}
diff --git a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/casparser/UnifiedResponse.kt b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/camskfintech/UnifiedResponse.kt
similarity index 54%
rename from cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/casparser/UnifiedResponse.kt
rename to cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/camskfintech/UnifiedResponse.kt
index 40030b6..6a27c6f 100644
--- a/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/casparser/UnifiedResponse.kt
+++ b/cas-parser-java-core/src/main/kotlin/com/cas_parser/api/models/camskfintech/UnifiedResponse.kt
@@ -1,6 +1,6 @@
// File generated from our OpenAPI spec by Stainless.
-package com.cas_parser.api.models.casparser
+package com.cas_parser.api.models.camskfintech
import com.cas_parser.api.core.Enum
import com.cas_parser.api.core.ExcludeMissing
@@ -2345,1211 +2345,615 @@ private constructor(
"AdditionalInfo{closeUnits=$closeUnits, openUnits=$openUnits, additionalProperties=$additionalProperties}"
}
- /**
- * Unified transaction schema for all holding types (MF folios, equities, bonds,
- * etc.)
- */
- class Transaction
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val additionalInfo: JsonField,
- private val amount: JsonField,
- private val balance: JsonField,
- private val date: JsonField,
- private val description: JsonField,
- private val dividendRate: JsonField,
- private val nav: JsonField,
- private val type: JsonField,
- private val units: JsonField,
- private val additionalProperties: MutableMap,
- ) {
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
- @JsonCreator
- private constructor(
- @JsonProperty("additional_info")
- @ExcludeMissing
- additionalInfo: JsonField = JsonMissing.of(),
- @JsonProperty("amount")
- @ExcludeMissing
- amount: JsonField = JsonMissing.of(),
- @JsonProperty("balance")
- @ExcludeMissing
- balance: JsonField = JsonMissing.of(),
- @JsonProperty("date")
- @ExcludeMissing
- date: JsonField = JsonMissing.of(),
- @JsonProperty("description")
- @ExcludeMissing
- description: JsonField = JsonMissing.of(),
- @JsonProperty("dividend_rate")
- @ExcludeMissing
- dividendRate: JsonField = JsonMissing.of(),
- @JsonProperty("nav")
- @ExcludeMissing
- nav: JsonField = JsonMissing.of(),
- @JsonProperty("type")
- @ExcludeMissing
- type: JsonField = JsonMissing.of(),
- @JsonProperty("units")
- @ExcludeMissing
- units: JsonField = JsonMissing.of(),
- ) : this(
+ return other is Aif &&
+ additionalInfo == other.additionalInfo &&
+ isin == other.isin &&
+ name == other.name &&
+ transactions == other.transactions &&
+ units == other.units &&
+ value == other.value &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
additionalInfo,
- amount,
- balance,
- date,
- description,
- dividendRate,
- nav,
- type,
+ isin,
+ name,
+ transactions,
units,
- mutableMapOf(),
+ value,
+ additionalProperties,
)
+ }
- /**
- * Additional transaction-specific fields that vary by source
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun additionalInfo(): Optional =
- additionalInfo.getOptional("additional_info")
-
- /**
- * Transaction amount in currency (computed from units × price/NAV)
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun amount(): Optional = amount.getOptional("amount")
-
- /**
- * Balance units after transaction
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun balance(): Optional = balance.getOptional("balance")
-
- /**
- * Transaction date (YYYY-MM-DD)
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun date(): Optional = date.getOptional("date")
-
- /**
- * Transaction description/particulars
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun description(): Optional = description.getOptional("description")
-
- /**
- * Dividend rate (for DIVIDEND_PAYOUT transactions)
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun dividendRate(): Optional = dividendRate.getOptional("dividend_rate")
-
- /**
- * NAV/price per unit on transaction date
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun nav(): Optional = nav.getOptional("nav")
+ override fun hashCode(): Int = hashCode
- /**
- * Transaction type. Possible values are PURCHASE, PURCHASE_SIP, REDEMPTION,
- * SWITCH_IN, SWITCH_IN_MERGER, SWITCH_OUT, SWITCH_OUT_MERGER, DIVIDEND_PAYOUT,
- * DIVIDEND_REINVEST, SEGREGATION, STAMP_DUTY_TAX, TDS_TAX, STT_TAX, MISC,
- * REVERSAL, UNKNOWN.
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun type(): Optional = type.getOptional("type")
+ override fun toString() =
+ "Aif{additionalInfo=$additionalInfo, isin=$isin, name=$name, transactions=$transactions, units=$units, value=$value, additionalProperties=$additionalProperties}"
+ }
- /**
- * Number of units involved in transaction
- *
- * @throws CasParserInvalidDataException if the JSON field has an unexpected
- * type (e.g. if the server responded with an unexpected value).
- */
- fun units(): Optional = units.getOptional("units")
+ class CorporateBond
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val additionalInfo: JsonField,
+ private val isin: JsonField,
+ private val name: JsonField,
+ private val transactions: JsonField>,
+ private val units: JsonField,
+ private val value: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
- /**
- * Returns the raw JSON value of [additionalInfo].
- *
- * Unlike [additionalInfo], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
+ @JsonCreator
+ private constructor(
@JsonProperty("additional_info")
@ExcludeMissing
- fun _additionalInfo(): JsonField = additionalInfo
-
- /**
- * Returns the raw JSON value of [amount].
- *
- * Unlike [amount], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
-
- /**
- * Returns the raw JSON value of [balance].
- *
- * Unlike [balance], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("balance")
+ additionalInfo: JsonField = JsonMissing.of(),
+ @JsonProperty("isin")
@ExcludeMissing
- fun _balance(): JsonField = balance
-
- /**
- * Returns the raw JSON value of [date].
- *
- * Unlike [date], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("date") @ExcludeMissing fun _date(): JsonField = date
-
- /**
- * Returns the raw JSON value of [description].
- *
- * Unlike [description], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("description")
+ isin: JsonField = JsonMissing.of(),
+ @JsonProperty("name")
@ExcludeMissing
- fun _description(): JsonField = description
-
- /**
- * Returns the raw JSON value of [dividendRate].
- *
- * Unlike [dividendRate], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("dividend_rate")
+ name: JsonField = JsonMissing.of(),
+ @JsonProperty("transactions")
@ExcludeMissing
- fun _dividendRate(): JsonField = dividendRate
-
- /**
- * Returns the raw JSON value of [nav].
- *
- * Unlike [nav], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("nav") @ExcludeMissing fun _nav(): JsonField = nav
-
- /**
- * Returns the raw JSON value of [type].
- *
- * Unlike [type], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
-
- /**
- * Returns the raw JSON value of [units].
- *
- * Unlike [units], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("units") @ExcludeMissing fun _units(): JsonField