ListClients
Method Details​
Description: ListClients retrieves a collection of client compliance profiles.
This method is useful for fetching multiple client records at once. Note: This endpoint does not currently support pagination or filtering.
Required Roles: Check proto file for roles
Parameters: No parameters
Returns: ListClientsResponse
Method Type: METHOD_TYPE_READ
Code Examples​
- Go
- Python
- Java
- Protobuf
package main
import (
"context"
"log"
clientv1 "github.com/meshtrade/api/go/compliance/client/v1"
)
func main() {
ctx := context.Background()
// Default configuration is used and credentials come from MESH_API_CREDENTIALS
// environment variable or default discovery methods. Zero config required
// unless you want custom configuration.
service, err := clientv1.NewClientService()
if err != nil {
log.Fatalf("Failed to create service: %v", err)
}
defer service.Close()
// Create request with service-specific parameters
request := &clientv1.ListClientsRequest{
// FIXME: Populate service-specific request fields
}
// Call the ListClients method
response, err := service.ListClients(ctx, request)
if err != nil {
log.Fatalf("ListClients failed: %v", err)
}
// FIXME: Add relevant response object usage
log.Printf("ListClients successful: %+v", response)
}
from meshtrade.compliance.client.v1 import (
ClientService,
)
def main():
# Default configuration is used and credentials come from MESH_API_CREDENTIALS
# environment variable or default discovery methods. Zero config required
# unless you want custom configuration.
service = ClientService()
with service:
# Call the ListClients method (no request parameters)
response = service.list_clients()
# FIXME: Add relevant response object usage
print("ListClients successful:", response)
if __name__ == "__main__":
main()
import co.meshtrade.api.compliance.client.v1.ClientService;
import co.meshtrade.api.compliance.client.v1.Service.ListClientsRequest;
import co.meshtrade.api.compliance.client.v1.Service.ListClientsResponse;
import java.util.Optional;
public class ListClientsExample {
public static void main(String[] args) {
// Default configuration is used and credentials come from MESH_API_CREDENTIALS
// environment variable or default discovery methods. Zero config required
// unless you want custom configuration.
try (ClientService service = new ClientService()) {
// Create request with service-specific parameters
ListClientsRequest request = ListClientsRequest.newBuilder()
// FIXME: Populate service-specific request fields
.build();
// Call the ListClients method
ListClientsResponse response = service.listClients(request, Optional.empty());
// FIXME: Add relevant response object usage
System.out.println("ListClients successful: " + response);
} catch (Exception e) {
System.err.println("ListClients failed: " + e.getMessage());
e.printStackTrace();
}
}
}
syntax = "proto3";
package meshtrade.compliance.client.v1;
import "meshtrade/compliance/client/v1/client.proto";
import "meshtrade/iam/role/v1/role.proto";
import "meshtrade/option/v1/method_type.proto";
option go_package = "github.com/meshtrade/api/go/compliance/client/v1;clientv1";
option java_package = "co.meshtrade.api.compliance.client.v1";
// Service manages client profiles for compliance and Know Your Customer (KYC)
// purposes.
//
// The main entity managed by this service is the `Client` resource. A client can
// be a natural person, company, or trust. This service allows you to retrieve
// the compliance profiles for these clients.
service ClientService {
// CreateClient creates a single client.
rpc CreateClient(CreateClientRequest) returns (meshtrade.compliance.client.v1.Client) {
option (meshtrade.option.v1.method_type) = METHOD_TYPE_WRITE;
option (meshtrade.iam.role.v1.roles) = {
roles: [ROLE_COMPLIANCE_ADMIN]
};
}
// GetClient retrieves a single client's compliance profile by its unique resource name.
//
// This allows for fetching the complete compliance details of a specific client,
// including all associated information like identification documents, tax residencies,
// and company structures.
rpc GetClient(GetClientRequest) returns (meshtrade.compliance.client.v1.Client) {
option (meshtrade.option.v1.method_type) = METHOD_TYPE_READ;
option (meshtrade.iam.role.v1.roles) = {
roles: [
ROLE_COMPLIANCE_ADMIN,
ROLE_COMPLIANCE_VIEWER
]
};
}
// ListClients retrieves a collection of client compliance profiles.
//
// This method is useful for fetching multiple client records at once.
// Note: This endpoint does not currently support pagination or filtering.
rpc ListClients(ListClientsRequest) returns (ListClientsResponse) {
option (meshtrade.option.v1.method_type) = METHOD_TYPE_READ;
option (meshtrade.iam.role.v1.roles) = {
roles: [
ROLE_COMPLIANCE_ADMIN,
ROLE_COMPLIANCE_VIEWER
]
};
}
}
// CreateClientRequest is the message used to create a single client resource.
message GetClientRequest {
// The unique resource name of the client to be retrieved.
// The name serves as the primary identifier for the client resource.
// Format: "clients/{client_id}"
string name = 1;
}
// GetClientRequest is the message used to request a single client resource.
message CreateClientRequest {
// Client is the client resource to create.
meshtrade.compliance.client.v1.Client client = 1;
}
// ListClientsRequest is the message used to request a list of client resources.
message ListClientsRequest {}
// ListClientsResponse contains a list of client resources.
message ListClientsResponse {
// A repeated field containing the client resource objects.
repeated meshtrade.compliance.client.v1.Client clients = 1;
}
Advanced Configuration​
For advanced client configuration options (custom endpoints, TLS settings, timeouts), see the SDK Configuration Guide.
Other Methods​
- Compliance Client v1 Method List - For Other methods