@@ -57,14 +57,14 @@ This library requires Java 8 or later.
5757``` java
5858import com.cas_parser.api.client.CasParserClient ;
5959import 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
6565CasParserClient 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
138138To 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
155155import com.cas_parser.api.client.CasParserClient ;
156156import 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 ;
159159import 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
163163CasParserClient client = CasParserOkHttpClient . fromEnv();
164164
165- CompletableFuture<UnifiedResponse > unifiedResponse = client. async(). camsKfintech (). parse ();
165+ CompletableFuture<CreditCheckResponse > response = client. async(). credits (). check ();
166166```
167167
168168Or create an asynchronous client from the beginning:
169169
170170``` java
171171import com.cas_parser.api.client.CasParserClientAsync ;
172172import 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 ;
175175import 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
179179CasParserClientAsync client = CasParserOkHttpClientAsync . fromEnv();
180180
181- CompletableFuture<UnifiedResponse > unifiedResponse = client. camsKfintech (). parse ();
181+ CompletableFuture<CreditCheckResponse > response = client. credits (). check ();
182182```
183183
184184The 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
193193import com.cas_parser.api.core.http.Headers ;
194194import 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
204204You 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.
304304To 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
312312Or 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
445445import 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()`
457457To 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
465465The 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
509509import com.cas_parser.api.core.JsonMissing ;
510- import com.cas_parser.api.models.camskfintech.CamsKfintechParseParams ;
511510import 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
525525import com.cas_parser.api.core.JsonValue ;
526526import java.util.Map ;
527527
528- Map<String , JsonValue > additionalProperties = client. camsKfintech (). parse (params). _additionalProperties();
528+ Map<String , JsonValue > additionalProperties = client. credits (). check (params). _additionalProperties();
529529JsonValue secretPropertyValue = additionalProperties. get(" secretProperty" );
530530
531531String 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
555555import com.cas_parser.api.core.JsonField ;
556556import 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
580580If 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
588588Or 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
596596Or configure the default for all method calls at the client level:
0 commit comments