com.ziqni.admin.sdk.ZiqniAdminApiFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ziqni-admin-sdk Show documentation
Show all versions of ziqni-admin-sdk Show documentation
ZIQNI Admin SDK Java Client
package com.ziqni.admin.sdk;
import com.ziqni.admin.sdk.api.*;
import com.ziqni.admin.sdk.streaming.StreamingClient;
import com.ziqni.admin.sdk.eventbus.ZiqniSimpleEventBus;
import com.ziqni.admin.sdk.configuration.WebSocketAddress;
import com.ziqni.admin.sdk.configuration.AdminApiClientConfiguration;
import java.time.Duration;
import java.util.function.Supplier;
public class ZiqniAdminApiFactory {
private StreamingClient streamingClient;
private ZiqniSimpleEventBus ziqniAdminEventBus;
private Boolean initialised = false;
private AccountMessagesApiWs accountMessagesApiWs;
private AchievementsApiWs achievementsApiWs;
private ActionTypesApiWs actionTypesApiWs;
private ApiKeysApiWs apiKeysApiWs;
private AwardsApiWs awardsApiWs;
private CollaboratorsApiWs collaboratorsApiWs;
private CompetitionsApiWs competitionsApiWs;
private ComputeEngineApiWs computeEngineApiWs;
private ConnectionsApiWs connectionsApiWs;
private ContestsApiWs contestsApiWs;
private CustomFieldsApiWs customFieldsApiWs;
private DefaultApiWs defaultApiWs;
private EntityChangesApiWs entityChangesApiWs;
private EntrantsApiWs entrantsApiWs;
private EventsApiWs eventsApiWs;
private FileObjectsApiWs fileObjectsApiWs;
private FileRepositoriesApiWs fileRepositoriesApiWs;
private GoalsApiWs goalsApiWs;
private GraphsApiWs graphsApiWs;
private InstantWinsApiWs instantWinsApiWs;
private LanguagesApiWs languagesApiWs;
private LeaderboardApiWs leaderboardApiWs;
private LogEventsApiWs logEventsApiWs;
private MemberMessagesApiWs memberMessagesApiWs;
private MemberTokenApiWs memberTokenApiWs;
private MembersApiWs membersApiWs;
private NotificationsApiWs notificationsApiWs;
private ProductsApiWs productsApiWs;
private RewardTypesApiWs rewardTypesApiWs;
private RewardsApiWs rewardsApiWs;
private RulesApiWs rulesApiWs;
private SpacesApiWs spacesApiWs;
private TagsApiWs tagsApiWs;
private TransformersApiWs transformersApiWs;
private TranslationsApiWs translationsApiWs;
private UnitsOfMeasureApiWs unitsOfMeasureApiWs;
private UserApiWs userApiWs;
private WebhooksApiWs webhooksApiWs;
private final AdminApiClientConfiguration configuration;
public ZiqniAdminApiFactory(AdminApiClientConfiguration configuration) {
this.configuration = configuration;
}
public T initialise(Supplier then) throws Exception {
initialise();
return then.get();
}
public void initialise() throws Exception {
if(initialised) return;
this.initialised = true;
this.ziqniAdminEventBus = new ZiqniSimpleEventBus();
this.streamingClient = new StreamingClient(this.configuration, new WebSocketAddress(this.configuration).getAddress(), getZiqniAdminEventBus());
}
private void init() {
try {
initialise();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public Boolean getInitialised() {
return initialised;
}
public StreamingClient getStreamingClient() {
assert getInitialised();
return streamingClient;
}
public ZiqniSimpleEventBus getZiqniAdminEventBus() {
init();
return ziqniAdminEventBus;
}
public AccountMessagesApiWs getAccountMessagesApi() {
/**
------
*/
if(this.accountMessagesApiWs == null) {
init();
this.accountMessagesApiWs = new AccountMessagesApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.accountMessagesApiWs;
}
public AchievementsApiWs getAchievementsApi() {
/**
------
*/
if(this.achievementsApiWs == null) {
init();
this.achievementsApiWs = new AchievementsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.achievementsApiWs;
}
public ActionTypesApiWs getActionTypesApi() {
/**
------
*/
if(this.actionTypesApiWs == null) {
init();
this.actionTypesApiWs = new ActionTypesApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.actionTypesApiWs;
}
public ApiKeysApiWs getApiKeysApi() {
/**
------
*/
if(this.apiKeysApiWs == null) {
init();
this.apiKeysApiWs = new ApiKeysApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.apiKeysApiWs;
}
public AwardsApiWs getAwardsApi() {
/**
------
*/
if(this.awardsApiWs == null) {
init();
this.awardsApiWs = new AwardsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.awardsApiWs;
}
public CollaboratorsApiWs getCollaboratorsApi() {
/**
------
*/
if(this.collaboratorsApiWs == null) {
init();
this.collaboratorsApiWs = new CollaboratorsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.collaboratorsApiWs;
}
public CompetitionsApiWs getCompetitionsApi() {
/**
------
*/
if(this.competitionsApiWs == null) {
init();
this.competitionsApiWs = new CompetitionsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.competitionsApiWs;
}
public ComputeEngineApiWs getComputeEngineApi() {
/**
------
*/
if(this.computeEngineApiWs == null) {
init();
this.computeEngineApiWs = new ComputeEngineApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.computeEngineApiWs;
}
public ConnectionsApiWs getConnectionsApi() {
/**
------
*/
if(this.connectionsApiWs == null) {
init();
this.connectionsApiWs = new ConnectionsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.connectionsApiWs;
}
public ContestsApiWs getContestsApi() {
/**
------
*/
if(this.contestsApiWs == null) {
init();
this.contestsApiWs = new ContestsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.contestsApiWs;
}
public CustomFieldsApiWs getCustomFieldsApi() {
/**
------
*/
if(this.customFieldsApiWs == null) {
init();
this.customFieldsApiWs = new CustomFieldsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.customFieldsApiWs;
}
public DefaultApiWs getDefaultApi() {
/**
------
*/
if(this.defaultApiWs == null) {
init();
this.defaultApiWs = new DefaultApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.defaultApiWs;
}
public EntityChangesApiWs getEntityChangesApi() {
/**
------,
entityChanged: Option,
entityChangedentityChangedPost
entityStateChanged: Option,
entityStateChangedentityStateChangedPost
*/
if(this.entityChangesApiWs == null) {
init();
this.entityChangesApiWs = new EntityChangesApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.entityChangesApiWs;
}
public EntrantsApiWs getEntrantsApi() {
/**
------
*/
if(this.entrantsApiWs == null) {
init();
this.entrantsApiWs = new EntrantsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.entrantsApiWs;
}
public EventsApiWs getEventsApi() {
/**
------
*/
if(this.eventsApiWs == null) {
init();
this.eventsApiWs = new EventsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.eventsApiWs;
}
public FileObjectsApiWs getFileObjectsApi() {
/**
------
*/
if(this.fileObjectsApiWs == null) {
init();
this.fileObjectsApiWs = new FileObjectsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.fileObjectsApiWs;
}
public FileRepositoriesApiWs getFileRepositoriesApi() {
/**
------
*/
if(this.fileRepositoriesApiWs == null) {
init();
this.fileRepositoriesApiWs = new FileRepositoriesApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.fileRepositoriesApiWs;
}
public GoalsApiWs getGoalsApi() {
/**
------
*/
if(this.goalsApiWs == null) {
init();
this.goalsApiWs = new GoalsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.goalsApiWs;
}
public GraphsApiWs getGraphsApi() {
/**
------
*/
if(this.graphsApiWs == null) {
init();
this.graphsApiWs = new GraphsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.graphsApiWs;
}
public InstantWinsApiWs getInstantWinsApi() {
/**
------
*/
if(this.instantWinsApiWs == null) {
init();
this.instantWinsApiWs = new InstantWinsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.instantWinsApiWs;
}
public LanguagesApiWs getLanguagesApi() {
/**
------
*/
if(this.languagesApiWs == null) {
init();
this.languagesApiWs = new LanguagesApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.languagesApiWs;
}
public LeaderboardApiWs getLeaderboardApi() {
/**
------
*/
if(this.leaderboardApiWs == null) {
init();
this.leaderboardApiWs = new LeaderboardApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.leaderboardApiWs;
}
public LogEventsApiWs getLogEventsApi() {
/**
------
*/
if(this.logEventsApiWs == null) {
init();
this.logEventsApiWs = new LogEventsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.logEventsApiWs;
}
public MemberMessagesApiWs getMemberMessagesApi() {
/**
------
*/
if(this.memberMessagesApiWs == null) {
init();
this.memberMessagesApiWs = new MemberMessagesApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.memberMessagesApiWs;
}
public MemberTokenApiWs getMemberTokenApi() {
/**
------
*/
if(this.memberTokenApiWs == null) {
init();
this.memberTokenApiWs = new MemberTokenApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.memberTokenApiWs;
}
public MembersApiWs getMembersApi() {
/**
------
*/
if(this.membersApiWs == null) {
init();
this.membersApiWs = new MembersApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.membersApiWs;
}
public NotificationsApiWs getNotificationsApi() {
/**
------
*/
if(this.notificationsApiWs == null) {
init();
this.notificationsApiWs = new NotificationsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.notificationsApiWs;
}
public ProductsApiWs getProductsApi() {
/**
------
*/
if(this.productsApiWs == null) {
init();
this.productsApiWs = new ProductsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.productsApiWs;
}
public RewardTypesApiWs getRewardTypesApi() {
/**
------
*/
if(this.rewardTypesApiWs == null) {
init();
this.rewardTypesApiWs = new RewardTypesApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.rewardTypesApiWs;
}
public RewardsApiWs getRewardsApi() {
/**
------
*/
if(this.rewardsApiWs == null) {
init();
this.rewardsApiWs = new RewardsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.rewardsApiWs;
}
public RulesApiWs getRulesApi() {
/**
------
*/
if(this.rulesApiWs == null) {
init();
this.rulesApiWs = new RulesApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.rulesApiWs;
}
public SpacesApiWs getSpacesApi() {
/**
------
*/
if(this.spacesApiWs == null) {
init();
this.spacesApiWs = new SpacesApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.spacesApiWs;
}
public TagsApiWs getTagsApi() {
/**
------
*/
if(this.tagsApiWs == null) {
init();
this.tagsApiWs = new TagsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.tagsApiWs;
}
public TransformersApiWs getTransformersApi() {
/**
------
*/
if(this.transformersApiWs == null) {
init();
this.transformersApiWs = new TransformersApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.transformersApiWs;
}
public TranslationsApiWs getTranslationsApi() {
/**
------
*/
if(this.translationsApiWs == null) {
init();
this.translationsApiWs = new TranslationsApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.translationsApiWs;
}
public UnitsOfMeasureApiWs getUnitsOfMeasureApi() {
/**
------
*/
if(this.unitsOfMeasureApiWs == null) {
init();
this.unitsOfMeasureApiWs = new UnitsOfMeasureApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.unitsOfMeasureApiWs;
}
public UserApiWs getUserApi() {
/**
------
*/
if(this.userApiWs == null) {
init();
this.userApiWs = new UserApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.userApiWs;
}
public WebhooksApiWs getWebhooksApi() {
/**
------
*/
if(this.webhooksApiWs == null) {
init();
this.webhooksApiWs = new WebhooksApiWs(streamingClient, Duration.ofSeconds(5));
}
return this.webhooksApiWs;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy