Skip to content

Latest commit

 

History

History
129 lines (92 loc) · 4.14 KB

File metadata and controls

129 lines (92 loc) · 4.14 KB

Search.V1

Warning

This SDK is DEPRECATED

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.*;
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(System.getenv().getOrDefault("CLIENT_ID", ""))
                    .clientSecret(System.getenv().getOrDefault("CLIENT_SECRET", ""))
                    .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()) {
            System.out.println(res.response().get());
        }
    }
}

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(System.getenv().getOrDefault("CLIENT_ID", ""))
                    .clientSecret(System.getenv().getOrDefault("CLIENT_SECRET", ""))
                    .build())
            .build();

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

        if (res.serverInfo().isPresent()) {
            System.out.println(res.serverInfo().get());
        }
    }
}

Response

SearchgetServerInfoResponse

Errors

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