Skip to content

Latest commit

 

History

History
592 lines (414 loc) · 20.2 KB

README.md

File metadata and controls

592 lines (414 loc) · 20.2 KB

V1

(auth().v1())

Overview

Available Operations

createClient

Create client

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.CreateClientResponse;
import com.formance.formance_sdk.models.shared.CreateClientRequest;
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();

        CreateClientRequest req = CreateClientRequest.builder()
                .name("<value>")
                .build();

        CreateClientResponse res = sdk.auth().v1().createClient()
                .request(req)
                .call();

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

Parameters

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

Response

CreateClientResponse

Errors

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

createSecret

Add a secret to a client

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.CreateSecretRequest;
import com.formance.formance_sdk.models.operations.CreateSecretResponse;
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();

        CreateSecretRequest req = CreateSecretRequest.builder()
                .clientId("<id>")
                .build();

        CreateSecretResponse res = sdk.auth().v1().createSecret()
                .request(req)
                .call();

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

Parameters

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

Response

CreateSecretResponse

Errors

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

deleteClient

Delete client

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.DeleteClientRequest;
import com.formance.formance_sdk.models.operations.DeleteClientResponse;
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();

        DeleteClientRequest req = DeleteClientRequest.builder()
                .clientId("<id>")
                .build();

        DeleteClientResponse res = sdk.auth().v1().deleteClient()
                .request(req)
                .call();

        // handle response
    }
}

Parameters

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

Response

DeleteClientResponse

Errors

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

deleteSecret

Delete a secret from a client

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.DeleteSecretRequest;
import com.formance.formance_sdk.models.operations.DeleteSecretResponse;
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();

        DeleteSecretRequest req = DeleteSecretRequest.builder()
                .clientId("<id>")
                .secretId("<id>")
                .build();

        DeleteSecretResponse res = sdk.auth().v1().deleteSecret()
                .request(req)
                .call();

        // handle response
    }
}

Parameters

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

Response

DeleteSecretResponse

Errors

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

getOIDCWellKnowns

Retrieve OpenID connect well-knowns.

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.GetOIDCWellKnownsResponse;
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();

        GetOIDCWellKnownsResponse res = sdk.auth().v1().getOIDCWellKnowns()
                .call();

        // handle response
    }
}

Response

GetOIDCWellKnownsResponse

Errors

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

getServerInfo

Get server info

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.GetServerInfoResponse;
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();

        GetServerInfoResponse res = sdk.auth().v1().getServerInfo()
                .call();

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

Response

GetServerInfoResponse

Errors

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

listClients

List clients

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.ListClientsResponse;
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();

        ListClientsResponse res = sdk.auth().v1().listClients()
                .call();

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

Response

ListClientsResponse

Errors

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

listUsers

List users

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.ListUsersResponse;
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();

        ListUsersResponse res = sdk.auth().v1().listUsers()
                .call();

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

Response

ListUsersResponse

Errors

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

readClient

Read client

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.ReadClientRequest;
import com.formance.formance_sdk.models.operations.ReadClientResponse;
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();

        ReadClientRequest req = ReadClientRequest.builder()
                .clientId("<id>")
                .build();

        ReadClientResponse res = sdk.auth().v1().readClient()
                .request(req)
                .call();

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

Parameters

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

Response

ReadClientResponse

Errors

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

readUser

Read user

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.ReadUserRequest;
import com.formance.formance_sdk.models.operations.ReadUserResponse;
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();

        ReadUserRequest req = ReadUserRequest.builder()
                .userId("<id>")
                .build();

        ReadUserResponse res = sdk.auth().v1().readUser()
                .request(req)
                .call();

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

Parameters

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

Response

ReadUserResponse

Errors

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

updateClient

Update client

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.operations.UpdateClientRequest;
import com.formance.formance_sdk.models.operations.UpdateClientResponse;
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();

        UpdateClientRequest req = UpdateClientRequest.builder()
                .clientId("<id>")
                .build();

        UpdateClientResponse res = sdk.auth().v1().updateClient()
                .request(req)
                .call();

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

Parameters

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

Response

UpdateClientResponse

Errors

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