Skip to content

Commit

Permalink
#46: Update swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar committed Aug 1, 2019
1 parent a642a2c commit 2cef1e7
Show file tree
Hide file tree
Showing 45 changed files with 3,993 additions and 2,628 deletions.
32 changes: 4 additions & 28 deletions client/src/generated/java/com/influxdb/client/domain/Axes.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ public class Axes {
@SerializedName(SERIALIZED_NAME_Y)
private Axis y = null;

public static final String SERIALIZED_NAME_Y2 = "y2";
@SerializedName(SERIALIZED_NAME_Y2)
private Axis y2 = null;

public Axes x(Axis x) {
this.x = x;
return this;
Expand All @@ -52,7 +48,7 @@ public Axes x(Axis x) {
* Get x
* @return x
**/
@ApiModelProperty(value = "")
@ApiModelProperty(required = true, value = "")
public Axis getX() {
return x;
}
Expand All @@ -70,7 +66,7 @@ public Axes y(Axis y) {
* Get y
* @return y
**/
@ApiModelProperty(value = "")
@ApiModelProperty(required = true, value = "")
public Axis getY() {
return y;
}
Expand All @@ -79,24 +75,6 @@ public void setY(Axis y) {
this.y = y;
}

public Axes y2(Axis y2) {
this.y2 = y2;
return this;
}

/**
* Get y2
* @return y2
**/
@ApiModelProperty(value = "")
public Axis getY2() {
return y2;
}

public void setY2(Axis y2) {
this.y2 = y2;
}


@Override
public boolean equals(java.lang.Object o) {
Expand All @@ -108,13 +86,12 @@ public boolean equals(java.lang.Object o) {
}
Axes axes = (Axes) o;
return Objects.equals(this.x, axes.x) &&
Objects.equals(this.y, axes.y) &&
Objects.equals(this.y2, axes.y2);
Objects.equals(this.y, axes.y);
}

@Override
public int hashCode() {
return Objects.hash(x, y, y2);
return Objects.hash(x, y);
}


Expand All @@ -124,7 +101,6 @@ public String toString() {
sb.append("class Axes {\n");
sb.append(" x: ").append(toIndentedString(x)).append("\n");
sb.append(" y: ").append(toIndentedString(y)).append("\n");
sb.append(" y2: ").append(toIndentedString(y2)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
80 changes: 65 additions & 15 deletions client/src/generated/java/com/influxdb/client/domain/Axis.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.influxdb.client.domain.AxisScale;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
Expand All @@ -34,7 +35,7 @@
public class Axis {
public static final String SERIALIZED_NAME_BOUNDS = "bounds";
@SerializedName(SERIALIZED_NAME_BOUNDS)
private List<Long> bounds = new ArrayList<>();
private List<String> bounds = new ArrayList<>();

public static final String SERIALIZED_NAME_LABEL = "label";
@SerializedName(SERIALIZED_NAME_LABEL)
Expand All @@ -48,20 +49,69 @@ public class Axis {
@SerializedName(SERIALIZED_NAME_SUFFIX)
private String suffix;

/**
* Base represents the radix for formatting axis values.
*/
@JsonAdapter(BaseEnum.Adapter.class)
public enum BaseEnum {
EMPTY(""),

_2("2"),

_10("10");

private String value;

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

public String getValue() {
return value;
}

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

public static BaseEnum fromValue(String text) {
for (BaseEnum b : BaseEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}

public static class Adapter extends TypeAdapter<BaseEnum> {
@Override
public void write(final JsonWriter jsonWriter, final BaseEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}

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

public static final String SERIALIZED_NAME_BASE = "base";
@SerializedName(SERIALIZED_NAME_BASE)
private String base;
private BaseEnum base;

public static final String SERIALIZED_NAME_SCALE = "scale";
@SerializedName(SERIALIZED_NAME_SCALE)
private String scale;
private AxisScale scale = null;

public Axis bounds(List<Long> bounds) {
public Axis bounds(List<String> bounds) {
this.bounds = bounds;
return this;
}

public Axis addBoundsItem(Long boundsItem) {
public Axis addBoundsItem(String boundsItem) {
if (this.bounds == null) {
this.bounds = new ArrayList<>();
}
Expand All @@ -74,11 +124,11 @@ public Axis addBoundsItem(Long boundsItem) {
* @return bounds
**/
@ApiModelProperty(value = "The extents of an axis in the form [lower, upper]. Clients determine whether bounds are to be inclusive or exclusive of their limits")
public List<Long> getBounds() {
public List<String> getBounds() {
return bounds;
}

public void setBounds(List<Long> bounds) {
public void setBounds(List<String> bounds) {
this.bounds = bounds;
}

Expand Down Expand Up @@ -136,7 +186,7 @@ public void setSuffix(String suffix) {
this.suffix = suffix;
}

public Axis base(String base) {
public Axis base(BaseEnum base) {
this.base = base;
return this;
}
Expand All @@ -146,29 +196,29 @@ public Axis base(String base) {
* @return base
**/
@ApiModelProperty(value = "Base represents the radix for formatting axis values.")
public String getBase() {
public BaseEnum getBase() {
return base;
}

public void setBase(String base) {
public void setBase(BaseEnum base) {
this.base = base;
}

public Axis scale(String scale) {
public Axis scale(AxisScale scale) {
this.scale = scale;
return this;
}

/**
* Scale is the axis formatting scale. Supported: \&quot;log\&quot;, \&quot;linear\&quot;
* Get scale
* @return scale
**/
@ApiModelProperty(value = "Scale is the axis formatting scale. Supported: \"log\", \"linear\"")
public String getScale() {
@ApiModelProperty(value = "")
public AxisScale getScale() {
return scale;
}

public void setScale(String scale) {
public void setScale(AxisScale scale) {
this.scale = scale;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Influx API Service
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* OpenAPI spec version: 0.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


package com.influxdb.client.domain;

import java.util.Objects;
import java.util.Arrays;
import io.swagger.annotations.ApiModel;
import com.google.gson.annotations.SerializedName;

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

/**
* Scale is the axis formatting scale. Supported: \&quot;log\&quot;, \&quot;linear\&quot;
*/
@JsonAdapter(AxisScale.Adapter.class)
public enum AxisScale {

LOG("log"),

LINEAR("linear");

private String value;

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

public String getValue() {
return value;
}

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

public static AxisScale fromValue(String text) {
for (AxisScale b : AxisScale.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}

public static class Adapter extends TypeAdapter<AxisScale> {
@Override
public void write(final JsonWriter jsonWriter, final AxisScale enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}

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

Loading

0 comments on commit 2cef1e7

Please sign in to comment.