Skip to content

Commit

Permalink
#46: Updated swagger to latest version (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar authored Aug 1, 2019
1 parent 86514ab commit 475166e
Show file tree
Hide file tree
Showing 91 changed files with 10,113 additions and 2,573 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package com.influxdb.client.kotlin

import com.influxdb.LogLevel
import com.influxdb.client.domain.Check
import com.influxdb.client.domain.HealthCheck

/**
* The reference Kotlin client that allows query and write for the InfluxDB 2.0 by Kotlin Channel coroutines.
Expand All @@ -43,7 +43,7 @@ interface InfluxDBClientKotlin {
*
* @return health of an instance
*/
fun health(): Check
fun health(): HealthCheck

/**
* Gets the [LogLevel] that is used for logging requests and responses.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package com.influxdb.client.kotlin.internal

import com.influxdb.LogLevel
import com.influxdb.client.InfluxDBClientOptions
import com.influxdb.client.domain.Check
import com.influxdb.client.domain.HealthCheck
import com.influxdb.client.internal.AbstractInfluxDBClient
import com.influxdb.client.kotlin.InfluxDBClientKotlin
import com.influxdb.client.kotlin.QueryKotlinApi
Expand All @@ -38,7 +38,7 @@ internal class InfluxDBClientKotlinImpl(options: InfluxDBClientOptions) : Abstra
return QueryKotlinApiImpl(retrofit.create<QueryService>(QueryService::class.java))
}

override fun health(): Check {
override fun health(): HealthCheck {
return health(healthService.getHealth(null))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ internal class QueryKotlinApiImpl(private val service: QueryService) : AbstractQ
val channel = Channel<String>()

val queryCall = service.postQueryResponseBody(null, "application/json",
null, orgID, query)
null, null, orgID, query)

val consumer = BiConsumer { cancellable: Cancellable, line: String ->

Expand All @@ -145,7 +145,7 @@ internal class QueryKotlinApiImpl(private val service: QueryService) : AbstractQ
val channel = Channel<T>()

val queryCall = service.postQueryResponseBody(null, "application/json",
null, orgID, query)
null, null, orgID, query)

val responseConsumer = object : FluxResponseConsumer {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package com.influxdb.client.kotlin

import com.influxdb.LogLevel
import com.influxdb.client.domain.Check
import com.influxdb.client.domain.HealthCheck
import org.assertj.core.api.Assertions
import org.junit.jupiter.api.Test
import org.junit.platform.runner.JUnitPlatform
Expand All @@ -47,7 +47,7 @@ internal class ITInfluxDBClientKotlin : AbstractITInfluxDBClientKotlin() {
val health = influxDBClient.health()

Assertions.assertThat(health).isNotNull
Assertions.assertThat(health.status).isEqualTo(Check.StatusEnum.PASS)
Assertions.assertThat(health.status).isEqualTo(HealthCheck.StatusEnum.PASS)
Assertions.assertThat(health.message).isEqualTo("ready for queries and writes")
}

Expand All @@ -60,7 +60,7 @@ internal class ITInfluxDBClientKotlin : AbstractITInfluxDBClientKotlin() {
val health = clientNotRunning.health()

Assertions.assertThat(health).isNotNull
Assertions.assertThat(health.status).isEqualTo(Check.StatusEnum.FAIL)
Assertions.assertThat(health.status).isEqualTo(HealthCheck.StatusEnum.FAIL)
Assertions.assertThat(health.message).startsWith("Failed to connect to")

clientNotRunning.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import com.influxdb.LogLevel;
import com.influxdb.client.InfluxDBClient;
import com.influxdb.client.WriteOptions;
import com.influxdb.client.domain.Check;
import com.influxdb.client.domain.HealthCheck;

import io.reactivex.Single;

Expand Down Expand Up @@ -68,7 +68,7 @@ public interface InfluxDBClientReactive extends AutoCloseable {
* @return health of an instance
*/
@Nonnull
Single<Check> health();
Single<HealthCheck> health();

/**
* @return the {@link LogLevel} that is used for logging requests and responses
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import com.influxdb.LogLevel;
import com.influxdb.client.InfluxDBClientOptions;
import com.influxdb.client.WriteOptions;
import com.influxdb.client.domain.Check;
import com.influxdb.client.domain.HealthCheck;
import com.influxdb.client.internal.AbstractInfluxDBClient;
import com.influxdb.client.reactive.InfluxDBClientReactive;
import com.influxdb.client.reactive.QueryReactiveApi;
Expand Down Expand Up @@ -70,7 +70,7 @@ public WriteReactiveApi getWriteReactiveApi(@Nonnull final WriteOptions writeOpt

@Nonnull
@Override
public Single<Check> health() {
public Single<HealthCheck> health() {

return Single.fromCallable(() -> health(healthService.getHealth(null)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public Flowable<FluxRecord> query(@Nonnull final Publisher<String> queryStream,
return Flowable
.fromPublisher(queryStream)
.map(it -> service.postQueryResponseBody(null, "application/json",
null, orgID, new Query().query(it).dialect(AbstractInfluxDBClient.DEFAULT_DIALECT)))
null, null, orgID, new Query().query(it).dialect(AbstractInfluxDBClient.DEFAULT_DIALECT)))
.flatMap(queryCall -> {

Observable<FluxRecord> observable = Observable.create(subscriber -> {
Expand Down Expand Up @@ -181,7 +181,7 @@ public Flowable<String> queryRaw(@Nonnull final Publisher<String> queryStream,
return Flowable
.fromPublisher(queryStream)
.map(it -> service.postQueryResponseBody(null, "application/json",
null, orgID, new Query().query(it).dialect(dialect)))
null, null, orgID, new Query().query(it).dialect(dialect)))
.flatMap(queryCall -> {

Observable<String> observable = Observable.create(subscriber -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package com.influxdb.client.reactive;

import com.influxdb.LogLevel;
import com.influxdb.client.domain.Check;
import com.influxdb.client.domain.HealthCheck;

import io.reactivex.Single;
import org.assertj.core.api.Assertions;
Expand Down Expand Up @@ -51,15 +51,15 @@ void writeClient() {
@Test
void health() {

Single<Check> check = influxDBClient.health();
Single<HealthCheck> check = influxDBClient.health();

check
.test()
.assertNoErrors()
.assertValue(it -> {

Assertions.assertThat(it).isNotNull();
Assertions.assertThat(it.getStatus()).isEqualTo(Check.StatusEnum.PASS);
Assertions.assertThat(it.getStatus()).isEqualTo(HealthCheck.StatusEnum.PASS);
Assertions.assertThat(it.getMessage()).isEqualTo("ready for queries and writes");

return true;
Expand All @@ -70,15 +70,15 @@ void health() {
void healthNotRunningInstance() throws Exception {

InfluxDBClientReactive clientNotRunning = InfluxDBClientReactiveFactory.create("http://localhost:8099");
Single<Check> health = clientNotRunning.health();
Single<HealthCheck> health = clientNotRunning.health();

health
.test()
.assertNoErrors()
.assertValue(it -> {

Assertions.assertThat(it).isNotNull();
Assertions.assertThat(it.getStatus()).isEqualTo(Check.StatusEnum.FAIL);
Assertions.assertThat(it.getStatus()).isEqualTo(HealthCheck.StatusEnum.FAIL);
Assertions.assertThat(it.getMessage()).startsWith("Failed to connect to");

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package com.influxdb.client.scala

import com.influxdb.LogLevel
import com.influxdb.client.domain.Check
import com.influxdb.client.domain.HealthCheck
import javax.annotation.Nonnull

/**
Expand All @@ -44,7 +44,7 @@ trait InfluxDBClientScala {
*
* @return health of an instance
*/
@Nonnull def health: Check
@Nonnull def health: HealthCheck

/**
* Gets the [[LogLevel]] that is used for logging requests and responses.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ package com.influxdb.client.scala.internal
import akka.stream.OverflowStrategy
import com.influxdb.LogLevel
import com.influxdb.client.InfluxDBClientOptions
import com.influxdb.client.domain.Check
import com.influxdb.client.domain.HealthCheck
import com.influxdb.client.internal.AbstractInfluxDBClient
import com.influxdb.client.scala.{InfluxDBClientScala, QueryScalaApi}
import com.influxdb.client.service.QueryService
Expand All @@ -48,7 +48,7 @@ class InfluxDBClientScalaImpl(@Nonnull options: InfluxDBClientOptions,
*
* @return health of an instance
*/
override def health: Check = health(healthService.getHealth(null))
override def health: HealthCheck = health(healthService.getHealth(null))

/**
* Gets the [[LogLevel]] that is used for logging requests and responses.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class QueryScalaApiImpl(@Nonnull service: QueryService,
.single(query)
.map(_ => service
.postQueryResponseBody(null, "application/json",
null, orgID, query))
null, null, orgID, query))
.flatMapConcat(queryCall => {
Source.queue[FluxRecord](bufferSize, overflowStrategy)
.mapMaterializedValue(queue => {
Expand Down Expand Up @@ -191,7 +191,7 @@ class QueryScalaApiImpl(@Nonnull service: QueryService,
.single(query)
.map(it => service
.postQueryResponseBody(null, "application/json",
null, orgID, query))
null, null, orgID, query))
.flatMapConcat(queryCall => {
Source.queue[String](bufferSize, overflowStrategy)
.mapMaterializedValue(queue => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
package com.influxdb.client.scala

import com.influxdb.LogLevel
import com.influxdb.client.domain.Check
import com.influxdb.client.domain.HealthCheck
import org.scalatest.Matchers

/**
Expand All @@ -44,7 +44,7 @@ class ITInfluxDBClientScala extends AbstractITQueryScalaApi with Matchers {
val health = influxDBClient.health

health should not be null
health.getStatus should be(Check.StatusEnum.PASS)
health.getStatus should be(HealthCheck.StatusEnum.PASS)
health.getMessage should be("ready for queries and writes")
}

Expand All @@ -55,7 +55,7 @@ class ITInfluxDBClientScala extends AbstractITQueryScalaApi with Matchers {
val health = client.health

health should not be null
health.getStatus should be(Check.StatusEnum.FAIL)
health.getStatus should be(HealthCheck.StatusEnum.FAIL)
health.getMessage should startWith("Failed to connect to")

client.close()
Expand Down
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
Loading

0 comments on commit 475166e

Please sign in to comment.