Skip to content

Commit

Permalink
at least it's running
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp committed Jan 21, 2022
1 parent e741805 commit 0cc9690
Show file tree
Hide file tree
Showing 80 changed files with 3,003 additions and 760 deletions.
Original file line number Diff line number Diff line change
@@ -1,87 +1,33 @@
package com.algolia.model;

import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.Objects;

/** BatchDictionaryEntriesRequest */
public class BatchDictionaryEntriesRequest {

/** Actions to perform. */
@JsonAdapter(ActionEnum.Adapter.class)
public enum ActionEnum {
ADDENTRY("addEntry"),

DELETEENTRY("deleteEntry");

private String value;

ActionEnum(String value) {
this.value = value;
}

public String getValue() {
return value;
}

@Override
public String toString() {
return String.valueOf(value);
}

public static ActionEnum fromValue(String value) {
for (ActionEnum b : ActionEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}

public static class Adapter extends TypeAdapter<ActionEnum> {

@Override
public void write(
final JsonWriter jsonWriter,
final ActionEnum enumeration
) throws IOException {
jsonWriter.value(enumeration.getValue());
}

@Override
public ActionEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ActionEnum.fromValue(value);
}
}
}

@SerializedName("action")
private ActionEnum action;
private DictionaryAction action;

@SerializedName("body")
private DictionaryEntry body;

public BatchDictionaryEntriesRequest action(ActionEnum action) {
public BatchDictionaryEntriesRequest action(DictionaryAction action) {
this.action = action;
return this;
}

/**
* Actions to perform.
* Get action
*
* @return action
*/
@javax.annotation.Nonnull
public ActionEnum getAction() {
public DictionaryAction getAction() {
return action;
}

public void setAction(ActionEnum action) {
public void setAction(DictionaryAction action) {
this.action = action;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.algolia.model;

import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;

/** Actions to perform. */
@JsonAdapter(DictionaryAction.Adapter.class)
public enum DictionaryAction {
ADDENTRY("addEntry"),

DELETEENTRY("deleteEntry");

private String value;

DictionaryAction(String value) {
this.value = value;
}

public String getValue() {
return value;
}

@Override
public String toString() {
return String.valueOf(value);
}

public static DictionaryAction fromValue(String value) {
for (DictionaryAction b : DictionaryAction.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}

public static class Adapter extends TypeAdapter<DictionaryAction> {

@Override
public void write(
final JsonWriter jsonWriter,
final DictionaryAction enumeration
) throws IOException {
jsonWriter.value(enumeration.getValue());
}

@Override
public DictionaryAction read(final JsonReader jsonReader)
throws IOException {
String value = jsonReader.nextString();
return DictionaryAction.fromValue(value);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package com.algolia.model;

import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand All @@ -29,57 +24,8 @@ public class DictionaryEntry extends HashMap<String, Object> {
@SerializedName("decomposition")
private List<String> decomposition = null;

/** The state of the dictionary entry. */
@JsonAdapter(StateEnum.Adapter.class)
public enum StateEnum {
ENABLED("enabled"),

DISABLED("disabled");

private String value;

StateEnum(String value) {
this.value = value;
}

public String getValue() {
return value;
}

@Override
public String toString() {
return String.valueOf(value);
}

public static StateEnum fromValue(String value) {
for (StateEnum b : StateEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}

public static class Adapter extends TypeAdapter<StateEnum> {

@Override
public void write(
final JsonWriter jsonWriter,
final StateEnum enumeration
) throws IOException {
jsonWriter.value(enumeration.getValue());
}

@Override
public StateEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StateEnum.fromValue(value);
}
}
}

@SerializedName("state")
private StateEnum state = StateEnum.ENABLED;
private DictionaryEntryState state = DictionaryEntryState.ENABLED;

public DictionaryEntry objectID(String objectID) {
this.objectID = objectID;
Expand Down Expand Up @@ -192,22 +138,22 @@ public void setDecomposition(List<String> decomposition) {
this.decomposition = decomposition;
}

public DictionaryEntry state(StateEnum state) {
public DictionaryEntry state(DictionaryEntryState state) {
this.state = state;
return this;
}

/**
* The state of the dictionary entry.
* Get state
*
* @return state
*/
@javax.annotation.Nullable
public StateEnum getState() {
public DictionaryEntryState getState() {
return state;
}

public void setState(StateEnum state) {
public void setState(DictionaryEntryState state) {
this.state = state;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.algolia.model;

import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;

/** The state of the dictionary entry. */
@JsonAdapter(DictionaryEntryState.Adapter.class)
public enum DictionaryEntryState {
ENABLED("enabled"),

DISABLED("disabled");

private String value;

DictionaryEntryState(String value) {
this.value = value;
}

public String getValue() {
return value;
}

@Override
public String toString() {
return String.valueOf(value);
}

public static DictionaryEntryState fromValue(String value) {
for (DictionaryEntryState b : DictionaryEntryState.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}

public static class Adapter extends TypeAdapter<DictionaryEntryState> {

@Override
public void write(
final JsonWriter jsonWriter,
final DictionaryEntryState enumeration
) throws IOException {
jsonWriter.value(enumeration.getValue());
}

@Override
public DictionaryEntryState read(final JsonReader jsonReader)
throws IOException {
String value = jsonReader.nextString();
return DictionaryEntryState.fromValue(value);
}
}
}
Loading

0 comments on commit 0cc9690

Please sign in to comment.