Skip to content

Commit

Permalink
Merge branch 'main' into chore/renovateBaseBranch
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp committed Oct 3, 2022
2 parents 0c8c5bb + 45a9727 commit 87d2363
Show file tree
Hide file tree
Showing 16 changed files with 230 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ private static List<StatefulHost> getDefaultHosts(String region) throws AlgoliaR

/**
* Activate an existing model template. This action triggers the training and inference pipelines
* for the selected model. The model is added with `status=pending`. If a model with the exact
* same source & index already exists, the API endpoint returns an error.
* for the selected model. The model is added with `modelStatus=pending`. If a model with the
* exact same source & index already exists, the API endpoint returns an error.
*
* @param activateModelParams (required)
* @param requestOptions The requestOptions to send along with the query, they will be merged with
Expand All @@ -79,8 +79,8 @@ public ActivateModelInstanceResponse activateModelInstance(ActivateModelParams a

/**
* Activate an existing model template. This action triggers the training and inference pipelines
* for the selected model. The model is added with `status=pending`. If a model with the exact
* same source & index already exists, the API endpoint returns an error.
* for the selected model. The model is added with `modelStatus=pending`. If a model with the
* exact same source & index already exists, the API endpoint returns an error.
*
* @param activateModelParams (required)
* @return ActivateModelInstanceResponse
Expand All @@ -93,7 +93,7 @@ public ActivateModelInstanceResponse activateModelInstance(ActivateModelParams a
/**
* (asynchronously) Activate an existing model template. This action triggers the training and
* inference pipelines for the selected model. The model is added with
* &#x60;status&#x3D;pending&#x60;. If a model with the exact same source &amp; index already
* &#x60;modelStatus&#x3D;pending&#x60;. If a model with the exact same source &amp; index already
* exists, the API endpoint returns an error.
*
* @param activateModelParams (required)
Expand Down Expand Up @@ -125,7 +125,7 @@ public CompletableFuture<ActivateModelInstanceResponse> activateModelInstanceAsy
/**
* (asynchronously) Activate an existing model template. This action triggers the training and
* inference pipelines for the selected model. The model is added with
* &#x60;status&#x3D;pending&#x60;. If a model with the exact same source &amp; index already
* &#x60;modelStatus&#x3D;pending&#x60;. If a model with the exact same source &amp; index already
* exists, the API endpoint returns an error.
*
* @param activateModelParams (required)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class ActivateModelParams {
@JsonProperty("index")
private String index;

@JsonProperty("affinities")
private List<String> affinities;
@JsonProperty("modelAttributes")
private List<String> modelAttributes;

@JsonProperty("contentAttributes")
private List<String> contentAttributes;
Expand Down Expand Up @@ -89,27 +89,27 @@ public String getIndex() {
return index;
}

public ActivateModelParams setAffinities(List<String> affinities) {
this.affinities = affinities;
public ActivateModelParams setModelAttributes(List<String> modelAttributes) {
this.modelAttributes = modelAttributes;
return this;
}

public ActivateModelParams addAffinities(String affinitiesItem) {
if (this.affinities == null) {
this.affinities = new ArrayList<>();
public ActivateModelParams addModelAttributes(String modelAttributesItem) {
if (this.modelAttributes == null) {
this.modelAttributes = new ArrayList<>();
}
this.affinities.add(affinitiesItem);
this.modelAttributes.add(modelAttributesItem);
return this;
}

/**
* Get affinities
* Get modelAttributes
*
* @return affinities
* @return modelAttributes
*/
@javax.annotation.Nullable
public List<String> getAffinities() {
return affinities;
public List<String> getModelAttributes() {
return modelAttributes;
}

public ActivateModelParams setContentAttributes(List<String> contentAttributes) {
Expand Down Expand Up @@ -149,14 +149,14 @@ public boolean equals(Object o) {
Objects.equals(this.name, activateModelParams.name) &&
Objects.equals(this.sourceID, activateModelParams.sourceID) &&
Objects.equals(this.index, activateModelParams.index) &&
Objects.equals(this.affinities, activateModelParams.affinities) &&
Objects.equals(this.modelAttributes, activateModelParams.modelAttributes) &&
Objects.equals(this.contentAttributes, activateModelParams.contentAttributes)
);
}

@Override
public int hashCode() {
return Objects.hash(type, name, sourceID, index, affinities, contentAttributes);
return Objects.hash(type, name, sourceID, index, modelAttributes, contentAttributes);
}

@Override
Expand All @@ -167,7 +167,7 @@ public String toString() {
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" sourceID: ").append(toIndentedString(sourceID)).append("\n");
sb.append(" index: ").append(toIndentedString(index)).append("\n");
sb.append(" affinities: ").append(toIndentedString(affinities)).append("\n");
sb.append(" modelAttributes: ").append(toIndentedString(modelAttributes)).append("\n");
sb.append(" contentAttributes: ").append(toIndentedString(contentAttributes)).append("\n");
sb.append("}");
return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// This file is generated, manual changes will be lost - read more on
// https://github.com/algolia/api-clients-automation.

package com.algolia.model.predict;

import com.fasterxml.jackson.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/** ModelAttributes */
public class ModelAttributes {

@JsonProperty("name")
private String name;

@JsonProperty("values")
private List<String> values;

public ModelAttributes setName(String name) {
this.name = name;
return this;
}

/**
* Get name
*
* @return name
*/
@javax.annotation.Nonnull
public String getName() {
return name;
}

public ModelAttributes setValues(List<String> values) {
this.values = values;
return this;
}

public ModelAttributes addValues(String valuesItem) {
if (this.values == null) {
this.values = new ArrayList<>();
}
this.values.add(valuesItem);
return this;
}

/**
* Get values
*
* @return values
*/
@javax.annotation.Nullable
public List<String> getValues() {
return values;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelAttributes modelAttributes = (ModelAttributes) o;
return Objects.equals(this.name, modelAttributes.name) && Objects.equals(this.values, modelAttributes.values);
}

@Override
public int hashCode() {
return Objects.hash(name, values);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelAttributes {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" values: ").append(toIndentedString(values)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public class ModelInstance {
@JsonProperty("index")
private String index;

@JsonProperty("affinities")
private List<String> affinities = new ArrayList<>();
@JsonProperty("modelAttributes")
private ModelAttributes modelAttributes;

@JsonProperty("contentAttributes")
private List<String> contentAttributes = new ArrayList<>();
Expand Down Expand Up @@ -119,24 +119,19 @@ public String getIndex() {
return index;
}

public ModelInstance setAffinities(List<String> affinities) {
this.affinities = affinities;
return this;
}

public ModelInstance addAffinities(String affinitiesItem) {
this.affinities.add(affinitiesItem);
public ModelInstance setModelAttributes(ModelAttributes modelAttributes) {
this.modelAttributes = modelAttributes;
return this;
}

/**
* Get affinities
* Get modelAttributes
*
* @return affinities
* @return modelAttributes
*/
@javax.annotation.Nonnull
public List<String> getAffinities() {
return affinities;
public ModelAttributes getModelAttributes() {
return modelAttributes;
}

public ModelInstance setContentAttributes(List<String> contentAttributes) {
Expand Down Expand Up @@ -214,7 +209,7 @@ public ModelInstance setModelStatus(GetModelInstanceConfigStatus modelStatus) {
*
* @return modelStatus
*/
@javax.annotation.Nullable
@javax.annotation.Nonnull
public GetModelInstanceConfigStatus getModelStatus() {
return modelStatus;
}
Expand All @@ -234,7 +229,7 @@ public boolean equals(Object o) {
Objects.equals(this.type, modelInstance.type) &&
Objects.equals(this.sourceID, modelInstance.sourceID) &&
Objects.equals(this.index, modelInstance.index) &&
Objects.equals(this.affinities, modelInstance.affinities) &&
Objects.equals(this.modelAttributes, modelInstance.modelAttributes) &&
Objects.equals(this.contentAttributes, modelInstance.contentAttributes) &&
Objects.equals(this.lastTrained, modelInstance.lastTrained) &&
Objects.equals(this.lastInference, modelInstance.lastInference) &&
Expand All @@ -251,7 +246,7 @@ public int hashCode() {
type,
sourceID,
index,
affinities,
modelAttributes,
contentAttributes,
lastTrained,
lastInference,
Expand All @@ -269,7 +264,7 @@ public String toString() {
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" sourceID: ").append(toIndentedString(sourceID)).append("\n");
sb.append(" index: ").append(toIndentedString(index)).append("\n");
sb.append(" affinities: ").append(toIndentedString(affinities)).append("\n");
sb.append(" modelAttributes: ").append(toIndentedString(modelAttributes)).append("\n");
sb.append(" contentAttributes: ").append(toIndentedString(contentAttributes)).append("\n");
sb.append(" lastTrained: ").append(toIndentedString(lastTrained)).append("\n");
sb.append(" lastInference: ").append(toIndentedString(lastInference)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
* current status of the model is `inactive`. \\ `inactive` - model training and inference have been
* paused. The inactive value is allowed only if the current status of the model is `active`.
*/
public enum Status {
public enum ModelStatus {
ACTIVE("active"),

INACTIVE("inactive");

private final String value;

Status(String value) {
ModelStatus(String value) {
this.value = value;
}

Expand All @@ -34,8 +34,8 @@ public String toString() {
}

@JsonCreator
public static Status fromValue(String value) {
for (Status b : Status.values()) {
public static ModelStatus fromValue(String value) {
for (ModelStatus b : ModelStatus.values()) {
if (b.value.equals(value)) {
return b;
}
Expand Down
Loading

0 comments on commit 87d2363

Please sign in to comment.