Skip to content

Commit 2bb349e

Browse files
feat(api): manual updates
1 parent b23e224 commit 2bb349e

File tree

75 files changed

+12522
-257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+12522
-257
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 12
1+
configured_endpoints: 21
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-d9763d006969b49a1473851069fdfa429eb13133b64103a62963bb70ddb22305.yml
33
openapi_spec_hash: 6aee689b7a759b12c85c088c15e29bc0
4-
config_hash: 41c337f5cda03b13880617490f82bad0
4+
config_hash: d54f39abb185904495bef7c5f8702746

README.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ This library requires Java 8 or later.
5757
```java
5858
import com.cas_parser.api.client.CasParserClient;
5959
import com.cas_parser.api.client.okhttp.CasParserOkHttpClient;
60-
import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;
61-
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
60+
import com.cas_parser.api.models.credits.CreditCheckParams;
61+
import com.cas_parser.api.models.credits.CreditCheckResponse;
6262

6363
// Configures using the `casparser.apiKey` and `casparser.baseUrl` system properties
6464
// Or configures using the `CAS_PARSER_API_KEY` and `CAS_PARSER_BASE_URL` environment variables
6565
CasParserClient client = CasParserOkHttpClient.fromEnv();
6666

67-
UnifiedResponse unifiedResponse = client.camsKfintech().parse();
67+
CreditCheckResponse response = client.credits().check();
6868
```
6969

7070
## Client configuration
@@ -137,7 +137,7 @@ The `withOptions()` method does not affect the original client or service.
137137

138138
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.
139139

140-
For example, `client.camsKfintech().parse(...)` should be called with an instance of `CamsKfintechParseParams`, and it will return an instance of `UnifiedResponse`.
140+
For example, `client.credits().check(...)` should be called with an instance of `CreditCheckParams`, and it will return an instance of `CreditCheckResponse`.
141141

142142
## Immutability
143143

@@ -154,31 +154,31 @@ The default client is synchronous. To switch to asynchronous execution, call the
154154
```java
155155
import com.cas_parser.api.client.CasParserClient;
156156
import com.cas_parser.api.client.okhttp.CasParserOkHttpClient;
157-
import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;
158-
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
157+
import com.cas_parser.api.models.credits.CreditCheckParams;
158+
import com.cas_parser.api.models.credits.CreditCheckResponse;
159159
import java.util.concurrent.CompletableFuture;
160160

161161
// Configures using the `casparser.apiKey` and `casparser.baseUrl` system properties
162162
// Or configures using the `CAS_PARSER_API_KEY` and `CAS_PARSER_BASE_URL` environment variables
163163
CasParserClient client = CasParserOkHttpClient.fromEnv();
164164

165-
CompletableFuture<UnifiedResponse> unifiedResponse = client.async().camsKfintech().parse();
165+
CompletableFuture<CreditCheckResponse> response = client.async().credits().check();
166166
```
167167

168168
Or create an asynchronous client from the beginning:
169169

170170
```java
171171
import com.cas_parser.api.client.CasParserClientAsync;
172172
import com.cas_parser.api.client.okhttp.CasParserOkHttpClientAsync;
173-
import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;
174-
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
173+
import com.cas_parser.api.models.credits.CreditCheckParams;
174+
import com.cas_parser.api.models.credits.CreditCheckResponse;
175175
import java.util.concurrent.CompletableFuture;
176176

177177
// Configures using the `casparser.apiKey` and `casparser.baseUrl` system properties
178178
// Or configures using the `CAS_PARSER_API_KEY` and `CAS_PARSER_BASE_URL` environment variables
179179
CasParserClientAsync client = CasParserOkHttpClientAsync.fromEnv();
180180

181-
CompletableFuture<UnifiedResponse> unifiedResponse = client.camsKfintech().parse();
181+
CompletableFuture<CreditCheckResponse> response = client.credits().check();
182182
```
183183

184184
The asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.
@@ -192,21 +192,21 @@ To access this data, prefix any HTTP method call on a client or service with `wi
192192
```java
193193
import com.cas_parser.api.core.http.Headers;
194194
import com.cas_parser.api.core.http.HttpResponseFor;
195-
import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;
196-
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
195+
import com.cas_parser.api.models.credits.CreditCheckParams;
196+
import com.cas_parser.api.models.credits.CreditCheckResponse;
197197

