Skip to content

Latest commit

 

History

History
127 lines (91 loc) · 3.9 KB

README.md

File metadata and controls

127 lines (91 loc) · 3.9 KB

SDKSearchV1

(search().v1())

Overview

Available Operations

search

Elasticsearch.v1 query engine

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.SearchResponse;
import com.formance.formance_sdk.models.shared.Query;
import com.formance.formance_sdk.models.shared.QueryRaw;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
import java.util.List;

public class Application {

    public static void main(String[] args) throws Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        Query req = Query.builder()
                .after(List.of(
                    "users:002"))
                .cursor("YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=")
                .ledgers(List.of(
                    "quickstart"))
                .policy("OR")
                .raw(QueryRaw.builder()
                    .build())
                .sort("id:asc")
                .terms(List.of(
                    "destination=central_bank1"))
                .build();

        SearchResponse res = sdk.search().v1().search()
                .request(req)
                .call();

        if (res.response().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request Query ✔️ The request object to use for the request.

Response

SearchResponse

Errors

Error Type Status Code Content Type
models/errors/SDKError 4XX, 5XX */*

searchgetServerInfo

Get server info

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.SearchgetServerInfoResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        SearchgetServerInfoResponse res = sdk.search().v1().searchgetServerInfo()
                .call();

        if (res.serverInfo().isPresent()) {
            // handle response
        }
    }
}

Response

SearchgetServerInfoResponse

Errors

Error Type Status Code Content Type
models/errors/SDKError 4XX, 5XX */*