index
int64
repo_id
string
file_path
string
content
string
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/training/TrainingOpenOperation.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.training; import java.util.Date; import com.fasterxml.jackson.annotation.JsonProperty; import ai.toloka.client.v1.operation.Operation; import ai.toloka.client.v1.operation.OperationType; public class TrainingOpenOperation extends Operation<TrainingOpenOperation.Parameters, TrainingOpenOperation> { public static final OperationType TYPE = OperationType.TRAINING_OPEN; public TrainingOpenOperation() {} private TrainingOpenOperation(Date currentDateTime) { super(currentDateTime); } public static class Parameters { @JsonProperty("training_id") private String trainingId; public String getTrainingId() { return trainingId; } } public static TrainingOpenOperation createPseudo(Date currentDateTime) { return new TrainingOpenOperation(currentDateTime); } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/training/TrainingRangeParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.training; import ai.toloka.client.v1.RangeParam; public enum TrainingRangeParam implements RangeParam { id(TrainingSearchRequest.ID_PARAMETER), created(TrainingSearchRequest.CREATED_PARAMETER), lastStarted(TrainingSearchRequest.LAST_STARTED_PARAMETER); private String parameter; TrainingRangeParam(String parameter) { this.parameter = parameter; } @Override public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/training/TrainingSearchRequest.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.training; import java.util.Date; import java.util.Map; import ai.toloka.client.v1.SearchRequest; public class TrainingSearchRequest extends SearchRequest { static final String OWNER_ID_PARAMETER = "owner_id"; static final String OWNER_COMPANY_ID_PARAMETER = "owner_company_id"; static final String STATUS_PARAMETER = "status"; static final String PROJECT_ID_PARAMETER = "project_id"; static final String ID_PARAMETER = "id"; static final String CREATED_PARAMETER = "created"; static final String LAST_STARTED_PARAMETER = "last_started"; public TrainingSearchRequest(Map<String, Object> filterParameters, Map<String, Object> rangeParameters, String sortParameter, Integer limit) { super(filterParameters, rangeParameters, sortParameter, limit); } public static TrainingBuilder make() { return new TrainingBuilder(new TrainingFilterBuilder(), new TrainingRangeBuilder(), new TrainingSortBuilder()); } public static class TrainingBuilder extends Builder< TrainingSearchRequest, TrainingBuilder, TrainingFilterBuilder, TrainingRangeBuilder, TrainingSortBuilder> { public TrainingBuilder(TrainingFilterBuilder filterBuilder, TrainingRangeBuilder rangeBuilder, TrainingSortBuilder sortBuilder) { super(filterBuilder, rangeBuilder, sortBuilder); } @Override public TrainingSearchRequest done() { return new TrainingSearchRequest(filterBuilder.getFilterParameters(), rangeBuilder.getRangeParameters(), sortBuilder.getSortParameter(), getLimit()); } } public static class TrainingFilterBuilder extends FilterBuilder<TrainingFilterBuilder, TrainingBuilder, TrainingFilterParam> { public TrainingFilterBuilder byOwnerId(String ownerId) { return by(TrainingFilterParam.ownerId, ownerId); } public TrainingFilterBuilder byOwnerCompanyId(String companyId) { return by(TrainingFilterParam.ownerCompanyId, companyId); } public TrainingFilterBuilder byStatus(TrainingStatus status) { return by(TrainingFilterParam.status, status); } public TrainingFilterBuilder byProjectId(String projectId) { return by(TrainingFilterParam.projectId, projectId); } } public static class TrainingRangeBuilder extends RangeBuilder<TrainingRangeBuilder, TrainingBuilder, TrainingRangeParam> { public RangeItemBuilder<TrainingRangeBuilder> byId(String id) { return by(TrainingRangeParam.id, id); } public RangeItemBuilder<TrainingRangeBuilder> byCreated(Date created) { return by(TrainingRangeParam.created, created); } public RangeItemBuilder<TrainingRangeBuilder> byLastStarted(Date lastStarted) { return by(TrainingRangeParam.lastStarted, lastStarted); } } public static class TrainingSortBuilder extends SortBuilder<TrainingSortBuilder, TrainingBuilder, TrainingSortParam> { public SortItem<TrainingSortBuilder> byId() { return by(TrainingSortParam.id); } public SortItem<TrainingSortBuilder> byCreated() { return by(TrainingSortParam.created); } public SortItem<TrainingSortBuilder> byLastStarted() { return by(TrainingSortParam.lastStarted); } } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/training/TrainingSortParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.training; import ai.toloka.client.v1.SortParam; public enum TrainingSortParam implements SortParam { id(TrainingSearchRequest.ID_PARAMETER), created(TrainingSearchRequest.CREATED_PARAMETER), lastStarted(TrainingSearchRequest.LAST_STARTED_PARAMETER); private String parameter; TrainingSortParam(String parameter) { this.parameter = parameter; } @Override public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/training/TrainingStatus.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.training; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import com.fasterxml.jackson.annotation.JsonCreator; import ai.toloka.client.v1.FlexibleEnum; public final class TrainingStatus extends FlexibleEnum<TrainingStatus> { public static TrainingStatus OPEN = new TrainingStatus("OPEN"); public static TrainingStatus CLOSED = new TrainingStatus("CLOSED"); public static TrainingStatus ARCHIVED = new TrainingStatus("ARCHIVED"); public static TrainingStatus LOCKED = new TrainingStatus("LOCKED"); private static final TrainingStatus[] VALUES = {OPEN, CLOSED, ARCHIVED, LOCKED}; private static final ConcurrentMap<String, TrainingStatus> DISCOVERED_VALUES = new ConcurrentHashMap<>(); public static TrainingStatus[] values() { return values(VALUES, DISCOVERED_VALUES.values(), TrainingStatus.class); } @JsonCreator public static TrainingStatus valueOf(String name) { return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<TrainingStatus>() { @Override public TrainingStatus create(String name) { return new TrainingStatus(name); } }); } private TrainingStatus(String name) { super(name); } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userbonus/UserBonus.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userbonus; import java.math.BigDecimal; import java.util.Date; import java.util.Map; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import ai.toloka.client.v1.LangIso639; public class UserBonus { private String id; @JsonProperty("user_id") private String userId; @JsonProperty("assignment_id") private String assignmentId; private BigDecimal amount; @JsonProperty("private_comment") private String privateComment; @JsonProperty("public_title") private Map<LangIso639, String> publicTitle; @JsonProperty("public_message") private Map<LangIso639, String> publicMessage; @JsonProperty("without_message") private Boolean withoutMessage; private Date created; @JsonCreator public UserBonus(@JsonProperty("user_id") String userId, @JsonProperty("amount") BigDecimal amount) { this.userId = userId; this.amount = amount; } public UserBonus(String userId, BigDecimal amount, Map<LangIso639, String> publicTitle, Map<LangIso639, String> publicMessage) { this.userId = userId; this.amount = amount; this.publicTitle = publicTitle; this.publicMessage = publicMessage; } public UserBonus(String userId, BigDecimal amount, boolean withoutMessage) { this.userId = userId; this.amount = amount; this.withoutMessage = withoutMessage; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public BigDecimal getAmount() { return amount; } public void setAmount(BigDecimal amount) { this.amount = amount; } public String getPrivateComment() { return privateComment; } public void setPrivateComment(String privateComment) { this.privateComment = privateComment; } public Map<LangIso639, String> getPublicTitle() { return publicTitle; } public void setPublicTitle(Map<LangIso639, String> publicTitle) { this.publicTitle = publicTitle; } public Map<LangIso639, String> getPublicMessage() { return publicMessage; } public void setPublicMessage(Map<LangIso639, String> publicMessage) { this.publicMessage = publicMessage; } public Boolean getWithoutMessage() { return withoutMessage; } public void setWithoutMessage(Boolean withoutMessage) { this.withoutMessage = withoutMessage; } public String getId() { return id; } public Date getCreated() { return created; } public String getAssignmentId() { return assignmentId; } public void setAssignmentId(String assignmentId) { this.assignmentId = assignmentId; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userbonus/UserBonusClient.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userbonus; import java.util.Iterator; import java.util.List; import ai.toloka.client.v1.BatchCreateResult; import ai.toloka.client.v1.ModificationResult; import ai.toloka.client.v1.SearchResult; public interface UserBonusClient { ModificationResult<UserBonus> createUserBonus(UserBonus userBonus); ModificationResult<UserBonus> createUserBonus(UserBonus userBonus, UserBonusCreateRequestParameters parameters); BatchCreateResult<UserBonus> createUserBonuses(List<UserBonus> userBonuses); BatchCreateResult<UserBonus> createUserBonuses( List<UserBonus> userBonuses, UserBonusCreateRequestParameters parameters); UserBonusCreateBatchOperation createUserBonusesAsync(Iterator<UserBonus> userBonuses); UserBonusCreateBatchOperation createUserBonusesAsync( Iterator<UserBonus> userBonuses, UserBonusCreateRequestParameters parameters); SearchResult<UserBonus> findUserBonuses(UserBonusSearchRequest request); UserBonus getUserBonus(String userBonusId); }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userbonus/UserBonusCreateBatchOperation.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userbonus; import com.fasterxml.jackson.annotation.JsonProperty; import ai.toloka.client.v1.operation.Operation; import ai.toloka.client.v1.operation.OperationType; public class UserBonusCreateBatchOperation extends Operation<UserBonusCreateBatchOperation.Parameters, UserBonusCreateBatchOperation> { public static final OperationType TYPE = OperationType.USER_BONUS_BATCH_CREATE; public static class Parameters { @JsonProperty("skip_invalid_items") private Boolean skipInvalidItems; public Boolean getSkipInvalidItems() { return skipInvalidItems; } } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userbonus/UserBonusCreateRequestParameters.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userbonus; import java.util.HashMap; import java.util.Map; import java.util.UUID; import ai.toloka.client.v1.AbstractRequestParameters; import ai.toloka.client.v1.RequestParameters; public class UserBonusCreateRequestParameters extends AbstractRequestParameters implements RequestParameters { private static final String OPERATION_ID_PARAMETER = "operation_id"; private static final String SKIP_INVALID_ITEMS_PARAMETER = "skip_invalid_items"; private UUID operationId; private Boolean skipInvalidItems; public UUID getOperationId() { return operationId; } public void setOperationId(UUID operationId) { this.operationId = operationId; } public Boolean getSkipInvalidItems() { return skipInvalidItems; } public void setSkipInvalidItems(Boolean skipInvalidItems) { this.skipInvalidItems = skipInvalidItems; } @Override public Map<String, Object> getQueryParameters() { Map<String, Object> params = new HashMap<>(); params.put(OPERATION_ID_PARAMETER, operationId); params.put(SKIP_INVALID_ITEMS_PARAMETER, skipInvalidItems); return filterNulls(params); } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userbonus/UserBonusFilterParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userbonus; import ai.toloka.client.v1.FilterParam; public enum UserBonusFilterParam implements FilterParam { userId(UserBonusSearchRequest.USER_ID_PARAMETER), privateComment(UserBonusSearchRequest.PRIVATE_COMMENT_PARAMETER); private String parameter; UserBonusFilterParam(String parameter) { this.parameter = parameter; } @Override public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userbonus/UserBonusRangeParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userbonus; import ai.toloka.client.v1.RangeParam; public enum UserBonusRangeParam implements RangeParam { id(UserBonusSearchRequest.ID_PARAMETER), created(UserBonusSearchRequest.CREATED_PARAMETER); private String parameter; UserBonusRangeParam(String parameter) { this.parameter = parameter; } @Override public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userbonus/UserBonusSearchRequest.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userbonus; import java.util.Date; import java.util.Map; import ai.toloka.client.v1.SearchRequest; public class UserBonusSearchRequest extends SearchRequest { public static final String USER_ID_PARAMETER = "user_id"; public static final String PRIVATE_COMMENT_PARAMETER = "private_comment"; public static final String ID_PARAMETER = "id"; public static final String CREATED_PARAMETER = "created"; private UserBonusSearchRequest(Map<String, Object> filterParameters, Map<String, Object> rangeParameters, String sortParameter, Integer limit) { super(filterParameters, rangeParameters, sortParameter, limit); } public static UserBonusBuilder make() { return new UserBonusBuilder( new UserBonusFilterBuilder(), new UserBonusRangeBuilder(), new UserBonusSortBuilder()); } public static class UserBonusBuilder extends Builder< UserBonusSearchRequest, UserBonusBuilder, UserBonusFilterBuilder, UserBonusRangeBuilder, UserBonusSortBuilder> { private UserBonusBuilder(UserBonusFilterBuilder filterBuilder, UserBonusRangeBuilder rangeBuilder, UserBonusSortBuilder sortBuilder) { super(filterBuilder, rangeBuilder, sortBuilder); } @Override public UserBonusSearchRequest done() { return new UserBonusSearchRequest(filterBuilder.getFilterParameters(), rangeBuilder.getRangeParameters(), sortBuilder.getSortParameter(), getLimit()); } } public static class UserBonusFilterBuilder extends FilterBuilder<UserBonusFilterBuilder, UserBonusBuilder, UserBonusFilterParam> { public UserBonusFilterBuilder byUserId(String userId) { return by(UserBonusFilterParam.userId, userId); } public UserBonusFilterBuilder byPrivateComment(String privateComment) { return by(UserBonusFilterParam.privateComment, privateComment); } } public static class UserBonusRangeBuilder extends RangeBuilder<UserBonusRangeBuilder, UserBonusBuilder, UserBonusRangeParam> { public RangeItemBuilder<UserBonusRangeBuilder> byId(String id) { return by(UserBonusRangeParam.id, id); } public RangeItemBuilder<UserBonusRangeBuilder> byCreated(Date created) { return by(UserBonusRangeParam.created, created); } } public static class UserBonusSortBuilder extends SortBuilder<UserBonusSortBuilder, UserBonusBuilder, UserBonusSortParam> { public SortItem<UserBonusSortBuilder> byId() { return by(UserBonusSortParam.id); } public SortItem<UserBonusSortBuilder> byCreated() { return by(UserBonusSortParam.created); } } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userbonus/UserBonusSortParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userbonus; import ai.toloka.client.v1.SortParam; public enum UserBonusSortParam implements SortParam { id(UserBonusSearchRequest.ID_PARAMETER), created(UserBonusSearchRequest.CREATED_PARAMETER); private String parameter; UserBonusSortParam(String parameter) { this.parameter = parameter; } @Override public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userrestriction/AllProjectsUserRestriction.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userrestriction; import java.util.Date; public class AllProjectsUserRestriction extends UserRestriction { AllProjectsUserRestriction() {} public AllProjectsUserRestriction(String userId, String privateComment, Date willExpire) { super(UserRestrictionScope.ALL_PROJECTS, userId, privateComment, willExpire); } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userrestriction/DurationUnit.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userrestriction; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import com.fasterxml.jackson.annotation.JsonCreator; import ai.toloka.client.v1.FlexibleEnum; public class DurationUnit extends FlexibleEnum<DurationUnit> { private DurationUnit(String name) { super(name); } public static final DurationUnit MINUTE = new DurationUnit("MINUTES"); public static final DurationUnit HOUR = new DurationUnit("HOURS"); public static final DurationUnit DAY = new DurationUnit("DAYS"); public static final DurationUnit FOREVER = new DurationUnit("PERMANENT"); private static final DurationUnit[] VALUES = {MINUTE, HOUR, DAY, FOREVER}; private static final ConcurrentMap<String, DurationUnit> DISCOVERED_VALUES = new ConcurrentHashMap<>(); public static DurationUnit[] values() { return values(VALUES, DISCOVERED_VALUES.values(), DurationUnit.class); } @JsonCreator public static DurationUnit valueOf(String name) { return valueOf(VALUES, DISCOVERED_VALUES, name, DurationUnit::new); } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userrestriction/PoolUserRestriction.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userrestriction; import java.util.Date; import com.fasterxml.jackson.annotation.JsonProperty; public class PoolUserRestriction extends UserRestriction { @JsonProperty("pool_id") private String poolId; PoolUserRestriction() {} public PoolUserRestriction(String userId, String poolId, String privateComment, Date willExpire) { super(UserRestrictionScope.POOL, userId, privateComment, willExpire); this.poolId = poolId; } public String getPoolId() { return poolId; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userrestriction/ProjectUserRestriction.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userrestriction; import java.util.Date; import com.fasterxml.jackson.annotation.JsonProperty; public class ProjectUserRestriction extends UserRestriction { @JsonProperty("project_id") private String projectId; ProjectUserRestriction() {} public ProjectUserRestriction(String userId, String projectId, String privateComment, Date willExpire) { super(UserRestrictionScope.PROJECT, userId, privateComment, willExpire); this.projectId = projectId; } public String getProjectId() { return projectId; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userrestriction/SystemUserRestriction.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userrestriction; public class SystemUserRestriction extends UserRestriction {}
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userrestriction/UserRestriction.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userrestriction; import java.util.Date; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "scope", visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = SystemUserRestriction.class, name = "SYSTEM"), @JsonSubTypes.Type(value = AllProjectsUserRestriction.class, name = "ALL_PROJECTS"), @JsonSubTypes.Type(value = ProjectUserRestriction.class, name = "PROJECT"), @JsonSubTypes.Type(value = PoolUserRestriction.class, name = "POOL") }) public abstract class UserRestriction { protected String id; protected UserRestrictionScope scope; @JsonProperty("user_id") protected String userId; @JsonProperty("private_comment") protected String privateComment; @JsonProperty("will_expire") protected Date willExpire; protected Date created; UserRestriction() {} UserRestriction(UserRestrictionScope scope, String userId, String privateComment, Date willExpire) { this.scope = scope; this.userId = userId; this.privateComment = privateComment; this.willExpire = willExpire; } public void setPrivateComment(String privateComment) { this.privateComment = privateComment; } public void setWillExpire(Date willExpire) { this.willExpire = willExpire; } public String getId() { return id; } public UserRestrictionScope getScope() { return scope; } public String getUserId() { return userId; } public String getPrivateComment() { return privateComment; } public Date getWillExpire() { return willExpire; } public Date getCreated() { return created; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userrestriction/UserRestrictionClient.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userrestriction; import ai.toloka.client.v1.ModificationResult; import ai.toloka.client.v1.SearchResult; public interface UserRestrictionClient { SearchResult<UserRestriction> findUserRestrictions(UserRestrictionSearchRequest request); UserRestriction getUserRestriction(String userRestrictionId); ModificationResult<UserRestriction> setUserRestriction(UserRestriction userRestriction); void deleteUserRestriction(String userRestrictionId); }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userrestriction/UserRestrictionFilterParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userrestriction; import ai.toloka.client.v1.FilterParam; public enum UserRestrictionFilterParam implements FilterParam { scope(UserRestrictionSearchRequest.SCOPE_PARAMETER), userId(UserRestrictionSearchRequest.USER_ID_PARAMETER), projectId(UserRestrictionSearchRequest.PROJECT_ID_PARAMETER), poolId(UserRestrictionSearchRequest.POOL_ID_PARAMETER); private final String parameter; UserRestrictionFilterParam(String parameter) { this.parameter = parameter; } public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userrestriction/UserRestrictionRangeParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userrestriction; import ai.toloka.client.v1.RangeParam; public enum UserRestrictionRangeParam implements RangeParam { id(UserRestrictionSearchRequest.ID_PARAMETER), created(UserRestrictionSearchRequest.CREATED_PARAMETER); private final String parameter; UserRestrictionRangeParam(String parameter) { this.parameter = parameter; } @Override public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userrestriction/UserRestrictionScope.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userrestriction; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import com.fasterxml.jackson.annotation.JsonCreator; import ai.toloka.client.v1.FlexibleEnum; public final class UserRestrictionScope extends FlexibleEnum<UserRestrictionScope> { private UserRestrictionScope(String name) { super(name); } public static final UserRestrictionScope SYSTEM = new UserRestrictionScope("SYSTEM"); public static final UserRestrictionScope ALL_PROJECTS = new UserRestrictionScope("ALL_PROJECTS"); public static final UserRestrictionScope PROJECT = new UserRestrictionScope("PROJECT"); public static final UserRestrictionScope POOL = new UserRestrictionScope("POOL"); private static final UserRestrictionScope[] VALUES = {SYSTEM, ALL_PROJECTS, PROJECT, POOL}; private static final ConcurrentMap<String, UserRestrictionScope> DISCOVERED_VALUES = new ConcurrentHashMap<>(); public static UserRestrictionScope[] values() { return values(VALUES, DISCOVERED_VALUES.values(), UserRestrictionScope.class); } @JsonCreator public static UserRestrictionScope valueOf(String name) { return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<UserRestrictionScope>() { @Override public UserRestrictionScope create(String name) { return new UserRestrictionScope(name); } }); } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userrestriction/UserRestrictionSearchRequest.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userrestriction; import java.util.Date; import java.util.Map; import ai.toloka.client.v1.SearchRequest; public class UserRestrictionSearchRequest extends SearchRequest { static final String ID_PARAMETER = "id"; static final String CREATED_PARAMETER = "created"; static final String SCOPE_PARAMETER = "scope"; static final String USER_ID_PARAMETER = "user_id"; static final String PROJECT_ID_PARAMETER = "project_id"; static final String POOL_ID_PARAMETER = "pool_id"; private UserRestrictionSearchRequest(Map<String, Object> filterParameters, Map<String, Object> rangeParameters, String sortParameter, Integer limit) { super(filterParameters, rangeParameters, sortParameter, limit); } public static UserRestrictionBuilder make() { return new UserRestrictionBuilder(new UserRestrictionFilterBuilder(), new UserRestrictionRangeBuilder(), new UserRestrictionSortBuilder()); } public static class UserRestrictionBuilder extends Builder< UserRestrictionSearchRequest, UserRestrictionBuilder, UserRestrictionFilterBuilder, UserRestrictionRangeBuilder, UserRestrictionSortBuilder> { private UserRestrictionBuilder(UserRestrictionFilterBuilder filterBuilder, UserRestrictionRangeBuilder rangeBuilder, UserRestrictionSortBuilder sortBuilder) { super(filterBuilder, rangeBuilder, sortBuilder); } @Override public UserRestrictionSearchRequest done() { return new UserRestrictionSearchRequest( filterBuilder.getFilterParameters(), rangeBuilder.getRangeParameters(), sortBuilder.getSortParameter(), getLimit()); } } public static class UserRestrictionFilterBuilder extends FilterBuilder<UserRestrictionFilterBuilder, UserRestrictionBuilder, UserRestrictionFilterParam> { public UserRestrictionFilterBuilder byScope(UserRestrictionScope scope) { return by(UserRestrictionFilterParam.scope, scope); } public UserRestrictionFilterBuilder byUser(String userId) { return by(UserRestrictionFilterParam.userId, userId); } public UserRestrictionFilterBuilder byProject(String projectId) { return by(UserRestrictionFilterParam.projectId, projectId); } public UserRestrictionFilterBuilder byPool(String poolId) { return by(UserRestrictionFilterParam.poolId, poolId); } } public static class UserRestrictionRangeBuilder extends RangeBuilder<UserRestrictionRangeBuilder, UserRestrictionBuilder, UserRestrictionRangeParam> { public RangeItemBuilder<UserRestrictionRangeBuilder> byId(String id) { return by(UserRestrictionRangeParam.id, id); } public RangeItemBuilder<UserRestrictionRangeBuilder> byCreated(Date date) { return by(UserRestrictionRangeParam.created, date); } } public static class UserRestrictionSortBuilder extends SortBuilder<UserRestrictionSortBuilder, UserRestrictionBuilder, UserRestrictionSortParam> { public SortItem<UserRestrictionSortBuilder> byId() { return by(UserRestrictionSortParam.id); } public SortItem<UserRestrictionSortBuilder> byCreated() { return by(UserRestrictionSortParam.created); } } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userrestriction/UserRestrictionSortParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userrestriction; import ai.toloka.client.v1.SortParam; public enum UserRestrictionSortParam implements SortParam { id(UserRestrictionSearchRequest.ID_PARAMETER), created(UserRestrictionSearchRequest.CREATED_PARAMETER); private final String parameter; UserRestrictionSortParam(String parameter) { this.parameter = parameter; } @Override public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userskill/UserSkill.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userskill; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.Date; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; public class UserSkill { private String id; @JsonProperty("skill_id") private String skillId; @JsonProperty("user_id") private String userId; private Integer value; @JsonProperty("exact_value") private BigDecimal exactValue; private Date created; private Date modified; @JsonCreator public UserSkill(@JsonProperty("skill_id") String skillId, @JsonProperty("user_id") String userId, @JsonProperty("value") Integer value) { this.skillId = skillId; this.userId = userId; setValue(value); } public void setValue(Integer value) { this.value = value; this.exactValue = value == null ? null : BigDecimal.valueOf(value); } public static UserSkill valueOf(String skillId, String userId, BigDecimal exactValue) { return new UserSkill(skillId, userId, exactValue); } private UserSkill(String skillId, String userId, BigDecimal exactValue) { this.skillId = skillId; this.userId = userId; setExactValue(exactValue); } public void setExactValue(BigDecimal exactValue) { this.value = exactValue == null ? null : exactValue.setScale(0, RoundingMode.HALF_UP).intValueExact(); this.exactValue = exactValue; } public String getId() { return id; } public String getSkillId() { return skillId; } public String getUserId() { return userId; } public Integer getValue() { return value; } public BigDecimal getExactValue() { return exactValue; } public Date getCreated() { return created; } public Date getModified() { return modified; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userskill/UserSkillClient.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userskill; import ai.toloka.client.v1.ModificationResult; import ai.toloka.client.v1.SearchResult; public interface UserSkillClient { SearchResult<UserSkill> findUsersSkills(UserSkillSearchRequest request); UserSkill getUserSkill(String userSkillId); ModificationResult<UserSkill> setUserSkill(UserSkill userSkill); ModificationResult<UserSkill> setUserSkill(UserSkill userSkill, String reason); void deleteUserSkill(String userSkillId); }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userskill/UserSkillFilterParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userskill; import ai.toloka.client.v1.FilterParam; public enum UserSkillFilterParam implements FilterParam { skillId(UserSkillSearchRequest.SKILL_ID_PARAMETER), userId(UserSkillSearchRequest.USER_ID_PARAMETER); private String parameter; UserSkillFilterParam(String parameter) { this.parameter = parameter; } @Override public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userskill/UserSkillRangeParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userskill; import ai.toloka.client.v1.RangeParam; public enum UserSkillRangeParam implements RangeParam { id(UserSkillSearchRequest.ID_PARAMETER), created(UserSkillSearchRequest.CREATED_PARAMETER), modified(UserSkillSearchRequest.MODIFIED_PARAMETER); private String parameter; UserSkillRangeParam(String parameter) { this.parameter = parameter; } @Override public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userskill/UserSkillSearchRequest.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userskill; import java.util.Date; import java.util.Map; import ai.toloka.client.v1.SearchRequest; public class UserSkillSearchRequest extends SearchRequest { static final String SKILL_ID_PARAMETER = "skill_id"; static final String USER_ID_PARAMETER = "user_id"; static final String ID_PARAMETER = "id"; static final String CREATED_PARAMETER = "created"; static final String MODIFIED_PARAMETER = "modified"; public UserSkillSearchRequest(Map<String, Object> filterParameters, Map<String, Object> rangeParameters, String sortParameter, Integer limit) { super(filterParameters, rangeParameters, sortParameter, limit); } public static UserSkillBuilder make() { return new UserSkillBuilder( new UserSkillFilterBuilder(), new UserSkillRangeBuilder(), new UserSkillSortBuilder()); } public static class UserSkillBuilder extends Builder< UserSkillSearchRequest, UserSkillBuilder, UserSkillFilterBuilder, UserSkillRangeBuilder, UserSkillSortBuilder> { public UserSkillBuilder(UserSkillFilterBuilder filterBuilder, UserSkillRangeBuilder rangeBuilder, UserSkillSortBuilder sortBuilder) { super(filterBuilder, rangeBuilder, sortBuilder); } @Override public UserSkillSearchRequest done() { return new UserSkillSearchRequest(filterBuilder.getFilterParameters(), rangeBuilder.getRangeParameters(), sortBuilder.getSortParameter(), getLimit()); } } public static class UserSkillFilterBuilder extends FilterBuilder<UserSkillFilterBuilder, UserSkillBuilder, UserSkillFilterParam> { public UserSkillFilterBuilder bySkillId(String skillId) { return by(UserSkillFilterParam.skillId, skillId); } public UserSkillFilterBuilder byUserId(String userId) { return by(UserSkillFilterParam.userId, userId); } } public static class UserSkillRangeBuilder extends RangeBuilder<UserSkillRangeBuilder, UserSkillBuilder, UserSkillRangeParam> { public RangeItemBuilder<UserSkillRangeBuilder> byId(String id) { return by(UserSkillRangeParam.id, id); } public RangeItemBuilder<UserSkillRangeBuilder> byCreated(Date created) { return by(UserSkillRangeParam.created, created); } public RangeItemBuilder<UserSkillRangeBuilder> byModified(Date modified) { return by(UserSkillRangeParam.modified, modified); } } public static class UserSkillSortBuilder extends SortBuilder<UserSkillSortBuilder, UserSkillBuilder, UserSkillSortParam> { public SortItem<UserSkillSortBuilder> byId() { return by(UserSkillSortParam.id); } public SortItem<UserSkillSortBuilder> byCreated() { return by(UserSkillSortParam.created); } } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/userskill/UserSkillSortParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.userskill; import ai.toloka.client.v1.SortParam; public enum UserSkillSortParam implements SortParam { id(UserSkillSearchRequest.ID_PARAMETER), created(UserSkillSearchRequest.CREATED_PARAMETER); private String parameter; UserSkillSortParam(String parameter) { this.parameter = parameter; } @Override public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/webhooksubscription/WebhookEventType.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.webhooksubscription; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import com.fasterxml.jackson.annotation.JsonCreator; import ai.toloka.client.v1.FlexibleEnum; public class WebhookEventType extends FlexibleEnum<WebhookEventType> { public static WebhookEventType POOL_CLOSED = new WebhookEventType("POOL_CLOSED"); public static WebhookEventType DYNAMIC_OVERLAP_COMPLETED = new WebhookEventType("DYNAMIC_OVERLAP_COMPLETED"); public static WebhookEventType ASSIGNMENT_CREATED = new WebhookEventType("ASSIGNMENT_CREATED"); public static WebhookEventType ASSIGNMENT_SUBMITTED = new WebhookEventType("ASSIGNMENT_SUBMITTED"); public static WebhookEventType ASSIGNMENT_SKIPPED = new WebhookEventType("ASSIGNMENT_SKIPPED"); public static WebhookEventType ASSIGNMENT_EXPIRED = new WebhookEventType("ASSIGNMENT_EXPIRED"); public static WebhookEventType ASSIGNMENT_APPROVED = new WebhookEventType("ASSIGNMENT_APPROVED"); public static WebhookEventType ASSIGNMENT_REJECTED = new WebhookEventType("ASSIGNMENT_REJECTED"); private static final WebhookEventType[] VALUES = {POOL_CLOSED, DYNAMIC_OVERLAP_COMPLETED, ASSIGNMENT_CREATED, ASSIGNMENT_SUBMITTED, ASSIGNMENT_SKIPPED, ASSIGNMENT_EXPIRED, ASSIGNMENT_APPROVED, ASSIGNMENT_REJECTED}; private static final ConcurrentMap<String, WebhookEventType> DISCOVERED_VALUES = new ConcurrentHashMap<>(); public static WebhookEventType[] values() { return values(VALUES, DISCOVERED_VALUES.values(), WebhookEventType.class); } @JsonCreator public static WebhookEventType valueOf(String name) { return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<WebhookEventType>() { @Override public WebhookEventType create(String name) { return new WebhookEventType(name); } }); } private WebhookEventType(String name) { super(name); } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/webhooksubscription/WebhookPushErrorType.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.webhooksubscription; public enum WebhookPushErrorType { WRONG_STATUS_CODE, TOO_MANY_CONNECTIONS, REQUEST_TIMEOUT, CONNECTION_ERROR, INTERNAL_ERROR, UNKNOWN }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/webhooksubscription/WebhookPushResult.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.webhooksubscription; import java.util.Date; import java.util.List; public class WebhookPushResult { public boolean success; public Date responseReceivedAt; public WebhookPushErrorType errorType; public Integer originalStatusCode; public List<String> uuids; }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/webhooksubscription/WebhookSubscription.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.webhooksubscription; import java.util.Date; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; public class WebhookSubscription { private String id; private Date created; @JsonProperty("event_type") private WebhookEventType eventType; @JsonProperty("webhook_url") private String webhookUrl; @JsonProperty("pool_id") private String poolId; @JsonProperty("secret_key") private String secretKey; public WebhookSubscription() {} @JsonCreator public WebhookSubscription(@JsonProperty("event_type") WebhookEventType eventType, @JsonProperty("webhook_url") String webhookUrl, @JsonProperty("pool_id") String poolId, @JsonProperty("secret_key") String secretKey) { this.eventType = eventType; this.webhookUrl = webhookUrl; this.poolId = poolId; this.secretKey = secretKey; } public WebhookSubscription(@JsonProperty("event_type") WebhookEventType eventType, @JsonProperty("webhook_url") String webhookUrl, @JsonProperty("pool_id") String poolId) { this(eventType, webhookUrl, poolId, null); } public String getId() { return id; } public Date getCreated() { return created; } public WebhookEventType getEventType() { return eventType; } public String getWebhookUrl() { return webhookUrl; } public String getPoolId() { return poolId; } public String getSecretKey() { return secretKey; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/webhooksubscription/WebhookSubscriptionClient.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.webhooksubscription; import java.util.List; import ai.toloka.client.v1.BatchCreateResult; import ai.toloka.client.v1.ModificationResult; import ai.toloka.client.v1.SearchResult; public interface WebhookSubscriptionClient { ModificationResult<WebhookSubscription> upsertWebhookSubscription(WebhookSubscription webhookSubscription); BatchCreateResult<WebhookSubscription> upsertWebhookSubscriptions(List<WebhookSubscription> webhookSubscriptions); SearchResult<WebhookSubscription> findWebhookSubscriptions(WebhookSubscriptionSearchRequest request); WebhookSubscription getWebhookSubscription(String webhookSubscriptionId); void deleteWebhookSubscription(String webhookSubscriptionId); ModificationResult<WebhookPushResult> sendTestWebhook(String webhookSubscriptionId); }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/webhooksubscription/WebhookSubscriptionFilterParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.webhooksubscription; import ai.toloka.client.v1.FilterParam; public enum WebhookSubscriptionFilterParam implements FilterParam { eventType(WebhookSubscriptionSearchRequest.EVENT_TYPE_PARAMETER), poolId(WebhookSubscriptionSearchRequest.POOL_ID_PARAMETER); private String parameter; WebhookSubscriptionFilterParam(String parameter) { this.parameter = parameter; } @Override public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/webhooksubscription/WebhookSubscriptionRangeParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.webhooksubscription; import ai.toloka.client.v1.RangeParam; public enum WebhookSubscriptionRangeParam implements RangeParam { id(WebhookSubscriptionSearchRequest.ID_PARAMETER), created(WebhookSubscriptionSearchRequest.CREATED_PARAMETER); private String parameter; WebhookSubscriptionRangeParam(String parameter) { this.parameter = parameter; } @Override public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/webhooksubscription/WebhookSubscriptionSearchRequest.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.webhooksubscription; import java.util.Date; import java.util.Map; import ai.toloka.client.v1.SearchRequest; public class WebhookSubscriptionSearchRequest extends SearchRequest { public static final String EVENT_TYPE_PARAMETER = "event_type"; public static final String POOL_ID_PARAMETER = "pool_id"; public static final String ID_PARAMETER = "id"; public static final String CREATED_PARAMETER = "created"; private WebhookSubscriptionSearchRequest(Map<String, Object> filterParameters, Map<String, Object> rangeParameters, String sortParameter, Integer limit) { super(filterParameters, rangeParameters, sortParameter, limit); } public static WebhookSubscriptionBuilder make() { return new WebhookSubscriptionBuilder( new WebhookSubscriptionFilterBuilder(), new WebhookSubscriptionRangeBuilder(), new WebhookSubscriptionSortBuilder()); } public static class WebhookSubscriptionBuilder extends Builder< WebhookSubscriptionSearchRequest, WebhookSubscriptionBuilder, WebhookSubscriptionFilterBuilder, WebhookSubscriptionRangeBuilder, WebhookSubscriptionSortBuilder> { private WebhookSubscriptionBuilder( WebhookSubscriptionFilterBuilder filterBuilder, WebhookSubscriptionRangeBuilder rangeBuilder, WebhookSubscriptionSortBuilder sortBuilder ) { super(filterBuilder, rangeBuilder, sortBuilder); } @Override public WebhookSubscriptionSearchRequest done() { return new WebhookSubscriptionSearchRequest(filterBuilder.getFilterParameters(), rangeBuilder.getRangeParameters(), sortBuilder.getSortParameter(), getLimit()); } } public static class WebhookSubscriptionFilterBuilder extends FilterBuilder<WebhookSubscriptionFilterBuilder, WebhookSubscriptionBuilder, WebhookSubscriptionFilterParam> { public WebhookSubscriptionFilterBuilder byEventType(WebhookEventType eventType) { return by(WebhookSubscriptionFilterParam.eventType, eventType); } public WebhookSubscriptionFilterBuilder byPoolId(String poolId) { return by(WebhookSubscriptionFilterParam.poolId, poolId); } } public static class WebhookSubscriptionRangeBuilder extends RangeBuilder<WebhookSubscriptionRangeBuilder, WebhookSubscriptionBuilder, WebhookSubscriptionRangeParam> { public RangeItemBuilder<WebhookSubscriptionRangeBuilder> byId(String id) { return by(WebhookSubscriptionRangeParam.id, id); } public RangeItemBuilder<WebhookSubscriptionRangeBuilder> byCreated(Date created) { return by(WebhookSubscriptionRangeParam.created, created); } } public static class WebhookSubscriptionSortBuilder extends SortBuilder<WebhookSubscriptionSortBuilder, WebhookSubscriptionBuilder, WebhookSubscriptionSortParam> { public SortItem<WebhookSubscriptionSortBuilder> byId() { return by(WebhookSubscriptionSortParam.id); } public SortItem<WebhookSubscriptionSortBuilder> byCreated() { return by(WebhookSubscriptionSortParam.created); } } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/webhooksubscription/WebhookSubscriptionSortParam.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.webhooksubscription; import ai.toloka.client.v1.SortParam; public enum WebhookSubscriptionSortParam implements SortParam { id(WebhookSubscriptionSearchRequest.ID_PARAMETER), created(WebhookSubscriptionSearchRequest.CREATED_PARAMETER); private String parameter; WebhookSubscriptionSortParam(String parameter) { this.parameter = parameter; } @Override public String parameter() { return parameter; } }
0
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/webhooksubscription
java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/webhooksubscription/utils/SignatureValidator.java
/* * Copyright 2021 YANDEX LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.toloka.client.v1.webhooksubscription.utils; import java.math.BigInteger; import java.nio.charset.StandardCharsets; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; /** * Utility class, validates {@code Toloka-Signature} header signature */ public class SignatureValidator { /** * HMAC Algorithm version. */ private static final String ALGORITHM = "HmacSHA256"; /** * Generates signature using request payload and {@code Toloka-Signature} header fields. * * @param secretKey Secret key, which was used during creation of webhook subscriptions * @param ts Timestamp ("ts") from {@code Toloka-Signature} header * @param v Version ("v") from {@code Toloka-Signature} header * @param requestPayload Payload of request from Toloka service * @return signature * @throws InvalidKeyException InvalidKeyException * @throws NoSuchAlgorithmException NoSuchAlgorithmException */ public static String generateSignature(String secretKey, Long ts, Integer v, String requestPayload) throws NoSuchAlgorithmException, InvalidKeyException { String data = ts + "." + v + "." + requestPayload; return doHmac(secretKey, data); } /** * Encrypts provided data with user's secret using hmac-SHA 256 algorithm. * * @param secretKey encryption key * @param data text to be encrypted * @return encrypted data. * @throws InvalidKeyException InvalidKeyException * @throws NoSuchAlgorithmException NoSuchAlgorithmException */ private static String doHmac(String secretKey, String data) throws NoSuchAlgorithmException, InvalidKeyException { Mac macAlgorithm = Mac.getInstance(ALGORITHM); SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey .getBytes(StandardCharsets.UTF_8), ALGORITHM); macAlgorithm.init(secretKeySpec); return encodeHex(macAlgorithm.doFinal(data.getBytes(StandardCharsets.UTF_8))); } /** * Encodes data to HEX string. * * @param data text to be encoded * @return HEX string */ private static String encodeHex(byte[] data) { return String.format("%040x", new BigInteger(1, data)); } }
0
java-sources/ai/traceable/agent/javaagent/1.1.22/ai/traceable/agent/java
java-sources/ai/traceable/agent/javaagent/1.1.22/ai/traceable/agent/java/instrument/TraceableAgent.java
package ai.traceable.agent.java.instrument; import java.io.File; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URISyntaxException; import java.util.List; public class TraceableAgent { public static void main(String... args) throws NoSuchFieldException, InvocationTargetException, IllegalAccessException, NoSuchMethodException { if (args.length == 0) { try { System.out.println(TraceableAgent.class.getPackage().getImplementationVersion()); } catch (Exception var2) { System.out.println("Failed to parse agent version"); var2.printStackTrace(); } return; } // Usage for Dynamic Attach: // java -Xbootclasspath/a:{{path_to_tools.jar}} -jar {{path_to_javaagent.jar}} {{TARGET_JAVA_PROCESS_NAME or TARGET_JAVA_PROCESS_ID}} {{agent_args in format `arg1=val1,arg2=val2,arg3=val3`}} // eg. : // java -Xbootclasspath/a:$JAVA_HOME/lib/tools.jar -jar javaagent.jar org.mule.runtime.module.reboot.MuleContainerBootstrap ht.service.name=service1,ht.reporting.endpoint=http://TPA_IP:5442 // or // java -Xbootclasspath/a:$JAVA_HOME/lib/tools.jar -jar javaagent.jar 12345 ht.service.name=service1,ht.reporting.endpoint=http://TPA_IP:5442 System.out.println("Dynamically attaching javaagent"); Class<?> virtualMachineClass; Class<?> virtualMachineDescriptorClass; try { virtualMachineClass = Class.forName("com.sun.tools.attach.VirtualMachine"); virtualMachineDescriptorClass = Class.forName("com.sun.tools.attach.VirtualMachineDescriptor"); } catch (ClassNotFoundException e) { System.out.println("ERROR: Class not found. Check if jdk's tools.jar is added to classpath"); e.printStackTrace(); return; } // Name or id of the Java executable to attach to is passed as 1st argument // from the command line String target = args[0]; // Find the target JVM by name Object targetJvm_VMDescriptor = null; Method listMethod; listMethod = virtualMachineClass.getDeclaredMethod("list"); listMethod.setAccessible(true); List<?> descriptorsList; descriptorsList = (List<?>)listMethod.invoke(null); for (Object descriptor : descriptorsList) { Field displayName = virtualMachineDescriptorClass.getDeclaredField("displayName"); displayName.setAccessible(true); if (((String)displayName.get(descriptor)).startsWith(target)) { targetJvm_VMDescriptor = descriptor; break; } Field id = virtualMachineDescriptorClass.getDeclaredField("id"); id.setAccessible(true); if ((id.get(descriptor)).equals(target)) { targetJvm_VMDescriptor = descriptor; break; } } if (targetJvm_VMDescriptor == null) { System.out.println("ERROR: Could not find target jvm with name or id: " + target); return; } // Location of agent jar String agentJar; try { agentJar = new File(TraceableAgent.class.getProtectionDomain().getCodeSource().getLocation() .toURI()).getPath(); } catch (URISyntaxException e) { System.out.println("ERROR: Unable to get location of agent jar"); e.printStackTrace(); return; } String agentArgs = null; if (args.length > 1) { // Agent Args are passed as 2nd argument from the command line // These should be of the format `arg1=val1,arg2=val2,arg3=val3` agentArgs = args[1]; } try { Method attachMethod = virtualMachineClass.getDeclaredMethod("attach", virtualMachineDescriptorClass); attachMethod.setAccessible(true); Object vm = attachMethod.invoke(null, targetJvm_VMDescriptor); Method loadAgentMethod = virtualMachineClass.getDeclaredMethod("loadAgent", String.class, String.class); loadAgentMethod.setAccessible(true); loadAgentMethod.invoke(vm, agentJar, agentArgs); Method detachMethod = virtualMachineClass.getDeclaredMethod("detach"); detachMethod.setAccessible(true); detachMethod.invoke(vm); } catch (Throwable t) { System.out.println("ERROR: Failed to attach javaagent dynamically"); t.printStackTrace(); return; } try { System.out.println(TraceableAgent.class.getPackage().getImplementationVersion()); System.out.println("Attached javaagent dynamically to java process: " + target); } catch (Exception var2) { System.out.println("Failed to parse agent version"); var2.printStackTrace(); } } }
0
java-sources/ai/tripl/arc_2.11/2.14.0/ai/tripl/arc/util
java-sources/ai/tripl/arc_2.11/2.14.0/ai/tripl/arc/util/log/LoggerFactory.java
/* * Copyright (c) 2016 Savoir Technologies * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * */ package ai.tripl.arc.util.log; import ai.tripl.arc.util.log.logger.Logger; import org.apache.commons.lang3.time.FastDateFormat; public class LoggerFactory { private static String dateFormatString = "yyyy-MM-dd HH:mm:ss.SSSZ"; private static FastDateFormat formatter = FastDateFormat.getInstance(dateFormatString); private static boolean includeLoggerName = true; private static boolean includeThreadName = true; private static boolean includeClassName = true; // ======================================== // Static Getters and Setters // ---------------------------------------- public static void setDateFormatString(String dateFormatString) { LoggerFactory.dateFormatString = dateFormatString; LoggerFactory.formatter = FastDateFormat.getInstance(dateFormatString); } public static void setIncludeLoggerName(boolean includeLoggerName) { LoggerFactory.includeLoggerName = includeLoggerName; } public static void setIncludeThreadName(boolean includeThreadName) { LoggerFactory.includeThreadName = includeThreadName; } public static void setIncludeClassName(boolean includeClassName) { LoggerFactory.includeClassName = includeClassName; } public static boolean isIncludeLoggerName() { return includeLoggerName; } public static boolean isIncludeThreadName() { return includeThreadName; } public static boolean isIncludeClassName() { return includeClassName; } // ======================================== // Factory API // ---------------------------------------- public static Logger getLogger(String name) { org.slf4j.Logger slf4jLogger = org.slf4j.LoggerFactory.getLogger(name); Logger result = new Logger(slf4jLogger, formatter); configureLogger(result); return result; } // ======================================== // Internal Methods // ---------------------------------------- private static void configureLogger(Logger logger) { logger.setIncludeClassName(includeClassName); logger.setIncludeLoggerName(includeLoggerName); logger.setIncludeThreadName(includeThreadName); } }
0
java-sources/ai/tripl/arc_2.11/2.14.0/ai/tripl/arc/util/log
java-sources/ai/tripl/arc_2.11/2.14.0/ai/tripl/arc/util/log/logger/JsonLogger.java
/* * Copyright (c) 2016 Savoir Technologies * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * */ package ai.tripl.arc.util.log.logger; import com.google.gson.JsonElement; import org.slf4j.Marker; import java.util.List; import java.util.Map; import java.util.function.Supplier; public interface JsonLogger { /** * Set top level message field. Convenience method for .field("message", ... ) */ JsonLogger message(String message); /** * Set top level message field as a lambda or supplier that is lazily evaluated * only if the message is logged */ JsonLogger message(Supplier<String> message); /** * Add a map to the JSON hierarchy */ JsonLogger map(String key, Map map); /** * Add a map to the JSON hierarchy as a lambda or supplier that is lazily * evaluated only if the message is logged */ JsonLogger map(String key, Supplier<Map> map); /** * Add a list to the JSON hierarchy */ JsonLogger list(String key, List list); /** * Add a list to the JSON hierarchy as a lambda or supplier that is lazily * evaluated only if the message is logged */ JsonLogger list(String key, Supplier<List> list); /** * Add a top level field. null values will be represented as the json null * primitive */ JsonLogger field(String key, Object value); /** * Add a top level field as a lambda or supplier that is lazily evaluated only * if the message is logged. null values will be represented as the json null * primitive */ JsonLogger field(String key, Supplier value); /** * Add an arbitrary JsonElement object to the top level with the given key. */ JsonLogger json(String key, JsonElement jsonElement); /** * Add an arbitrary JsonElement object to the top level with the given key that * is lazily evaluated only if the message is logged */ JsonLogger json(String key, Supplier<JsonElement> jsonElement); /** * Add an exception to the JSON hierarchy. The exception will be formatted to * include the message and the stacktrace similar to how it is outputted using * exception.printStackTrace() */ JsonLogger exception(String key, Exception exception); /** * Include the stack dump of the current running thread in the log output. This * data will be included in the output under the "stacktrace" key */ JsonLogger stack(); /** * Set the marker to use when generating the log message. * * @param marker marker to use when generating the log message. See details in * the SLF4J Logger API documents. */ JsonLogger marker(Marker marker); /** * Log the formatted message */ void log(); }
0
java-sources/ai/tripl/arc_2.11/2.14.0/ai/tripl/arc/util/log
java-sources/ai/tripl/arc_2.11/2.14.0/ai/tripl/arc/util/log/logger/Logger.java
/* * Copyright (c) 2016 Savoir Technologies * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * */ package ai.tripl.arc.util.log.logger; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import org.apache.commons.lang3.time.FastDateFormat; /** * Wrapper for slf4j Logger that enables a builder pattern and JSON layout */ public class Logger { public static final String TRACE_LEVEL_NAME = "TRACE"; public static final String DEBUG_LEVEL_NAME = "DEBUG"; public static final String INFO_LEVEL_NAME = "INFO"; public static final String WARN_LEVEL_NAME = "WARN"; public static final String ERROR_LEVEL_NAME = "ERROR"; private org.slf4j.Logger slf4jLogger; private Gson gson = new GsonBuilder().disableHtmlEscaping().serializeNulls().create(); private FastDateFormat formatter; private boolean includeLoggerName = true; private boolean includeThreadName = true; private boolean includeClassName = true; private NoopLogger noopLogger = new NoopLogger(); public Logger(org.slf4j.Logger slf4jLogger, FastDateFormat formatter) { this.slf4jLogger = slf4jLogger; this.formatter = formatter; } // ======================================== // Getters and Setters // ---------------------------------------- public boolean isTraceEnabled() { return slf4jLogger.isTraceEnabled(); } public boolean isDebugEnabled() { return slf4jLogger.isDebugEnabled(); } public boolean isInfoEnabled() { return slf4jLogger.isInfoEnabled(); } public boolean isWarnEnabled() { return slf4jLogger.isWarnEnabled(); } public boolean isErrorEnabled() { return slf4jLogger.isErrorEnabled(); } public boolean isIncludeLoggerName() { return includeLoggerName; } public void setIncludeLoggerName(boolean includeLoggerName) { this.includeLoggerName = includeLoggerName; } public boolean isIncludeThreadName() { return includeThreadName; } public void setIncludeThreadName(boolean includeThreadName) { this.includeThreadName = includeThreadName; } public boolean isIncludeClassName() { return includeClassName; } public void setIncludeClassName(boolean includeClassName) { this.includeClassName = includeClassName; } // ======================================== // Log Level API // ---------------------------------------- public JsonLogger trace() { if (slf4jLogger.isTraceEnabled()) { StandardJsonLogger result = new StandardJsonLogger(this.slf4jLogger, this.formatter, this.gson, TRACE_LEVEL_NAME, this.slf4jLogger::trace, this.slf4jLogger::trace); this.configureLogger(result); return result; } return noopLogger; } public JsonLogger debug() { if (slf4jLogger.isDebugEnabled()) { StandardJsonLogger result = new StandardJsonLogger(this.slf4jLogger, this.formatter, this.gson, DEBUG_LEVEL_NAME, this.slf4jLogger::debug, this.slf4jLogger::debug); this.configureLogger(result); return result; } return noopLogger; } public JsonLogger info() { if (slf4jLogger.isInfoEnabled()) { StandardJsonLogger result = new StandardJsonLogger(this.slf4jLogger, this.formatter, this.gson, INFO_LEVEL_NAME, this.slf4jLogger::info, this.slf4jLogger::info); this.configureLogger(result); return result; } return noopLogger; } public JsonLogger warn() { if (slf4jLogger.isWarnEnabled()) { StandardJsonLogger result = new StandardJsonLogger(this.slf4jLogger, this.formatter, this.gson, WARN_LEVEL_NAME, this.slf4jLogger::warn, this.slf4jLogger::warn); this.configureLogger(result); return result; } return noopLogger; } public JsonLogger error() { if (slf4jLogger.isErrorEnabled()) { StandardJsonLogger result = new StandardJsonLogger(this.slf4jLogger, this.formatter, this.gson, ERROR_LEVEL_NAME, this.slf4jLogger::error, this.slf4jLogger::error); this.configureLogger(result); return result; } return noopLogger; } // ======================================== // Internal Methods // ---------------------------------------- private void configureLogger(StandardJsonLogger logger) { logger.setIncludeClassName(this.includeClassName); logger.setIncludeLoggerName(this.includeLoggerName); logger.setIncludeThreadName(this.includeThreadName); } }
0
java-sources/ai/tripl/arc_2.11/2.14.0/ai/tripl/arc/util/log
java-sources/ai/tripl/arc_2.11/2.14.0/ai/tripl/arc/util/log/logger/LoggerBuilder.java
/* * Copyright (c) 2016 Savoir Technologies * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * */ package ai.tripl.arc.util.log.logger; import org.apache.commons.lang3.time.FastDateFormat; /** * Builder for Logger instances which provides a convenient means to configure * the logger that will easily remain backward-compatible as additional settings * are added over time. * * Created by art on 10/13/16. */ public class LoggerBuilder { private org.slf4j.Logger slf4jLogger; private FastDateFormat dateFormatter; private boolean includeLoggerName = true; private boolean includeThreadName = true; private boolean includeClassName = true; public LoggerBuilder slf4jLogger(org.slf4j.Logger slf4jLogger, FastDateFormat dateFormatter) { this.slf4jLogger = slf4jLogger; this.dateFormatter = dateFormatter; return this; } // ======================================== // Public API // ---------------------------------------- public LoggerBuilder includeLoggerName(boolean includeLoggerName) { this.includeLoggerName = includeLoggerName; return this; } public LoggerBuilder includeClassName(boolean includeClassName) { this.includeClassName = includeClassName; return this; } public LoggerBuilder includeThreadName(boolean includeThreadName) { this.includeThreadName = includeThreadName; return this; } public Logger build() { Logger result = new Logger(this.slf4jLogger, this.dateFormatter); result.setIncludeThreadName(this.includeThreadName); result.setIncludeLoggerName(this.includeLoggerName); result.setIncludeClassName(this.includeClassName); return result; } }
0
java-sources/ai/tripl/arc_2.11/2.14.0/ai/tripl/arc/util/log
java-sources/ai/tripl/arc_2.11/2.14.0/ai/tripl/arc/util/log/logger/NoopLogger.java
/* * Copyright (c) 2016 Savoir Technologies * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * */ package ai.tripl.arc.util.log.logger; import com.google.gson.JsonElement; import org.slf4j.Marker; import java.util.List; import java.util.Map; import java.util.function.Supplier; public class NoopLogger implements JsonLogger { @Override public JsonLogger map(String key, Map map) { return this; } @Override public JsonLogger map(String key, Supplier<Map> map) { return this; } @Override public JsonLogger list(String key, List list) { return this; } @Override public JsonLogger list(String key, Supplier<List> list) { return this; } @Override public JsonLogger message(String message) { return this; } @Override public JsonLogger message(Supplier<String> message) { return this; } @Override public JsonLogger field(String key, Object value) { return this; } @Override public JsonLogger field(String key, Supplier value) { return this; } @Override public JsonLogger json(String key, JsonElement jsonElement) { return this; } @Override public JsonLogger json(String key, Supplier<JsonElement> jsonElement) { return this; } @Override public JsonLogger exception(String key, Exception exception) { return this; } @Override public JsonLogger stack() { return this; } @Override public JsonLogger marker(Marker marker) { return this; } @Override public void log() { } }
0
java-sources/ai/tripl/arc_2.11/2.14.0/ai/tripl/arc/util/log
java-sources/ai/tripl/arc_2.11/2.14.0/ai/tripl/arc/util/log/logger/StandardJsonLogger.java
/* * Copyright (c) 2016 Savoir Technologies * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * */ package ai.tripl.arc.util.log.logger; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.time.FastDateFormat; import org.slf4j.MDC; import org.slf4j.Marker; import java.text.Format; import java.util.List; import java.util.Map; import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.Supplier; public class StandardJsonLogger implements JsonLogger { private final org.slf4j.Logger slf4jLogger; private final FastDateFormat formatter; private final Gson gson; private final JsonObject jsonObject; // LEVEL-Specific Settings private final Consumer<String> logOperation; private final BiConsumer<Marker, String> logWithMarkerOperation; private final String levelName; private Marker marker; private boolean includeLoggerName = true; private boolean includeThreadName = true; private boolean includeClassName = true; public StandardJsonLogger(org.slf4j.Logger slf4jLogger, FastDateFormat formatter, Gson gson, String levelName, Consumer<String> logOperation, BiConsumer<Marker, String> logWithMarkerOperation) { this.slf4jLogger = slf4jLogger; this.formatter = formatter; this.gson = gson; this.levelName = levelName; this.logOperation = logOperation; this.logWithMarkerOperation = logWithMarkerOperation; this.jsonObject = new JsonObject(); } // ======================================== // Getters and Setters // ---------------------------------------- public boolean isIncludeLoggerName() { return includeLoggerName; } public void setIncludeLoggerName(boolean includeLoggerName) { this.includeLoggerName = includeLoggerName; } public boolean isIncludeThreadName() { return includeThreadName; } public void setIncludeThreadName(boolean includeThreadName) { this.includeThreadName = includeThreadName; } public boolean isIncludeClassName() { return includeClassName; } public void setIncludeClassName(boolean includeClassName) { this.includeClassName = includeClassName; } // ======================================== // Public API // ---------------------------------------- @Override public JsonLogger message(String message) { try { jsonObject.add("message", gson.toJsonTree(message)); } catch (Exception e) { jsonObject.add("message", gson.toJsonTree(formatException(e))); } return this; } @Override public JsonLogger message(Supplier<String> message) { try { jsonObject.add("message", gson.toJsonTree(message.get())); } catch (Exception e) { jsonObject.add("message", gson.toJsonTree(formatException(e))); } return this; } @Override public JsonLogger map(String key, Map map) { try { jsonObject.add(key, gson.toJsonTree(map)); } catch (Exception e) { jsonObject.add(key, gson.toJsonTree(formatException(e))); } return this; } @Override public JsonLogger map(String key, Supplier<Map> map) { try { jsonObject.add(key, gson.toJsonTree(map.get())); } catch (Exception e) { jsonObject.add(key, gson.toJsonTree(formatException(e))); } return this; } @Override public JsonLogger list(String key, List list) { try { jsonObject.add(key, gson.toJsonTree(list)); } catch (Exception e) { jsonObject.add(key, gson.toJsonTree(formatException(e))); } return this; } @Override public JsonLogger list(String key, Supplier<List> list) { try { jsonObject.add(key, gson.toJsonTree(list.get())); } catch (Exception e) { jsonObject.add(key, gson.toJsonTree(formatException(e))); } return this; } @Override public JsonLogger field(String key, Object value) { try { jsonObject.add(key, gson.toJsonTree(value)); } catch (Exception e) { jsonObject.add(key, gson.toJsonTree(formatException(e))); } return this; } @Override public JsonLogger field(String key, Supplier value) { try { // in the rare case that the value passed is null, this method will be selected // as more specific than the Object // method. Have to handle it here or the value.get() will NullPointer if (value == null) { jsonObject.add(key, null); } else { jsonObject.add(key, gson.toJsonTree(value.get())); } } catch (Exception e) { jsonObject.add(key, gson.toJsonTree(formatException(e))); } return this; } @Override public JsonLogger json(String key, JsonElement jsonElement) { try { jsonObject.add(key, jsonElement); } catch (Exception e) { jsonObject.add(key, gson.toJsonTree(formatException(e))); } return this; } @Override public JsonLogger json(String key, Supplier<JsonElement> jsonElement) { try { jsonObject.add(key, jsonElement.get()); } catch (Exception e) { jsonObject.add(key, gson.toJsonTree(formatException(e))); } return this; } @Override public JsonLogger exception(String key, Exception exception) { try { jsonObject.add(key, gson.toJsonTree(formatException(exception))); } catch (Exception e) { jsonObject.add(key, gson.toJsonTree(formatException(e))); } return this; } @Override public JsonLogger stack() { try { jsonObject.add("stacktrace", gson.toJsonTree(formatStack())); } catch (Exception e) { jsonObject.add("stacktrace", gson.toJsonTree(formatException(e))); } return this; } @Override public JsonLogger marker(Marker marker) { this.marker = marker; jsonObject.add("marker", gson.toJsonTree(marker.getName())); return this; } @Override public void log() { String message = this.formatMessage(levelName); if (this.marker == null) { this.logOperation.accept(message); } else { this.logWithMarkerOperation.accept(marker, message); } } // ======================================== // Internals // ---------------------------------------- protected String formatMessage(String level) { jsonObject.add("level", gson.toJsonTree(level)); if (includeThreadName) { jsonObject.add("thread_name", gson.toJsonTree(Thread.currentThread().getName())); } if (includeClassName) { try { jsonObject.add("class", gson.toJsonTree(getCallingClass())); } catch (Exception e) { jsonObject.add("class", gson.toJsonTree(formatException(e))); } } if (includeLoggerName) { jsonObject.add("logger_name", gson.toJsonTree(slf4jLogger.getName())); } try { jsonObject.add("timestamp", gson.toJsonTree(getCurrentTimestamp(formatter))); } catch (Exception e) { jsonObject.add("timestamp", gson.toJsonTree(formatException(e))); } Map<String, String> mdc = MDC.getCopyOfContextMap(); if (mdc != null && !mdc.isEmpty()) { try { mdc.forEach((k, v) -> jsonObject.add(k.toString(), gson.toJsonTree(v))); } catch (Exception e) { jsonObject.add("mdc", gson.toJsonTree(formatException(e))); } } return gson.toJson(jsonObject); } private String getCallingClass() { StackTraceElement[] stackTraceElements = (new Exception()).getStackTrace(); return stackTraceElements[3].getClassName(); } private String getCurrentTimestamp(Format formatter) { return formatter.format(System.currentTimeMillis()); } private String formatException(Exception e) { return ExceptionUtils.getStackTrace(e); } /** * Some contention over performance of Thread.currentThread.getStackTrace() vs * (new Exception()).getStackTrace() Code in Thread.java actually uses the * latter if 'this' is the current thread so we do the same * * Remove the top two elements as those are the elements from this logging class */ private String formatStack() { StringBuilder output = new StringBuilder(); StackTraceElement[] stackTraceElements = (new Exception()).getStackTrace(); output.append(stackTraceElements[2]); for (int index = 3; index < stackTraceElements.length; index++) { output.append("\n\tat ").append(stackTraceElements[index]); } return output.toString(); } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/Waii.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii; import ai.waii.clients.accesskey.AccessKey; import ai.waii.clients.authorization.Authorization; import ai.waii.clients.chart.Chart; import ai.waii.clients.chat.Chat; import ai.waii.clients.database.Database; import ai.waii.clients.healthcheck.HealthCheck; import ai.waii.clients.history.History; import ai.waii.clients.model.LLM; import ai.waii.clients.query.Query; import ai.waii.clients.semanticcontext.SemanticContext; import ai.waii.clients.user.User; public final class Waii { private WaiiHttpClient httpClient; private History history; private SemanticContext semanticContext; private Query query; private Database database; private AccessKey accessKey; private HealthCheck healthCheck; private Authorization authorization; private LLM llm; private User user; private Chart chart; private Chat chat; public Waii(String url, String apiKey) { initialize(url, apiKey); } public void initialize(String url, String apiKey) { httpClient = new WaiiHttpClient(url, apiKey); history = new History(httpClient); semanticContext = new SemanticContext(httpClient); query = new Query(httpClient); database = new Database(httpClient); accessKey = new AccessKey(httpClient); healthCheck = new HealthCheck(httpClient); authorization = new Authorization(httpClient); llm = new LLM(httpClient); user = new User(httpClient); chart = new Chart(httpClient); chat = new Chat(httpClient); } public WaiiHttpClient getHttpClient() { return httpClient; } public History getHistory() { return history; } public SemanticContext getSemanticContext() { return semanticContext; } public Query getQuery() { return query; } public Database getDatabase() { return database; } public AccessKey getAccessKey() { return accessKey; } public HealthCheck getHealthCheck() { return healthCheck; } public Authorization getAuthorization() { return authorization; } public LLM getLLM() { return llm; } public User getUser() { return user; } public Chart getChart() { return chart; } public Chat getChat() { return chat; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/WaiiHttpClient.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; import java.util.Map; import com.google.gson.Gson; import com.google.gson.JsonSyntaxException; public class WaiiHttpClient { private final String url; private final String apiKey; private final long timeout = 150000; // adjusted for milliseconds private String scope = ""; private String orgId = ""; private String userId = ""; private final Gson gson = new Gson(); public WaiiHttpClient(String url, String apiKey) { this.url = url != null ? url : "http://localhost:9859/api/"; this.apiKey = apiKey != null ? apiKey : ""; } public void setScope(String scope) { this.scope = scope; } public String getScope() { return this.scope; } public void setOrgId(String orgId) { this.orgId = orgId; } public String getOrgId() { return this.orgId; } public void setUserId(String userId) { this.userId = userId; } public String getUserId() { return this.userId; } public String commonFetchRaw(String endpoint, String jsonParams) throws IOException { HttpURLConnection connection = null; // Convert jsonParams to a Map Map<String, Object> paramsMap = gson.fromJson(jsonParams, Map.class); // Add scope, orgId, and userId to the params map paramsMap.put("scope", this.scope); paramsMap.put("org_id", this.orgId); paramsMap.put("user_id", this.userId); // Convert the modified map back to JSON String modifiedJsonParams = gson.toJson(paramsMap); try { URL apiUrl = new URL(this.url + endpoint); connection = (HttpURLConnection) apiUrl.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Authorization", "Bearer " + this.apiKey); connection.setRequestProperty("Content-Type", "application/json"); connection.setConnectTimeout((int) this.timeout); connection.setReadTimeout((int) this.timeout); connection.setDoOutput(true); try (OutputStream os = connection.getOutputStream()) { byte[] input = modifiedJsonParams.getBytes(StandardCharsets.UTF_8); os.write(input, 0, input.length); } int status = connection.getResponseCode(); BufferedReader reader; if (status >= 200 && status < 300) { reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8)); } else { reader = new BufferedReader(new InputStreamReader(connection.getErrorStream(), StandardCharsets.UTF_8)); } StringBuilder response = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { response.append(line.trim()); } if (status >= 400 && status < 500) { throw new IOException("Authentication failed: Incorrect API key."); } else if (status >= 500) { throw new IOException("Server error: " + response.toString()); } return response.toString(); } catch (JsonSyntaxException | IOException e) { throw new IOException("Invalid response received.", e); } finally { if (connection != null) { connection.disconnect(); } } } public <Type> Type commonFetch(String endpoint, String jsonParams, Class<Type> clazz) throws IOException { String response = commonFetchRaw(endpoint, jsonParams); //System.out.println(response); return gson.fromJson(response, clazz); } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/AsyncObjectResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients; public class AsyncObjectResponse { private String uuid; public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/CommonResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients; public class CommonResponse { }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/GetObjectRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients; public class GetObjectRequest { private String uuid; public String getUuid() { return uuid; } public GetObjectRequest setUuid(String uuid) { this.uuid = uuid; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/LLMBasedRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package waii.ai.clients; import ai.waii.clients.semanticcontext.SemanticStatement; import com.google.gson.annotations.SerializedName; import java.util.List; public class LLMBasedRequest { private String model; @SerializedName("use_cache") private boolean useCache = true; @SerializedName("additional_context") private List<SemanticStatement> additionalContext; public String getModel() { return model; } public LLMBasedRequest setModel(String model) { this.model = model; return this; } public boolean isUseCache() { return useCache; } public LLMBasedRequest setUseCache(boolean useCache) { this.useCache = useCache; return this; } public List<SemanticStatement> getAdditionalContext() { return additionalContext; } public void setAdditionalContext(List<SemanticStatement> additionalContext) { this.additionalContext = additionalContext; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/accesskey/AccessKey.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.accesskey; import java.io.IOException; import ai.waii.WaiiHttpClient; public class AccessKey { private final WaiiHttpClient httpClient; private static final String GENERATE_ENDPOINT = "get-access-key"; public AccessKey(WaiiHttpClient httpClient) { this.httpClient = httpClient; } public KeyList getKeys() throws IOException { String jsonParams = "{}"; // Assuming an empty JSON object as parameters return this.httpClient.commonFetch(GENERATE_ENDPOINT, jsonParams, KeyList.class); } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/accesskey/Key.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.accesskey; import com.google.gson.annotations.SerializedName; public class Key { @SerializedName("access_key") private String accessKey; @SerializedName("user_id") private String userId; @SerializedName("description") private String description; public String getAccessKey() { return accessKey; } public String getUserId() { return userId; } public String getDescription() { return description; } public void setAccessKey(String accessKey) { this.accessKey = accessKey; } public void setUserId(String userId) { this.userId = userId; } public void setDescription(String description) { this.description = description; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/accesskey/KeyList.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.accesskey; import com.google.gson.annotations.SerializedName; public class KeyList { @SerializedName("access_keys") private Key[] accessKeys; public Key[] getAccessKeys() { return accessKeys; } public void setAccessKeys(Key[] accessKeys) { this.accessKeys = accessKeys; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/authorization/Authorization.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.authorization; import java.io.IOException; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import ai.waii.WaiiHttpClient; import ai.waii.clients.CommonResponse; public class Authorization { private final WaiiHttpClient httpClient; private static final String O_AUTH_ENDPOINT = "configure-oauth"; public Authorization(WaiiHttpClient httpClient) { this.httpClient = httpClient; } public CommonResponse authorize(AuthRequest params) throws IOException { Gson gson = new Gson(); String jsonParams = gson.toJson(params); return this.httpClient.commonFetch(O_AUTH_ENDPOINT, jsonParams, CommonResponse.class); } public static class AuthRequest { private String account; @SerializedName("oauth_configuration") private OAuthConfiguration oAuthConfiguration; public String getAccount() { return account; } public OAuthConfiguration getOauthConfiguration() { return oAuthConfiguration; } public AuthRequest setAccount(String account) { this.account = account; return this; } public AuthRequest setOauthConfiguration(OAuthConfiguration oAuthConfiguration) { this.oAuthConfiguration = oAuthConfiguration; return this; } } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/authorization/OAuthConfiguration.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.authorization; import com.google.gson.annotations.SerializedName; public class OAuthConfiguration { @SerializedName("oauth_provider") private String oauthProvider; @SerializedName("redicrect_uri") private String redirectUri; @SerializedName("client_id") private String clientId; @SerializedName("client_secret") private String clientSecret; public String getOauthProvider() { return oauthProvider; } public String getRedirectUri() { return redirectUri; } public String getClientId() { return clientId; } public String getClientSecret() { return clientSecret; } public OAuthConfiguration setOauthProvider(String oauthProvider) { this.oauthProvider = oauthProvider; return this; } public OAuthConfiguration setRedirectUri(String redirect_uri) { this.redirectUri = redirect_uri; return this; } public OAuthConfiguration setClientId(String client_id) { this.clientId = client_id; return this; } public OAuthConfiguration setClientSecret(String client_secret) { this.clientSecret = client_secret; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chart/Chart.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chart; import java.io.IOException; import java.lang.reflect.Type; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import ai.waii.WaiiHttpClient; public class Chart { private final WaiiHttpClient httpClient; private static final String GENERATE_ENDPOINT = "generate-chart"; public Chart(WaiiHttpClient httpClient) { this.httpClient = httpClient; } public ChartGenerationResponse generate(ChartGenerationRequest params) throws IOException { Gson gson = new GsonBuilder() .registerTypeAdapter(ChartSpec.class, new ChartSpecDeserializer()) .create(); String jsonParams = gson.toJson(params); String jsonResponse = this.httpClient.commonFetchRaw(GENERATE_ENDPOINT, jsonParams); return gson.fromJson(jsonResponse, ChartGenerationResponse.class); } public static class ChartSpecDeserializer implements JsonDeserializer<ChartSpec> { @Override public ChartSpec deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonObject jsonObject = json.getAsJsonObject(); //System.out.println(jsonObject); if (jsonObject.has("spec_type")) { if (jsonObject.get("spec_type").getAsString().equals("superset")) { return context.deserialize(json, SuperSetChartSpec.class); } if (jsonObject.get("spec_type").getAsString().equals("metabase")) { return context.deserialize(json, MetabaseChartSpec.class); } if (jsonObject.get("spec_type").getAsString().equals("vegalite")) { return context.deserialize(json, VegaliteChartSpec.class); } } return null; } } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chart/ChartGenerationRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chart; import java.util.List; import java.util.Map; import com.google.gson.annotations.SerializedName; import ai.waii.clients.database.Column; import waii.ai.clients.LLMBasedRequest; public class ChartGenerationRequest extends LLMBasedRequest { private String sql; private String ask; @SerializedName("dataframe_rows") private List<Map<String, Object>> dataframeRows; @SerializedName("dataframe_cols") private List<Column> dataframeCols; @SerializedName("chart_type") private ChartType chartType; @SerializedName("parent_uuid") private String parentUuid; @SerializedName("tweak_history") private List<ChartTweak> tweakHistory; // Getters and Setters public String getSql() { return sql; } public ChartGenerationRequest setSql(String sql) { this.sql = sql; return this; } public String getAsk() { return ask; } public ChartGenerationRequest setAsk(String ask) { this.ask = ask; return this; } public List<Map<String, Object>> getDataframeRows() { return dataframeRows; } public ChartGenerationRequest setDataframeRows(List<Map<String, Object>> dataframeRows) { this.dataframeRows = dataframeRows; return this; } public List<Column> getDataframeCols() { return dataframeCols; } public ChartGenerationRequest setDataframeCols(List<Column> dataframeCols) { this.dataframeCols = dataframeCols; return this; } public ChartType getChartType() { return chartType; } public ChartGenerationRequest setChartType(ChartType chartType) { this.chartType = chartType; return this; } public String getParentUuid() { return parentUuid; } public ChartGenerationRequest setParentUuid(String parentUuid) { this.parentUuid = parentUuid; return this; } public List<ChartTweak> getTweakHistory() { return tweakHistory; } public ChartGenerationRequest setTweakHistory(List<ChartTweak> tweakHistory) { this.tweakHistory = tweakHistory; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chart/ChartGenerationResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chart; import com.google.gson.annotations.SerializedName; public class ChartGenerationResponse { private String uuid; private Long timestamp; @SerializedName("chart_spec") private ChartSpec chartSpec; public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public Long getTimestamp() { return timestamp; } public void setTimestamp(Long timestamp) { this.timestamp = timestamp; } public ChartSpec getChartSpec() { return chartSpec; } public void setChartSpec(ChartSpec chartSpec) { this.chartSpec = chartSpec; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chart/ChartSpec.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chart; import com.google.gson.annotations.SerializedName; public abstract class ChartSpec { @SerializedName("plot_type") protected String plotType; @SerializedName("spec_type") private String specType = "superset"; public String getPlotType() { return plotType; } public void setPlotType(String plotType) { this.plotType = plotType; } public String getSpecType() { return specType; } public ChartSpec setSpecType(String specType) { this.specType = specType; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chart/ChartTweak.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chart; import com.google.gson.annotations.SerializedName; public class ChartTweak { private String ask; @SerializedName("chart_spec") private ChartSpec chartSpec; // Getters and Setters public String getAsk() { return ask; } public void setAsk(String ask) { this.ask = ask; } public ChartSpec getChartSpec() { return chartSpec; } public void setChartSpec(ChartSpec chartSpec) { this.chartSpec = chartSpec; } @Override public String toString() { return "previous ask=" + ask + ", previous chart_spec=" + chartSpec; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chart/ChartType.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chart; import com.google.gson.annotations.SerializedName; public enum ChartType { @SerializedName("metabase") METABASE("metabase"), @SerializedName("superset") SUPERSET("superset"), @SerializedName("vegalite") VEGALITE("vegalite"); private final String value; ChartType(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return value; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chart/MetabaseChartSpec.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chart; import com.google.gson.annotations.SerializedName; public class MetabaseChartSpec extends ChartSpec { @SerializedName("metric") private String metric; @SerializedName("dimension") private String dimension; @SerializedName("name") private String name; @SerializedName("color_hex") private String colorHex; public String getMetric() { return metric; } public void setMetric(String metric) { this.metric = metric; } public String getDimension() { return dimension; } public void setDimension(String dimension) { this.dimension = dimension; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getColorHex() { return colorHex; } public void setColorHex(String colorHex) { this.colorHex = colorHex; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chart/SuperSetChartSpec.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chart; import java.util.List; import java.util.Map; import com.google.gson.annotations.SerializedName; public class SuperSetChartSpec extends ChartSpec { @SerializedName("superset_specs") private Map<String, Object> supersetSpecs; @SerializedName("generation_message") private String message; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public SuperSetChartSpec(Map<String, Object> supersetSpecs) { this.supersetSpecs = supersetSpecs; } public Map<String, Object> getSupersetSpecs() { return supersetSpecs; } public void setSupersetSpecs(Map<String, Object> supersetSpecs) { this.supersetSpecs = supersetSpecs; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chart/VegaliteChartSpec.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chart; import com.google.gson.annotations.SerializedName; public class VegaliteChartSpec extends ChartSpec { @SerializedName("chart") private String vegaliteSpecJson; @SerializedName("generation_message") private String generationMessage; public VegaliteChartSpec() {} public VegaliteChartSpec(String vegaliteSpecJson, Integer numberOfDataPoints, String generationMessage) { this.vegaliteSpecJson = vegaliteSpecJson; this.generationMessage = generationMessage; } public String getVegaliteSpecJson() { return vegaliteSpecJson; } public void setVegaliteSpecJson(String vegaliteSpecJson) { this.vegaliteSpecJson = vegaliteSpecJson; } public String getGenerationMessage() { return generationMessage; } public void setGenerationMessage(String generationMessage) { this.generationMessage = generationMessage; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chat/Chat.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chat; import java.io.IOException; import ai.waii.clients.AsyncObjectResponse; import ai.waii.clients.GetObjectRequest; import ai.waii.clients.chart.Chart; import ai.waii.clients.chart.ChartSpec; import com.google.gson.Gson; import ai.waii.WaiiHttpClient; import com.google.gson.GsonBuilder; public class Chat { private final WaiiHttpClient httpClient; private static final String CHAT_ENDPOINT = "chat-message"; private static final String SUBMIT_CHAT_ENDPOINT = "submit-chat-message"; private static final String GET_CHAT_ENDPOINT = "get-chat-response"; public Chat(WaiiHttpClient httpClient) { this.httpClient = httpClient; } public ChatResponse chat(ChatRequest params) throws IOException { Gson gson = new GsonBuilder() .registerTypeAdapter(ChartSpec.class, new Chart.ChartSpecDeserializer()) .create(); String jsonParams = gson.toJson(params); String jsonResponse = this.httpClient.commonFetchRaw(CHAT_ENDPOINT, jsonParams); return gson.fromJson(jsonResponse, ChatResponse.class); } public AsyncObjectResponse submitChat(ChatRequest params) throws IOException { Gson gson = new GsonBuilder() .registerTypeAdapter(ChartSpec.class, new Chart.ChartSpecDeserializer()) .create(); String jsonParams = gson.toJson(params); return this.httpClient.commonFetch(SUBMIT_CHAT_ENDPOINT, jsonParams, AsyncObjectResponse.class); } public ChatResponse getChatResponse(GetObjectRequest params) throws IOException { Gson gson = new GsonBuilder() .registerTypeAdapter(ChartSpec.class, new Chart.ChartSpecDeserializer()) .create(); String jsonParams = gson.toJson(params); String jsonResponse = this.httpClient.commonFetchRaw(GET_CHAT_ENDPOINT, jsonParams); return gson.fromJson(jsonResponse, ChatResponse.class); } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chat/ChatModule.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chat; import com.google.gson.annotations.SerializedName; public enum ChatModule { @SerializedName("data") DATA, @SerializedName("tables") TABLES, @SerializedName("query") QUERY, @SerializedName("chart") CHART }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chat/ChatRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chat; import ai.waii.clients.chart.ChartType; import com.google.gson.annotations.SerializedName; import waii.ai.clients.LLMBasedRequest; import java.util.List; public class ChatRequest extends LLMBasedRequest { private String ask; private boolean streaming = false; @SerializedName("parent_uuid") private String parentUuid; @SerializedName("chart_type") private ChartType chartType; @SerializedName("modules") private List<ChatModule> modules; @SerializedName("module_limit_in_response") private Integer responseModuleLimit; public String getAsk() { return ask; } public void setAsk(String ask) { this.ask = ask; } public boolean isStreaming() { return streaming; } public void setStreaming(boolean streaming) { this.streaming = streaming; } public String getParentUuid() { return parentUuid; } public void setParentUuid(String parentUuid) { this.parentUuid = parentUuid; } public ChartType getChartType() { return chartType; } public void setChartType(ChartType chartType) { this.chartType = chartType; } public List<ChatModule> getModules() { return modules; } public void setModules(List<ChatModule> modules) { this.modules = modules; } public Integer getResponseModuleLimit() { return responseModuleLimit; } public void setResponseModuleLimit(Integer responseModuleLimit) { this.responseModuleLimit = responseModuleLimit; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chat/ChatResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chat; import com.google.gson.annotations.SerializedName; import java.util.List; public class ChatResponse { private String response; @SerializedName("current_step") private String currentStep; @SerializedName("session_title") private String sessionTitle; @SerializedName("response_data") private ChatResponseData responseData; @SerializedName("is_new") private Boolean isNew = false; @SerializedName("timestamp_ms") private long timestamp; @SerializedName("chat_uuid") private String chatUuid; @SerializedName("response_selected_fields") private List<ChatModule> responseSelectedFields; @SerializedName("llm_usage_stats") private LLMUsageStatistics llmUsageStats; public LLMUsageStatistics getLlmUsageStats() { return llmUsageStats; } public void setLlmUsageStats(LLMUsageStatistics llmUsageStats) { this.llmUsageStats = llmUsageStats; } public String getCurrentStep() { return currentStep; } public void setCurrentStep(String currentStep) { this.currentStep = currentStep; } public String getSessionTitle() { return sessionTitle; } public void setSessionTitle(String sessionTitle) { this.sessionTitle = sessionTitle; } public static class LLMUsageStatistics { @SerializedName("token_total") private Integer tokenTotal; public Integer getTokenTotal() { return tokenTotal; } public void setTokenTotal(Integer tokenTotal) { this.tokenTotal = tokenTotal; } } public List<ChatModule> getResponseSelectedFields() { return responseSelectedFields; } public void setResponseSelectedFields(List<ChatModule> responseSelectedFields) { this.responseSelectedFields = responseSelectedFields; } public String getResponse() { return response; } public void setResponse(String response) { this.response = response; } public ChatResponseData getResponseData() { return responseData; } public void setResponseData(ChatResponseData responseData) { this.responseData = responseData; } public Boolean getIsNew() { return isNew; } public void setIsNew(Boolean isNew) { this.isNew = isNew; } public long getTimestamp() { return timestamp; } public void setTimestamp(long timestamp) { this.timestamp = timestamp; } public String getChatUuid() { return chatUuid; } public void setChatUuid(String chatUuid) { this.chatUuid = chatUuid; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/chat/ChatResponseData.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.chat; import com.google.gson.annotations.SerializedName; import ai.waii.clients.chart.ChartGenerationResponse; import ai.waii.clients.database.Catalog; import ai.waii.clients.query.GeneratedQuery; import ai.waii.clients.query.GetQueryResultResponse; import ai.waii.clients.semanticcontext.GetSemanticContextResponse; public class ChatResponseData { private GetQueryResultResponse data; private GeneratedQuery query; @SerializedName("chart") private ChartGenerationResponse chart; @SerializedName("python_plot") private Object pythonPlot; @SerializedName("semantic_context") private GetSemanticContextResponse semanticContext; private Catalog tables; @SerializedName("debug_info") private ChatError debugInfo; public GetQueryResultResponse getData() { return data; } public void setData(GetQueryResultResponse data) { this.data = data; } public GeneratedQuery getQuery() { return query; } public void setQuery(GeneratedQuery query) { this.query = query; } public ChartGenerationResponse getChart() { return chart; } public void setChart(ChartGenerationResponse chart) { this.chart = chart; } public Object getPythonPlot() { return pythonPlot; } public void setPythonPlot(Object pythonPlot) { this.pythonPlot = pythonPlot; } public GetSemanticContextResponse getSemanticContext() { return semanticContext; } public void setSemanticContext(GetSemanticContextResponse semanticContext) { this.semanticContext = semanticContext; } public Catalog getTables() { return tables; } public void setTables(Catalog tables) { this.tables = tables; } public ChatError getDebugInfo() { return debugInfo; } public void setDebugInfo(ChatError debugInfo) { this.debugInfo = debugInfo; } public static class ChatError { @SerializedName("query_gen_error") private ErrorInfo queryGenError; @SerializedName("query_run_error") private ErrorInfo queryRunError; @SerializedName("chart_gen_error") private ErrorInfo chartGenError; public ErrorInfo getChartGenError() { return chartGenError; } public void setChartGenError(ErrorInfo chartGenError) { this.chartGenError = chartGenError; } public ErrorInfo getQueryRunError() { return queryRunError; } public void setQueryRunError(ErrorInfo queryRunError) { this.queryRunError = queryRunError; } public ErrorInfo getQueryGenError() { return queryGenError; } public void setQueryGenError(ErrorInfo queryGenError) { this.queryGenError = queryGenError; } } public static class ErrorInfo { @SerializedName("error_detail") private String errorDetail; @SerializedName("error_code") private Integer errorCode; public String getErrorDetail() { return errorDetail; } public void setErrorDetail(String errorDetail) { this.errorDetail = errorDetail; } public Integer getErrorCode() { return errorCode; } public void setErrorCode(Integer errorCode) { this.errorCode = errorCode; } } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/Catalog.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import java.util.List; public class Catalog { private String name; private List<Schema> schemas; public Catalog() { } public Catalog(String name, List<Schema> schemas) { this.name = name; this.schemas = schemas; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List<Schema> getSchemas() { return schemas; } public void setSchemas(List<Schema> schemas) { this.schemas = schemas; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/Column.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; public class Column { private String name; private String type; private String comment; @SerializedName("sample_values") private ColumnSampleValues sampleValues; private String description; public Column(String name, String type, String comment) { this.name = name; this.type = type; this.comment = comment; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } public ColumnSampleValues getSampleValues() { return sampleValues; } public void setSampleValues(ColumnSampleValues sampleValues) { this.sampleValues = sampleValues; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/ColumnDescription.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; public class ColumnDescription { @SerializedName("column_name") private String columnName; private String description; public ColumnDescription(String columnName, String description) { this.columnName = columnName; this.description = description; } public String getColumnName() { return columnName; } public void setColumnName(String columnName) { this.columnName = columnName; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/ColumnSampleValues.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import java.util.Map; import com.google.gson.annotations.SerializedName; class ColumnSampleValues { private Map<String, Integer> values; private Integer ndv; @SerializedName("col_type") private SampledColumnType columnType; public Map<String, Integer> getValues() { return values; } public void setValues(Map<String, Integer> values) { this.values = values; } public Integer getNdv() { return ndv; } public void setNdv(Integer ndv) { this.ndv = ndv; } public SampledColumnType getColumnType() { return columnType; } public void setColumnType(SampledColumnType columnType) { this.columnType = columnType; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/DBAccessPolicy.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; public class DBAccessPolicy { @SerializedName("read_only") private Boolean readOnly; @SerializedName("allow_access_beyond_db_content_filter") private Boolean allowAccessBeyondDbContentFilter; @SerializedName("allow_access_beyond_search_context") private Boolean allowAccessBeyondSearchContext; public DBAccessPolicy() { this.readOnly = false; this.allowAccessBeyondDbContentFilter = true; this.allowAccessBeyondSearchContext = true; } public DBAccessPolicy(Boolean readOnly, Boolean allowAccessBeyondDbContentFilter, Boolean allowAccessBeyondSearchContext) { this.readOnly = readOnly; this.allowAccessBeyondDbContentFilter = allowAccessBeyondDbContentFilter; this.allowAccessBeyondSearchContext = allowAccessBeyondSearchContext; } public Boolean getReadOnly() { return readOnly; } public void setReadOnly(Boolean readOnly) { this.readOnly = readOnly; } public Boolean getAllowAccessBeyondDbContentFilter() { return allowAccessBeyondDbContentFilter; } public void setAllowAccessBeyondDbContentFilter(Boolean allowAccessBeyondDbContentFilter) { this.allowAccessBeyondDbContentFilter = allowAccessBeyondDbContentFilter; } public Boolean getAllowAccessBeyondSearchContext() { return allowAccessBeyondSearchContext; } public void setAllowAccessBeyondSearchContext(Boolean allowAccessBeyondSearchContext) { this.allowAccessBeyondSearchContext = allowAccessBeyondSearchContext; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/DBConnection.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; import java.util.List; public class DBConnection { private String key; @SerializedName("db_type") private String dbType; private String description; @SerializedName("account_name") private String accountName; private String username; private String password; private String database; private String warehouse; private String role; private String path; private String host; @SerializedName("client_id") private String clientId; @SerializedName("client_secret") private String clientSecret; private Integer port; private Object parameters; @SerializedName("sample_col_values") private Boolean sampleColValues; private Boolean push; @SerializedName("db_content_filters") private List<DBContentFilter> dbContentFilters; @SerializedName("embedding_model") private String embeddingModel; @SerializedName("always_include_tables") private List<TableName> alwaysIncludeTables; private String alias; @SerializedName("db_access_policy") private DBAccessPolicy dbAccessPolicy; @SerializedName("host_alias") private String hostAlias; @SerializedName("user_alias") private String userAlias; @SerializedName("db_alias") private String dbAlias; @SerializedName("client_email") private String clientEmail; @SerializedName("content_filters") private List<SearchContext> contentFilters; @SerializedName("sample_filters") private List<SearchContext> sampleFilters; @SerializedName("enable_multi_db_connection") private Boolean enableMultiDbConnection; @SerializedName("default_database") private String defaultDatabase; public DBConnection() { this.sampleColValues = true; this.push = false; this.dbAccessPolicy = new DBAccessPolicy(); this.enableMultiDbConnection = false; } public DBConnection(String key, String dbType, String description, String accountName, String username, String password, String database, String warehouse, String role, String path, String host, String clientId, String clientSecret, Integer port, Object parameters, Boolean sampleColValues, Boolean push, List<DBContentFilter> dbContentFilters, String embeddingModel, List<TableName> alwaysIncludeTables, String alias, DBAccessPolicy dbAccessPolicy, String hostAlias, String userAlias, String dbAlias, String clientEmail, List<SearchContext> contentFilters, List<SearchContext> sampleFilters, Boolean enableMultiDbConnection, String defaultDatabase) { this.key = key; this.dbType = dbType; this.description = description; this.accountName = accountName; this.username = username; this.password = password; this.database = database; this.warehouse = warehouse; this.role = role; this.path = path; this.host = host; this.clientId = clientId; this.clientSecret = clientSecret; this.port = port; this.parameters = parameters; this.sampleColValues = sampleColValues != null ? sampleColValues : true; this.push = push != null ? push : false; this.dbContentFilters = dbContentFilters; this.embeddingModel = embeddingModel; this.alwaysIncludeTables = alwaysIncludeTables; this.alias = alias; this.dbAccessPolicy = dbAccessPolicy != null ? dbAccessPolicy : new DBAccessPolicy(); this.hostAlias = hostAlias; this.userAlias = userAlias; this.dbAlias = dbAlias; this.clientEmail = clientEmail; this.contentFilters = contentFilters; this.sampleFilters = sampleFilters; this.enableMultiDbConnection = enableMultiDbConnection != null ? enableMultiDbConnection : false; this.defaultDatabase = defaultDatabase; } public boolean equals(DBConnection db2) { if (db2 == null) return false; return java.util.Objects.equals(this.dbType, db2.dbType) && java.util.Objects.equals(this.accountName, db2.accountName) && java.util.Objects.equals(this.username, db2.username) && java.util.Objects.equals(this.database, db2.database) && java.util.Objects.equals(this.host, db2.host) && java.util.Objects.equals(this.port, db2.port); } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getDbType() { return dbType; } public void setDbType(String dbType) { this.dbType = dbType; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getAccountName() { return accountName; } public void setAccountName(String accountName) { this.accountName = accountName; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getDatabase() { return database; } public void setDatabase(String database) { this.database = database; } public String getWarehouse() { return warehouse; } public void setWarehouse(String warehouse) { this.warehouse = warehouse; } public String getRole() { return role; } public void setRole(String role) { this.role = role; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } public String getHost() { return host; } public void setHost(String host) { this.host = host; } public int getPort() { return port; } public void setPort(int port) { this.port = port; } public Object getParameters() { return parameters; } public void setParameters(Object parameters) { this.parameters = parameters; } public Boolean isSampleColValues() { return sampleColValues; } public void setSampleColValues(Boolean sampleColValues) { this.sampleColValues = sampleColValues; } public List<DBContentFilter> getDbContentFilters() { return dbContentFilters; } public void setDbContentFilters(List<DBContentFilter> dbContentFilters) { this.dbContentFilters = dbContentFilters; } public String getClientId() { return clientId; } public void setClientId(String clientId) { this.clientId = clientId; } public String getClientSecret() { return clientSecret; } public void setClientSecret(String clientSecret) { this.clientSecret = clientSecret; } public Boolean getPush() { return push; } public void setPush(Boolean push) { this.push = push; } public String getEmbeddingModel() { return embeddingModel; } public void setEmbeddingModel(String embeddingModel) { this.embeddingModel = embeddingModel; } public List<TableName> getAlwaysIncludeTables() { return alwaysIncludeTables; } public void setAlwaysIncludeTables(List<TableName> alwaysIncludeTables) { this.alwaysIncludeTables = alwaysIncludeTables; } public String getAlias() { return alias; } public void setAlias(String alias) { this.alias = alias; } public DBAccessPolicy getDbAccessPolicy() { return dbAccessPolicy; } public void setDbAccessPolicy(DBAccessPolicy dbAccessPolicy) { this.dbAccessPolicy = dbAccessPolicy; } public String getHostAlias() { return hostAlias; } public void setHostAlias(String hostAlias) { this.hostAlias = hostAlias; } public String getUserAlias() { return userAlias; } public void setUserAlias(String userAlias) { this.userAlias = userAlias; } public String getDbAlias() { return dbAlias; } public void setDbAlias(String dbAlias) { this.dbAlias = dbAlias; } public String getClientEmail() { return clientEmail; } public void setClientEmail(String clientEmail) { this.clientEmail = clientEmail; } public List<SearchContext> getContentFilters() { return contentFilters; } public void setContentFilters(List<SearchContext> contentFilters) { this.contentFilters = contentFilters; } public List<SearchContext> getSampleFilters() { return sampleFilters; } public void setSampleFilters(List<SearchContext> sampleFilters) { this.sampleFilters = sampleFilters; } public Boolean getEnableMultiDbConnection() { return enableMultiDbConnection; } public void setEnableMultiDbConnection(Boolean enableMultiDbConnection) { this.enableMultiDbConnection = enableMultiDbConnection; } public String getDefaultDatabase() { return defaultDatabase; } public void setDefaultDatabase(String defaultDatabase) { this.defaultDatabase = defaultDatabase; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/DBConnectionIndexingStatus.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import java.util.Map; import com.google.gson.annotations.SerializedName; public class DBConnectionIndexingStatus { private String status; @SerializedName("schema_status") private Map<String, SchemaIndexingStatus> schemaStatus; public DBConnectionIndexingStatus() { } public DBConnectionIndexingStatus(String status, Map<String, SchemaIndexingStatus> schemaStatus) { this.status = status; this.schemaStatus = schemaStatus; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public Map<String, SchemaIndexingStatus> getSchemaStatus() { return schemaStatus; } public void setSchemaStatus(Map<String, SchemaIndexingStatus> schemaStatus) { this.schemaStatus = schemaStatus; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/DBContentFilter.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; import java.util.List; public class DBContentFilter { @SerializedName("filter_scope") private String filterScope; @SerializedName("filter_type") private String filterType; @SerializedName("ignore_case") private Boolean ignoreCase; private String pattern; @SerializedName("filter_action_type") private String filterActionType; @SerializedName("search_context") private List<SearchContext> searchContext; public DBContentFilter() { this.filterType = "include"; this.filterActionType = "visibility"; this.ignoreCase = true; } public DBContentFilter(String filterScope, String filterType, Boolean ignoreCase, String pattern, String filterActionType, List<SearchContext> searchContext) { this.filterScope = filterScope; this.filterType = filterType; this.ignoreCase = ignoreCase; this.pattern = pattern; this.filterActionType = filterActionType; this.searchContext = searchContext; } public String getFilterScope() { return filterScope; } public void setFilterScope(String filterScope) { this.filterScope = filterScope; } public String getFilterType() { return filterType; } public void setFilterType(String filterType) { this.filterType = filterType; } public Boolean getIgnoreCase() { return ignoreCase; } public void setIgnoreCase(Boolean ignoreCase) { this.ignoreCase = ignoreCase; } public String getPattern() { return pattern; } public void setPattern(String pattern) { this.pattern = pattern; } public String getFilterActionType() { return filterActionType; } public void setFilterActionType(String filterActionType) { this.filterActionType = filterActionType; } public List<SearchContext> getSearchContext() { return searchContext; } public void setSearchContext(List<SearchContext> searchContext) { this.searchContext = searchContext; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/Database.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import java.io.IOException; import com.google.gson.Gson; import ai.waii.WaiiHttpClient; public class Database { private final WaiiHttpClient httpClient; private static final String MODIFY_DB_ENDPOINT = "update-db-connect-info"; private static final String GET_CATALOG_ENDPOINT = "get-table-definitions"; private static final String UPDATE_TABLE_DESCRIPTION_ENDPOINT = "update-table-description"; private static final String UPDATE_SCHEMA_DESCRIPTION_ENDPOINT = "update-schema-description"; private static final String UPDATE_COLUMN_DESCRIPTION_ENDPOINT = "update-column-description"; private static final String EXTRACT_DATABASE_DOCUMENTATION_ENDPOINT = "extract-database-documentation"; public Database(WaiiHttpClient httpClient) { this.httpClient = httpClient; } public ModifyDBConnectionResponse modifyConnections(ModifyDBConnectionRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(MODIFY_DB_ENDPOINT, jsonParams, ModifyDBConnectionResponse.class); } public GetDBConnectionResponse getConnections(GetDBConnectionRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(MODIFY_DB_ENDPOINT, jsonParams, GetDBConnectionResponse.class); } public ModifyDBConnectionResponse activateConnection(String key) throws IOException { this.httpClient.setScope(key); ModifyDBConnectionRequest request = new ModifyDBConnectionRequest(); request.setDefaultDbConnectionKey(key); String jsonParams = new Gson().toJson(request); return this.httpClient.commonFetch(MODIFY_DB_ENDPOINT, jsonParams, ModifyDBConnectionResponse.class); } public GetCatalogResponse getCatalogs(GetCatalogRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(GET_CATALOG_ENDPOINT, jsonParams, GetCatalogResponse.class); } public String getDefaultConnection() { return this.httpClient.getScope(); } public ModifyDBConnectionResponse updateTableDescription(UpdateTableDescriptionRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(UPDATE_TABLE_DESCRIPTION_ENDPOINT, jsonParams, ModifyDBConnectionResponse.class); } public ModifyDBConnectionResponse updateSchemaDescription(UpdateSchemaDescriptionRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(UPDATE_SCHEMA_DESCRIPTION_ENDPOINT, jsonParams, ModifyDBConnectionResponse.class); } public ModifyDBConnectionResponse updateColumnDescription(UpdateColumnDescriptionRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(UPDATE_COLUMN_DESCRIPTION_ENDPOINT, jsonParams, ModifyDBConnectionResponse.class); } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/GetCatalogRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; public class GetCatalogRequest { }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/GetCatalogResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import java.util.List; import java.util.Map; import ai.waii.clients.CommonResponse; public class GetCatalogResponse extends CommonResponse { private List<Catalog> catalogs; private Map<String, Object> debugInfo; public List<Catalog> getCatalogs() { return catalogs; } public void setCatalogs(List<Catalog> catalogs) { this.catalogs = catalogs; } public Map<String, Object> getDebugInfo() { return debugInfo; } public void setDebugInfo(Map<String, Object> debugInfo) { this.debugInfo = debugInfo; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/GetDBConnectionRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; public class GetDBConnectionRequest { }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/GetDBConnectionResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import java.util.Map; import java.util.List; import com.google.gson.annotations.SerializedName; import ai.waii.clients.CommonResponse; public class GetDBConnectionResponse extends CommonResponse { private List<DBConnection> connectors; private String diagnostics; @SerializedName("default_db_connection_key") private String defaultDbConnectionKey; @SerializedName("connector_status") private Map<String, DBConnectionIndexingStatus> connectorStatus; public List<DBConnection> getConnectors() { return connectors; } public void setConnectors(List<DBConnection> connectors) { this.connectors = connectors; } public String getDiagnostics() { return diagnostics; } public void setDiagnostics(String diagnostics) { this.diagnostics = diagnostics; } public String getDefaultDbConnectionKey() { return defaultDbConnectionKey; } public void setDefaultDbConnectionKey(String defaultDbConnectionKey) { this.defaultDbConnectionKey = defaultDbConnectionKey; } public Map<String, DBConnectionIndexingStatus> getConnectorStatus() { return connectorStatus; } public void setConnectorStatus(Map<String, DBConnectionIndexingStatus> connectorStatus) { this.connectorStatus = connectorStatus; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/ModifyDBConnectionRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; import java.util.List; public class ModifyDBConnectionRequest { private List<DBConnection> updated; private List<String> removed; @SerializedName("validate_before_save") private Boolean validateBeforeSave; @SerializedName("user_id") private String userId; @SerializedName("default_db_connection_key") private String defaultDbConnectionKey; @SerializedName("owner_user_id") private String ownerUserId; public List<DBConnection> getUpdated() { return updated; } public void setUpdated(List<DBConnection> updated) { this.updated = updated; } public List<String> getRemoved() { return removed; } public void setRemoved(List<String> removed) { this.removed = removed; } public Boolean getValidateBeforeSave() { return validateBeforeSave; } public void setValidateBeforeSave(Boolean validateBeforeSave) { this.validateBeforeSave = validateBeforeSave; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } public String getDefaultDbConnectionKey() { return defaultDbConnectionKey; } public void setDefaultDbConnectionKey(String defaultDbConnectionKey) { this.defaultDbConnectionKey = defaultDbConnectionKey; } public String getOwnerUserId() { return ownerUserId; } public void setOwnerUserId(String ownerUserId) { this.ownerUserId = ownerUserId; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/ModifyDBConnectionResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import java.util.Map; import java.util.List; import com.google.gson.annotations.SerializedName; import ai.waii.clients.CommonResponse; public class ModifyDBConnectionResponse extends CommonResponse { private List<DBConnection> connectors; private String diagnostics; @SerializedName("default_db_connection_key") private String defaultDbConnectionKey; @SerializedName("connector_status") private Map<String, DBConnectionIndexingStatus> connectorStatus; public List<DBConnection> getConnectors() { return connectors; } public void setConnectors(List<DBConnection> connectors) { this.connectors = connectors; } public String getDiagnostics() { return diagnostics; } public void setDiagnostics(String diagnostics) { this.diagnostics = diagnostics; } public String getDefaultDbConnectionKey() { return defaultDbConnectionKey; } public void setDefaultDbConnectionKey(String defaultDbConnectionKey) { this.defaultDbConnectionKey = defaultDbConnectionKey; } public Map<String, DBConnectionIndexingStatus> getConnectorStatus() { return connectorStatus; } public void setConnectorStatus(Map<String, DBConnectionIndexingStatus> connectorStatus) { this.connectorStatus = connectorStatus; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/SampledColumnType.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; public enum SampledColumnType { STRING("string"), JSON("json"), ENUM("enum"); private final String value; SampledColumnType(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return value; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/Schema.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import java.util.List; public class Schema { private SchemaName name; private List<Table> tables; private SchemaDescription description; public Schema() { } public Schema(SchemaName schemaName, List<Table> tables, SchemaDescription description) { this.name = schemaName; this.tables = tables; this.description = description; } public List<Table> getTables() { return tables; } public void setTables(List<Table> tables) { this.tables = tables; } public SchemaDescription getDescription() { return description; } public void setDescription(SchemaDescription description) { this.description = description; } public SchemaName getName() { return name; } public void setName(SchemaName name) { this.name = name; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/SchemaDescription.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; public class SchemaDescription { private String summary; @SerializedName("common_questions") private String[] commonQuestions; @SerializedName("common_tables") private TableDescriptionPair[] commonTables; public SchemaDescription(String summary, String[] commonQuestions, TableDescriptionPair[] commonTables) { this.summary = summary; this.commonQuestions = commonQuestions; this.commonTables = commonTables; } public String getSummary() { return summary; } public void setSummary(String summary) { this.summary = summary; } public String[] getCommonQuestions() { return commonQuestions; } public void setCommonQuestions(String[] commonQuestions) { this.commonQuestions = commonQuestions; } public TableDescriptionPair[] getCommonTables() { return commonTables; } public void setCommonTables(TableDescriptionPair[] commonTables) { this.commonTables = commonTables; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/SchemaIndexingStatus.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; public class SchemaIndexingStatus { @SerializedName("n_pending_indexing_tables") private int pendingIndexingTables; @SerializedName("n_total_tables") private int totalTables; private String status; public SchemaIndexingStatus(int pendingIndexingTables, int totalTables, String status) { this.pendingIndexingTables = pendingIndexingTables; this.totalTables = totalTables; this.status = status; } public int getPendingIndexingTables() { return pendingIndexingTables; } public void setPendingIndexingTables(int pendingIndexingTables) { this.pendingIndexingTables = pendingIndexingTables; } public int getTotalTables() { return totalTables; } public void setTotalTables(int totalTables) { this.totalTables = totalTables; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/SchemaName.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; public class SchemaName { @SerializedName("schema_name") private String schemaName; @SerializedName("database_name") private String databaseName; public SchemaName(String schemaName, String databaseName) { this.schemaName = schemaName; this.databaseName = databaseName; } // Getters and Setters public String getSchemaName() { return schemaName; } public void setSchemaName(String schemaName) { this.schemaName = schemaName; } public String getDatabaseName() { return databaseName; } public void setDatabaseName(String databaseName) { this.databaseName = databaseName; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/SearchContext.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; public class SearchContext { private String type; @SerializedName("db_name") private String dbName; @SerializedName("schema_name") private String schemaName; @SerializedName("table_name") private String tableName; @SerializedName("column_name") private String columnName; @SerializedName("ignore_case") private Boolean ignoreCase; public SearchContext() { this.type = "inclusion"; this.dbName = "*"; this.schemaName = "*"; this.tableName = "*"; this.columnName = "*"; this.ignoreCase = true; } public SearchContext(String type, String dbName, String schemaName, String tableName, String columnName, Boolean ignoreCase) { this.type = type; this.dbName = dbName; this.schemaName = schemaName; this.tableName = tableName; this.columnName = columnName; this.ignoreCase = ignoreCase; } public String getDbName() { return dbName; } public void setDbName(String dbName) { this.dbName = dbName; } public String getSchemaName() { return schemaName; } public void setSchemaName(String schemaName) { this.schemaName = schemaName; } public String getTableName() { return tableName; } public void setTableName(String tableName) { this.tableName = tableName; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getColumnName() { return columnName; } public void setColumnName(String columnName) { this.columnName = columnName; } public Boolean getIgnoreCase() { return ignoreCase; } public void setIgnoreCase(Boolean ignoreCase) { this.ignoreCase = ignoreCase; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/Table.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; import java.util.List; public class Table { @SerializedName("name") private TableName tableName; private List<Column> columns; private String comment; public Table() { } public Table(TableName tableName, List<Column> columns) { this.tableName = tableName; this.columns = columns; } public TableName getTableName() { return tableName; } public void setTableName(TableName tableName) { this.tableName = tableName; } public List<Column> getColumns() { return columns; } public void setColumns(List<Column> columns) { this.columns = columns; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/TableDescriptionPair.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; public class TableDescriptionPair { private String name; private String description; public TableDescriptionPair(String name, String description) { this.name = name; this.description = description; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/TableName.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; public class TableName { @SerializedName("table_name") private String tableName; @SerializedName("schema_name") private String schemaName; @SerializedName("database_name") private String databaseName; public TableName(String tableName, String schemaName, String databaseName) { this.tableName = tableName; this.schemaName = schemaName; this.databaseName = databaseName; } public String getTableName() { return tableName; } public void setTableName(String tableName) { this.tableName = tableName; } public String getSchemaName() { return schemaName; } public void setSchemaName(String schemaName) { this.schemaName = schemaName; } public String getDatabaseName() { return databaseName; } public void setDatabaseName(String databaseName) { this.databaseName = databaseName; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/TableToColumnDescription.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; public class TableToColumnDescription { @SerializedName("table_name") private TableName tableName; @SerializedName("column_description") private ColumnDescription[] columnDescriptions; public TableToColumnDescription(TableName tableName, ColumnDescription[] columnDescriptions) { this.tableName = tableName; this.columnDescriptions = columnDescriptions; } public TableName getTableName() { return tableName; } public void setTableName(TableName tableName) { this.tableName = tableName; } public ColumnDescription[] getColumnDescriptions() { return columnDescriptions; } public void setColumnDescriptions(ColumnDescription[] columnDescriptions) { this.columnDescriptions = columnDescriptions; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/UpdateColumnDescriptionRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; public class UpdateColumnDescriptionRequest { @SerializedName("col_descriptions") private TableToColumnDescription[] colDescriptions; public TableToColumnDescription[] getColDescriptions() { return colDescriptions; } public void setColDescriptions(TableToColumnDescription[] colDescriptions) { this.colDescriptions = colDescriptions; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/UpdateSchemaDescriptionRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; public class UpdateSchemaDescriptionRequest { @SerializedName("schema_name") private SchemaName schemaName; private SchemaDescription description; public SchemaName getSchemaName() { return schemaName; } public void setSchemaName(SchemaName schemaName) { this.schemaName = schemaName; } public SchemaDescription getDescription() { return description; } public void setDescription(SchemaDescription description) { this.description = description; } }