198-
HttpResponseFor<UnifiedResponse> unifiedResponse = client.camsKfintech().withRawResponse().parse();
198+
HttpResponseFor<CreditCheckResponse> response = client.credits().withRawResponse().check();
199199

200-
int statusCode = unifiedResponse.statusCode();
201-
Headers headers = unifiedResponse.headers();
200+
int statusCode = response.statusCode();
201+
Headers headers = response.headers();
202202
```
203203

204204
You can still deserialize the response into an instance of a Java class if needed:
205205

206206
```java
207-
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
207+
import com.cas_parser.api.models.credits.CreditCheckResponse;
208208

209-
UnifiedResponse parsedUnifiedResponse = unifiedResponse.parse();
209+
CreditCheckResponse parsedResponse = response.parse();
210210
```
211211

212212
## Error handling
@@ -304,9 +304,9 @@ Requests time out after 1 minute by default.
304304
To set a custom timeout, configure the method call using the `timeout` method:
305305

306306
```java
307-
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
307+
import com.cas_parser.api.models.credits.CreditCheckResponse;
308308

309-
UnifiedResponse unifiedResponse = client.camsKfintech().parse(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());
309+
CreditCheckResponse response = client.credits().check(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());
310310
```
311311

312312
Or configure the default for all method calls at the client level:
@@ -443,9 +443,9 @@ To set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQu
443443

444444
```java
445445
import com.cas_parser.api.core.JsonValue;
446-
import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;
446+
import com.cas_parser.api.models.credits.CreditCheckParams;
447447

448-
CamsKfintechParseParams params = CamsKfintechParseParams.builder()
448+
CreditCheckParams params = CreditCheckParams.builder()
449449
.putAdditionalHeader("Secret-Header", "42")
450450
.putAdditionalQueryParam("secret_query_param", "42")
451451
.putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))
@@ -457,9 +457,9 @@ These can be accessed on the built object later using the `_additionalHeaders()`
457457
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:
458458

459459
```java
460-
import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;
460+
import com.cas_parser.api.models.credits.CreditCheckParams;
461461

462-
CamsKfintechParseParams params = CamsKfintechParseParams.builder().build();
462+
CreditCheckParams params = CreditCheckParams.builder().build();
463463
```
464464

