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/pool/PoolPatchRequest.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.pool;
public class PoolPatchRequest {
private Long priority;
public static Builder make() {
return new Builder();
}
public Long getPriority() {
return priority;
}
@Override
public String toString() {
return "PoolPatchRequest{"
+ "priority=" + priority
+ '}';
}
public static class Builder {
private final PoolPatchRequest request = new PoolPatchRequest();
public Builder priority(Long priority) {
request.priority = priority;
return this;
}
public PoolPatchRequest done() {
return request;
}
}
}
|
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/pool/PoolRangeParam.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.pool;
import ai.toloka.client.v1.RangeParam;
public enum PoolRangeParam implements RangeParam {
id(PoolSearchRequest.ID_PARAMETER),
created(PoolSearchRequest.CREATED_PARAMETER),
lastStarted(PoolSearchRequest.LAST_STARTED_PARAMETER);
private String parameter;
PoolRangeParam(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/pool/PoolSearchRequest.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.pool;
import java.util.Date;
import java.util.Map;
import ai.toloka.client.v1.SearchRequest;
public class PoolSearchRequest 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 PoolSearchRequest(Map<String, Object> filterParameters, Map<String, Object> rangeParameters,
String sortParameter, Integer limit) {
super(filterParameters, rangeParameters, sortParameter, limit);
}
public static PoolBuilder make() {
return new PoolBuilder(new PoolFilterBuilder(), new PoolRangeBuilder(), new PoolSortBuilder());
}
public static class PoolBuilder extends Builder<
PoolSearchRequest, PoolBuilder, PoolFilterBuilder, PoolRangeBuilder, PoolSortBuilder> {
public PoolBuilder(PoolFilterBuilder filterBuilder, PoolRangeBuilder rangeBuilder,
PoolSortBuilder sortBuilder) {
super(filterBuilder, rangeBuilder, sortBuilder);
}
@Override public PoolSearchRequest done() {
return new PoolSearchRequest(filterBuilder.getFilterParameters(), rangeBuilder.getRangeParameters(),
sortBuilder.getSortParameter(), getLimit());
}
}
public static class PoolFilterBuilder extends FilterBuilder<PoolFilterBuilder, PoolBuilder, PoolFilterParam> {
public PoolFilterBuilder byOwnerId(String ownerId) {
return by(PoolFilterParam.ownerId, ownerId);
}
public PoolFilterBuilder byOwnerCompanyId(String companyId) {
return by(PoolFilterParam.ownerCompanyId, companyId);
}
public PoolFilterBuilder byStatus(PoolStatus status) {
return by(PoolFilterParam.status, status);
}
public PoolFilterBuilder byProjectId(String projectId) {
return by(PoolFilterParam.projectId, projectId);
}
}
public static class PoolRangeBuilder extends RangeBuilder<PoolRangeBuilder, PoolBuilder, PoolRangeParam> {
public RangeItemBuilder<PoolRangeBuilder> byId(String id) {
return by(PoolRangeParam.id, id);
}
public RangeItemBuilder<PoolRangeBuilder> byCreated(Date created) {
return by(PoolRangeParam.created, created);
}
public RangeItemBuilder<PoolRangeBuilder> byLastStarted(Date lastStarted) {
return by(PoolRangeParam.lastStarted, lastStarted);
}
}
public static class PoolSortBuilder extends SortBuilder<PoolSortBuilder, PoolBuilder, PoolSortParam> {
public SortItem<PoolSortBuilder> byId() {
return by(PoolSortParam.id);
}
public SortItem<PoolSortBuilder> byCreated() {
return by(PoolSortParam.created);
}
public SortItem<PoolSortBuilder> byLastStarted() {
return by(PoolSortParam.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/pool/PoolSortParam.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.pool;
import ai.toloka.client.v1.SortParam;
public enum PoolSortParam implements SortParam {
id(PoolSearchRequest.ID_PARAMETER),
created(PoolSearchRequest.CREATED_PARAMETER),
lastStarted(PoolSearchRequest.LAST_STARTED_PARAMETER);
private String parameter;
PoolSortParam(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/pool/PoolStatus.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.pool;
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 PoolStatus extends FlexibleEnum<PoolStatus> {
public static PoolStatus OPEN = new PoolStatus("OPEN");
public static PoolStatus CLOSED = new PoolStatus("CLOSED");
public static PoolStatus ARCHIVED = new PoolStatus("ARCHIVED");
public static PoolStatus LOCKED = new PoolStatus("LOCKED");
private static final PoolStatus[] VALUES = {OPEN, CLOSED, ARCHIVED, LOCKED};
private static final ConcurrentMap<String, PoolStatus> DISCOVERED_VALUES = new ConcurrentHashMap<>();
public static PoolStatus[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), PoolStatus.class);
}
@JsonCreator
public static PoolStatus valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<PoolStatus>() {
@Override public PoolStatus create(String name) {
return new PoolStatus(name);
}
});
}
private PoolStatus(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/pool/PoolTrainingConfig.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.pool;
import com.fasterxml.jackson.annotation.JsonProperty;
public class PoolTrainingConfig {
@JsonProperty("training_skill_ttl_days")
private Integer trainingSkillTtlDays;
public Integer getTrainingSkillTtlDays() {
return trainingSkillTtlDays;
}
}
|
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/pool/PoolType.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.pool;
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 PoolType extends FlexibleEnum<PoolType> {
private static final ConcurrentMap<String, PoolType> DISCOVERED_VALUES = new ConcurrentHashMap<>();
public static PoolType REGULAR = new PoolType("REGULAR");
public static PoolType TRAINING = new PoolType("TRAINING");
private static final PoolType[] VALUES = {REGULAR, TRAINING};
private PoolType(String name) {
super(name);
}
public static PoolType[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), PoolType.class);
}
@JsonCreator
public static PoolType valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<PoolType>() {
@Override
public PoolType create(String name) {
return new PoolType(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/pool/TaskDistributionFunction.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.pool;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import ai.toloka.client.v1.FlexibleEnum;
public class TaskDistributionFunction {
public Scope scope;
public Distribution distribution;
@JsonProperty("window_days")
public Long windowDays;
public List<Interval> intervals;
@JsonCreator
public TaskDistributionFunction(@JsonProperty("scope") Scope scope,
@JsonProperty("distribution") Distribution distribution,
@JsonProperty("window_days") Long windowDays,
@JsonProperty("intervals") List<Interval> intervals) {
this.scope = scope;
this.distribution = distribution;
this.windowDays = windowDays;
this.intervals = intervals;
}
public static class Scope extends FlexibleEnum<Scope> {
public static final Scope PROJECT = new Scope("PROJECT");
public static final Scope POOL = new Scope("POOL");
private static final Scope[] VALUES = {PROJECT, POOL};
private static final ConcurrentMap<String, Scope> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private Scope(String name) {
super(name);
}
public static Scope[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), Scope.class);
}
public static Scope valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<Scope>() {
@Override public Scope create(String name) {
return new Scope(name);
}
});
}
}
public static class Distribution extends FlexibleEnum<Distribution> {
public static final Distribution UNIFORM = new Distribution("UNIFORM");
private static final Distribution[] VALUES = {UNIFORM};
private static final ConcurrentMap<String, Distribution> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private Distribution(String name) {
super(name);
}
public static Distribution[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), Distribution.class);
}
public static Distribution valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<Distribution>() {
@Override public Distribution create(String name) {
return new Distribution(name);
}
});
}
}
public static class Interval {
private Long from;
private Long to;
private Integer frequency;
@JsonCreator
public Interval(@JsonProperty("from") Long from,
@JsonProperty("to") Long to,
@JsonProperty("frequency") Integer frequency) {
this.from = from;
this.to = to;
this.frequency = frequency;
}
public Long getFrom() {
return from;
}
public void setFrom(Long from) {
this.from = from;
}
public Long getTo() {
return to;
}
public void setTo(Long to) {
this.to = to;
}
public Integer getFrequency() {
return frequency;
}
public void setFrequency(Integer frequency) {
this.frequency = frequency;
}
}
}
|
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/pool/TopPercentageSpeedQualityBalance.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.pool;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TopPercentageSpeedQualityBalance extends AbstractSpeedQualityBalance {
@JsonProperty("percent")
private Integer percent;
public TopPercentageSpeedQualityBalance(@JsonProperty("percent") Integer percent) {
super(Type.TOP_PERCENTAGE_BY_QUALITY);
this.percent = percent;
}
public Integer getPercent() {
return percent;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
TopPercentageSpeedQualityBalance that = (TopPercentageSpeedQualityBalance) o;
return Objects.equals(percent, that.percent);
}
@Override
public int hashCode() {
return percent.hashCode();
}
@Override
public String toString() {
return "TopPercentageUsersCherryPickingConfig{"
+ "type=" + type
+ ", percent=" + percent
+ '}';
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/dynamicoverlap/AbstractDynamicOverlapConfig.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.pool.dynamicoverlap;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, visible = true,
property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value = BasicDynamicOverlapConfig.class, name = "BASIC")
})
public abstract class AbstractDynamicOverlapConfig {
protected DynamicOverlapType type;
protected AbstractDynamicOverlapConfig(DynamicOverlapType type) {
this.type = type;
}
public DynamicOverlapType getType() {
return type;
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/dynamicoverlap/BasicDynamicOverlapConfig.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.pool.dynamicoverlap;
import java.math.BigDecimal;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
public class BasicDynamicOverlapConfig extends AbstractDynamicOverlapConfig {
@JsonProperty("max_overlap")
private Long maxOverlap;
@JsonProperty("min_confidence")
private BigDecimal minConfidence;
@JsonProperty("answer_weight_skill_id")
private String answerWeightSkillId;
private List<Field> fields;
public BasicDynamicOverlapConfig() {
super(DynamicOverlapType.BASIC);
}
public Long getMaxOverlap() {
return maxOverlap;
}
public void setMaxOverlap(Long maxOverlap) {
this.maxOverlap = maxOverlap;
}
public BigDecimal getMinConfidence() {
return minConfidence;
}
public void setMinConfidence(BigDecimal minConfidence) {
this.minConfidence = minConfidence;
}
public String getAnswerWeightSkillId() {
return answerWeightSkillId;
}
public void setAnswerWeightSkillId(String answerWeightSkillId) {
this.answerWeightSkillId = answerWeightSkillId;
}
public List<Field> getFields() {
return fields;
}
public void setFields(List<Field> fields) {
this.fields = fields;
}
public static class Field {
private String name;
public Field() {
}
public Field(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/dynamicoverlap/DynamicOverlapType.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.pool.dynamicoverlap;
public enum DynamicOverlapType {
BASIC
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/ArrayInclusionOperator.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.pool.filter;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import ai.toloka.client.v1.FlexibleEnum;
public class ArrayInclusionOperator extends FlexibleEnum<ArrayInclusionOperator> {
public static final ArrayInclusionOperator IN = new ArrayInclusionOperator("IN");
public static final ArrayInclusionOperator NOT_IN = new ArrayInclusionOperator("NOT_IN");
private static final ArrayInclusionOperator[] VALUES = {IN, NOT_IN};
private static final ConcurrentMap<String, ArrayInclusionOperator> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private ArrayInclusionOperator(String name) {
super(name);
}
public static ArrayInclusionOperator[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), ArrayInclusionOperator.class);
}
public static ArrayInclusionOperator valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<ArrayInclusionOperator>() {
@Override
public ArrayInclusionOperator create(String name) {
return new ArrayInclusionOperator(name);
}
});
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/CompareOperator.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.pool.filter;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import com.fasterxml.jackson.annotation.JsonCreator;
import ai.toloka.client.v1.FlexibleEnum;
public class CompareOperator extends FlexibleEnum<CompareOperator> {
public static final CompareOperator EQ = new CompareOperator("EQ");
public static final CompareOperator NE = new CompareOperator("NE");
public static final CompareOperator GT = new CompareOperator("GT");
public static final CompareOperator GTE = new CompareOperator("GTE");
public static final CompareOperator LT = new CompareOperator("LT");
public static final CompareOperator LTE = new CompareOperator("LTE");
private static final CompareOperator[] VALUES = {EQ, NE, GT, GTE, LT, LTE};
private static final ConcurrentMap<String, CompareOperator> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private CompareOperator(String name) {
super(name);
}
public static CompareOperator[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), CompareOperator.class);
}
@JsonCreator
public static CompareOperator valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<CompareOperator>() {
@Override
public CompareOperator create(String name) {
return new CompareOperator(name);
}
});
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/Condition.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.pool.filter;
import java.io.IOException;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.core.TreeNode;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import ai.toloka.client.v1.impl.transport.MapperUtil;
public abstract class Condition {
public static class ConditionDeserializer extends JsonDeserializer<Condition> {
@Override
public Condition deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
if (p.getCurrentToken() == JsonToken.START_OBJECT) {
p.nextToken();
}
TreeNode node = p.readValueAsTree();
if (node instanceof ObjectNode) {
ObjectNode objectNode = (ObjectNode) node;
if (objectNode.has("and")) {
return MapperUtil.getObjectReader(Connective.And.class).readValue(objectNode);
} else if (objectNode.has("or")) {
return MapperUtil.getObjectReader(Connective.Or.class).readValue(objectNode);
} else {
if (objectNode.has("category") && objectNode.get("category").isTextual()) {
String category = objectNode.get("category").asText();
switch (category) {
case "profile":
return MapperUtil.getObjectReader(Expression.ProfileExpression.class)
.readValue(objectNode);
case "computed":
return MapperUtil.getObjectReader(Expression.ComputedExpression.class)
.readValue(objectNode);
case "skill":
return MapperUtil.getObjectReader(Expression.Skill.class).readValue(objectNode);
default:
}
}
return MapperUtil.getObjectReader(Expression.RawExpression.class).readValue(objectNode);
}
}
return MapperUtil.getObjectReader(RawCondition.class).readValue((JsonNode) node);
}
}
public static class RawCondition {
private final Map<String, Object> content;
@JsonCreator
RawCondition(Map<String, Object> content) {
this.content = content;
}
@JsonValue
public Map<String, Object> getContent() {
return content;
}
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/Connective.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.pool.filter;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
public abstract class Connective extends Condition {
public static class And extends Connective {
@JsonProperty("and")
private List<Condition> conditions;
@JsonCreator
public And(
@JsonProperty("and")
@JsonDeserialize(contentUsing = Condition.ConditionDeserializer.class) List<Condition> conditions
) {
this.conditions = conditions;
}
public List<Condition> getConditions() {
return conditions;
}
public void setConditions(List<Condition> conditions) {
this.conditions = conditions;
}
}
public static class Or extends Connective {
@JsonProperty("or")
private List<Condition> conditions;
@JsonCreator
public Or(
@JsonProperty("or")
@JsonDeserialize(contentUsing = Condition.ConditionDeserializer.class) List<Condition> conditions
) {
this.conditions = conditions;
}
public List<Condition> getConditions() {
return conditions;
}
public void setConditions(List<Condition> conditions) {
this.conditions = conditions;
}
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/DeviceCategory.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.pool.filter;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import ai.toloka.client.v1.FlexibleEnum;
public class DeviceCategory extends FlexibleEnum<DeviceCategory> {
public static final DeviceCategory PERSONAL_COMPUTER = new DeviceCategory("PERSONAL_COMPUTER");
public static final DeviceCategory SMARTPHONE = new DeviceCategory("SMARTPHONE");
public static final DeviceCategory TABLET = new DeviceCategory("TABLET");
private static final DeviceCategory[] VALUES = {PERSONAL_COMPUTER, TABLET, SMARTPHONE};
private static final ConcurrentMap<String, DeviceCategory> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private DeviceCategory(String name) {
super(name);
}
public static DeviceCategory[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), DeviceCategory.class);
}
public static DeviceCategory valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<DeviceCategory>() {
@Override
public DeviceCategory create(String name) {
return new DeviceCategory(name);
}
});
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/Education.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.pool.filter;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import ai.toloka.client.v1.FlexibleEnum;
public class Education extends FlexibleEnum<Education> {
public static final Education BASIC = new Education("BASIC");
public static final Education MIDDLE = new Education("MIDDLE");
public static final Education HIGH = new Education("HIGH");
private static final Education[] VALUES = {BASIC, MIDDLE, HIGH};
private static final ConcurrentMap<String, Education> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private Education(String name) {
super(name);
}
public static Education[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), Education.class);
}
public static Education valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<Education>() {
@Override
public Education create(String name) {
return new Education(name);
}
});
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/Expression.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.pool.filter;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import ai.toloka.client.v1.CountryIso3166;
import ai.toloka.client.v1.LangIso639;
import ai.toloka.client.v1.Region;
public abstract class Expression<K, O, V> extends Condition {
private FilterCategory category;
private K key;
private O operator;
@JsonInclude(JsonInclude.Include.ALWAYS)
private V value;
private Expression(FilterCategory category, K key, O operator, V value) {
this.category = category;
this.key = key;
this.operator = operator;
this.value = value;
}
protected Expression() {
this.category = category;
}
public FilterCategory getCategory() {
return category;
}
public K getKey() {
return key;
}
public O getOperator() {
return operator;
}
public void setOperator(O operator) {
this.operator = operator;
}
public V getValue() {
return value;
}
public void setValue(V value) {
this.value = value;
}
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "key",
visible = true, defaultImpl = RawProfileExpression.class)
@JsonSubTypes({
@JsonSubTypes.Type(value = AdultAllowed.class, name = "adult_allowed"),
@JsonSubTypes.Type(value = Gender.class, name = "gender"),
@JsonSubTypes.Type(value = Country.class, name = "country"),
@JsonSubTypes.Type(value = Citizenship.class, name = "citizenship"),
@JsonSubTypes.Type(value = Education.class, name = "education"),
@JsonSubTypes.Type(value = DateOfBirth.class, name = "date_of_birth"),
@JsonSubTypes.Type(value = City.class, name = "city"),
@JsonSubTypes.Type(value = Languages.class, name = "languages"),
@JsonSubTypes.Type(value = Verified.class, name = "verified")
})
public abstract static class ProfileExpression<O, V> extends Expression<FilterCategory.ProfileKey, O, V> {
private ProfileExpression(FilterCategory.ProfileKey key, O operator, V value) {
super(FilterCategory.PROFILE, key, operator, value);
}
}
public static class AdultAllowed extends ProfileExpression<IdentityOperator, Boolean> {
@JsonCreator
public AdultAllowed(@JsonProperty("operator") IdentityOperator operator, @JsonProperty("value") Boolean value) {
super(FilterCategory.ProfileKey.ADULT_ALLOWED, operator, value);
}
}
public static class Gender
extends ProfileExpression<IdentityOperator, ai.toloka.client.v1.pool.filter.Gender> {
@JsonCreator
public Gender(@JsonProperty("operator") IdentityOperator operator,
@JsonProperty("value") ai.toloka.client.v1.pool.filter.Gender value) {
super(FilterCategory.ProfileKey.GENDER, operator, value);
}
}
public static class Country extends ProfileExpression<IdentityOperator, CountryIso3166> {
@JsonCreator
public Country(@JsonProperty("operator") IdentityOperator operator,
@JsonProperty("value") CountryIso3166 value) {
super(FilterCategory.ProfileKey.COUNTRY, operator, value);
}
}
public static class Citizenship extends ProfileExpression<IdentityOperator, CountryIso3166> {
@JsonCreator
public Citizenship(@JsonProperty("operator") IdentityOperator operator,
@JsonProperty("value") CountryIso3166 value) {
super(FilterCategory.ProfileKey.CITIZENSHIP, operator, value);
}
}
public static class Education
extends ProfileExpression<IdentityOperator, ai.toloka.client.v1.pool.filter.Education> {
@JsonCreator
public Education(@JsonProperty("operator") IdentityOperator operator,
@JsonProperty("value") ai.toloka.client.v1.pool.filter.Education value) {
super(FilterCategory.ProfileKey.EDUCATION, operator, value);
}
}
public static class DateOfBirth extends ProfileExpression<CompareOperator, Long> {
@JsonCreator
public DateOfBirth(@JsonProperty("operator") CompareOperator operator, @JsonProperty("value") Long value) {
super(FilterCategory.ProfileKey.DATE_OF_BIRTH, operator, value);
}
}
public static class City extends ProfileExpression<RegionCompareOperator, Region> {
@JsonCreator
public City(@JsonProperty("operator") RegionCompareOperator operator, @JsonProperty("value") Region value) {
super(FilterCategory.ProfileKey.CITY, operator, value);
}
}
public static class Languages extends ProfileExpression<ArrayInclusionOperator, LangIso639> {
@JsonCreator
public Languages(@JsonProperty("operator") ArrayInclusionOperator operator,
@JsonProperty("value") LangIso639 value) {
super(FilterCategory.ProfileKey.LANGUAGES, operator, value);
}
}
public static class Verified extends ProfileExpression<IdentityOperator, Boolean> {
@JsonCreator
public Verified(@JsonProperty("operator") IdentityOperator operator,
@JsonProperty("value") Boolean value) {
super(FilterCategory.ProfileKey.VERIFIED, operator, value);
}
}
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "key",
visible = true, defaultImpl = RawComputedExpression.class)
@JsonSubTypes({
@JsonSubTypes.Type(value = RegionByPhone.class, name = "region_by_phone"),
@JsonSubTypes.Type(value = RegionByIp.class, name = "region_by_ip"),
@JsonSubTypes.Type(value = DeviceCategory.class, name = "device_category"),
@JsonSubTypes.Type(value = OsFamily.class, name = "os_family"),
@JsonSubTypes.Type(value = OsVersion.class, name = "os_version"),
@JsonSubTypes.Type(value = OsVersionMajor.class, name = "os_version_major"),
@JsonSubTypes.Type(value = OsVersionMinor.class, name = "os_version_minor"),
@JsonSubTypes.Type(value = OsVersionBugfix.class, name = "os_version_bugfix"),
@JsonSubTypes.Type(value = UserAgentType.class, name = "user_agent_type"),
@JsonSubTypes.Type(value = UserAgentFamily.class, name = "user_agent_family"),
@JsonSubTypes.Type(value = UserAgentVersion.class, name = "user_agent_version"),
@JsonSubTypes.Type(value = UserAgentVersionMajor.class, name = "user_agent_version_major"),
@JsonSubTypes.Type(value = UserAgentVersionMinor.class, name = "user_agent_version_minor"),
@JsonSubTypes.Type(value = UserAgentVersionBugfix.class, name = "user_agent_version_bugfix"),
@JsonSubTypes.Type(value = Rating.class, name = "rating")
})
public static class ComputedExpression<O, V> extends Expression<FilterCategory.ComputedKey, O, V> {
private ComputedExpression(FilterCategory.ComputedKey key, O operator, V value) {
super(FilterCategory.COMPUTED, key, operator, value);
}
}
public static class RegionByPhone extends ComputedExpression<RegionCompareOperator, Region> {
@JsonCreator
public RegionByPhone(@JsonProperty("operator") RegionCompareOperator operator,
@JsonProperty("value") Region value) {
super(FilterCategory.ComputedKey.REGION_BY_PHONE, operator, value);
}
}
public static class RegionByIp extends ComputedExpression<RegionCompareOperator, Region> {
@JsonCreator
public RegionByIp(@JsonProperty("operator") RegionCompareOperator operator,
@JsonProperty("value") Region value) {
super(FilterCategory.ComputedKey.REGION_BY_IP, operator, value);
}
}
public static class DeviceCategory
extends ComputedExpression<IdentityOperator, ai.toloka.client.v1.pool.filter.DeviceCategory> {
@JsonCreator
public DeviceCategory(@JsonProperty("operator") IdentityOperator operator,
@JsonProperty("value") ai.toloka.client.v1.pool.filter.DeviceCategory value) {
super(FilterCategory.ComputedKey.DEVICE_CATEGORY, operator, value);
}
}
public static class OsFamily
extends ComputedExpression<IdentityOperator, ai.toloka.client.v1.pool.filter.OsFamily> {
@JsonCreator
public OsFamily(@JsonProperty("operator") IdentityOperator operator,
@JsonProperty("value") ai.toloka.client.v1.pool.filter.OsFamily value) {
super(FilterCategory.ComputedKey.OS_FAMILY, operator, value);
}
}
public static class OsVersion extends ComputedExpression<CompareOperator, Double> {
@JsonCreator
public OsVersion(@JsonProperty("operator") CompareOperator operator, @JsonProperty("value") Double value) {
super(FilterCategory.ComputedKey.OS_VERSION, operator, value);
}
}
public static class OsVersionMajor extends ComputedExpression<CompareOperator, Integer> {
@JsonCreator
public OsVersionMajor(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(FilterCategory.ComputedKey.OS_VERSION_MAJOR, operator, value);
}
}
public static class OsVersionMinor extends ComputedExpression<CompareOperator, Integer> {
@JsonCreator
public OsVersionMinor(
@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value
) {
super(FilterCategory.ComputedKey.OS_VERSION_MINOR, operator, value);
}
}
public static class OsVersionBugfix extends ComputedExpression<CompareOperator, Integer> {
@JsonCreator
public OsVersionBugfix(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(FilterCategory.ComputedKey.OS_VERSION_BUGFIX, operator, value);
}
}
public static class UserAgentType
extends ComputedExpression<IdentityOperator, ai.toloka.client.v1.pool.filter.UserAgentType> {
@JsonCreator
public UserAgentType(@JsonProperty("operator") IdentityOperator operator,
@JsonProperty("value") ai.toloka.client.v1.pool.filter.UserAgentType value) {
super(FilterCategory.ComputedKey.USER_AGENT_TYPE, operator, value);
}
}
public static class UserAgentFamily
extends ComputedExpression<IdentityOperator, ai.toloka.client.v1.pool.filter.UserAgentFamily> {
@JsonCreator
public UserAgentFamily(@JsonProperty("operator") IdentityOperator operator,
@JsonProperty("value") ai.toloka.client.v1.pool.filter.UserAgentFamily value) {
super(FilterCategory.ComputedKey.USER_AGENT_FAMILY, operator, value);
}
}
public static class UserAgentVersion extends ComputedExpression<CompareOperator, Double> {
@JsonCreator
public UserAgentVersion(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Double value) {
super(FilterCategory.ComputedKey.USER_AGENT_VERSION, operator, value);
}
}
public static class UserAgentVersionMajor extends ComputedExpression<CompareOperator, Integer> {
@JsonCreator
public UserAgentVersionMajor(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(FilterCategory.ComputedKey.USER_AGENT_VERSION_MAJOR, operator, value);
}
}
public static class UserAgentVersionMinor extends ComputedExpression<CompareOperator, Integer> {
@JsonCreator
public UserAgentVersionMinor(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(FilterCategory.ComputedKey.USER_AGENT_VERSION_MINOR, operator, value);
}
}
public static class UserAgentVersionBugfix extends ComputedExpression<CompareOperator, Integer> {
@JsonCreator
public UserAgentVersionBugfix(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(FilterCategory.ComputedKey.USER_AGENT_VERSION_BUGFIX, operator, value);
}
}
@Deprecated
public static class Rating extends ComputedExpression<CompareOperator, Double> {
@JsonCreator
public Rating(@JsonProperty("operator") CompareOperator operator, @JsonProperty("value") Double value) {
super(FilterCategory.ComputedKey.RATING, operator, value);
}
}
public static class Skill extends Expression<String, CompareOperator, BigDecimal> {
/**
* @param fakeValue used just to prevent compilation fails on constructor overloading
*/
@JsonCreator
protected Skill(@JsonProperty("key") String skillId, @JsonProperty("operator") CompareOperator operator,
@JsonProperty(value = "___fake_value___", defaultValue = "0") Integer fakeValue,
@JsonProperty("value") BigDecimal exactValue) {
super(FilterCategory.SKILL, skillId, operator, exactValue);
}
/**
* See {@link Skill#valueOf(String, CompareOperator, Integer)}
*/
@Deprecated
public Skill(String skillId, CompareOperator operator, Integer value) {
super(FilterCategory.SKILL, skillId, operator, value == null ? null : BigDecimal.valueOf(value));
}
public static Skill valueOf(String skillId, CompareOperator operator, Integer value) {
return new Skill(skillId, operator, value);
}
public static Skill exactValueOf(String skillId, CompareOperator operator, BigDecimal exactValue) {
return new Skill(skillId, operator, null, exactValue);
}
@JsonIgnore
public String getSkillId() {
return getKey();
}
}
public static class RawProfileExpression extends ProfileExpression<String, Object> {
@JsonCreator
public RawProfileExpression(@JsonProperty("key") FilterCategory.ProfileKey key,
@JsonProperty("operator") String operator,
@JsonProperty("value") Object value) {
super(key, operator, value);
}
}
public static class RawComputedExpression extends ComputedExpression<String, Object> {
@JsonCreator
public RawComputedExpression(@JsonProperty("key") FilterCategory.ComputedKey key,
@JsonProperty("operator") String operator,
@JsonProperty("value") Object value) {
super(key, operator, value);
}
}
public static class RawExpression extends Expression<String, String, Object> {
@JsonCreator
public RawExpression(@JsonProperty("category") FilterCategory category,
@JsonProperty("key") String key,
@JsonProperty("operator") String operator,
@JsonProperty("value") Object value) {
super(category, key, operator, value);
}
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/FilterCategory.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.pool.filter;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import com.fasterxml.jackson.annotation.JsonCreator;
import ai.toloka.client.v1.FlexibleEnum;
public class FilterCategory extends FlexibleEnum<FilterCategory> {
public static final FilterCategory PROFILE = new FilterCategory("profile");
public static final FilterCategory COMPUTED = new FilterCategory("computed");
public static final FilterCategory SKILL = new FilterCategory("skill");
private static final FilterCategory[] VALUES = {PROFILE, COMPUTED, SKILL};
private static final ConcurrentMap<String, FilterCategory> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private FilterCategory(String name) {
super(name);
}
public static FilterCategory[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), FilterCategory.class);
}
@JsonCreator
public static FilterCategory valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<FilterCategory>() {
@Override
public FilterCategory create(String name) {
return new FilterCategory(name);
}
});
}
public static class ProfileKey extends FlexibleEnum<ProfileKey> {
public static final ProfileKey GENDER = new ProfileKey("gender");
public static final ProfileKey COUNTRY = new ProfileKey("country");
public static final ProfileKey CITIZENSHIP = new ProfileKey("citizenship");
public static final ProfileKey EDUCATION = new ProfileKey("education");
public static final ProfileKey ADULT_ALLOWED = new ProfileKey("adult_allowed");
public static final ProfileKey DATE_OF_BIRTH = new ProfileKey("date_of_birth");
public static final ProfileKey CITY = new ProfileKey("city");
public static final ProfileKey LANGUAGES = new ProfileKey("languages");
public static final ProfileKey VERIFIED = new ProfileKey("verified");
private static final ProfileKey[] VALUES =
{GENDER, COUNTRY, CITIZENSHIP, EDUCATION, ADULT_ALLOWED, DATE_OF_BIRTH, CITY, LANGUAGES, VERIFIED};
private static final ConcurrentMap<String, ProfileKey> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private ProfileKey(String name) {
super(name);
}
public static ProfileKey[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), ProfileKey.class);
}
@JsonCreator
public static ProfileKey valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<ProfileKey>() {
@Override
public ProfileKey create(String name) {
return new ProfileKey(name);
}
});
}
}
public static class ComputedKey extends FlexibleEnum<ComputedKey> {
public static final ComputedKey REGION_BY_PHONE = new ComputedKey("region_by_phone");
public static final ComputedKey REGION_BY_IP = new ComputedKey("region_by_ip");
public static final ComputedKey RATING = new ComputedKey("rating");
public static final ComputedKey DEVICE_CATEGORY = new ComputedKey("device_category");
public static final ComputedKey OS_FAMILY = new ComputedKey("os_family");
public static final ComputedKey OS_VERSION = new ComputedKey("os_version");
public static final ComputedKey USER_AGENT_TYPE = new ComputedKey("user_agent_type");
public static final ComputedKey USER_AGENT_FAMILY = new ComputedKey("user_agent_family");
public static final ComputedKey USER_AGENT_VERSION = new ComputedKey("user_agent_version");
public static final ComputedKey OS_VERSION_MAJOR = new ComputedKey("os_version_major");
public static final ComputedKey OS_VERSION_MINOR = new ComputedKey("os_version_minor");
public static final ComputedKey OS_VERSION_BUGFIX = new ComputedKey("os_version_bugfix");
public static final ComputedKey USER_AGENT_VERSION_MAJOR = new ComputedKey("user_agent_version_major");
public static final ComputedKey USER_AGENT_VERSION_MINOR = new ComputedKey("user_agent_version_minor");
public static final ComputedKey USER_AGENT_VERSION_BUGFIX = new ComputedKey("user_agent_version_bugfix");
private static final ComputedKey[] VALUES = {
REGION_BY_PHONE, REGION_BY_IP,
RATING,
DEVICE_CATEGORY,
OS_FAMILY, OS_VERSION,
USER_AGENT_TYPE, USER_AGENT_FAMILY, USER_AGENT_VERSION,
OS_VERSION_MAJOR, OS_VERSION_MINOR, OS_VERSION_BUGFIX,
USER_AGENT_VERSION_MAJOR, USER_AGENT_VERSION_MINOR, USER_AGENT_VERSION_BUGFIX
};
private static final ConcurrentMap<String, ComputedKey> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private ComputedKey(String name) {
super(name);
}
public static ComputedKey[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), ComputedKey.class);
}
@JsonCreator
public static ComputedKey valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<ComputedKey>() {
@Override
public ComputedKey create(String name) {
return new ComputedKey(name);
}
});
}
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/Gender.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.pool.filter;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import ai.toloka.client.v1.FlexibleEnum;
public class Gender extends FlexibleEnum<Gender> {
public static final Gender MALE = new Gender("MALE");
public static final Gender FEMALE = new Gender("FEMALE");
public static final Gender OTHER = new Gender("OTHER");
private static final Gender[] VALUES = {MALE, FEMALE, OTHER};
private static final ConcurrentMap<String, Gender> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private Gender(String name) {
super(name);
}
public static Gender[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), Gender.class);
}
public static Gender valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<Gender>() {
@Override
public Gender create(String name) {
return new Gender(name);
}
});
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/IdentityOperator.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.pool.filter;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import ai.toloka.client.v1.FlexibleEnum;
public class IdentityOperator extends FlexibleEnum<IdentityOperator> {
public static final IdentityOperator EQ = new IdentityOperator("EQ");
public static final IdentityOperator NE = new IdentityOperator("NE");
private static final IdentityOperator[] VALUES = {EQ, NE};
private static final ConcurrentMap<String, IdentityOperator> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private IdentityOperator(String name) {
super(name);
}
public static IdentityOperator[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), IdentityOperator.class);
}
public static IdentityOperator valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<IdentityOperator>() {
@Override
public IdentityOperator create(String name) {
return new IdentityOperator(name);
}
});
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/OsFamily.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.pool.filter;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import ai.toloka.client.v1.FlexibleEnum;
public class OsFamily extends FlexibleEnum<OsFamily> {
public static final OsFamily WINDOWS = new OsFamily("WINDOWS");
public static final OsFamily OS_X = new OsFamily("OS_X");
public static final OsFamily MAC_OS = new OsFamily("MAC_OS");
public static final OsFamily LINUX = new OsFamily("LINUX");
public static final OsFamily BSD = new OsFamily("BSD");
public static final OsFamily ANDROID = new OsFamily("ANDROID");
public static final OsFamily IOS = new OsFamily("IOS");
public static final OsFamily BLACKBERRY = new OsFamily("BLACKBERRY");
private static final OsFamily[] VALUES = {WINDOWS, OS_X, MAC_OS, LINUX, BSD, ANDROID, IOS, BLACKBERRY};
private static final ConcurrentMap<String, OsFamily> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private OsFamily(String name) {
super(name);
}
public static OsFamily[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), OsFamily.class);
}
public static OsFamily valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<OsFamily>() {
@Override
public OsFamily create(String name) {
return new OsFamily(name);
}
});
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/RegionCompareOperator.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.pool.filter;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import ai.toloka.client.v1.FlexibleEnum;
public class RegionCompareOperator extends FlexibleEnum<RegionCompareOperator> {
public static final RegionCompareOperator IN = new RegionCompareOperator("IN");
public static final RegionCompareOperator NOT_IN = new RegionCompareOperator("NOT_IN");
private static final RegionCompareOperator[] VALUES = {IN, NOT_IN};
private static final ConcurrentMap<String, RegionCompareOperator> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private RegionCompareOperator(String name) {
super(name);
}
public static RegionCompareOperator[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), RegionCompareOperator.class);
}
public static RegionCompareOperator valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<RegionCompareOperator>() {
@Override
public RegionCompareOperator create(String name) {
return new RegionCompareOperator(name);
}
});
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/UserAgentFamily.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.pool.filter;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import ai.toloka.client.v1.FlexibleEnum;
public class UserAgentFamily extends FlexibleEnum<UserAgentFamily> {
public static final UserAgentFamily IE = new UserAgentFamily("IE");
public static final UserAgentFamily CHROMIUM = new UserAgentFamily("CHROMIUM");
public static final UserAgentFamily CHROME = new UserAgentFamily("CHROME");
public static final UserAgentFamily FIREFOX = new UserAgentFamily("FIREFOX");
public static final UserAgentFamily SAFARI = new UserAgentFamily("SAFARI");
public static final UserAgentFamily YANDEX_BROWSER = new UserAgentFamily("YANDEX_BROWSER");
public static final UserAgentFamily IE_MOBILE = new UserAgentFamily("IE_MOBILE");
public static final UserAgentFamily CHROME_MOBILE = new UserAgentFamily("CHROME_MOBILE");
public static final UserAgentFamily MOBILE_FIREFOX = new UserAgentFamily("MOBILE_FIREFOX");
public static final UserAgentFamily MOBILE_SAFARI = new UserAgentFamily("MOBILE_SAFARI");
private static final UserAgentFamily[] VALUES = {
IE, CHROMIUM, CHROME, FIREFOX, SAFARI, YANDEX_BROWSER,
IE_MOBILE, CHROME_MOBILE, MOBILE_FIREFOX, MOBILE_SAFARI
};
private static final ConcurrentMap<String, UserAgentFamily> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private UserAgentFamily(String name) {
super(name);
}
public static UserAgentFamily[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), UserAgentFamily.class);
}
public static UserAgentFamily valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<UserAgentFamily>() {
@Override
public UserAgentFamily create(String name) {
return new UserAgentFamily(name);
}
});
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/filter/UserAgentType.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.pool.filter;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import ai.toloka.client.v1.FlexibleEnum;
public class UserAgentType extends FlexibleEnum<UserAgentType> {
public static final UserAgentType BROWSER = new UserAgentType("BROWSER");
public static final UserAgentType MOBILE_BROWSER = new UserAgentType("MOBIL_BROWSER");
public static final UserAgentType OTHER = new UserAgentType("OTHER");
private static final UserAgentType[] VALUES = {BROWSER, MOBILE_BROWSER, OTHER};
private static final ConcurrentMap<String, UserAgentType> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private UserAgentType(String name) {
super(name);
}
public static UserAgentType[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), UserAgentType.class);
}
public static UserAgentType valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<UserAgentType>() {
@Override
public UserAgentType create(String name) {
return new UserAgentType(name);
}
});
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/qualitycontrol/CaptchaFrequency.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.pool.qualitycontrol;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import ai.toloka.client.v1.FlexibleEnum;
public class CaptchaFrequency extends FlexibleEnum<CaptchaFrequency> {
public static final CaptchaFrequency LOW = new CaptchaFrequency("LOW");
public static final CaptchaFrequency MEDIUM = new CaptchaFrequency("MEDIUM");
public static final CaptchaFrequency HIGH = new CaptchaFrequency("HIGH");
private static final CaptchaFrequency[] VALUES = {LOW, MEDIUM, HIGH};
private static final ConcurrentMap<String, CaptchaFrequency> DISCOVERED_VALUES = new ConcurrentHashMap<>();
public static CaptchaFrequency[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), CaptchaFrequency.class);
}
public static CaptchaFrequency valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<CaptchaFrequency>() {
@Override
public CaptchaFrequency create(String name) {
return new CaptchaFrequency(name);
}
});
}
private CaptchaFrequency(String name) {
super(name);
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/qualitycontrol/CheckpointsConfig.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.pool.qualitycontrol;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import ai.toloka.client.v1.pool.TaskDistributionFunction;
public class CheckpointsConfig {
@JsonProperty("real_settings")
private Settings realSettings;
@JsonProperty("golden_settings")
private Settings goldenSettings;
@JsonProperty("training_settings")
private Settings trainingSettings;
public Settings getRealSettings() {
return realSettings;
}
public void setRealSettings(Settings realSettings) {
this.realSettings = realSettings;
}
public Settings getGoldenSettings() {
return goldenSettings;
}
public void setGoldenSettings(Settings goldenSettings) {
this.goldenSettings = goldenSettings;
}
public Settings getTrainingSettings() {
return trainingSettings;
}
public void setTrainingSettings(Settings trainingSettings) {
this.trainingSettings = trainingSettings;
}
public static class Settings {
@JsonProperty("target_overlap")
private Integer targetOverlap;
@JsonProperty("task_distribution_function")
private TaskDistributionFunction taskDistributionFunction;
@JsonCreator
public Settings(@JsonProperty("target_overlap") Integer targetOverlap,
@JsonProperty("task_distribution_function") TaskDistributionFunction taskDistributionFunction) {
this.targetOverlap = targetOverlap;
this.taskDistributionFunction = taskDistributionFunction;
}
public Integer getTargetOverlap() {
return targetOverlap;
}
public void setTargetOverlap(Integer targetOverlap) {
this.targetOverlap = targetOverlap;
}
public TaskDistributionFunction getTaskDistributionFunction() {
return taskDistributionFunction;
}
public void setTaskDistributionFunction(TaskDistributionFunction taskDistributionFunction) {
this.taskDistributionFunction = taskDistributionFunction;
}
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/qualitycontrol/CollectorConfig.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.pool.qualitycontrol;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import com.fasterxml.jackson.annotation.JsonCreator;
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 = "type",
visible = true, defaultImpl = CollectorConfig.Unknown.class)
@JsonSubTypes({
@JsonSubTypes.Type(value = CollectorConfig.GoldenSet.class, name = "GOLDEN_SET"),
@JsonSubTypes.Type(value = CollectorConfig.MajorityVote.class, name = "MAJORITY_VOTE"),
@JsonSubTypes.Type(value = CollectorConfig.Captcha.class, name = "CAPTCHA"),
@JsonSubTypes.Type(value = CollectorConfig.Income.class, name = "INCOME"),
@JsonSubTypes.Type(value = CollectorConfig.SkippedInRowAssignments.class, name = "SKIPPED_IN_ROW_ASSIGNMENTS"),
@JsonSubTypes.Type(value = CollectorConfig.AnswerCount.class, name = "ANSWER_COUNT"),
@JsonSubTypes.Type(value = CollectorConfig.AssignmentSubmitTime.class, name = "ASSIGNMENT_SUBMIT_TIME"),
@JsonSubTypes.Type(value = CollectorConfig.AcceptanceRate.class, name = "ACCEPTANCE_RATE"),
@JsonSubTypes.Type(value = CollectorConfig.AssignmentsAssessment.class, name = "ASSIGNMENTS_ASSESSMENT"),
@JsonSubTypes.Type(value = CollectorConfig.UsersAssessment.class, name = "USERS_ASSESSMENT"),
@JsonSubTypes.Type(value = CollectorConfig.Training.class, name = "TRAINING")
})
public abstract class CollectorConfig<P> {
protected UUID uuid;
private final CollectorConfigType type;
private P parameters;
private CollectorConfig(CollectorConfigType type) {
this.type = type;
}
private CollectorConfig(CollectorConfigType type, P parameters) {
this.type = type;
this.parameters = parameters;
}
public CollectorConfigType getType() {
return type;
}
public UUID getUuid() {
return uuid;
}
public P getParameters() {
return parameters;
}
public void setParameters(P parameters) {
this.parameters = parameters;
}
public static class GoldenSet extends CollectorConfig<GoldenSet.Parameters> {
private static final Set<RuleConditionKey> OUTPUT_FIELDS =
Collections.unmodifiableSet(new HashSet<RuleConditionKey>() {{
add(RuleConditionKey.TOTAL_ANSWERS_COUNT);
add(RuleConditionKey.CORRECT_ANSWERS_RATE);
add(RuleConditionKey.INCORRECT_ANSWERS_RATE);
add(RuleConditionKey.GOLDEN_SET_ANSWERS_COUNT);
add(RuleConditionKey.GOLDEN_SET_CORRECT_ANSWERS_RATE);
add(RuleConditionKey.GOLDEN_SET_INCORRECT_ANSWERS_RATE);
}}
);
public GoldenSet() {
super(CollectorConfigType.GOLDEN_SET);
}
@JsonCreator
public GoldenSet(@JsonProperty("parameters") GoldenSet.Parameters parameters) {
super(CollectorConfigType.GOLDEN_SET, parameters);
}
public static Set<RuleConditionKey> outputFields() {
return OUTPUT_FIELDS;
}
public static class Parameters {
@JsonProperty("history_size")
private Integer historySize;
public Integer getHistorySize() {
return historySize;
}
public void setHistorySize(Integer historySize) {
this.historySize = historySize;
}
}
}
public static class MajorityVote extends CollectorConfig<MajorityVote.Parameters> {
private static final Set<RuleConditionKey> OUTPUT_FIELDS =
Collections.unmodifiableSet(new HashSet<RuleConditionKey>() {{
add(RuleConditionKey.TOTAL_ANSWERS_COUNT);
add(RuleConditionKey.CORRECT_ANSWERS_RATE);
add(RuleConditionKey.INCORRECT_ANSWERS_RATE);
}}
);
@JsonCreator
public MajorityVote(@JsonProperty("parameters") Parameters parameters) {
super(CollectorConfigType.MAJORITY_VOTE, parameters);
}
public static Set<RuleConditionKey> outputFields() {
return OUTPUT_FIELDS;
}
public static class Parameters {
@JsonProperty("answer_threshold")
private Integer answerThreshold;
@JsonProperty("history_size")
private Integer historySize;
@JsonCreator
public Parameters(@JsonProperty("answer_threshold") Integer answerThreshold) {
this.answerThreshold = answerThreshold;
}
public Integer getAnswerThreshold() {
return answerThreshold;
}
public void setAnswerThreshold(Integer answerThreshold) {
this.answerThreshold = answerThreshold;
}
public Integer getHistorySize() {
return historySize;
}
public void setHistorySize(Integer historySize) {
this.historySize = historySize;
}
}
}
public static class Captcha extends CollectorConfig<Captcha.Parameters> {
private static final Set<RuleConditionKey> OUTPUT_FIELDS =
Collections.unmodifiableSet(new HashSet<RuleConditionKey>() {{
add(RuleConditionKey.STORED_RESULTS_COUNT);
add(RuleConditionKey.SUCCESS_RATE);
add(RuleConditionKey.FAIL_RATE);
}}
);
@JsonCreator
public Captcha(@JsonProperty("parameters") Captcha.Parameters parameters) {
super(CollectorConfigType.CAPTCHA, parameters);
}
public static Set<RuleConditionKey> outputFields() {
return OUTPUT_FIELDS;
}
public static class Parameters {
@JsonProperty("history_size")
private Integer historySize;
@JsonCreator
public Parameters(@JsonProperty("history_size") Integer historySize) {
this.historySize = historySize;
}
public Integer getHistorySize() {
return historySize;
}
public void setHistorySize(Integer historySize) {
this.historySize = historySize;
}
}
}
public static class Income extends CollectorConfig<Income.Parameters> {
private static final Set<RuleConditionKey> OUTPUT_FIELDS =
Collections.unmodifiableSet(new HashSet<RuleConditionKey>() {{
add(RuleConditionKey.INCOME_SUM_FOR_LAST_24_HOURS);
}}
);
public Income() {
super(CollectorConfigType.INCOME);
}
@JsonCreator
public Income(@JsonProperty("parameters") Parameters parameters) {
super(CollectorConfigType.INCOME, parameters);
}
public static Set<RuleConditionKey> outputFields() {
return OUTPUT_FIELDS;
}
public static class Parameters {}
}
public static class SkippedInRowAssignments extends CollectorConfig<SkippedInRowAssignments.Parameters> {
private static final Set<RuleConditionKey> OUTPUT_FIELDS =
Collections.unmodifiableSet(new HashSet<RuleConditionKey>() {{
add(RuleConditionKey.SKIPPED_IN_ROW_COUNT);
}}
);
public SkippedInRowAssignments() {
super(CollectorConfigType.SKIPPED_IN_ROW_ASSIGNMENTS);
}
@JsonCreator
public SkippedInRowAssignments(@JsonProperty("parameters") Parameters parameters) {
super(CollectorConfigType.SKIPPED_IN_ROW_ASSIGNMENTS, parameters);
}
public static Set<RuleConditionKey> outputFields() {
return OUTPUT_FIELDS;
}
public static class Parameters {}
}
public static class AnswerCount extends CollectorConfig<AnswerCount.Parameters> {
private static final Set<RuleConditionKey> OUTPUT_FIELDS =
Collections.unmodifiableSet(new HashSet<RuleConditionKey>() {{
add(RuleConditionKey.ASSIGNMENTS_ACCEPTED_COUNT);
}}
);
public AnswerCount() {
super(CollectorConfigType.ANSWER_COUNT);
}
@JsonCreator
public AnswerCount(@JsonProperty("parameters") Parameters parameters) {
super(CollectorConfigType.ANSWER_COUNT, parameters);
}
public static Set<RuleConditionKey> outputFields() {
return OUTPUT_FIELDS;
}
public static class Parameters {}
}
public static class AssignmentSubmitTime extends CollectorConfig<AssignmentSubmitTime.Parameters> {
private static final Set<RuleConditionKey> OUTPUT_FIELDS =
Collections.unmodifiableSet(new HashSet<RuleConditionKey>() {{
add(RuleConditionKey.TOTAL_SUBMITTED_COUNT);
add(RuleConditionKey.FAST_SUBMITTED_COUNT);
}}
);
@JsonCreator
public AssignmentSubmitTime(@JsonProperty("parameters") Parameters parameters) {
super(CollectorConfigType.ASSIGNMENT_SUBMIT_TIME, parameters);
}
public static Set<RuleConditionKey> outputFields() {
return OUTPUT_FIELDS;
}
public static class Parameters {
@JsonProperty("history_size")
private Integer historySize;
@JsonProperty("fast_submit_threshold_seconds")
private Integer fastSubmitThresholdSeconds;
@JsonCreator
public Parameters(@JsonProperty("history_size") Integer historySize,
@JsonProperty("fast_submit_threshold_seconds") Integer fastSubmitThresholdSeconds) {
this.historySize = historySize;
this.fastSubmitThresholdSeconds = fastSubmitThresholdSeconds;
}
public Integer getHistorySize() {
return historySize;
}
public void setHistorySize(Integer historySize) {
this.historySize = historySize;
}
public Integer getFastSubmitThresholdSeconds() {
return fastSubmitThresholdSeconds;
}
public void setFastSubmitThresholdSeconds(Integer fastSubmitThresholdSeconds) {
this.fastSubmitThresholdSeconds = fastSubmitThresholdSeconds;
}
}
}
public static class AcceptanceRate extends CollectorConfig<AcceptanceRate.Parameters> {
private static final Set<RuleConditionKey> OUTPUT_FIELDS =
Collections.unmodifiableSet(new HashSet<RuleConditionKey>() {{
add(RuleConditionKey.TOTAL_ASSIGNMENTS_COUNT);
add(RuleConditionKey.ACCEPTED_ASSIGNMENTS_RATE);
add(RuleConditionKey.REJECTED_ASSIGNMENTS_RATE);
}}
);
public AcceptanceRate() {
super(CollectorConfigType.ACCEPTANCE_RATE);
}
@JsonCreator
public AcceptanceRate(@JsonProperty("parameters") Parameters parameters) {
super(CollectorConfigType.ACCEPTANCE_RATE, parameters);
}
public static Set<RuleConditionKey> outputFields() {
return OUTPUT_FIELDS;
}
public static class Parameters {}
}
public static class AssignmentsAssessment extends CollectorConfig<AssignmentsAssessment.Parameters> {
private static final Set<RuleConditionKey> OUTPUT_FIELDS =
Collections.unmodifiableSet(new HashSet<RuleConditionKey>() {{
add(RuleConditionKey.PENDING_ASSIGNMENTS_COUNT);
add(RuleConditionKey.ACCEPTED_ASSIGNMENTS_COUNT);
add(RuleConditionKey.REJECTED_ASSIGNMENTS_COUNT);
add(RuleConditionKey.ASSESSMENT_EVENT);
}}
);
public AssignmentsAssessment() {
super(CollectorConfigType.ASSIGNMENTS_ASSESSMENT);
}
@JsonCreator
public AssignmentsAssessment(@JsonProperty("parameters") Parameters parameters) {
super(CollectorConfigType.ASSIGNMENTS_ASSESSMENT, parameters);
}
public static Set<RuleConditionKey> outputFields() {
return OUTPUT_FIELDS;
}
public static class Parameters {}
}
public static class UsersAssessment extends CollectorConfig<UsersAssessment.Parameters> {
private static final Set<RuleConditionKey> OUTPUT_FIELDS =
Collections.unmodifiableSet(new HashSet<RuleConditionKey>() {{
add(RuleConditionKey.POOL_ACCESS_REVOKED_REASON);
add(RuleConditionKey.SKILL_ID);
}}
);
public UsersAssessment() {
super(CollectorConfigType.USERS_ASSESSMENT);
}
@JsonCreator
public UsersAssessment(@JsonProperty("parameters") Parameters parameters) {
super(CollectorConfigType.USERS_ASSESSMENT, parameters);
}
public static Set<RuleConditionKey> outputFields() {
return OUTPUT_FIELDS;
}
public static class Parameters {}
}
public static class Training extends CollectorConfig<Training.Parameters> {
private static final Set<RuleConditionKey> OUTPUT_FIELDS =
Collections.unmodifiableSet(new HashSet<RuleConditionKey>() {{
add(RuleConditionKey.SUBMITTED_ASSIGNMENTS_COUNT);
add(RuleConditionKey.TOTAL_ANSWERS_COUNT);
add(RuleConditionKey.CORRECT_ANSWERS_RATE);
add(RuleConditionKey.INCORRECT_ANSWERS_RATE);
add(RuleConditionKey.NEXT_ASSIGNMENT_AVAILABLE);
}}
);
public Training() {
super(CollectorConfigType.TRAINING);
}
@JsonCreator
public Training(@JsonProperty("parameters") Parameters parameters) {
super(CollectorConfigType.TRAINING, parameters);
}
public static Set<RuleConditionKey> outputFields() {
return OUTPUT_FIELDS;
}
public static class Parameters {}
}
public static class Unknown extends CollectorConfig<Map<String, Object>> {
@JsonCreator
public Unknown(@JsonProperty("type") CollectorConfigType type) {
super(type);
}
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/qualitycontrol/CollectorConfigType.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.pool.qualitycontrol;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import ai.toloka.client.v1.FlexibleEnum;
public class CollectorConfigType extends FlexibleEnum<CollectorConfigType> {
public static final CollectorConfigType GOLDEN_SET = new CollectorConfigType("GOLDEN_SET");
public static final CollectorConfigType MAJORITY_VOTE = new CollectorConfigType("MAJORITY_VOTE");
public static final CollectorConfigType CAPTCHA = new CollectorConfigType("CAPTCHA");
public static final CollectorConfigType INCOME = new CollectorConfigType("INCOME");
public static final CollectorConfigType SKIPPED_IN_ROW_ASSIGNMENTS =
new CollectorConfigType("SKIPPED_IN_ROW_ASSIGNMENTS");
public static final CollectorConfigType ANSWER_COUNT = new CollectorConfigType("ANSWER_COUNT");
public static final CollectorConfigType ASSIGNMENT_SUBMIT_TIME = new CollectorConfigType("ASSIGNMENT_SUBMIT_TIME");
public static final CollectorConfigType ACCEPTANCE_RATE = new CollectorConfigType("ACCEPTANCE_RATE");
public static final CollectorConfigType ASSIGNMENTS_ASSESSMENT = new CollectorConfigType("ASSIGNMENTS_ASSESSMENT");
public static final CollectorConfigType USERS_ASSESSMENT = new CollectorConfigType("USERS_ASSESSMENT");
public static final CollectorConfigType TRAINING = new CollectorConfigType("TRAINING");
private static final CollectorConfigType[] VALUES = {
GOLDEN_SET, MAJORITY_VOTE, CAPTCHA, INCOME, SKIPPED_IN_ROW_ASSIGNMENTS, ANSWER_COUNT,
ASSIGNMENT_SUBMIT_TIME, ACCEPTANCE_RATE, ASSIGNMENTS_ASSESSMENT, USERS_ASSESSMENT, TRAINING
};
private static final ConcurrentMap<String, CollectorConfigType> DISCOVERED_VALUES = new ConcurrentHashMap<>();
public static CollectorConfigType[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), CollectorConfigType.class);
}
public static CollectorConfigType valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<CollectorConfigType>() {
@Override public CollectorConfigType create(String name) {
return new CollectorConfigType(name);
}
});
}
private CollectorConfigType(String name) {
super(name);
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/qualitycontrol/QualityControl.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.pool.qualitycontrol;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class QualityControl {
@JsonProperty("captcha_frequency")
private CaptchaFrequency captchaFrequency;
@JsonProperty("checkpoints_config")
private CheckpointsConfig checkpointsConfig;
@JsonProperty("training_requirement")
private TrainingRequirement trainingRequirement;
private List<QualityControlConfig> configs;
@JsonCreator
public QualityControl(@JsonProperty("configs") List<QualityControlConfig> configs) {
this.configs = configs;
}
public CaptchaFrequency getCaptchaFrequency() {
return captchaFrequency;
}
public void setCaptchaFrequency(CaptchaFrequency captchaFrequency) {
this.captchaFrequency = captchaFrequency;
}
public CheckpointsConfig getCheckpointsConfig() {
return checkpointsConfig;
}
public void setCheckpointsConfig(CheckpointsConfig checkpointsConfig) {
this.checkpointsConfig = checkpointsConfig;
}
public TrainingRequirement getTrainingRequirement() {
return trainingRequirement;
}
public void setTrainingRequirement(TrainingRequirement trainingRequirement) {
this.trainingRequirement = trainingRequirement;
}
public List<QualityControlConfig> getConfigs() {
return configs;
}
public void setConfigs(List<QualityControlConfig> configs) {
this.configs = configs;
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/qualitycontrol/QualityControlConfig.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.pool.qualitycontrol;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class QualityControlConfig {
@JsonProperty("collector_config")
private CollectorConfig collectorConfig;
private List<RuleConfig> rules;
@JsonCreator
public QualityControlConfig(@JsonProperty("collector_config") CollectorConfig<?> collectorConfig,
@JsonProperty("rules") List<RuleConfig> rules) {
this.collectorConfig = collectorConfig;
this.rules = rules;
}
public CollectorConfig<?> getCollectorConfig() {
return collectorConfig;
}
public void setCollectorConfig(CollectorConfig<?> collectorConfig) {
this.collectorConfig = collectorConfig;
}
public List<RuleConfig> getRules() {
return rules;
}
public void setRules(List<RuleConfig> rules) {
this.rules = rules;
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/qualitycontrol/RuleAction.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.pool.qualitycontrol;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import ai.toloka.client.v1.userrestriction.DurationUnit;
import ai.toloka.client.v1.userrestriction.UserRestrictionScope;
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type",
visible = true, defaultImpl = RuleAction.Unknown.class)
@JsonSubTypes({
@JsonSubTypes.Type(value = RuleAction.Restriction.class, name = "RESTRICTION"),
@JsonSubTypes.Type(value = RuleAction.RestrictionV2.class, name = "RESTRICTION_V2"),
@JsonSubTypes.Type(value = RuleAction.SetSkillFromOutputField.class, name = "SET_SKILL_FROM_OUTPUT_FIELD"),
@JsonSubTypes.Type(value = RuleAction.ChangeOverlap.class, name = "CHANGE_OVERLAP"),
@JsonSubTypes.Type(value = RuleAction.SetSkill.class, name = "SET_SKILL"),
@JsonSubTypes.Type(value = RuleAction.RejectAllAssignments.class, name = "REJECT_ALL_ASSIGNMENTS"),
@JsonSubTypes.Type(value = RuleAction.ApproveAllAssignments.class, name = "APPROVE_ALL_ASSIGNMENTS")
})
public abstract class RuleAction<P> {
private final RuleActionType type;
private P parameters;
private RuleAction(RuleActionType type) {
this.type = type;
}
private RuleAction(RuleActionType type, P parameters) {
this.type = type;
this.parameters = parameters;
}
public RuleActionType getType() {
return type;
}
public P getParameters() {
return parameters;
}
public void setParameters(P parameters) {
this.parameters = parameters;
}
/**
* See {@link RuleAction.RestrictionV2}
*/
@Deprecated
public static class Restriction extends RuleAction<Restriction.Parameters> {
@JsonCreator
public Restriction(@JsonProperty("parameters") Restriction.Parameters parameters) {
super(RuleActionType.RESTRICTION, parameters);
}
public static class Parameters {
private UserRestrictionScope scope;
@JsonProperty("duration_days")
private Integer durationDays;
@JsonProperty("private_comment")
private String privateComment;
@JsonCreator
public Parameters(@JsonProperty("scope") UserRestrictionScope scope) {
this.scope = scope;
}
public Parameters(UserRestrictionScope scope, Integer durationDays, String privateComment) {
this.scope = scope;
this.durationDays = durationDays;
this.privateComment = privateComment;
}
public UserRestrictionScope getScope() {
return scope;
}
public void setScope(UserRestrictionScope scope) {
this.scope = scope;
}
public Integer getDurationDays() {
return durationDays;
}
public void setDurationDays(Integer durationDays) {
this.durationDays = durationDays;
}
public String getPrivateComment() {
return privateComment;
}
public void setPrivateComment(String privateComment) {
this.privateComment = privateComment;
}
}
}
public static class RestrictionV2 extends RuleAction<RestrictionV2.Parameters> {
@JsonCreator
public RestrictionV2(@JsonProperty("parameters") RestrictionV2.Parameters parameters) {
super(RuleActionType.RESTRICTION_V2, parameters);
}
public static class Parameters {
private UserRestrictionScope scope;
@JsonProperty("duration")
private Integer duration;
@JsonProperty("duration_unit")
private DurationUnit durationUnit;
@JsonProperty("private_comment")
private String privateComment;
@JsonCreator
public Parameters(@JsonProperty("scope") UserRestrictionScope scope) {
this.scope = scope;
}
public Parameters(
UserRestrictionScope scope,
Integer duration,
DurationUnit durationUnit,
String privateComment
) {
this.scope = scope;
this.duration = duration;
this.durationUnit = durationUnit;
this.privateComment = privateComment;
}
public UserRestrictionScope getScope() {
return scope;
}
public void setScope(UserRestrictionScope scope) {
this.scope = scope;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
public DurationUnit getDurationUnit() {
return durationUnit;
}
public void setDurationUnit(DurationUnit durationUnit) {
this.durationUnit = durationUnit;
}
public String getPrivateComment() {
return privateComment;
}
public void setPrivateComment(String privateComment) {
this.privateComment = privateComment;
}
}
}
public static class SetSkillFromOutputField extends RuleAction<SetSkillFromOutputField.Parameters> {
@JsonCreator
public SetSkillFromOutputField(@JsonProperty("parameters") SetSkillFromOutputField.Parameters parameters) {
super(RuleActionType.SET_SKILL_FROM_OUTPUT_FIELD, parameters);
}
public static class Parameters {
@JsonProperty("skill_id")
private String skillId;
@JsonProperty("from_field")
private RuleConditionKey fromField;
@JsonCreator
public Parameters(@JsonProperty("skill_id") String skillId,
@JsonProperty("from_field") RuleConditionKey fromField) {
this.skillId = skillId;
this.fromField = fromField;
}
public String getSkillId() {
return skillId;
}
public void setSkillId(String skillId) {
this.skillId = skillId;
}
public RuleConditionKey getFromField() {
return fromField;
}
public void setFromField(RuleConditionKey fromField) {
this.fromField = fromField;
}
}
}
public static class ChangeOverlap extends RuleAction<ChangeOverlap.Parameters> {
@JsonCreator
public ChangeOverlap(@JsonProperty("parameters") Parameters parameters) {
super(RuleActionType.CHANGE_OVERLAP, parameters);
}
public static class Parameters {
private Integer delta;
@JsonProperty("open_pool")
private Boolean openPool;
@JsonCreator
public Parameters(@JsonProperty("delta") Integer delta) {
this.delta = delta;
}
public Parameters(Integer delta, Boolean openPool) {
this.delta = delta;
this.openPool = openPool;
}
public Integer getDelta() {
return delta;
}
public void setDelta(Integer delta) {
this.delta = delta;
}
public Boolean getOpenPool() {
return openPool;
}
public void setOpenPool(Boolean openPool) {
this.openPool = openPool;
}
}
}
public static class SetSkill extends RuleAction<SetSkill.Parameters> {
@JsonCreator
public SetSkill(@JsonProperty("parameters") Parameters parameters) {
super(RuleActionType.SET_SKILL, parameters);
}
public static class Parameters {
@JsonProperty("skill_id")
private String skillId;
@JsonProperty("skill_value")
private Integer skillValue;
@JsonCreator
public Parameters(@JsonProperty("skill_id") String skillId,
@JsonProperty("skill_value") Integer skillValue) {
this.skillId = skillId;
this.skillValue = skillValue;
}
public String getSkillId() {
return skillId;
}
public void setSkillId(String skillId) {
this.skillId = skillId;
}
public Integer getSkillValue() {
return skillValue;
}
public void setSkillValue(Integer skillValue) {
this.skillValue = skillValue;
}
}
}
@Deprecated
public static class RejectAllAssignments extends RuleAction<RejectAllAssignments.Parameters> {
@JsonCreator
public RejectAllAssignments(@JsonProperty("parameters") RejectAllAssignments.Parameters parameters) {
super(RuleActionType.REJECT_ALL_ASSIGNMENTS, parameters);
}
public static class Parameters {
@JsonProperty("public_comment")
private String publicComment;
@JsonCreator
public Parameters(@JsonProperty("public_comment") String publicComment) {
this.publicComment = publicComment;
}
public String getPublicComment() {
return publicComment;
}
public void setPublicComment(String publicComment) {
this.publicComment = publicComment;
}
}
}
public static class ApproveAllAssignments extends RuleAction<ApproveAllAssignments.Parameters> {
@JsonCreator
public ApproveAllAssignments(@JsonProperty("parameters") ApproveAllAssignments.Parameters parameters) {
super(RuleActionType.APPROVE_ALL_ASSIGNMENTS, parameters);
}
public static class Parameters {
}
}
public static class Unknown extends RuleAction<Map<String, Object>> {
@JsonCreator
public Unknown(@JsonProperty("type") RuleActionType type) {
super(type);
}
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/qualitycontrol/RuleActionType.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.pool.qualitycontrol;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import ai.toloka.client.v1.FlexibleEnum;
public class RuleActionType extends FlexibleEnum<RuleActionType> {
public static final RuleActionType RESTRICTION = new RuleActionType("RESTRICTION");
public static final RuleActionType RESTRICTION_V2 = new RuleActionType("RESTRICTION_V2");
public static final RuleActionType SET_SKILL_FROM_OUTPUT_FIELD = new RuleActionType("SET_SKILL_FROM_OUTPUT_FIELD");
public static final RuleActionType CHANGE_OVERLAP = new RuleActionType("CHANGE_OVERLAP");
public static final RuleActionType SET_SKILL = new RuleActionType("SET_SKILL");
public static final RuleActionType APPROVE_ALL_ASSIGNMENTS = new RuleActionType("APPROVE_ALL_ASSIGNMENTS");
@Deprecated
public static final RuleActionType REJECT_ALL_ASSIGNMENTS = new RuleActionType("REJECT_ALL_ASSIGNMENTS");
private static final RuleActionType[] VALUES = {
RESTRICTION, RESTRICTION_V2, SET_SKILL_FROM_OUTPUT_FIELD, CHANGE_OVERLAP, SET_SKILL, REJECT_ALL_ASSIGNMENTS,
APPROVE_ALL_ASSIGNMENTS
};
private static final ConcurrentMap<String, RuleActionType> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private RuleActionType(String name) {
super(name);
}
public static RuleActionType[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), RuleActionType.class);
}
public static RuleActionType valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<RuleActionType>() {
@Override
public RuleActionType create(String name) {
return new RuleActionType(name);
}
});
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/qualitycontrol/RuleCondition.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.pool.qualitycontrol;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import ai.toloka.client.v1.FlexibleEnum;
import ai.toloka.client.v1.pool.filter.CompareOperator;
import ai.toloka.client.v1.pool.filter.IdentityOperator;
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
property = "key",
visible = true,
defaultImpl = RuleCondition.Unknown.class
)
@JsonSubTypes({
@JsonSubTypes.Type(value = RuleCondition.TotalAnswersCount.class, name = "total_answers_count"),
@JsonSubTypes.Type(value = RuleCondition.CorrectAnswersRate.class, name = "correct_answers_rate"),
@JsonSubTypes.Type(value = RuleCondition.IncorrectAnswersRate.class, name = "incorrect_answers_rate"),
@JsonSubTypes.Type(value = RuleCondition.GoldenSetAnswersCount.class, name = "golden_set_answers_count"),
@JsonSubTypes.Type(value = RuleCondition.GoldenSetCorrectAnswersRate.class,
name = "golden_set_correct_answers_rate"),
@JsonSubTypes.Type(value = RuleCondition.GoldenSetIncorrectAnswersRate.class,
name = "golden_set_incorrect_answers_rate"),
@JsonSubTypes.Type(value = RuleCondition.StoredResultsCount.class, name = "stored_results_count"),
@JsonSubTypes.Type(value = RuleCondition.SuccessRate.class, name = "success_rate"),
@JsonSubTypes.Type(value = RuleCondition.FailRate.class, name = "fail_rate"),
@JsonSubTypes.Type(value = RuleCondition.IncomeSumForLast24Hours.class, name = "income_sum_for_last_24_hours"),
@JsonSubTypes.Type(value = RuleCondition.SkippedInRowCount.class, name = "skipped_in_row_count"),
@JsonSubTypes.Type(value = RuleCondition.AssignmentsAcceptedCount.class, name = "assignments_accepted_count"),
@JsonSubTypes.Type(value = RuleCondition.TotalSubmittedCount.class, name = "total_submitted_count"),
@JsonSubTypes.Type(value = RuleCondition.FastSubmittedCount.class, name = "fast_submitted_count"),
@JsonSubTypes.Type(value = RuleCondition.TotalAssignmentsCount.class, name = "total_assignments_count"),
@JsonSubTypes.Type(value = RuleCondition.AcceptedAssignmentsRate.class, name = "accepted_assignments_rate"),
@JsonSubTypes.Type(value = RuleCondition.RejectedAssignmentsRate.class, name = "rejected_assignments_rate"),
@JsonSubTypes.Type(value = RuleCondition.PendingAssignmentsCount.class, name = "pending_assignments_count"),
@JsonSubTypes.Type(value = RuleCondition.AcceptedAssignmentsCount.class, name = "accepted_assignments_count"),
@JsonSubTypes.Type(value = RuleCondition.RejectedAssignmentsCount.class, name = "rejected_assignments_count"),
@JsonSubTypes.Type(value = RuleCondition.AssessmentEvent.class, name = "assessment_event"),
@JsonSubTypes.Type(value = RuleCondition.PoolAccessRevokedReason.class, name = "pool_access_revoked_reason"),
@JsonSubTypes.Type(value = RuleCondition.SkillId.class, name = "skill_id"),
@JsonSubTypes.Type(value = RuleCondition.SubmittedAssignmentsCount.class, name = "submitted_assignments_count"),
@JsonSubTypes.Type(value = RuleCondition.NextAssignmentAvailable.class, name = "next_assignment_available")
})
public abstract class RuleCondition<O, V> {
private final RuleConditionKey key;
private O operator;
private V value;
private RuleCondition(RuleConditionKey key) {
this.key = key;
}
private RuleCondition(RuleConditionKey key, O operator, V value) {
this.key = key;
this.operator = operator;
this.value = value;
}
public RuleConditionKey getKey() {
return key;
}
public O getOperator() {
return operator;
}
public void setOperator(O operator) {
this.operator = operator;
}
public V getValue() {
return value;
}
public void setValue(V value) {
this.value = value;
}
public static class TotalAnswersCount extends RuleCondition<CompareOperator, Integer> {
@JsonCreator
public TotalAnswersCount(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(RuleConditionKey.TOTAL_ANSWERS_COUNT, operator, value);
}
}
public static class CorrectAnswersRate extends RuleCondition<CompareOperator, Double> {
@JsonCreator
public CorrectAnswersRate(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Double value) {
super(RuleConditionKey.CORRECT_ANSWERS_RATE, operator, value);
}
}
public static class IncorrectAnswersRate extends RuleCondition<CompareOperator, Double> {
@JsonCreator
public IncorrectAnswersRate(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Double value) {
super(RuleConditionKey.INCORRECT_ANSWERS_RATE, operator, value);
}
}
public static class GoldenSetAnswersCount extends RuleCondition<CompareOperator, Integer> {
@JsonCreator
public GoldenSetAnswersCount(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(RuleConditionKey.GOLDEN_SET_ANSWERS_COUNT, operator, value);
}
}
public static class GoldenSetCorrectAnswersRate extends RuleCondition<CompareOperator, Double> {
@JsonCreator
public GoldenSetCorrectAnswersRate(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Double value) {
super(RuleConditionKey.GOLDEN_SET_CORRECT_ANSWERS_RATE, operator, value);
}
}
public static class GoldenSetIncorrectAnswersRate extends RuleCondition<CompareOperator, Double> {
@JsonCreator
public GoldenSetIncorrectAnswersRate(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Double value) {
super(RuleConditionKey.GOLDEN_SET_INCORRECT_ANSWERS_RATE, operator, value);
}
}
public static class StoredResultsCount extends RuleCondition<CompareOperator, Integer> {
@JsonCreator
public StoredResultsCount(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(RuleConditionKey.STORED_RESULTS_COUNT, operator, value);
}
}
public static class SuccessRate extends RuleCondition<CompareOperator, Double> {
@JsonCreator
public SuccessRate(@JsonProperty("operator") CompareOperator operator, @JsonProperty("value") Double value) {
super(RuleConditionKey.SUCCESS_RATE, operator, value);
}
}
public static class FailRate extends RuleCondition<CompareOperator, Double> {
@JsonCreator
public FailRate(@JsonProperty("operator") CompareOperator operator, @JsonProperty("value") Double value) {
super(RuleConditionKey.FAIL_RATE, operator, value);
}
}
public static class IncomeSumForLast24Hours extends RuleCondition<CompareOperator, Double> {
@JsonCreator
public IncomeSumForLast24Hours(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Double value) {
super(RuleConditionKey.INCOME_SUM_FOR_LAST_24_HOURS, operator, value);
}
}
public static class SkippedInRowCount extends RuleCondition<CompareOperator, Integer> {
@JsonCreator
public SkippedInRowCount(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(RuleConditionKey.SKIPPED_IN_ROW_COUNT, operator, value);
}
}
public static class AssignmentsAcceptedCount extends RuleCondition<CompareOperator, Integer> {
@JsonCreator
public AssignmentsAcceptedCount(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(RuleConditionKey.ASSIGNMENTS_ACCEPTED_COUNT, operator, value);
}
}
public static class TotalSubmittedCount extends RuleCondition<CompareOperator, Integer> {
@JsonCreator
public TotalSubmittedCount(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(RuleConditionKey.TOTAL_SUBMITTED_COUNT, operator, value);
}
}
public static class FastSubmittedCount extends RuleCondition<CompareOperator, Integer> {
@JsonCreator
public FastSubmittedCount(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(RuleConditionKey.FAST_SUBMITTED_COUNT, operator, value);
}
}
public static class TotalAssignmentsCount extends RuleCondition<CompareOperator, Integer> {
@JsonCreator
public TotalAssignmentsCount(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(RuleConditionKey.TOTAL_ASSIGNMENTS_COUNT, operator, value);
}
}
public static class AcceptedAssignmentsRate extends RuleCondition<CompareOperator, Double> {
@JsonCreator
public AcceptedAssignmentsRate(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Double value) {
super(RuleConditionKey.ACCEPTED_ASSIGNMENTS_RATE, operator, value);
}
}
public static class RejectedAssignmentsRate extends RuleCondition<CompareOperator, Double> {
@JsonCreator
public RejectedAssignmentsRate(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Double value) {
super(RuleConditionKey.REJECTED_ASSIGNMENTS_RATE, operator, value);
}
}
public static class PendingAssignmentsCount extends RuleCondition<CompareOperator, Integer> {
@JsonCreator
public PendingAssignmentsCount(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(RuleConditionKey.PENDING_ASSIGNMENTS_COUNT, operator, value);
}
}
public static class AcceptedAssignmentsCount extends RuleCondition<CompareOperator, Integer> {
@JsonCreator
public AcceptedAssignmentsCount(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(RuleConditionKey.ACCEPTED_ASSIGNMENTS_COUNT, operator, value);
}
}
public static class RejectedAssignmentsCount extends RuleCondition<CompareOperator, Integer> {
@JsonCreator
public RejectedAssignmentsCount(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(RuleConditionKey.REJECTED_ASSIGNMENTS_COUNT, operator, value);
}
}
public static class AssessmentEvent extends RuleCondition<IdentityOperator, AssessmentEvent.Type> {
@JsonCreator
public AssessmentEvent(@JsonProperty("operator") IdentityOperator operator, @JsonProperty("value") Type value) {
super(RuleConditionKey.ASSESSMENT_EVENT, operator, value);
}
public static class Type extends FlexibleEnum<Type> {
public static final Type ACCEPT = new Type("ACCEPT");
public static final Type REJECT = new Type("REJECT");
public static final Type ACCEPT_AFTER_REJECT = new Type("ACCEPT_AFTER_REJECT");
private static final Type[] VALUES = {ACCEPT, REJECT, ACCEPT_AFTER_REJECT};
private static final ConcurrentMap<String, Type> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private Type(String name) {
super(name);
}
public static Type[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), Type.class);
}
public static Type valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<Type>() {
@Override
public Type create(String name) {
return new Type(name);
}
});
}
}
}
public static class PoolAccessRevokedReason extends RuleCondition<IdentityOperator, PoolAccessRevokedReason.Type> {
@JsonCreator
public PoolAccessRevokedReason(@JsonProperty("operator") IdentityOperator operator,
@JsonProperty("value") Type value) {
super(RuleConditionKey.POOL_ACCESS_REVOKED_REASON, operator, value);
}
public static class Type extends FlexibleEnum<Type> {
public static final Type SKILL_CHANGE = new Type("SKILL_CHANGE");
public static final Type RESTRICTION = new Type("RESTRICTION");
private static final Type[] VALUES = {SKILL_CHANGE, RESTRICTION};
private static final ConcurrentMap<String, Type> DISCOVERED_VALUES = new ConcurrentHashMap<>();
public Type(String name) {
super(name);
}
public static Type[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), Type.class);
}
public static Type valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<Type>() {
@Override
public Type create(String name) {
return new Type(name);
}
});
}
}
}
public static class SkillId extends RuleCondition<IdentityOperator, String> {
@JsonCreator
public SkillId(@JsonProperty("operator") IdentityOperator operator, @JsonProperty("value") String value) {
super(RuleConditionKey.SKILL_ID, operator, value);
}
}
public static class SubmittedAssignmentsCount extends RuleCondition<CompareOperator, Integer> {
@JsonCreator
public SubmittedAssignmentsCount(@JsonProperty("operator") CompareOperator operator,
@JsonProperty("value") Integer value) {
super(RuleConditionKey.SUBMITTED_ASSIGNMENTS_COUNT, operator, value);
}
}
public static class NextAssignmentAvailable extends RuleCondition<IdentityOperator, Boolean> {
@JsonCreator
public NextAssignmentAvailable(@JsonProperty("operator") IdentityOperator operator,
@JsonProperty("value") Boolean value) {
super(RuleConditionKey.NEXT_ASSIGNMENT_AVAILABLE, operator, value);
}
}
public static class Unknown extends RuleCondition<CompareOperator, Object> {
@JsonCreator
public Unknown(@JsonProperty("key") RuleConditionKey key) {
super(key);
}
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/qualitycontrol/RuleConditionKey.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.pool.qualitycontrol;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import ai.toloka.client.v1.FlexibleEnum;
public class RuleConditionKey extends FlexibleEnum<RuleConditionKey> {
public static final RuleConditionKey TOTAL_ANSWERS_COUNT = new RuleConditionKey("total_answers_count");
public static final RuleConditionKey CORRECT_ANSWERS_RATE = new RuleConditionKey("correct_answers_rate");
public static final RuleConditionKey INCORRECT_ANSWERS_RATE = new RuleConditionKey("incorrect_answers_rate");
public static final RuleConditionKey GOLDEN_SET_ANSWERS_COUNT = new RuleConditionKey("golden_set_answers_count");
public static final RuleConditionKey GOLDEN_SET_CORRECT_ANSWERS_RATE =
new RuleConditionKey("golden_set_correct_answers_rate");
public static final RuleConditionKey GOLDEN_SET_INCORRECT_ANSWERS_RATE =
new RuleConditionKey("golden_set_incorrect_answers_rate");
public static final RuleConditionKey STORED_RESULTS_COUNT = new RuleConditionKey("stored_results_count");
public static final RuleConditionKey SUCCESS_RATE = new RuleConditionKey("success_rate");
public static final RuleConditionKey FAIL_RATE = new RuleConditionKey("fail_rate");
public static final RuleConditionKey INCOME_SUM_FOR_LAST_24_HOURS =
new RuleConditionKey("income_sum_for_last_24_hours");
public static final RuleConditionKey SKIPPED_IN_ROW_COUNT = new RuleConditionKey("skipped_in_row_count");
public static final RuleConditionKey ASSIGNMENTS_ACCEPTED_COUNT =
new RuleConditionKey("assignments_accepted_count");
public static final RuleConditionKey TOTAL_SUBMITTED_COUNT = new RuleConditionKey("total_submitted_count");
public static final RuleConditionKey FAST_SUBMITTED_COUNT = new RuleConditionKey("fast_submitted_count");
public static final RuleConditionKey TOTAL_ASSIGNMENTS_COUNT = new RuleConditionKey("total_assignments_count");
public static final RuleConditionKey ACCEPTED_ASSIGNMENTS_RATE = new RuleConditionKey("accepted_assignments_rate");
public static final RuleConditionKey REJECTED_ASSIGNMENTS_RATE = new RuleConditionKey("rejected_assignments_rate");
public static final RuleConditionKey PENDING_ASSIGNMENTS_COUNT = new RuleConditionKey("pending_assignments_count");
public static final RuleConditionKey ACCEPTED_ASSIGNMENTS_COUNT =
new RuleConditionKey("accepted_assignments_count");
public static final RuleConditionKey REJECTED_ASSIGNMENTS_COUNT =
new RuleConditionKey("rejected_assignments_count");
public static final RuleConditionKey ASSESSMENT_EVENT = new RuleConditionKey("assessment_event");
public static final RuleConditionKey POOL_ACCESS_REVOKED_REASON =
new RuleConditionKey("pool_access_revoked_reason");
public static final RuleConditionKey SKILL_ID = new RuleConditionKey("skill_id");
public static final RuleConditionKey SUBMITTED_ASSIGNMENTS_COUNT =
new RuleConditionKey("submitted_assignments_count");
public static final RuleConditionKey NEXT_ASSIGNMENT_AVAILABLE = new RuleConditionKey("next_assignment_available");
private static final RuleConditionKey[] VALUES = {
TOTAL_ANSWERS_COUNT, CORRECT_ANSWERS_RATE, INCORRECT_ANSWERS_RATE,
GOLDEN_SET_ANSWERS_COUNT, GOLDEN_SET_CORRECT_ANSWERS_RATE, GOLDEN_SET_INCORRECT_ANSWERS_RATE,
STORED_RESULTS_COUNT, SUCCESS_RATE, FAIL_RATE,
INCOME_SUM_FOR_LAST_24_HOURS,
SKIPPED_IN_ROW_COUNT,
ASSIGNMENTS_ACCEPTED_COUNT,
TOTAL_SUBMITTED_COUNT, FAST_SUBMITTED_COUNT,
TOTAL_ASSIGNMENTS_COUNT, ACCEPTED_ASSIGNMENTS_RATE, REJECTED_ASSIGNMENTS_RATE,
PENDING_ASSIGNMENTS_COUNT, ACCEPTED_ASSIGNMENTS_COUNT, REJECTED_ASSIGNMENTS_COUNT, ASSESSMENT_EVENT,
POOL_ACCESS_REVOKED_REASON, SKILL_ID,
SUBMITTED_ASSIGNMENTS_COUNT, NEXT_ASSIGNMENT_AVAILABLE
};
private static final ConcurrentMap<String, RuleConditionKey> DISCOVERED_VALUES = new ConcurrentHashMap<>();
public static RuleConditionKey[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), RuleConditionKey.class);
}
public static RuleConditionKey valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<RuleConditionKey>() {
@Override public RuleConditionKey create(String name) {
return new RuleConditionKey(name);
}
});
}
private RuleConditionKey(String name) {
super(name);
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/qualitycontrol/RuleConfig.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.pool.qualitycontrol;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class RuleConfig {
private List<RuleCondition> conditions;
private RuleAction action;
@JsonCreator
public RuleConfig(@JsonProperty("conditions") List<RuleCondition> conditions,
@JsonProperty("action") RuleAction action) {
this.conditions = conditions;
this.action = action;
}
public List<RuleCondition> getConditions() {
return conditions;
}
public void setConditions(List<RuleCondition> conditions) {
this.conditions = conditions;
}
public RuleAction getAction() {
return action;
}
public void setAction(RuleAction action) {
this.action = action;
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/pool/qualitycontrol/TrainingRequirement.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.pool.qualitycontrol;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TrainingRequirement {
@JsonProperty("training_pool_id")
private String trainingPoolId;
@JsonProperty("training_passing_skill_value")
private Integer trainingPassingSkillValue;
@JsonCreator
public TrainingRequirement(@JsonProperty("training_pool_id") String trainingPoolId,
@JsonProperty("training_passing_skill_value") Integer trainingPassingSkillValue) {
this.trainingPoolId = trainingPoolId;
this.trainingPassingSkillValue = trainingPassingSkillValue;
}
public String getTrainingPoolId() {
return trainingPoolId;
}
public Integer getTrainingPassingSkillValue() {
return trainingPassingSkillValue;
}
public void setTrainingPoolId(String trainingPoolId) {
this.trainingPoolId = trainingPoolId;
}
public void setTrainingPassingSkillValue(Integer trainingPassingSkillValue) {
this.trainingPassingSkillValue = trainingPassingSkillValue;
}
}
|
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/project/AssignmentsIssuingType.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.project;
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 AssignmentsIssuingType extends FlexibleEnum<AssignmentsIssuingType> {
private AssignmentsIssuingType(String name) {
super(name);
}
public static final AssignmentsIssuingType AUTOMATED = new AssignmentsIssuingType("AUTOMATED");
public static final AssignmentsIssuingType MAP_SELECTOR = new AssignmentsIssuingType("MAP_SELECTOR");
private static final AssignmentsIssuingType[] VALUES = {AUTOMATED, MAP_SELECTOR};
private static final ConcurrentMap<String, AssignmentsIssuingType> DISCOVERED_VALUES = new ConcurrentHashMap<>();
public static AssignmentsIssuingType[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), AssignmentsIssuingType.class);
}
@JsonCreator
public static AssignmentsIssuingType valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<AssignmentsIssuingType>() {
@Override public AssignmentsIssuingType create(String name) {
return new AssignmentsIssuingType(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/project/AssignmentsIssuingViewConfig.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.project;
import com.fasterxml.jackson.annotation.JsonProperty;
public class AssignmentsIssuingViewConfig {
@JsonProperty("title_template")
private String titleTemplate;
@JsonProperty("description_template")
private String descriptionTemplate;
public String getTitleTemplate() {
return titleTemplate;
}
public String getDescriptionTemplate() {
return descriptionTemplate;
}
public void setTitleTemplate(String titleTemplate) {
this.titleTemplate = titleTemplate;
}
public void setDescriptionTemplate(String descriptionTemplate) {
this.descriptionTemplate = descriptionTemplate;
}
}
|
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/project/Project.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.project;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import ai.toloka.client.v1.Owner;
import ai.toloka.client.v1.project.spec.TaskSpec;
public class Project {
private String id;
private Owner owner;
@JsonProperty("public_name")
private String publicName;
@JsonProperty("public_description")
private String publicDescription;
@JsonProperty("public_instructions")
private String publicInstructions;
@JsonProperty("private_comment")
private String privateComment;
@JsonProperty("task_spec")
private TaskSpec taskSpec;
@JsonProperty("assignments_issuing_type")
private AssignmentsIssuingType assignmentsIssuingType;
@JsonProperty("assignments_issuing_view_config")
private AssignmentsIssuingViewConfig assignmentsIssuingViewConfig;
@JsonProperty("quality_control")
private ProjectQualityControl qualityControl;
@JsonProperty("assignments_automerge_enabled")
private Boolean assignmentsAutomergeEnabled;
@JsonProperty("max_active_assignments_count")
private Integer maxActiveAssignmentsCount;
private Map<String, List<String>> metadata;
@JsonProperty("localization_config")
private ProjectLocalizationConfig localizationConfig;
private ProjectStatus status;
private Date created;
@JsonCreator
public Project(@JsonProperty("public_name") String publicName,
@JsonProperty("public_description") String publicDescription,
@JsonProperty("public_instructions") String publicInstructions,
@JsonProperty("task_spec") TaskSpec taskSpec,
@JsonProperty("assignments_issuing_type") AssignmentsIssuingType assignmentsIssuingType) {
this.publicName = publicName;
this.publicDescription = publicDescription;
this.publicInstructions = publicInstructions;
this.taskSpec = taskSpec;
this.assignmentsIssuingType = assignmentsIssuingType;
}
public String getId() {
return id;
}
public Owner getOwner() {
return owner;
}
public String getPublicName() {
return publicName;
}
public String getPublicDescription() {
return publicDescription;
}
public String getPublicInstructions() {
return publicInstructions;
}
public String getPrivateComment() {
return privateComment;
}
public TaskSpec getTaskSpec() {
return taskSpec;
}
public AssignmentsIssuingType getAssignmentsIssuingType() {
return assignmentsIssuingType;
}
public AssignmentsIssuingViewConfig getAssignmentsIssuingViewConfig() {
return assignmentsIssuingViewConfig;
}
public ProjectQualityControl getQualityControl() {
return qualityControl;
}
public Boolean getAssignmentsAutomergeEnabled() {
return assignmentsAutomergeEnabled;
}
public Integer getMaxActiveAssignmentsCount() {
return maxActiveAssignmentsCount;
}
public ProjectStatus getStatus() {
return status;
}
public Date getCreated() {
return created;
}
public void setPublicName(String publicName) {
this.publicName = publicName;
}
public void setPublicDescription(String publicDescription) {
this.publicDescription = publicDescription;
}
public void setPublicInstructions(String publicInstructions) {
this.publicInstructions = publicInstructions;
}
public void setPrivateComment(String privateComment) {
this.privateComment = privateComment;
}
public void setTaskSpec(TaskSpec taskSpec) {
this.taskSpec = taskSpec;
}
public void setAssignmentsIssuingType(AssignmentsIssuingType assignmentsIssuingType) {
this.assignmentsIssuingType = assignmentsIssuingType;
}
public void setAssignmentsIssuingViewConfig(AssignmentsIssuingViewConfig assignmentsIssuingViewConfig) {
this.assignmentsIssuingViewConfig = assignmentsIssuingViewConfig;
}
public void setQualityControl(ProjectQualityControl qualityControl) {
this.qualityControl = qualityControl;
}
public void setAssignmentsAutomergeEnabled(Boolean assignmentsAutomergeEnabled) {
this.assignmentsAutomergeEnabled = assignmentsAutomergeEnabled;
}
public void setMaxActiveAssignmentsCount(Integer maxActiveAssignmentsCount) {
this.maxActiveAssignmentsCount = maxActiveAssignmentsCount;
}
public Map<String, List<String>> getMetadata() {
return metadata;
}
public void setMetadata(Map<String, List<String>> metadata) {
this.metadata = metadata;
}
public ProjectLocalizationConfig getLocalizationConfig() {
return localizationConfig;
}
public void setLocalizationConfig(ProjectLocalizationConfig localizationConfig) {
this.localizationConfig = localizationConfig;
}
}
|
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/project/ProjectArchiveOperation.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.project;
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 ProjectArchiveOperation extends Operation<ProjectArchiveOperation.Parameters, ProjectArchiveOperation> {
public static final OperationType TYPE = OperationType.PROJECT_ARCHIVE;
public ProjectArchiveOperation() {}
private ProjectArchiveOperation(Date currentDateTime) {
super(currentDateTime);
}
public static class Parameters {
@JsonProperty("project_id")
private String projectId;
public String getProjectId() {
return projectId;
}
}
public static ProjectArchiveOperation createPseudo(Date currentDateTime) {
return new ProjectArchiveOperation(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/project/ProjectClient.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.project;
import ai.toloka.client.v1.ModificationResult;
import ai.toloka.client.v1.SearchResult;
public interface ProjectClient {
SearchResult<Project> findProjects(ProjectSearchRequest request);
Project getProject(String projectId);
ModificationResult<Project> createProject(Project project);
ModificationResult<Project> updateProject(String projectId, Project project);
ProjectArchiveOperation archiveProject(String 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/project/ProjectFilterParam.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.project;
import ai.toloka.client.v1.FilterParam;
public enum ProjectFilterParam implements FilterParam {
status(ProjectSearchRequest.STATUS_PARAMETER),
ownerId(ProjectSearchRequest.OWNER_ID_PARAMETER),
ownerCompanyId(ProjectSearchRequest.OWNER_COMPANY_ID_PARAMETER);
private String parameter;
ProjectFilterParam(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/project/ProjectLocalizationConfig.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.project;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import ai.toloka.client.v1.FlexibleEnum;
import ai.toloka.client.v1.LangIso639;
public class ProjectLocalizationConfig {
@JsonProperty("default_language")
private LangIso639 defaultLanguage;
@JsonProperty("additional_languages")
private List<AdditionalLanguage> additionalLanguages;
public ProjectLocalizationConfig() {
}
public ProjectLocalizationConfig(LangIso639 defaultLanguage,
List<AdditionalLanguage> additionalLanguages) {
this.defaultLanguage = defaultLanguage;
this.additionalLanguages = additionalLanguages;
}
public LangIso639 getDefaultLanguage() {
return defaultLanguage;
}
public void setDefaultLanguage(LangIso639 defaultLanguage) {
this.defaultLanguage = defaultLanguage;
}
public List<AdditionalLanguage> getAdditionalLanguages() {
return additionalLanguages;
}
public void setAdditionalLanguages(List<AdditionalLanguage> additionalLanguages) {
this.additionalLanguages = additionalLanguages;
}
public static class AdditionalLanguage {
private LangIso639 language;
@JsonProperty("public_name")
private LocalizedValue publicName;
@JsonProperty("public_description")
private LocalizedValue publicDescription;
@JsonProperty("public_instructions")
private LocalizedValue publicInstructions;
@JsonProperty("tb_view_spec")
private LocalizedTbViewSpec tbViewSpec;
public AdditionalLanguage() {
}
public AdditionalLanguage(LangIso639 language) {
this.language = language;
}
public LangIso639 getLanguage() {
return language;
}
public void setLanguage(LangIso639 language) {
this.language = language;
}
public LocalizedValue getPublicName() {
return publicName;
}
public void setPublicName(LocalizedValue publicName) {
this.publicName = publicName;
}
public LocalizedValue getPublicDescription() {
return publicDescription;
}
public LocalizedTbViewSpec getTbViewSpec() {
return tbViewSpec;
}
public void setTbViewSpec(LocalizedTbViewSpec tbViewSpec) {
this.tbViewSpec = tbViewSpec;
}
public void setPublicDescription(LocalizedValue publicDescription) {
this.publicDescription = publicDescription;
}
public LocalizedValue getPublicInstructions() {
return publicInstructions;
}
public void setPublicInstructions(LocalizedValue publicInstructions) {
this.publicInstructions = publicInstructions;
}
public static class LocalizedTbViewSpec {
private List<LocalizedKeyValue> keys;
public LocalizedTbViewSpec() {
}
public LocalizedTbViewSpec(List<LocalizedKeyValue> keys) {
this.keys = keys;
}
public List<LocalizedKeyValue> getKeys() {
return keys;
}
public void setKeys(List<LocalizedKeyValue> keys) {
this.keys = keys;
}
}
public static class LocalizedKeyValue {
private String key;
private String value;
private Source source;
public LocalizedKeyValue() {
}
public LocalizedKeyValue(String key, String value, Source source) {
this.key = key;
this.value = value;
this.source = source;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public Source getSource() {
return source;
}
public void setSource(Source source) {
this.source = source;
}
}
public static class LocalizedValue {
private String value;
private Source source;
public LocalizedValue() {
}
public LocalizedValue(String value, Source source) {
this.value = value;
this.source = source;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public Source getSource() {
return source;
}
public void setSource(Source source) {
this.source = source;
}
}
public static class Source extends FlexibleEnum<Source> {
public static final Source REQUESTER = new Source("REQUESTER");
private static final Source[] VALUES = {REQUESTER};
private static final ConcurrentMap<String, Source> DISCOVERED_VALUES = new ConcurrentHashMap<>();
public static Source[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), Source.class);
}
@JsonCreator
public static Source valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<Source>() {
@Override public Source create(String name) {
return new Source(name);
}
});
}
private Source(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/project/ProjectQualityControl.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.project;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import ai.toloka.client.v1.pool.qualitycontrol.QualityControlConfig;
public class ProjectQualityControl {
private List<QualityControlConfig> configs;
@JsonCreator
public ProjectQualityControl(@JsonProperty("configs") List<QualityControlConfig> configs) {
this.configs = configs;
}
public List<QualityControlConfig> getConfigs() {
return configs;
}
public void setConfigs(List<QualityControlConfig> configs) {
this.configs = configs;
}
}
|
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/project/ProjectRangeParam.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.project;
import ai.toloka.client.v1.RangeParam;
public enum ProjectRangeParam implements RangeParam {
id(ProjectSearchRequest.ID_PARAMETER), created(ProjectSearchRequest.CREATED_PARAMETER);
private String parameter;
ProjectRangeParam(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/project/ProjectSearchRequest.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.project;
import java.util.Date;
import java.util.Map;
import ai.toloka.client.v1.SearchRequest;
public class ProjectSearchRequest extends SearchRequest {
static final String STATUS_PARAMETER = "status";
static final String OWNER_ID_PARAMETER = "owner_id";
static final String OWNER_COMPANY_ID_PARAMETER = "owner_company_id";
static final String ID_PARAMETER = "id";
static final String CREATED_PARAMETER = "created";
static final String PUBLIC_NAME_PARAMETER = "public_name";
static final String PRIVATE_COMMENT_PARAMETER = "private_comment";
private ProjectSearchRequest(Map<String, Object> filterParameters, Map<String, Object> rangeParameters,
String sortParameter, Integer limit) {
super(filterParameters, rangeParameters, sortParameter, limit);
}
public static ProjectBuilder make() {
return new ProjectBuilder(new ProjectFilterBuilder(), new ProjectRangeBuilder(), new ProjectSortBuilder());
}
public static class ProjectBuilder extends Builder<
ProjectSearchRequest, ProjectBuilder, ProjectFilterBuilder, ProjectRangeBuilder, ProjectSortBuilder> {
private ProjectBuilder(ProjectFilterBuilder filterBuilder, ProjectRangeBuilder rangeBuilder,
ProjectSortBuilder sortBuilder) {
super(filterBuilder, rangeBuilder, sortBuilder);
}
@Override public ProjectSearchRequest done() {
return new ProjectSearchRequest(
filterBuilder.getFilterParameters(),
rangeBuilder.getRangeParameters(),
sortBuilder.getSortParameter(),
getLimit());
}
}
public static class ProjectFilterBuilder
extends FilterBuilder<ProjectFilterBuilder, ProjectBuilder, ProjectFilterParam> {
public ProjectFilterBuilder byStatus(ProjectStatus status) {
return by(ProjectFilterParam.status, status);
}
public ProjectFilterBuilder byOwnerId(String ownerId) {
return by(ProjectFilterParam.ownerId, ownerId);
}
public ProjectFilterBuilder byOwnerCompanyId(String ownerCompanyId) {
return by(ProjectFilterParam.ownerCompanyId, ownerCompanyId);
}
}
public static class ProjectRangeBuilder
extends RangeBuilder<ProjectRangeBuilder, ProjectBuilder, ProjectRangeParam> {
public RangeItemBuilder<ProjectRangeBuilder> byId(String id) {
return by(ProjectRangeParam.id, id);
}
public RangeItemBuilder<ProjectRangeBuilder> byCreated(Date date) {
return by(ProjectRangeParam.created, date);
}
}
public static class ProjectSortBuilder extends SortBuilder<ProjectSortBuilder, ProjectBuilder, ProjectSortParam> {
public SortItem<ProjectSortBuilder> byId() {
return by(ProjectSortParam.id);
}
public SortItem<ProjectSortBuilder> byCreated() {
return by(ProjectSortParam.created);
}
public SortItem<ProjectSortBuilder> byPublicName() {
return by(ProjectSortParam.publicName);
}
public SortItem<ProjectSortBuilder> byPrivateComment() {
return by(ProjectSortParam.privateComment);
}
}
}
|
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/project/ProjectSortParam.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.project;
import ai.toloka.client.v1.SortParam;
public enum ProjectSortParam implements SortParam {
id(ProjectSearchRequest.ID_PARAMETER),
created(ProjectSearchRequest.CREATED_PARAMETER),
publicName(ProjectSearchRequest.PUBLIC_NAME_PARAMETER),
privateComment(ProjectSearchRequest.PRIVATE_COMMENT_PARAMETER);
private String parameter;
ProjectSortParam(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/project/ProjectStatus.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.project;
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 ProjectStatus extends FlexibleEnum<ProjectStatus> {
private ProjectStatus(String name) {
super(name);
}
public static final ProjectStatus ACTIVE = new ProjectStatus("ACTIVE");
public static final ProjectStatus ARCHIVED = new ProjectStatus("ARCHIVED");
private static final ProjectStatus[] VALUES = {ACTIVE, ARCHIVED};
private static final ConcurrentMap<String, ProjectStatus> DISCOVERED_VALUES = new ConcurrentHashMap<>();
public static ProjectStatus[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), ProjectStatus.class);
}
@JsonCreator
public static ProjectStatus valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<ProjectStatus>() {
@Override public ProjectStatus create(String name) {
return new ProjectStatus(name);
}
});
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/project | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/project/spec/BaseTaskViewSpec.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.project.spec;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonValue;
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
property = "type",
defaultImpl = ClassicTaskViewSpec.class)
@JsonSubTypes({
@JsonSubTypes.Type(value = ClassicTaskViewSpec.class, name = "classic"),
@JsonSubTypes.Type(value = TbTaskViewSpec.class, name = "tb")
})
public abstract class BaseTaskViewSpec {
private Map<String, Object> settings;
private Type type;
public BaseTaskViewSpec(Map<String, Object> settings, Type type) {
this.settings = settings;
this.type = type;
}
public BaseTaskViewSpec(BaseTaskViewSpec original, Type type) {
this.settings = original.settings;
this.type = type;
}
public Map<String, Object> getSettings() {
return settings;
}
public void setSettings(Map<String, Object> settings) {
this.settings = settings;
}
public Type getType() {
return type;
}
public void setType(Type type) {
this.type = type;
}
public enum Type {
CLASSIC("classic"),
TB("tb");
final String value;
Type(String type) {
this.value = type;
}
@JsonValue
public String getValue() {
return value;
}
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/project | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/project/spec/ClassicTaskViewSpec.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.project.spec;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class ClassicTaskViewSpec extends BaseTaskViewSpec {
private String script;
private String markup;
private String styles;
private Map<String, Object> assets;
@JsonCreator
public ClassicTaskViewSpec(@JsonProperty("settings") Map<String, Object> settings) {
super(settings, Type.CLASSIC);
}
public ClassicTaskViewSpec(ClassicTaskViewSpec original) {
super(original, Type.CLASSIC);
this.script = original.script;
this.markup = original.markup;
this.styles = original.styles;
this.assets = new HashMap<>(original.assets);
}
public String getScript() {
return script;
}
public void setScript(String script) {
this.script = script;
}
public String getMarkup() {
return markup;
}
public void setMarkup(String markup) {
this.markup = markup;
}
public String getStyles() {
return styles;
}
public void setStyles(String styles) {
this.styles = styles;
}
public Map<String, Object> getAssets() {
return assets;
}
public void setAssets(Map<String, Object> assets) {
this.assets = assets;
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/project | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/project/spec/FieldSpec.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.project.spec;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import static com.fasterxml.jackson.annotation.JsonTypeInfo.As.EXISTING_PROPERTY;
import static com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME;
@JsonTypeInfo(use = NAME, include = EXISTING_PROPERTY, property = "type", visible = true,
defaultImpl = FieldSpec.UnknownSpec.class)
@JsonSubTypes({
@JsonSubTypes.Type(value = FieldSpec.BooleanSpec.class, name = "boolean"),
@JsonSubTypes.Type(value = FieldSpec.ArrayBooleanSpec.class, name = "array_boolean"),
@JsonSubTypes.Type(value = FieldSpec.StringSpec.class, name = "string"),
@JsonSubTypes.Type(value = FieldSpec.ArrayStringSpec.class, name = "array_string"),
@JsonSubTypes.Type(value = FieldSpec.IntegerSpec.class, name = "integer"),
@JsonSubTypes.Type(value = FieldSpec.ArrayIntegerSpec.class, name = "array_integer"),
@JsonSubTypes.Type(value = FieldSpec.FloatSpec.class, name = "float"),
@JsonSubTypes.Type(value = FieldSpec.ArrayFloatSpec.class, name = "array_float"),
@JsonSubTypes.Type(value = FieldSpec.UrlSpec.class, name = "url"),
@JsonSubTypes.Type(value = FieldSpec.ArrayUrlSpec.class, name = "array_url"),
@JsonSubTypes.Type(value = FieldSpec.FileSpec.class, name = "file"),
@JsonSubTypes.Type(value = FieldSpec.ArrayFileSpec.class, name = "array_file"),
@JsonSubTypes.Type(value = FieldSpec.CoordinatesSpec.class, name = "coordinates"),
@JsonSubTypes.Type(value = FieldSpec.ArrayCoordinatesSpec.class, name = "array_coordinates"),
@JsonSubTypes.Type(value = FieldSpec.JsonSpec.class, name = "json"),
@JsonSubTypes.Type(value = FieldSpec.ArrayJsonSpec.class, name = "array_json")
})
public abstract class FieldSpec {
private FieldType type;
private boolean required;
private boolean hidden;
@JsonCreator
private FieldSpec(@JsonProperty("type") FieldType type,
@JsonProperty("required") boolean required,
@JsonProperty("hidden") boolean hidden) {
this.type = type;
this.required = required;
this.hidden = hidden;
}
public FieldType getType() {
return type;
}
public boolean isRequired() {
return required;
}
public void setRequired(boolean required) {
this.required = required;
}
public boolean isHidden() {
return hidden;
}
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
public static class BooleanSpec extends FieldSpec {
@JsonProperty("allowed_values")
private Set<Boolean> allowedValues;
public BooleanSpec(boolean required) {
this(required, false);
}
@JsonCreator
public BooleanSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
this(FieldType.BOOLEAN, required, hidden);
}
private BooleanSpec(FieldType type, boolean required, boolean hidden) {
super(type, required, hidden);
}
}
public static class ArrayBooleanSpec extends BooleanSpec {
@JsonProperty("min_size")
private Integer minSize;
@JsonProperty("max_size")
private Integer maxSize;
public ArrayBooleanSpec(boolean required) {
this(required, false);
}
@JsonCreator
public ArrayBooleanSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
super(FieldType.ARRAY_BOOLEAN, required, hidden);
}
public Integer getMinSize() {
return minSize;
}
public void setMinSize(Integer minSize) {
this.minSize = minSize;
}
public Integer getMaxSize() {
return maxSize;
}
public void setMaxSize(Integer maxSize) {
this.maxSize = maxSize;
}
}
public static class StringSpec extends FieldSpec {
@JsonProperty("min_length")
private Integer minLength;
@JsonProperty("max_length")
private Integer maxLength;
private String pattern;
@JsonProperty("allowed_values")
private Set<String> allowedValues;
public StringSpec(boolean required) {
this(required, false);
}
@JsonCreator
public StringSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
this(FieldType.STRING, required, hidden);
}
private StringSpec(FieldType type, boolean required, boolean hidden) {
super(type, required, hidden);
}
public Integer getMinLength() {
return minLength;
}
public void setMinLength(Integer minLength) {
this.minLength = minLength;
}
public Integer getMaxLength() {
return maxLength;
}
public void setMaxLength(Integer maxLength) {
this.maxLength = maxLength;
}
public String getPattern() {
return pattern;
}
public void setPattern(String pattern) {
this.pattern = pattern;
}
public Set<String> getAllowedValues() {
return allowedValues;
}
public void setAllowedValues(Set<String> allowedValues) {
this.allowedValues = allowedValues;
}
}
public static class ArrayStringSpec extends StringSpec {
@JsonProperty("min_size")
private Integer minSize;
@JsonProperty("max_size")
private Integer maxSize;
public ArrayStringSpec(boolean required) {
this(required, false);
}
@JsonCreator
public ArrayStringSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
super(FieldType.ARRAY_STRING, required, hidden);
}
public Integer getMinSize() {
return minSize;
}
public void setMinSize(Integer minSize) {
this.minSize = minSize;
}
public Integer getMaxSize() {
return maxSize;
}
public void setMaxSize(Integer maxSize) {
this.maxSize = maxSize;
}
}
public static class IntegerSpec extends FieldSpec {
@JsonProperty("min_value")
private Long minValue;
@JsonProperty("max_value")
private Long maxValue;
@JsonProperty("allowed_values")
private Set<Long> allowedValues;
public IntegerSpec(boolean required) {
this(required, false);
}
@JsonCreator
public IntegerSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
super(FieldType.INTEGER, required, hidden);
}
private IntegerSpec(FieldType type, boolean required, boolean hidden) {
super(type, required, hidden);
}
public Long getMinValue() {
return minValue;
}
public void setMinValue(Long minValue) {
this.minValue = minValue;
}
public Long getMaxValue() {
return maxValue;
}
public void setMaxValue(Long maxValue) {
this.maxValue = maxValue;
}
public Set<Long> getAllowedValues() {
return allowedValues;
}
public void setAllowedValues(Set<Long> allowedValues) {
this.allowedValues = allowedValues;
}
}
public static class ArrayIntegerSpec extends IntegerSpec {
@JsonProperty("min_size")
private Integer minSize;
@JsonProperty("max_size")
private Integer maxSize;
public ArrayIntegerSpec(boolean required) {
this(required, false);
}
@JsonCreator
public ArrayIntegerSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
super(FieldType.ARRAY_INTEGER, required, hidden);
}
public Integer getMinSize() {
return minSize;
}
public void setMinSize(Integer minSize) {
this.minSize = minSize;
}
public Integer getMaxSize() {
return maxSize;
}
public void setMaxSize(Integer maxSize) {
this.maxSize = maxSize;
}
}
public static class FloatSpec extends FieldSpec {
@JsonProperty("min_value")
private Double minValue;
@JsonProperty("max_value")
private Double maxValue;
public FloatSpec(boolean required) {
this(required, false);
}
@JsonCreator
public FloatSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
this(FieldType.FLOAT, required, hidden);
}
private FloatSpec(FieldType type, boolean required, boolean hidden) {
super(type, required, hidden);
}
public Double getMinValue() {
return minValue;
}
public void setMinValue(Double minValue) {
this.minValue = minValue;
}
public Double getMaxValue() {
return maxValue;
}
public void setMaxValue(Double maxValue) {
this.maxValue = maxValue;
}
}
public static class ArrayFloatSpec extends FloatSpec {
@JsonProperty("min_size")
private Integer minSize;
@JsonProperty("max_size")
private Integer maxSize;
public ArrayFloatSpec(boolean required) {
this(required, false);
}
@JsonCreator
public ArrayFloatSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
super(FieldType.ARRAY_FLOAT, required, hidden);
}
public Integer getMinSize() {
return minSize;
}
public void setMinSize(Integer minSize) {
this.minSize = minSize;
}
public Integer getMaxSize() {
return maxSize;
}
public void setMaxSize(Integer maxSize) {
this.maxSize = maxSize;
}
}
public static class UrlSpec extends FieldSpec {
public UrlSpec(boolean required) {
this(required, false);
}
@JsonCreator
public UrlSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
this(FieldType.URL, required, hidden);
}
private UrlSpec(FieldType type, boolean required, boolean hidden) {
super(type, required, hidden);
}
}
public static class ArrayUrlSpec extends UrlSpec {
@JsonProperty("min_size")
private Integer minSize;
@JsonProperty("max_size")
private Integer maxSize;
public ArrayUrlSpec(boolean required) {
this(required, false);
}
@JsonCreator
public ArrayUrlSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
super(FieldType.ARRAY_URL, required, hidden);
}
public Integer getMinSize() {
return minSize;
}
public void setMinSize(Integer minSize) {
this.minSize = minSize;
}
public Integer getMaxSize() {
return maxSize;
}
public void setMaxSize(Integer maxSize) {
this.maxSize = maxSize;
}
}
public static class FileSpec extends FieldSpec {
public FileSpec(boolean required) {
this(required, false);
}
@JsonCreator
public FileSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
this(FieldType.FILE, required, hidden);
}
private FileSpec(FieldType type, boolean required, boolean hidden) {
super(type, required, hidden);
}
}
public static class ArrayFileSpec extends FileSpec {
@JsonProperty("min_size")
private Integer minSize;
@JsonProperty("max_size")
private Integer maxSize;
public ArrayFileSpec(boolean required) {
this(required, false);
}
public ArrayFileSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
super(FieldType.ARRAY_FILE, required, hidden);
}
public Integer getMinSize() {
return minSize;
}
public void setMinSize(Integer minSize) {
this.minSize = minSize;
}
public Integer getMaxSize() {
return maxSize;
}
public void setMaxSize(Integer maxSize) {
this.maxSize = maxSize;
}
}
public static class CoordinatesSpec extends FieldSpec {
@JsonProperty("current_location")
private Boolean currentLocation;
public CoordinatesSpec(boolean required) {
this(required, false);
}
public CoordinatesSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
this(FieldType.COORDINATES, required, hidden);
}
private CoordinatesSpec(FieldType type, boolean required, boolean hidden) {
super(type, required, hidden);
}
public Boolean getCurrentLocation() {
return currentLocation;
}
public void setCurrentLocation(Boolean currentLocation) {
this.currentLocation = currentLocation;
}
}
public static class ArrayCoordinatesSpec extends CoordinatesSpec {
@JsonProperty("min_size")
private Integer minSize;
@JsonProperty("max_size")
private Integer maxSize;
public ArrayCoordinatesSpec(boolean required) {
this(required, false);
}
@JsonCreator
public ArrayCoordinatesSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
super(FieldType.ARRAY_COORDINATES, required, hidden);
}
public Integer getMinSize() {
return minSize;
}
public void setMinSize(Integer minSize) {
this.minSize = minSize;
}
public Integer getMaxSize() {
return maxSize;
}
public void setMaxSize(Integer maxSize) {
this.maxSize = maxSize;
}
}
public static class JsonSpec extends FieldSpec {
public JsonSpec(boolean required) {
this(required, false);
}
@JsonCreator
public JsonSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
this(FieldType.JSON, required, hidden);
}
private JsonSpec(FieldType type, boolean required, boolean hidden) {
super(type, required, hidden);
}
}
public static class ArrayJsonSpec extends JsonSpec {
@JsonProperty("min_size")
private Integer minSize;
@JsonProperty("max_size")
private Integer maxSize;
public ArrayJsonSpec(boolean required) {
this(required, false);
}
@JsonCreator
public ArrayJsonSpec(@JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
super(FieldType.ARRAY_JSON, required, hidden);
}
public Integer getMinSize() {
return minSize;
}
public void setMinSize(Integer minSize) {
this.minSize = minSize;
}
public Integer getMaxSize() {
return maxSize;
}
public void setMaxSize(Integer maxSize) {
this.maxSize = maxSize;
}
}
public static class UnknownSpec extends FieldSpec {
public UnknownSpec(FieldType type, boolean required) {
this(type, required, false);
}
@JsonCreator UnknownSpec(@JsonProperty("type") FieldType type, @JsonProperty("required") boolean required,
@JsonProperty(value = "hidden", defaultValue = "false") boolean hidden) {
super(type, required, hidden);
}
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/project | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/project/spec/FieldType.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.project.spec;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import com.fasterxml.jackson.annotation.JsonCreator;
import ai.toloka.client.v1.FlexibleEnum;
public class FieldType extends FlexibleEnum<FieldType> {
public static final FieldType BOOLEAN = new FieldType("boolean");
public static final FieldType ARRAY_BOOLEAN = new FieldType("array_boolean");
public static final FieldType STRING = new FieldType("string");
public static final FieldType ARRAY_STRING = new FieldType("array_string");
public static final FieldType INTEGER = new FieldType("integer");
public static final FieldType ARRAY_INTEGER = new FieldType("array_integer");
public static final FieldType FLOAT = new FieldType("float");
public static final FieldType ARRAY_FLOAT = new FieldType("array_float");
public static final FieldType URL = new FieldType("url");
public static final FieldType ARRAY_URL = new FieldType("array_url");
public static final FieldType FILE = new FieldType("file");
public static final FieldType ARRAY_FILE = new FieldType("array_file");
public static final FieldType COORDINATES = new FieldType("coordinates");
public static final FieldType ARRAY_COORDINATES = new FieldType("array_coordinates");
public static final FieldType JSON = new FieldType("json");
public static final FieldType ARRAY_JSON = new FieldType("array_json");
private static final FieldType[] VALUES = {
BOOLEAN, ARRAY_BOOLEAN,
STRING, ARRAY_STRING,
INTEGER, ARRAY_INTEGER,
FLOAT, ARRAY_FLOAT,
URL, ARRAY_URL,
FILE, ARRAY_FILE,
COORDINATES, ARRAY_COORDINATES,
JSON, ARRAY_JSON
};
private static final ConcurrentMap<String, FieldType> DISCOVERED_VALUES = new ConcurrentHashMap<>();
public static FieldType[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), FieldType.class);
}
@JsonCreator
public static FieldType valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<FieldType>() {
@Override public FieldType create(String name) {
return new FieldType(name);
}
});
}
private FieldType(String name) {
super(name);
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/project | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/project/spec/TaskSpec.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.project.spec;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TaskSpec {
@JsonProperty("input_spec")
private Map<String, FieldSpec> inputSpec;
@JsonProperty("output_spec")
private Map<String, FieldSpec> outputSpec;
@JsonProperty("view_spec")
private BaseTaskViewSpec viewSpec;
@JsonCreator
public TaskSpec(@JsonProperty("input_spec") Map<String, FieldSpec> inputSpec,
@JsonProperty("output_spec") Map<String, FieldSpec> outputSpec,
@JsonProperty("view_spec") BaseTaskViewSpec viewSpec) {
this.inputSpec = inputSpec;
this.outputSpec = outputSpec;
this.viewSpec = viewSpec;
}
public Map<String, FieldSpec> getInputSpec() {
return inputSpec;
}
public void setInputSpec(Map<String, FieldSpec> inputSpec) {
this.inputSpec = inputSpec;
}
public Map<String, FieldSpec> getOutputSpec() {
return outputSpec;
}
public void setOutputSpec(Map<String, FieldSpec> outputSpec) {
this.outputSpec = outputSpec;
}
public BaseTaskViewSpec getViewSpec() {
return viewSpec;
}
public void setViewSpec(BaseTaskViewSpec viewSpec) {
this.viewSpec = viewSpec;
}
}
|
0 | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/project | java-sources/ai/toloka/toloka-java-sdk/0.0.7/ai/toloka/client/v1/project/spec/TbTaskViewSpec.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.project.spec;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TbTaskViewSpec extends BaseTaskViewSpec {
private String config;
private Map<String, String> lock;
private LocalizationConfig localizationConfig;
@JsonCreator
public TbTaskViewSpec(@JsonProperty("settings") Map<String, Object> settings) {
super(settings, Type.TB);
}
public TbTaskViewSpec(TbTaskViewSpec original) {
super(original, Type.TB);
this.config = original.config;
this.lock = new HashMap<>(original.lock);
this.localizationConfig = new LocalizationConfig(original.localizationConfig);
}
public String getConfig() {
return config;
}
public void setConfig(String config) {
this.config = config;
}
public Map<String, String> getLock() {
return lock;
}
public void setLock(Map<String, String> lock) {
this.lock = lock;
}
public LocalizationConfig getLocalizationConfig() {
return localizationConfig;
}
public void setLocalizationConfig(LocalizationConfig localizationConfig) {
this.localizationConfig = localizationConfig;
}
public static class LocalizationConfig {
public List<Key> keys;
public LocalizationConfig() {
}
public LocalizationConfig(LocalizationConfig localizationConfig) {
this.keys = localizationConfig.keys.stream().map(Key::new).collect(Collectors.toList());
}
public static class Key {
public String key;
public String defaultValue;
public Key() {
}
public Key(String key, String defaultValue) {
this.key = key;
this.defaultValue = defaultValue;
}
public Key(Key viewKey) {
this.key = viewKey.key;
this.defaultValue = viewKey.defaultValue;
}
}
}
}
|
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/requester/Company.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.requester;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Company {
private String id;
@JsonProperty("superintendent_id")
private String superintendentId;
public String getId() {
return id;
}
public String getSuperintendentId() {
return superintendentId;
}
}
|
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/requester/Requester.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.requester;
import java.math.BigDecimal;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
import ai.toloka.client.v1.LangIso639;
public class Requester {
private String id;
private BigDecimal balance;
@JsonProperty("public_name")
private Map<LangIso639, String> publicName;
private Company company;
Requester() {}
public String getId() {
return id;
}
public BigDecimal getBalance() {
return balance;
}
public Map<LangIso639, String> getPublicName() {
return publicName;
}
public Company getCompany() {
return company;
}
}
|
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/requester/RequesterClient.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.requester;
public interface RequesterClient {
Requester getRequester();
}
|
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/skill/Skill.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.skill;
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 Skill {
private String id;
private String name;
@JsonProperty("public_name")
private Map<LangIso639, String> publicName;
@JsonProperty("private_comment")
private String privateComment;
@JsonProperty("public_requester_description")
private Map<LangIso639, String> publicRequesterDescription;
private boolean hidden;
@JsonProperty("skill_ttl_hours")
private Long skillTtlHours;
private Boolean training;
private Date created;
private Boolean global;
private Boolean deprecated;
@JsonCreator
public Skill(@JsonProperty("name") String name) {
this.name = name;
}
public String getId() {
return id;
}
public String getName() {
return name;
}
public Map<LangIso639, String> getPublicName() {
return publicName;
}
public String getPrivateComment() {
return privateComment;
}
public Map<LangIso639, String> getPublicRequesterDescription() {
return publicRequesterDescription;
}
public boolean isHidden() {
return hidden;
}
public Long getSkillTtlHours() {
return skillTtlHours;
}
public Boolean getTraining() {
return training;
}
public Date getCreated() {
return created;
}
public Boolean getGlobal() {
return global;
}
public Boolean isDeprecated() {
return deprecated;
}
public void setPublicName(Map<LangIso639, String> publicName) {
this.publicName = publicName;
}
public void setPrivateComment(String privateComment) {
this.privateComment = privateComment;
}
public void setPublicRequesterDescription(Map<LangIso639, String> publicRequesterDescription) {
this.publicRequesterDescription = publicRequesterDescription;
}
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
public void setSkillTtlHours(Long skillTtlHours) {
this.skillTtlHours = skillTtlHours;
}
public void setDeprecated(Boolean deprecated) {
this.deprecated = deprecated;
}
}
|
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/skill/SkillClient.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.skill;
import ai.toloka.client.v1.ModificationResult;
import ai.toloka.client.v1.SearchResult;
public interface SkillClient {
ModificationResult<Skill> createSkill(Skill skill);
SearchResult<Skill> findSkills(SkillSearchRequest request);
Skill getSkill(String skillId);
ModificationResult<Skill> updateSkill(String skillId, Skill skill);
}
|
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/skill/SkillFilterParam.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.skill;
import ai.toloka.client.v1.FilterParam;
public enum SkillFilterParam implements FilterParam {
ownerId(SkillSearchRequest.OWNER_ID_PARAMETER),
ownerCompanyId(SkillSearchRequest.OWNER_COMPANY_ID_PARAMETER),
global(SkillSearchRequest.GLOBAL_PARAMETER);
private String parameter;
SkillFilterParam(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/skill/SkillRangeParam.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.skill;
import ai.toloka.client.v1.RangeParam;
public enum SkillRangeParam implements RangeParam {
id(SkillSearchRequest.ID_PARAMETER), created(SkillSearchRequest.CREATED_PARAMETER);
private String parameter;
SkillRangeParam(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/skill/SkillSearchRequest.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.skill;
import java.util.Date;
import java.util.Map;
import ai.toloka.client.v1.SearchRequest;
public class SkillSearchRequest extends SearchRequest {
static final String ID_PARAMETER = "id";
static final String OWNER_ID_PARAMETER = "owner_id";
static final String OWNER_COMPANY_ID_PARAMETER = "owner_company_id";
static final String CREATED_PARAMETER = "created";
static final String GLOBAL_PARAMETER = "global";
private SkillSearchRequest(Map<String, Object> filterParameters,
Map<String, Object> rangeParameters,
String sortParameter,
Integer limit) {
super(filterParameters, rangeParameters, sortParameter, limit);
}
public static SkillSearchRequest.SkillBuilder make() {
return new SkillBuilder(new SkillFilterBuilder(), new SkillRangeBuilder(), new SkillSortBuilder());
}
public static class SkillBuilder extends SearchRequest.Builder<
SkillSearchRequest, SkillBuilder, SkillFilterBuilder, SkillRangeBuilder, SkillSortBuilder> {
private SkillBuilder(SkillFilterBuilder filterBuilder,
SkillRangeBuilder rangeBuilder,
SkillSortBuilder sortBuilder) {
super(filterBuilder, rangeBuilder, sortBuilder);
}
@Override public SkillSearchRequest done() {
return new SkillSearchRequest(
filterBuilder.getFilterParameters(),
rangeBuilder.getRangeParameters(),
sortBuilder.getSortParameter(),
getLimit());
}
}
public static class SkillFilterBuilder
extends SearchRequest.FilterBuilder<SkillFilterBuilder, SkillBuilder, SkillFilterParam> {
public SkillFilterBuilder byOwnerId(String ownerId) {
return by(SkillFilterParam.ownerId, ownerId);
}
public SkillFilterBuilder byOwnerCompanyId(String ownerCompanyId) {
return by(SkillFilterParam.ownerCompanyId, ownerCompanyId);
}
public SkillFilterBuilder byGlobal(Boolean global) {
return by(SkillFilterParam.global, global);
}
}
public static class SkillRangeBuilder
extends SearchRequest.RangeBuilder<SkillRangeBuilder, SkillBuilder, SkillRangeParam> {
public RangeItemBuilder<SkillRangeBuilder> byId(String id) {
return by(SkillRangeParam.id, id);
}
public RangeItemBuilder<SkillRangeBuilder> byCreated(Date date) {
return by(SkillRangeParam.created, date);
}
}
public static class SkillSortBuilder
extends SearchRequest.SortBuilder<SkillSortBuilder, SkillBuilder, SkillSortParam> {
public SortItem<SkillSortBuilder> byId() {
return by(SkillSortParam.id);
}
public SortItem<SkillSortBuilder> byCreated() {
return by(SkillSortParam.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/skill/SkillSortParam.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.skill;
import ai.toloka.client.v1.SortParam;
public enum SkillSortParam implements SortParam {
id(SkillSearchRequest.ID_PARAMETER),
created(SkillSearchRequest.CREATED_PARAMETER);
private String parameter;
SkillSortParam(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/solution/Solution.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.solution;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Solution {
@JsonProperty("output_values")
private Map<String, Object> outputValues;
public Map<String, Object> getOutputValues() {
return outputValues;
}
}
|
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/task/BaseTask.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.task;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class BaseTask {
private String id;
@JsonProperty("input_values")
private final Map<String, Object> inputValues;
@JsonProperty("known_solutions")
private List<KnownSolution> knownSolutions;
@JsonProperty("message_on_unknown_solution")
private String messageOnUnknownSolution;
@JsonProperty("localization_config")
private TaskLocalizationConfig localizationConfig;
@JsonCreator
public BaseTask(@JsonProperty("input_values") Map<String, Object> inputValues) {
this.inputValues = inputValues;
}
public BaseTask(Map<String, Object> inputValues, List<KnownSolution> knownSolutions) {
this(inputValues, knownSolutions, null);
}
public BaseTask(Map<String, Object> inputValues, List<KnownSolution> knownSolutions,
String messageOnUnknownSolution) {
this(inputValues, knownSolutions, messageOnUnknownSolution, null);
}
public BaseTask(Map<String, Object> inputValues, List<KnownSolution> knownSolutions,
String messageOnUnknownSolution, TaskLocalizationConfig localizationConfig) {
this.inputValues = inputValues;
this.knownSolutions = knownSolutions;
this.messageOnUnknownSolution = messageOnUnknownSolution;
this.localizationConfig = localizationConfig;
}
public String getId() {
return id;
}
public Map<String, Object> getInputValues() {
return inputValues;
}
public List<KnownSolution> getKnownSolutions() {
return knownSolutions;
}
public void setKnownSolutions(List<KnownSolution> knownSolutions) {
this.knownSolutions = knownSolutions;
}
public String getMessageOnUnknownSolution() {
return messageOnUnknownSolution;
}
public void setMessageOnUnknownSolution(String messageOnUnknownSolution) {
this.messageOnUnknownSolution = messageOnUnknownSolution;
}
public TaskLocalizationConfig getLocalizationConfig() {
return localizationConfig;
}
}
|
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/task/BaselineSolution.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.task;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class BaselineSolution {
@JsonProperty("output_values")
private Map<String, Object> outputValues;
@JsonProperty("confidence_weight")
private Double confidenceWeight;
@JsonCreator
public BaselineSolution(@JsonProperty("output_values") Map<String, Object> outputValues,
@JsonProperty("confidence_weight") Double confidenceWeight) {
this.outputValues = outputValues;
this.confidenceWeight = confidenceWeight;
}
public Map<String, Object> getOutputValues() {
return outputValues;
}
public Double getConfidenceWeight() {
return confidenceWeight;
}
}
|
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/task/KnownSolution.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.task;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class KnownSolution {
@JsonProperty("output_values")
private Map<String, Object> outputValues;
@JsonProperty("correctness_weight")
private Double correctnessWeight;
@JsonCreator
public KnownSolution(@JsonProperty("output_values") Map<String, Object> outputValues,
@JsonProperty("correctness_weight") Double correctnessWeight) {
this.outputValues = outputValues;
this.correctnessWeight = correctnessWeight;
}
public Map<String, Object> getOutputValues() {
return outputValues;
}
public Double getCorrectnessWeight() {
return correctnessWeight;
}
}
|
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/task/KnownSolutionsGenerateOperation.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.task;
import com.fasterxml.jackson.annotation.JsonProperty;
import ai.toloka.client.v1.operation.Operation;
import ai.toloka.client.v1.operation.OperationType;
public class KnownSolutionsGenerateOperation extends
Operation<KnownSolutionsGenerateOperation.Parameters, KnownSolutionsGenerateOperation> {
public static final OperationType TYPE = OperationType.KNOWN_SOLUTIONS_GENERATE;
public static class Parameters {
@JsonProperty("pool_id")
private String poolId;
private String poolName;
@JsonProperty("project_id")
private String projectId;
private String projectName;
private String secret;
private String requesterId;
public String getPoolName() {
return poolName;
}
public String getProjectId() {
return projectId;
}
public String getProjectName() {
return projectName;
}
public String getSecret() {
return secret;
}
public String getRequesterId() {
return requesterId;
}
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/task/Task.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.task;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Task extends BaseTask {
@JsonProperty("pool_id")
private final String poolId;
private Integer overlap;
@JsonProperty("infinite_overlap")
private Boolean infiniteOverlap;
@JsonProperty("remaining_overlap")
private Integer remainingOverlap;
@JsonProperty("reserved_for")
private Set<String> reservedFor;
@JsonProperty("unavailable_for")
private Set<String> unavailableFor;
@JsonProperty("traits_all_of")
private Set<String> traitsAllOf;
@JsonProperty("traits_any_of")
private Set<String> traitsAnyOf;
@JsonProperty("traits_none_of_any")
private Set<String> traitsNoneOfAny;
private Date created;
@JsonProperty("origin_task_id")
private String originTaskId;
@JsonProperty("baseline_solutions")
private List<BaselineSolution> baselineSolutions;
@JsonCreator
public Task(@JsonProperty("pool_id") String poolId, @JsonProperty("input_values") Map<String, Object> inputValues) {
super(inputValues);
this.poolId = poolId;
}
public Task(String poolId, Map<String, Object> inputValues, List<KnownSolution> knownSolutions) {
super(inputValues, knownSolutions);
this.poolId = poolId;
}
public Task(String poolId, Map<String, Object> inputValues, List<KnownSolution> knownSolutions,
String messageOnUnknownSolution) {
super(inputValues, knownSolutions, messageOnUnknownSolution);
this.poolId = poolId;
}
public Task(String poolId, Map<String, Object> inputValues, List<KnownSolution> knownSolutions,
String messageOnUnknownSolution, TaskLocalizationConfig localizationConfig) {
super(inputValues, knownSolutions, messageOnUnknownSolution, localizationConfig);
this.poolId = poolId;
}
public String getPoolId() {
return poolId;
}
public Integer getOverlap() {
return overlap;
}
public void setOverlap(Integer overlap) {
this.overlap = overlap;
}
public Boolean getInfiniteOverlap() {
return infiniteOverlap;
}
public void setInfiniteOverlap(final Boolean infiniteOverlap) {
this.infiniteOverlap = infiniteOverlap;
}
public Set<String> getReservedFor() {
return reservedFor;
}
public void setReservedFor(Set<String> reservedFor) {
this.reservedFor = reservedFor;
}
public Set<String> getUnavailableFor() {
return unavailableFor;
}
public void setUnavailableFor(Set<String> unavailableFor) {
this.unavailableFor = unavailableFor;
}
public Set<String> getTraitsAllOf() {
return traitsAllOf;
}
public void setTraitsAllOf(Set<String> traitsAllOf) {
this.traitsAllOf = traitsAllOf;
}
public Set<String> getTraitsAnyOf() {
return traitsAnyOf;
}
public void setTraitsAnyOf(Set<String> traitsAnyOf) {
this.traitsAnyOf = traitsAnyOf;
}
public Set<String> getTraitsNoneOfAny() {
return traitsNoneOfAny;
}
public void setTraitsNoneOfAny(Set<String> traitsNoneOfAny) {
this.traitsNoneOfAny = traitsNoneOfAny;
}
public Date getCreated() {
return created;
}
public String getOriginTaskId() {
return originTaskId;
}
public Integer getRemainingOverlap() {
return remainingOverlap;
}
public List<BaselineSolution> getBaselineSolutions() {
return baselineSolutions;
}
public void setBaselineSolutions(List<BaselineSolution> baselineSolutions) {
this.baselineSolutions = baselineSolutions;
}
}
|
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/task/TaskClient.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.task;
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 TaskClient {
ModificationResult<Task> createTask(Task task);
ModificationResult<Task> createTask(Task task, TaskCreateRequestParameters parameters);
BatchCreateResult<Task> createTasks(List<Task> tasks);
BatchCreateResult<Task> createTasks(List<Task> tasks, TaskCreateRequestParameters parameters);
TaskCreateBatchOperation createTasksAsync(Iterator<Task> tasks);
TaskCreateBatchOperation createTasksAsync(Iterator<Task> tasks, TaskCreateRequestParameters parameters);
SearchResult<Task> findTasks(TaskSearchRequest request);
Task getTask(String taskId);
ModificationResult<Task> patchTask(String taskId, TaskPatch patch);
ModificationResult<Task> patchTask(String taskId, TaskPatch patch, TaskPatchRequestParameters parameters);
ModificationResult<Task> setOverlapOrMin(String taskId, TaskOverlapPatch overlapPatch);
}
|
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/task/TaskCreateBatchOperation.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.task;
import com.fasterxml.jackson.annotation.JsonProperty;
import ai.toloka.client.v1.operation.Operation;
import ai.toloka.client.v1.operation.OperationType;
public class TaskCreateBatchOperation extends Operation<TaskCreateBatchOperation.Parameters, TaskCreateBatchOperation> {
public static final OperationType TYPE = OperationType.TASK_BATCH_CREATE;
public static class Parameters {
@JsonProperty("skip_invalid_items")
private Boolean skipInvalidItems;
@JsonProperty("allow_defaults")
private Boolean allowDefaults;
@JsonProperty("open_pool")
private Boolean openPool;
public Boolean getSkipInvalidItems() {
return skipInvalidItems;
}
public Boolean getAllowDefaults() {
return allowDefaults;
}
public Boolean getOpenPool() {
return openPool;
}
}
}
|
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/task/TaskCreateRequestParameters.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.task;
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 TaskCreateRequestParameters 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 static final String ALLOW_DEFAULTS_PARAMETER = "allow_defaults";
private static final String OPEN_POOL_PARAMETER = "open_pool";
private UUID operationId;
private Boolean skipInvalidItems;
private Boolean allowDefaults;
private Boolean openPool;
public void setOperationId(UUID operationId) {
this.operationId = operationId;
}
public void setSkipInvalidItems(Boolean skipInvalidItems) {
this.skipInvalidItems = skipInvalidItems;
}
public void setAllowDefaults(Boolean allowDefaults) {
this.allowDefaults = allowDefaults;
}
public void setOpenPool(Boolean openPool) {
this.openPool = openPool;
}
public UUID getOperationId() {
return operationId;
}
public Boolean getSkipInvalidItems() {
return skipInvalidItems;
}
public Boolean getAllowDefaults() {
return allowDefaults;
}
public Boolean getOpenPool() {
return openPool;
}
@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);
params.put(ALLOW_DEFAULTS_PARAMETER, allowDefaults);
params.put(OPEN_POOL_PARAMETER, openPool);
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/task/TaskFilterParam.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.task;
import ai.toloka.client.v1.FilterParam;
public enum TaskFilterParam implements FilterParam {
ownerId(TaskSearchRequest.OWNER_ID_PARAMETER),
ownerCompanyId(TaskSearchRequest.OWNER_COMPANY_ID_PARAMETER),
poolId(TaskSearchRequest.POOL_ID_PARAMETER),
overlap(TaskSearchRequest.OVERLAP);
private String parameter;
TaskFilterParam(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/task/TaskLocalizationConfig.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.task;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import ai.toloka.client.v1.FlexibleEnum;
import ai.toloka.client.v1.LangIso639;
public class TaskLocalizationConfig {
@JsonProperty("default_language")
private LangIso639 defaultLanguage;
@JsonProperty("additional_languages")
private List<AdditionalLanguage> additionalLanguages;
public TaskLocalizationConfig() {
}
public TaskLocalizationConfig(LangIso639 defaultLanguage,
List<AdditionalLanguage> additionalLanguages) {
this.defaultLanguage = defaultLanguage;
this.additionalLanguages = additionalLanguages;
}
public LangIso639 getDefaultLanguage() {
return defaultLanguage;
}
public void setDefaultLanguage(LangIso639 defaultLanguage) {
this.defaultLanguage = defaultLanguage;
}
public List<AdditionalLanguage> getAdditionalLanguages() {
return additionalLanguages;
}
public void setAdditionalLanguages(List<AdditionalLanguage> additionalLanguages) {
this.additionalLanguages = additionalLanguages;
}
public static class AdditionalLanguage {
private LangIso639 language;
@JsonProperty("message_on_unknown_solution")
private LocalizedValue messageOnUnknownSolution;
public AdditionalLanguage() {
}
public AdditionalLanguage(LangIso639 language) {
this.language = language;
}
public LangIso639 getLanguage() {
return language;
}
public void setLanguage(LangIso639 language) {
this.language = language;
}
public LocalizedValue getMessageOnUnknownSolution() {
return messageOnUnknownSolution;
}
public void setMessageOnUnknownSolution(LocalizedValue messageOnUnknownSolution) {
this.messageOnUnknownSolution = messageOnUnknownSolution;
}
public static class LocalizedValue {
private String value;
private Source source;
public LocalizedValue() {
}
public LocalizedValue(String value, Source source) {
this.value = value;
this.source = source;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public Source getSource() {
return source;
}
public void setSource(Source source) {
this.source = source;
}
}
public static class Source extends FlexibleEnum<Source> {
public static final Source REQUESTER = new Source("REQUESTER");
private static final Source[] VALUES = {REQUESTER};
private static final ConcurrentMap<String, Source> DISCOVERED_VALUES = new ConcurrentHashMap<>();
public static Source[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), Source.class);
}
@JsonCreator
public static Source valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<Source>() {
@Override public Source create(String name) {
return new Source(name);
}
});
}
private Source(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/task/TaskOverlapPatch.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.task;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TaskOverlapPatch {
private Integer overlap;
@JsonProperty("infinite_overlap")
private Boolean infiniteOverlap;
public TaskOverlapPatch() {
}
public TaskOverlapPatch(final int overlap) {
this.overlap = overlap;
this.infiniteOverlap = null;
}
public TaskOverlapPatch(final boolean infiniteOverlap) {
this.overlap = null;
this.infiniteOverlap = infiniteOverlap;
}
public Integer getOverlap() {
return overlap;
}
public void setOverlap(final Integer overlap) {
this.overlap = overlap;
}
public Boolean getInfiniteOverlap() {
return infiniteOverlap;
}
public void setInfiniteOverlap(final Boolean infiniteOverlap) {
this.infiniteOverlap = infiniteOverlap;
}
}
|
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/task/TaskPatch.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.task;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TaskPatch {
private Integer overlap;
@JsonProperty("baseline_solutions")
private List<BaselineSolution> baselineSolutions;
@JsonProperty("known_solutions")
private List<KnownSolution> knownSolutions;
@JsonProperty("message_on_unknown_solution")
private String messageOnUnknownSolution;
public Integer getOverlap() {
return overlap;
}
public void setOverlap(Integer overlap) {
this.overlap = overlap;
}
public List<BaselineSolution> getBaselineSolutions() {
return baselineSolutions;
}
public void setBaselineSolutions(List<BaselineSolution> baselineSolutions) {
this.baselineSolutions = baselineSolutions;
}
public String getMessageOnUnknownSolution() {
return messageOnUnknownSolution;
}
public void setMessageOnUnknownSolution(String messageOnUnknownSolution) {
this.messageOnUnknownSolution = messageOnUnknownSolution;
}
public List<KnownSolution> getKnownSolutions() {
return knownSolutions;
}
public void setKnownSolutions(List<KnownSolution> knownSolutions) {
this.knownSolutions = knownSolutions;
}
}
|
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/task/TaskPatchRequestParameters.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.task;
import java.util.HashMap;
import java.util.Map;
import ai.toloka.client.v1.AbstractRequestParameters;
import ai.toloka.client.v1.RequestParameters;
public class TaskPatchRequestParameters extends AbstractRequestParameters implements RequestParameters {
private static final String OPEN_POOL_PARAMETER = "open_pool";
private Boolean openPool;
public Boolean getOpenPool() {
return openPool;
}
public void setOpenPool(Boolean openPool) {
this.openPool = openPool;
}
@Override public Map<String, Object> getQueryParameters() {
Map<String, Object> params = new HashMap<>();
params.put(OPEN_POOL_PARAMETER, openPool);
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/task/TaskRangeParam.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.task;
import ai.toloka.client.v1.RangeParam;
public enum TaskRangeParam implements RangeParam {
id(TaskSearchRequest.ID_PARAMETER),
created(TaskSearchRequest.CREATED_PARAMETER),
overlap(TaskSearchRequest.OVERLAP);
private String parameter;
TaskRangeParam(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/task/TaskSearchRequest.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.task;
import java.util.Date;
import java.util.Map;
import ai.toloka.client.v1.SearchRequest;
public class TaskSearchRequest extends SearchRequest {
static final String OWNER_ID_PARAMETER = "owner_id";
static final String OWNER_COMPANY_ID_PARAMETER = "owner_company_id";
static final String ID_PARAMETER = "id";
static final String CREATED_PARAMETER = "created";
static final String POOL_ID_PARAMETER = "pool_id";
static final String OVERLAP = "overlap";
private TaskSearchRequest(Map<String, Object> filterParameters, Map<String, Object> rangeParameters,
String sortParameter, Integer limit) {
super(filterParameters, rangeParameters, sortParameter, limit);
}
public static TaskSearchRequest.TaskBuilder make() {
return new TaskBuilder(new TaskFilterBuilder(), new TaskRangeBuilder(), new TaskSortBuilder());
}
public static class TaskBuilder extends SearchRequest.Builder<
TaskSearchRequest, TaskBuilder, TaskFilterBuilder, TaskRangeBuilder, TaskSortBuilder> {
private TaskBuilder(TaskFilterBuilder filterBuilder, TaskRangeBuilder rangeBuilder,
TaskSortBuilder sortBuilder) {
super(filterBuilder, rangeBuilder, sortBuilder);
}
@Override public TaskSearchRequest done() {
return new TaskSearchRequest(filterBuilder.getFilterParameters(), rangeBuilder.getRangeParameters(),
sortBuilder.getSortParameter(), getLimit());
}
}
public static class TaskFilterBuilder
extends SearchRequest.FilterBuilder<TaskFilterBuilder, TaskBuilder, TaskFilterParam> {
public TaskFilterBuilder byOwnerId(String ownerId) {
return by(TaskFilterParam.ownerId, ownerId);
}
public TaskFilterBuilder byOwnerCompanyId(String companyId) {
return by(TaskFilterParam.ownerCompanyId, companyId);
}
public TaskFilterBuilder byPoolId(String poolId) {
return by(TaskFilterParam.poolId, poolId);
}
/**
* @since 65
*/
public TaskFilterBuilder byOverlap(Integer overlap) {
return by(TaskFilterParam.overlap, overlap);
}
}
public static class TaskRangeBuilder
extends SearchRequest.RangeBuilder<TaskRangeBuilder, TaskBuilder, TaskRangeParam> {
public RangeItemBuilder<TaskRangeBuilder> byId(String id) {
return by(TaskRangeParam.id, id);
}
public RangeItemBuilder<TaskRangeBuilder> byCreated(Date created) {
return by(TaskRangeParam.created, created);
}
public RangeItemBuilder<TaskRangeBuilder> byOverlap(Integer overlap) {
return by(TaskRangeParam.overlap, overlap);
}
}
public static class TaskSortBuilder extends SearchRequest.SortBuilder<TaskSortBuilder, TaskBuilder, TaskSortParam> {
public SortItem<TaskSortBuilder> byId() {
return by(TaskSortParam.id);
}
public SortItem<TaskSortBuilder> byCreated() {
return by(TaskSortParam.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/task/TaskSortParam.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.task;
import ai.toloka.client.v1.SortParam;
public enum TaskSortParam implements SortParam {
id(TaskSearchRequest.ID_PARAMETER),
created(TaskSearchRequest.CREATED_PARAMETER);
private String parameter;
TaskSortParam(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/tasksuite/TaskSuite.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.tasksuite;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Set;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import ai.toloka.client.v1.task.BaseTask;
public class TaskSuite {
private String id;
@JsonProperty("pool_id")
private String poolId;
private List<BaseTask> tasks;
private Integer overlap;
@JsonProperty("remaining_overlap")
private Integer remainingOverlap;
@JsonProperty("reserved_for")
private Set<String> reservedFor;
@JsonProperty("unavailable_for")
private Set<String> unavailableFor;
@JsonProperty("traits_all_of")
private Set<String> traitsAllOf;
@JsonProperty("traits_any_of")
private Set<String> traitsAnyOf;
@JsonProperty("traits_none_of_any")
private Set<String> traitsNoneOfAny;
private BigDecimal longitude;
private BigDecimal latitude;
private Boolean mixed;
private Boolean automerged;
private Date created;
@JsonProperty("issuing_order_override")
private Double issuingOrderOverride;
@JsonCreator
public TaskSuite(@JsonProperty("pool_id") String poolId, @JsonProperty("tasks") List<BaseTask> tasks) {
this.poolId = poolId;
this.tasks = tasks;
}
public void setOverlap(Integer overlap) {
this.overlap = overlap;
}
public void setReservedFor(Set<String> reservedFor) {
this.reservedFor = reservedFor;
}
public void setUnavailableFor(Set<String> unavailableFor) {
this.unavailableFor = unavailableFor;
}
public void setLongitude(BigDecimal longitude) {
this.longitude = longitude;
}
public void setLatitude(BigDecimal latitude) {
this.latitude = latitude;
}
public String getId() {
return id;
}
public String getPoolId() {
return poolId;
}
public List<BaseTask> getTasks() {
return tasks;
}
public Integer getOverlap() {
return overlap;
}
public Set<String> getReservedFor() {
return reservedFor;
}
public Set<String> getUnavailableFor() {
return unavailableFor;
}
public Set<String> getTraitsAllOf() {
return traitsAllOf;
}
public void setTraitsAllOf(Set<String> traitsAllOf) {
this.traitsAllOf = traitsAllOf;
}
public Set<String> getTraitsAnyOf() {
return traitsAnyOf;
}
public void setTraitsAnyOf(Set<String> traitsAnyOf) {
this.traitsAnyOf = traitsAnyOf;
}
public Set<String> getTraitsNoneOfAny() {
return traitsNoneOfAny;
}
public void setTraitsNoneOfAny(Set<String> traitsNoneOfAny) {
this.traitsNoneOfAny = traitsNoneOfAny;
}
public BigDecimal getLongitude() {
return longitude;
}
public BigDecimal getLatitude() {
return latitude;
}
public Boolean getMixed() {
return mixed;
}
public Boolean getAutomerged() {
return automerged;
}
public Date getCreated() {
return created;
}
public Double getIssuingOrderOverride() {
return issuingOrderOverride;
}
public void setIssuingOrderOverride(Double issuingOrderOverride) {
this.issuingOrderOverride = issuingOrderOverride;
}
public Integer getRemainingOverlap() {
return remainingOverlap;
}
}
|
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/tasksuite/TaskSuiteClient.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.tasksuite;
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 TaskSuiteClient {
ModificationResult<TaskSuite> createTaskSuite(TaskSuite taskSuite);
ModificationResult<TaskSuite> createTaskSuite(TaskSuite taskSuite, TaskSuiteCreateRequestParameters parameters);
BatchCreateResult<TaskSuite> createTaskSuites(List<TaskSuite> taskSuites);
BatchCreateResult<TaskSuite> createTaskSuites(List<TaskSuite> taskSuites,
TaskSuiteCreateRequestParameters parameters);
TaskSuiteCreateBatchOperation createTaskSuitesAsync(Iterator<TaskSuite> taskSuites);
TaskSuiteCreateBatchOperation createTaskSuitesAsync(Iterator<TaskSuite> taskSuites,
TaskSuiteCreateRequestParameters parameters);
SearchResult<TaskSuite> findTaskSuites(TaskSuiteSearchRequest request);
TaskSuite getTaskSuite(String taskSuiteId);
ModificationResult<TaskSuite> patchTaskSuite(String taskSuiteId, TaskSuitePatch patch);
ModificationResult<TaskSuite> patchTaskSuite(String taskSuiteId,
TaskSuitePatch patch,
TaskSuitePatchRequestParameters parameters);
ModificationResult<TaskSuite> setOverlapOrMin(String taskSuiteId, TaskSuiteOverlapPatch overlapPatch);
}
|
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/tasksuite/TaskSuiteCreateBatchOperation.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.tasksuite;
import com.fasterxml.jackson.annotation.JsonProperty;
import ai.toloka.client.v1.operation.Operation;
import ai.toloka.client.v1.operation.OperationType;
public class TaskSuiteCreateBatchOperation
extends Operation<TaskSuiteCreateBatchOperation.Parameters, TaskSuiteCreateBatchOperation> {
public static final OperationType TYPE = OperationType.TASK_SUITE_BATCH_CREATE;
public static class Parameters {
@JsonProperty("skip_invalid_items")
private Boolean skipInvalidItems;
@JsonProperty("allow_defaults")
private Boolean allowDefaults;
@JsonProperty("open_pool")
private Boolean openPool;
public Boolean getSkipInvalidItems() {
return skipInvalidItems;
}
public Boolean getAllowDefaults() {
return allowDefaults;
}
public Boolean getOpenPool() {
return openPool;
}
}
}
|
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/tasksuite/TaskSuiteCreateRequestParameters.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.tasksuite;
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 TaskSuiteCreateRequestParameters 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 static final String ALLOW_DEFAULTS_PARAMETER = "allow_defaults";
private static final String OPEN_POOL_PARAMETER = "open_pool";
private UUID operationId;
private Boolean skipInvalidItems;
private Boolean allowDefaults;
private Boolean openPool;
public UUID getOperationId() {
return operationId;
}
public void setOperationId(UUID operationId) {
this.operationId = operationId;
}
public void setSkipInvalidItems(Boolean skipInvalidItems) {
this.skipInvalidItems = skipInvalidItems;
}
public void setAllowDefaults(Boolean allowDefaults) {
this.allowDefaults = allowDefaults;
}
public void setOpenPool(Boolean openPool) {
this.openPool = openPool;
}
public Boolean getSkipInvalidItems() {
return skipInvalidItems;
}
public Boolean getAllowDefaults() {
return allowDefaults;
}
public Boolean getOpenPool() {
return openPool;
}
@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);
params.put(ALLOW_DEFAULTS_PARAMETER, allowDefaults);
params.put(OPEN_POOL_PARAMETER, openPool);
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/tasksuite/TaskSuiteFilterParam.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.tasksuite;
import ai.toloka.client.v1.FilterParam;
public enum TaskSuiteFilterParam implements FilterParam {
owner_id(TaskSuiteSearchRequest.OWNER_ID_PARAMETER),
owner_company_id(TaskSuiteSearchRequest.OWNER_COMPANY_ID_PARAMETER),
task_id(TaskSuiteSearchRequest.TASK_ID_PARAMETER),
pool_id(TaskSuiteSearchRequest.POOL_ID_PARAMETER),
overlap(TaskSuiteSearchRequest.OVERLAP);
private String parameter;
TaskSuiteFilterParam(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/tasksuite/TaskSuiteOverlapPatch.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.tasksuite;
public class TaskSuiteOverlapPatch {
private int overlap;
public TaskSuiteOverlapPatch() {
}
public TaskSuiteOverlapPatch(final int overlap) {
this.overlap = overlap;
}
public int getOverlap() {
return overlap;
}
public void setOverlap(final int overlap) {
this.overlap = overlap;
}
}
|
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/tasksuite/TaskSuitePatch.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.tasksuite;
import com.fasterxml.jackson.annotation.JsonProperty;
public class TaskSuitePatch {
private Integer overlap;
@JsonProperty("infinite_overlap")
private Boolean infiniteOverlap;
@JsonProperty("issuing_order_override")
private Double issuingOrderOverride;
public Integer getOverlap() {
return overlap;
}
public void setOverlap(Integer overlap) {
this.overlap = overlap;
this.infiniteOverlap = overlap == null;
}
public Double getIssuingOrderOverride() {
return issuingOrderOverride;
}
public void setIssuingOrderOverride(Double issuingOrderOverride) {
this.issuingOrderOverride = issuingOrderOverride;
}
}
|
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/tasksuite/TaskSuitePatchRequestParameters.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.tasksuite;
import java.util.HashMap;
import java.util.Map;
import ai.toloka.client.v1.AbstractRequestParameters;
import ai.toloka.client.v1.RequestParameters;
public class TaskSuitePatchRequestParameters extends AbstractRequestParameters implements RequestParameters {
private static final String OPEN_POOL_PARAMETER = "open_pool";
private Boolean openPool;
public Boolean getOpenPool() {
return openPool;
}
public void setOpenPool(Boolean openPool) {
this.openPool = openPool;
}
@Override public Map<String, Object> getQueryParameters() {
Map<String, Object> params = new HashMap<>();
params.put(OPEN_POOL_PARAMETER, openPool);
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/tasksuite/TaskSuiteRangeParam.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.tasksuite;
import ai.toloka.client.v1.RangeParam;
public enum TaskSuiteRangeParam implements RangeParam {
id(TaskSuiteSearchRequest.ID_PARAMETER),
created(TaskSuiteSearchRequest.CREATED_PARAMETER),
overlap(TaskSuiteSearchRequest.OVERLAP);
private String parameter;
TaskSuiteRangeParam(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/tasksuite/TaskSuiteSearchRequest.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.tasksuite;
import java.util.Date;
import java.util.Map;
import ai.toloka.client.v1.SearchRequest;
public class TaskSuiteSearchRequest extends SearchRequest {
static final String OWNER_ID_PARAMETER = "owner_id";
static final String OWNER_COMPANY_ID_PARAMETER = "owner_company_id";
static final String TASK_ID_PARAMETER = "task_id";
static final String POOL_ID_PARAMETER = "pool_id";
static final String OVERLAP = "overlap";
static final String ID_PARAMETER = "id";
static final String CREATED_PARAMETER = "created";
private TaskSuiteSearchRequest(Map<String, Object> filterParameters, Map<String, Object> rangeParameters,
String sortParameter, Integer limit) {
super(filterParameters, rangeParameters, sortParameter, limit);
}
public static TaskSuiteBuilder make() {
return new TaskSuiteBuilder(
new TaskSuiteFilterBuilder(), new TaskSuiteRangeBuilder(), new TaskSuiteSortBuilder());
}
public static class TaskSuiteBuilder extends Builder<TaskSuiteSearchRequest, TaskSuiteBuilder,
TaskSuiteFilterBuilder, TaskSuiteRangeBuilder, TaskSuiteSortBuilder> {
public TaskSuiteBuilder(TaskSuiteFilterBuilder filterBuilder, TaskSuiteRangeBuilder rangeBuilder,
TaskSuiteSortBuilder sortBuilder) {
super(filterBuilder, rangeBuilder, sortBuilder);
}
@Override public TaskSuiteSearchRequest done() {
return new TaskSuiteSearchRequest(filterBuilder.getFilterParameters(), rangeBuilder.getRangeParameters(),
sortBuilder.getSortParameter(), getLimit());
}
}
public static class TaskSuiteFilterBuilder
extends FilterBuilder<TaskSuiteFilterBuilder, TaskSuiteBuilder, TaskSuiteFilterParam> {
public TaskSuiteFilterBuilder byOwnerId(String ownerId) {
return by(TaskSuiteFilterParam.owner_id, ownerId);
}
public TaskSuiteFilterBuilder byOwnerCompanyId(String companyId) {
return by(TaskSuiteFilterParam.owner_company_id, companyId);
}
public TaskSuiteFilterBuilder byTaskId(String taskId) {
return by(TaskSuiteFilterParam.task_id, taskId);
}
public TaskSuiteFilterBuilder byPoolId(String poolId) {
return by(TaskSuiteFilterParam.pool_id, poolId);
}
/**
* @since 65
*/
public TaskSuiteFilterBuilder byOverlap(Integer overlap) {
return by(TaskSuiteFilterParam.overlap, overlap);
}
}
public static class TaskSuiteRangeBuilder
extends RangeBuilder<TaskSuiteRangeBuilder, TaskSuiteBuilder, TaskSuiteRangeParam> {
public RangeItemBuilder<TaskSuiteRangeBuilder> byId(String id) {
return by(TaskSuiteRangeParam.id, id);
}
public RangeItemBuilder<TaskSuiteRangeBuilder> byCreated(Date created) {
return by(TaskSuiteRangeParam.created, created);
}
/**
* @since 65
*/
public RangeItemBuilder<TaskSuiteRangeBuilder> byOverlap(Integer overlap) {
return by(TaskSuiteRangeParam.overlap, overlap);
}
}
public static class TaskSuiteSortBuilder
extends SortBuilder<TaskSuiteSortBuilder, TaskSuiteBuilder, TaskSuiteSortParam> {
public SortItem<TaskSuiteSortBuilder> byId() {
return by(TaskSuiteSortParam.id);
}
public SortItem<TaskSuiteSortBuilder> byCreated() {
return by(TaskSuiteSortParam.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/tasksuite/TaskSuiteSortParam.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.tasksuite;
import ai.toloka.client.v1.SortParam;
public enum TaskSuiteSortParam implements SortParam {
id(TaskSuiteSearchRequest.ID_PARAMETER),
created(TaskSuiteSearchRequest.CREATED_PARAMETER);
private String parameter;
TaskSuiteSortParam(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/Training.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.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
import ai.toloka.client.v1.Owner;
public class Training {
private String id;
private Owner owner;
@JsonProperty("project_id")
private String projectId;
@JsonProperty("private_name")
private String privateName;
@JsonProperty("private_comment")
private String privateComment;
@JsonProperty("public_description")
private String publicDescription;
@JsonProperty("inherited_instructions")
private Boolean inheritedInstructions;
@JsonProperty("public_instructions")
private String publicInstructions;
@JsonProperty("may_contain_adult_content")
private Boolean mayContainAdultContent;
@JsonProperty("assignment_max_duration_seconds")
private Integer assignmentMaxDurationSeconds;
@JsonProperty("mix_tasks_in_creation_order")
private Boolean mixTasksInCreationOrder;
@JsonProperty("shuffle_tasks_in_task_suite")
private Boolean shuffleTasksInTaskSuite;
@JsonProperty("training_tasks_in_task_suite_count")
private Integer trainingTasksInTaskSuiteCount;
@JsonProperty("task_suites_required_to_pass")
private Integer taskSuitesRequiredToPass;
@JsonProperty("retry_training_after_days")
private Long retryTrainingAfterDays;
private Map<String, List<String>> metadata;
private TrainingStatus status;
private Date created;
@JsonProperty("last_started")
private Date lastStarted;
@JsonProperty("last_stopped")
private Date lastStopped;
@JsonProperty("last_close_reason")
private TrainingCloseReason lastCloseReason;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Owner getOwner() {
return owner;
}
public void setOwner(Owner owner) {
this.owner = owner;
}
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public String getPrivateName() {
return privateName;
}
public void setPrivateName(String privateName) {
this.privateName = privateName;
}
public String getPrivateComment() {
return privateComment;
}
public void setPrivateComment(String privateComment) {
this.privateComment = privateComment;
}
public String getPublicDescription() {
return publicDescription;
}
public void setPublicDescription(String publicDescription) {
this.publicDescription = publicDescription;
}
public Boolean getInheritedInstructions() {
return inheritedInstructions;
}
public void setInheritedInstructions(Boolean inheritedInstructions) {
this.inheritedInstructions = inheritedInstructions;
}
public String getPublicInstructions() {
return publicInstructions;
}
public void setPublicInstructions(String publicInstructions) {
this.publicInstructions = publicInstructions;
}
public Boolean getMayContainAdultContent() {
return mayContainAdultContent;
}
public void setMayContainAdultContent(Boolean mayContainAdultContent) {
this.mayContainAdultContent = mayContainAdultContent;
}
public Map<String, List<String>> getMetadata() {
return metadata;
}
public void setMetadata(Map<String, List<String>> metadata) {
this.metadata = metadata;
}
public Integer getAssignmentMaxDurationSeconds() {
return assignmentMaxDurationSeconds;
}
public void setAssignmentMaxDurationSeconds(Integer assignmentMaxDurationSeconds) {
this.assignmentMaxDurationSeconds = assignmentMaxDurationSeconds;
}
public Boolean getMixTasksInCreationOrder() {
return mixTasksInCreationOrder;
}
public void setMixTasksInCreationOrder(Boolean mixTasksInCreationOrder) {
this.mixTasksInCreationOrder = mixTasksInCreationOrder;
}
public Boolean getShuffleTasksInTaskSuite() {
return shuffleTasksInTaskSuite;
}
public void setShuffleTasksInTaskSuite(Boolean shuffleTasksInTaskSuite) {
this.shuffleTasksInTaskSuite = shuffleTasksInTaskSuite;
}
public Integer getTrainingTasksInTaskSuiteCount() {
return trainingTasksInTaskSuiteCount;
}
public void setTrainingTasksInTaskSuiteCount(Integer trainingTasksInTaskSuiteCount) {
this.trainingTasksInTaskSuiteCount = trainingTasksInTaskSuiteCount;
}
public Integer getTaskSuitesRequiredToPass() {
return taskSuitesRequiredToPass;
}
public void setTaskSuitesRequiredToPass(Integer taskSuitesRequiredToPass) {
this.taskSuitesRequiredToPass = taskSuitesRequiredToPass;
}
public Long getRetryTrainingAfterDays() {
return retryTrainingAfterDays;
}
public void setRetryTrainingAfterDays(Long retryTrainingAfterDays) {
this.retryTrainingAfterDays = retryTrainingAfterDays;
}
public TrainingStatus getStatus() {
return status;
}
public void setStatus(TrainingStatus status) {
this.status = status;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getLastStarted() {
return lastStarted;
}
public void setLastStarted(Date lastStarted) {
this.lastStarted = lastStarted;
}
public Date getLastStopped() {
return lastStopped;
}
public void setLastStopped(Date lastStopped) {
this.lastStopped = lastStopped;
}
public TrainingCloseReason getLastCloseReason() {
return lastCloseReason;
}
public void setLastCloseReason(TrainingCloseReason lastCloseReason) {
this.lastCloseReason = lastCloseReason;
}
}
|
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/TrainingArchiveOperation.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 TrainingArchiveOperation extends Operation<TrainingArchiveOperation.Parameters, TrainingArchiveOperation> {
public static final OperationType TYPE = OperationType.TRAINING_ARCHIVE;
public TrainingArchiveOperation() {}
private TrainingArchiveOperation(Date currentDateTime) {
super(currentDateTime);
}
public static class Parameters {
@JsonProperty("training_id")
private String trainingId;
public String getTrainingId() {
return trainingId;
}
}
public static TrainingArchiveOperation createPseudo(Date currentDateTime) {
return new TrainingArchiveOperation(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/TrainingClient.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.ModificationResult;
import ai.toloka.client.v1.SearchResult;
public interface TrainingClient {
SearchResult<Training> findTrainings(TrainingSearchRequest request);
Training getTraining(String id);
ModificationResult<Training> createTraining(Training training);
ModificationResult<Training> updateTraining(String trainingId, Training training);
TrainingOpenOperation openTraining(String trainingId);
TrainingCloseOperation closeTraining(String trainingId);
TrainingArchiveOperation archiveTraining(String trainingId);
TrainingCloneOperation cloneTraining(String trainingId);
}
|
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/TrainingCloneOperation.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 TrainingCloneOperation extends Operation<TrainingCloneOperation.Parameters, TrainingCloneOperation> {
public static final OperationType TYPE = OperationType.TRAINING_CLONE;
public TrainingCloneOperation() {
}
private TrainingCloneOperation(Date currentDateTime) {
super(currentDateTime);
}
public static class Parameters {
@JsonProperty("training_id")
private String trainingId;
public String getTrainingId() {
return trainingId;
}
}
public static TrainingCloneOperation createPseudo(Date currentDateTime) {
return new TrainingCloneOperation(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/TrainingCloseOperation.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 TrainingCloseOperation extends Operation<TrainingCloseOperation.Parameters, TrainingCloseOperation> {
public static final OperationType TYPE = OperationType.TRAINING_CLOSE;
public TrainingCloseOperation() {}
private TrainingCloseOperation(Date currentDateTime) {
super(currentDateTime);
}
public static class Parameters {
@JsonProperty("training_id")
private String trainingId;
public String getTrainingId() {
return trainingId;
}
}
public static TrainingCloseOperation createPseudo(Date currentDateTime) {
return new TrainingCloseOperation(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/TrainingCloseReason.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 TrainingCloseReason extends FlexibleEnum<TrainingCloseReason> {
public static final TrainingCloseReason MANUAL = new TrainingCloseReason("MANUAL");
public static final TrainingCloseReason EXPIRED = new TrainingCloseReason("EXPIRED");
public static final TrainingCloseReason COMPLETED = new TrainingCloseReason("COMPLETED");
public static final TrainingCloseReason NOT_ENOUGH_BALANCE = new TrainingCloseReason("NOT_ENOUGH_BALANCE");
public static final TrainingCloseReason ASSIGNMENTS_LIMIT_EXCEEDED =
new TrainingCloseReason("ASSIGNMENTS_LIMIT_EXCEEDED");
public static final TrainingCloseReason BLOCKED = new TrainingCloseReason("BLOCKED");
public static final TrainingCloseReason FOR_UPDATE = new TrainingCloseReason("FOR_UPDATE");
private static final TrainingCloseReason[] VALUES = {MANUAL, EXPIRED, COMPLETED,
NOT_ENOUGH_BALANCE, ASSIGNMENTS_LIMIT_EXCEEDED, BLOCKED, FOR_UPDATE};
private static final ConcurrentMap<String, TrainingCloseReason> DISCOVERED_VALUES = new ConcurrentHashMap<>();
private TrainingCloseReason(String name) {
super(name);
}
public static TrainingCloseReason[] values() {
return values(VALUES, DISCOVERED_VALUES.values(), TrainingCloseReason.class);
}
@JsonCreator
public static TrainingCloseReason valueOf(String name) {
return valueOf(VALUES, DISCOVERED_VALUES, name, new NewEnumCreator<TrainingCloseReason>() {
@Override public TrainingCloseReason create(String name) {
return new TrainingCloseReason(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/training/TrainingFilterParam.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.FilterParam;
public enum TrainingFilterParam implements FilterParam {
ownerId(TrainingSearchRequest.OWNER_ID_PARAMETER),
ownerCompanyId(TrainingSearchRequest.OWNER_COMPANY_ID_PARAMETER),
status(TrainingSearchRequest.STATUS_PARAMETER),
projectId(TrainingSearchRequest.PROJECT_ID_PARAMETER);
private String parameter;
TrainingFilterParam(String parameter) {
this.parameter = parameter;
}
@Override
public String parameter() {
return parameter;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.