Skip to content

Commit 8d2cb43

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

File tree

49 files changed

+258
-5772
lines changed

Some content is hidden

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

49 files changed

+258
-5772
lines changed

.stats.yml

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

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.credits.CreditCheckParams;
61-
import com.cas_parser.api.models.credits.CreditCheckResponse;
60+
import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;
61+
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
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-
CreditCheckResponse response = client.credits().check();
67+
UnifiedResponse unifiedResponse = client.camsKfintech().parse();
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.credits().check(...)` should be called with an instance of `CreditCheckParams`, and it will return an instance of `CreditCheckResponse`.
140+
For example, `client.camsKfintech().parse(...)` should be called with an instance of `CamsKfintechParseParams`, and it will return an instance of `UnifiedResponse`.
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.credits.CreditCheckParams;
158-
import com.cas_parser.api.models.credits.CreditCheckResponse;
157+
import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;
158+
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
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<CreditCheckResponse> response = client.async().credits().check();
165+
CompletableFuture<UnifiedResponse> unifiedResponse = client.async().camsKfintech().parse();
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.credits.CreditCheckParams;
174-
import com.cas_parser.api.models.credits.CreditCheckResponse;
173+
import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;
174+
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
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<CreditCheckResponse> response = client.credits().check();
181+
CompletableFuture<UnifiedResponse> unifiedResponse = client.camsKfintech().parse();
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.credits.CreditCheckParams;
196-
import com.cas_parser.api.models.credits.CreditCheckResponse;
195+
import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;
196+
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
197197

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

200-
int statusCode = response.statusCode();
201-
Headers headers = response.headers();
200+
int statusCode = unifiedResponse.statusCode();
201+
Headers headers = unifiedResponse.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.credits.CreditCheckResponse;
207+
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
208208

209-
CreditCheckResponse parsedResponse = response.parse();
209+
UnifiedResponse parsedUnifiedResponse = unifiedResponse.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.credits.CreditCheckResponse;
307+
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
308308

309-
CreditCheckResponse response = client.credits().check(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());
309+
UnifiedResponse unifiedResponse = client.camsKfintech().parse(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.credits.CreditCheckParams;
446+
import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;
447447

448-
CreditCheckParams params = CreditCheckParams.builder()
448+
CamsKfintechParseParams params = CamsKfintechParseParams.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.credits.CreditCheckParams;
460+
import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams;
461461

462-
CreditCheckParams params = CreditCheckParams.builder().build();
462+
CamsKfintechParseParams params = CamsKfintechParseParams.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;
510511
import com.cas_parser.api.models.cdsl.fetch.FetchRequestOtpParams;
511-
import com.cas_parser.api.models.credits.CreditCheckParams;
512512

513-
CreditCheckParams params = FetchRequestOtpParams.builder()
513+
CamsKfintechParseParams 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.credits().check(params)._additionalProperties();
528+
Map<String, JsonValue> additionalProperties = client.camsKfintech().parse(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<Object> field = client.credits().check(params)._field();
558+
JsonField<String> password = client.camsKfintech().parse(params)._password();
559559

560-
if (field.isMissing()) {
560+
if (password.isMissing()) {
561561
// The property is absent from the JSON response
562-
} else if (field.isNull()) {
562+
} else if (password.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 = field.asString();
567+
Optional<String> jsonString = password.asString();
568568

569569
// Try to deserialize into a custom type
570-
MyClass myObject = field.asUnknown().orElseThrow().convert(MyClass.class);
570+
MyClass myObject = password.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.credits.CreditCheckResponse;
583+
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
584584

585-
CreditCheckResponse response = client.credits().check(params).validate();
585+
UnifiedResponse unifiedResponse = client.camsKfintech().parse(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.credits.CreditCheckResponse;
591+
import com.cas_parser.api.models.camskfintech.UnifiedResponse;
592592

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

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

0 commit comments

Comments
 (0)