465465
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:
@@ -507,10 +507,10 @@ To forcibly omit a required parameter or property, pass [`JsonMissing`](cas-pars
507507

508508
```java
509509
import com.cas_parser.api.core.JsonMissing;
510-
import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;
511510
import com.cas_parser.api.models.cdsl.fetch.FetchRequestOtpParams;
511+
import com.cas_parser.api.models.credits.CreditCheckParams;
512512

513-
CamsKfintechParseParams params = FetchRequestOtpParams.builder()
513+
CreditCheckParams params = FetchRequestOtpParams.builder()
514514
.dob("1990-01-15")
515515
.pan("ABCDE1234F")
516516
.boId(JsonMissing.of())
@@ -525,7 +525,7 @@ To access undocumented response properties, call the `_additionalProperties()` m
525525
import com.cas_parser.api.core.JsonValue;
526526
import java.util.Map;
527527

528-
Map<String, JsonValue> additionalProperties = client.camsKfintech().parse(params)._additionalProperties();
528+
Map<String, JsonValue> additionalProperties = client.credits().check(params)._additionalProperties();
529529
JsonValue secretPropertyValue = additionalProperties.get("secretProperty");
530530

531531
String result = secretPropertyValue.accept(new JsonValue.Visitor<>() {
@@ -555,19 +555,19 @@ To access a property's raw JSON value, which may be undocumented, call its `_` p
555555
import com.cas_parser.api.core.JsonField;
556556
import java.util.Optional;
557557

558-
JsonField<String> password = client.camsKfintech().parse(params)._password();
558+
JsonField<Object> field = client.credits().check(params)._field();
559559

560-
if (password.isMissing()) {
560+
if (field.isMissing()) {
561561
// The property is absent from the JSON response
562-
} else if (password.isNull()) {
562+
} else if (field.isNull()) {
563563
// The property was set to literal null
564564
} else {
565565
// Check if value was provided as a string
566566
// Other methods include `asNumber()`, `asBoolean()`, etc.
567-
Optional<String> jsonString = password.asString();
567+
Optional<String> jsonString = field.asString();
568568

569569
// Try to deserialize into a custom type
570-
MyClass myObject = password.asUnknown().orElseThrow().convert(MyClass.class);
570+
MyClass myObject = field.asUnknown().orElseThrow().convert(MyClass.class);
571571
}
572572
```
573573

@@ -580,17 +580,17 @@ By default, the SDK will not throw an exception in this case. It will throw [`Ca
580580
If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`:
581581

582582
```java
583-
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
583+
import com.cas_parser.api.models.credits.CreditCheckResponse;
584584

585-
UnifiedResponse unifiedResponse = client.camsKfintech().parse(params).validate();
585+
CreditCheckResponse response = client.credits().check(params).validate();
586586
```
587587

588588
Or configure the method call to validate the response using the `responseValidation` method:
589589

590590
```java
591-
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
591+
import com.cas_parser.api.models.credits.CreditCheckResponse;
592592

593-
UnifiedResponse unifiedResponse = client.camsKfintech().parse(RequestOptions.builder().responseValidation(true).build());
593+
CreditCheckResponse response = client.credits().check(RequestOptions.builder().responseValidation(true).build());
594594
```
595595

596596
Or configure the default for all method calls at the client level:

cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClient.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import com.cas_parser.api.services.blocking.CamsKfintechService
88
import com.cas_parser.api.services.blocking.CdslService
99
import com.cas_parser.api.services.blocking.ContractNoteService
1010
import com.cas_parser.api.services.blocking.CreditService
11+
import com.cas_parser.api.services.blocking.InboundEmailService
1112
import com.cas_parser.api.services.blocking.InboxService
1213
import com.cas_parser.api.services.blocking.KfintechService
1314
import com.cas_parser.api.services.blocking.LogService
@@ -74,6 +75,8 @@ interface CasParserClient {
7475

7576
fun smart(): SmartService
7677

78+
fun inboundEmail(): InboundEmailService
79+
7780
/**
7881
* Closes this client, relinquishing any underlying resources.
7982
*
@@ -118,5 +121,7 @@ interface CasParserClient {
118121
fun nsdl(): NsdlService.WithRawResponse
119122

120123
fun smart(): SmartService.WithRawResponse
124+
125+
fun inboundEmail(): InboundEmailService.WithRawResponse
121126
}
122127
}

cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsync.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import com.cas_parser.api.services.async.CamsKfintechServiceAsync
88
import com.cas_parser.api.services.async.CdslServiceAsync
99
import com.cas_parser.api.services.async.ContractNoteServiceAsync
1010
import com.cas_parser.api.services.async.CreditServiceAsync
11+
import com.cas_parser.api.services.async.InboundEmailServiceAsync
1112
import com.cas_parser.api.services.async.InboxServiceAsync
1213
import com.cas_parser.api.services.async.KfintechServiceAsync
1314
import com.cas_parser.api.services.async.LogServiceAsync
@@ -74,6 +75,8 @@ interface CasParserClientAsync {
7475

7576
fun smart(): SmartServiceAsync
7677

78+
fun inboundEmail(): InboundEmailServiceAsync
79+
7780
/**
7881
* Closes this client, relinquishing any underlying resources.
7982
*
@@ -122,5 +125,7 @@ interface CasParserClientAsync {
122125
fun nsdl(): NsdlServiceAsync.WithRawResponse
123126

124127
fun smart(): SmartServiceAsync.WithRawResponse
128+
129+
fun inboundEmail(): InboundEmailServiceAsync.WithRawResponse
125130
}
126131
}

cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsyncImpl.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import com.cas_parser.api.services.async.ContractNoteServiceAsync
1414
import com.cas_parser.api.services.async.ContractNoteServiceAsyncImpl
1515
import com.cas_parser.api.services.async.CreditServiceAsync
1616
import com.cas_parser.api.services.async.CreditServiceAsyncImpl
17+
import com.cas_parser.api.services.async.InboundEmailServiceAsync
18+
import com.cas_parser.api.services.async.InboundEmailServiceAsyncImpl
1719
import com.cas_parser.api.services.async.InboxServiceAsync
1820
import com.cas_parser.api.services.async.InboxServiceAsyncImpl
1921
import com.cas_parser.api.services.async.KfintechServiceAsync
@@ -83,6 +85,10 @@ class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasPa
8385
SmartServiceAsyncImpl(clientOptionsWithUserAgent)
8486
}
8587

88+
private val inboundEmail: InboundEmailServiceAsync by lazy {
89+
InboundEmailServiceAsyncImpl(clientOptionsWithUserAgent)
90+
}
91+
8692
override fun sync(): CasParserClient = sync
8793

8894
override fun withRawResponse(): CasParserClientAsync.WithRawResponse = withRawResponse
@@ -112,6 +118,8 @@ class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasPa
112118

113119
override fun smart(): SmartServiceAsync = smart
114120

121+
override fun inboundEmail(): InboundEmailServiceAsync = inboundEmail
122+
115123
override fun close() = clientOptions.close()
116124

117125
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -161,6 +169,10 @@ class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasPa
161169
SmartServiceAsyncImpl.WithRawResponseImpl(clientOptions)
162170
}
163171

172+
private val inboundEmail: InboundEmailServiceAsync.WithRawResponse by lazy {
173+
InboundEmailServiceAsyncImpl.WithRawResponseImpl(clientOptions)
174+
}
175+
164176
override fun withOptions(
165177
modifier: Consumer<ClientOptions.Builder>
166178
): CasParserClientAsync.WithRawResponse =
@@ -189,5 +201,7 @@ class CasParserClientAsyncImpl(private val clientOptions: ClientOptions) : CasPa
189201
override fun nsdl(): NsdlServiceAsync.WithRawResponse = nsdl
190202

191203
override fun smart(): SmartServiceAsync.WithRawResponse = smart
204+
205+
override fun inboundEmail(): InboundEmailServiceAsync.WithRawResponse = inboundEmail
192206
}
193207
}

cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientImpl.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import com.cas_parser.api.services.blocking.ContractNoteService
1414
import com.cas_parser.api.services.blocking.ContractNoteServiceImpl
1515
import com.cas_parser.api.services.blocking.CreditService
1616
import com.cas_parser.api.services.blocking.CreditServiceImpl
17+
import com.cas_parser.api.services.blocking.InboundEmailService
18+
import com.cas_parser.api.services.blocking.InboundEmailServiceImpl
1719
import com.cas_parser.api.services.blocking.InboxService
1820
import com.cas_parser.api.services.blocking.InboxServiceImpl
1921
import com.cas_parser.api.services.blocking.KfintechService
@@ -77,6 +79,10 @@ class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserC
7779

7880
private val smart: SmartService by lazy { SmartServiceImpl(clientOptionsWithUserAgent) }
7981

82+
private val inboundEmail: InboundEmailService by lazy {
83+
InboundEmailServiceImpl(clientOptionsWithUserAgent)
84+
}
85+
8086
override fun async(): CasParserClientAsync = async
8187

8288
override fun withRawResponse(): CasParserClient.WithRawResponse = withRawResponse
@@ -106,6 +112,8 @@ class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserC
106112

107113
override fun smart(): SmartService = smart
108114

115+
override fun inboundEmail(): InboundEmailService = inboundEmail
116+
109117
override fun close() = clientOptions.close()
110118

111119
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
@@ -155,6 +163,10 @@ class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserC
155163
SmartServiceImpl.WithRawResponseImpl(clientOptions)
156164
}
157165

166+
private val inboundEmail: InboundEmailService.WithRawResponse by lazy {
167+
InboundEmailServiceImpl.WithRawResponseImpl(clientOptions)
168+
}
169+
158170
override fun withOptions(
159171
modifier: Consumer<ClientOptions.Builder>
160172
): CasParserClient.WithRawResponse =
@@ -183,5 +195,7 @@ class CasParserClientImpl(private val clientOptions: ClientOptions) : CasParserC
183195
override fun nsdl(): NsdlService.WithRawResponse = nsdl
184196

185197
override fun smart(): SmartService.WithRawResponse = smart
198+
199+
override fun inboundEmail(): InboundEmailService.WithRawResponse = inboundEmail
186200
}
187201
}

0 commit comments

Comments
 (0)