public class CreateManagerRequestExecutor extends RequestExecutor<Manager>
ManagersApi
. Use this class if you want to create
managers through fluent API in chained fashion, for instance:
KontaktCloud kontaktCloud = KontaktCloudFactory.create();
Manager manager = new Manager.Builder()
.firstName("Superb")
.lastName("Kontakter")
.email("superb.kontakter@kontakt.io")
.role(Manager.Role.SUPERUSER)
.build();
kontaktCloud.managers().create(manager).execute();
Keep in mind that new manager instance that we want to create must have initialized the following
fields: first name, last name, email address and role. Otherwise an exception will be thrown.Constructor and Description |
---|
CreateManagerRequestExecutor(ManagersService managersService,
Manager manager)
Constructs request executor initialized with corresponding service class and manager object.
|
Modifier and Type | Method and Description |
---|---|
Manager |
execute()
Executes created request synchronously.
|
void |
execute(CloudCallback<Manager> callback)
Executes created request asynchronously and invokes callback with the result.
|
public CreateManagerRequestExecutor(ManagersService managersService, Manager manager)
managersService
- the managers API service.manager
- the manager entity.public Manager execute() throws java.io.IOException, KontaktCloudException
execute
in class RequestExecutor<Manager>
java.io.IOException
- exceptionKontaktCloudException
- exceptionpublic void execute(CloudCallback<Manager> callback)
execute
in class RequestExecutor<Manager>
callback
- the callback object.