Namespace Service
Wrapper for '/namespace' API.
List of all options
- Get list of namespaces
- Create/get one/modify namespace
Initialize service
TrivoreID sdk = TrivoreID.mgmtApiClient();
NamespaceServiceImpl namespaceService = new NamespaceServiceImpl(sdk.namespaceService());
Namespace management
// create new namespace
Namespace namespace = new Namespace();
namespace.setCode("examplecode");
namespace.setName("Example Name");
namespace.setShortName("Example Name");
namespace.setUsernamePolicy(UsernamePolicy.EIGHT_NUMBERS);
namespace = namespaceService.create(namespace);
// it is possible to get namespace both by code and ID
namespace = namespaceService.get(namespace.getCode());
namespace = namespaceService.get(namespace.getId());
// updating namespace
namespace.setUsernamePolicy(UsernamePolicy.EMAIL);
// Disable sending SMS for this namespace
namespace.getSmsSettings().setEnabled(false);
namespaceService.update(namespace2);