Skip to content

release: 0.1.0-alpha.8 #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.7"
".": "0.1.0-alpha.8"
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.1.0-alpha.8 (2024-11-25)

Full Changelog: [v0.1.0-alpha.7...v0.1.0-alpha.8](https://github.com/openlayer-ai/openlayer-java/compare/v0.1.0-alpha.7...v0.1.0-alpha.8)

### Features

* **client:** add logging when debug env is set ([#56](https://github.com/openlayer-ai/openlayer-java/issues/56)) ([9d81162](https://github.com/openlayer-ai/openlayer-java/commit/9d811622736492e0eeea4d4acde518a6a2319b21))


### Chores

* **internal:** codegen related update ([#54](https://github.com/openlayer-ai/openlayer-java/issues/54)) ([4794b46](https://github.com/openlayer-ai/openlayer-java/commit/4794b465e2893768f1763cf2254c6f8aba909fdf))

## 0.1.0-alpha.7 (2024-11-21)

Full Changelog: [v0.1.0-alpha.6...v0.1.0-alpha.7](https://github.com/openlayer-ai/openlayer-java/compare/v0.1.0-alpha.6...v0.1.0-alpha.7)
Expand Down
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/com.openlayer.api/openlayer-java)](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.1.0-alpha.7)
[![Maven Central](https://img.shields.io/maven-central/v/com.openlayer.api/openlayer-java)](https://central.sonatype.com/artifact/com.openlayer.api/openlayer-java/0.1.0-alpha.8)

<!-- x-release-please-end -->

Expand All @@ -27,7 +27,7 @@ The REST API documentation can be found on [openlayer.com](https://openlayer.co
<!-- x-release-please-start-version -->

```kotlin
implementation("com.openlayer.api:openlayer-java:0.1.0-alpha.7")
implementation("com.openlayer.api:openlayer-java:0.1.0-alpha.8")
```

#### Maven
Expand All @@ -36,7 +36,7 @@ implementation("com.openlayer.api:openlayer-java:0.1.0-alpha.7")
<dependency>
<groupId>com.openlayer.api</groupId>
<artifactId>openlayer-java</artifactId>
<version>0.1.0-alpha.7</version>
<version>0.1.0-alpha.8</version>
</dependency>
```

Expand Down Expand Up @@ -242,6 +242,22 @@ get a map of untyped fields of type `Map<String, JsonValue>`. You can then acces
`._additionalProperties().get("secret_prop").asString()` or use other helpers defined on the `JsonValue` class
to extract it to a desired type.

## Logging

We use the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).

You can enable logging by setting the environment variable `OPENLAYER_LOG` to `info`.

```sh
$ export OPENLAYER_LOG=info
```

Or to `debug` for more verbose logging.

```sh
$ export OPENLAYER_LOG=debug
```

## Semantic versioning

This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

allprojects {
group = "com.openlayer.api"
version = "0.1.0-alpha.7" // x-release-please-version
version = "0.1.0-alpha.8" // x-release-please-version
}


1 change: 1 addition & 0 deletions openlayer-java-client-okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies {
api(project(":openlayer-java-core"))

implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")

testImplementation(kotlin("test"))
testImplementation("org.assertj:assertj-core:3.25.3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,38 @@ import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
import okhttp3.logging.HttpLoggingInterceptor
import okio.BufferedSink

class OkHttpClient
private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val baseUrl: HttpUrl) :
HttpClient {

private fun getClient(requestOptions: RequestOptions): okhttp3.OkHttpClient {
val timeout = requestOptions.timeout ?: return okHttpClient
return okHttpClient
.newBuilder()
.connectTimeout(timeout)
.readTimeout(timeout)
.writeTimeout(timeout)
.callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30))
.build()
val clientBuilder = okHttpClient.newBuilder()

val logLevel =
when (System.getenv("OPENLAYER_LOG")?.lowercase()) {
"info" -> HttpLoggingInterceptor.Level.BASIC
"debug" -> HttpLoggingInterceptor.Level.BODY
else -> null
}
if (logLevel != null) {
clientBuilder.addNetworkInterceptor(
HttpLoggingInterceptor().setLevel(logLevel).apply { redactHeader("Authorization") }
)
}

val timeout = requestOptions.timeout
if (timeout != null) {
clientBuilder
.connectTimeout(timeout)
.readTimeout(timeout)
.writeTimeout(timeout)
.callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30))
}

return clientBuilder.build()
}

override fun execute(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ constructor(

fun type(): Optional<Type> = Optional.ofNullable(type)

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

@JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders

@JvmSynthetic
Expand All @@ -59,23 +63,6 @@ constructor(
}
}

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is CommitTestResultListParams && projectVersionId == other.projectVersionId && includeArchived == other.includeArchived && page == other.page && perPage == other.perPage && status == other.status && type == other.type && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(projectVersionId, includeArchived, page, perPage, status, type, additionalHeaders, additionalQueryParams) /* spotless:on */

override fun toString() =
"CommitTestResultListParams{projectVersionId=$projectVersionId, includeArchived=$includeArchived, page=$page, perPage=$perPage, status=$status, type=$type, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"

fun toBuilder() = Builder().from(this)

companion object {
Expand All @@ -97,14 +84,14 @@ constructor(

@JvmSynthetic
internal fun from(commitTestResultListParams: CommitTestResultListParams) = apply {
this.projectVersionId = commitTestResultListParams.projectVersionId
this.includeArchived = commitTestResultListParams.includeArchived
this.page = commitTestResultListParams.page
this.perPage = commitTestResultListParams.perPage
this.status = commitTestResultListParams.status
this.type = commitTestResultListParams.type
additionalHeaders(commitTestResultListParams.additionalHeaders)
additionalQueryParams(commitTestResultListParams.additionalQueryParams)
projectVersionId = commitTestResultListParams.projectVersionId
includeArchived = commitTestResultListParams.includeArchived
page = commitTestResultListParams.page
perPage = commitTestResultListParams.perPage
status = commitTestResultListParams.status
type = commitTestResultListParams.type
additionalHeaders = commitTestResultListParams.additionalHeaders.toBuilder()
additionalQueryParams = commitTestResultListParams.additionalQueryParams.toBuilder()
}

fun projectVersionId(projectVersionId: String) = apply {
Expand Down Expand Up @@ -394,4 +381,17 @@ constructor(

fun asString(): String = _value().asStringOrThrow()
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is CommitTestResultListParams && projectVersionId == other.projectVersionId && includeArchived == other.includeArchived && page == other.page && perPage == other.perPage && status == other.status && type == other.type && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(projectVersionId, includeArchived, page, perPage, status, type, additionalHeaders, additionalQueryParams) /* spotless:on */

override fun toString() =
"CommitTestResultListParams{projectVersionId=$projectVersionId, includeArchived=$includeArchived, page=$page, perPage=$perPage, status=$status, type=$type, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ constructor(

fun rows(): List<Row> = rows

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties

@JvmSynthetic
internal fun getBody(): InferencePipelineDataStreamBody {
return InferencePipelineDataStreamBody(
Expand Down Expand Up @@ -152,25 +158,6 @@ constructor(
"InferencePipelineDataStreamBody{config=$config, rows=$rows, additionalProperties=$additionalProperties}"
}

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is InferencePipelineDataStreamParams && inferencePipelineId == other.inferencePipelineId && config == other.config && rows == other.rows && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(inferencePipelineId, config, rows, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */

override fun toString() =
"InferencePipelineDataStreamParams{inferencePipelineId=$inferencePipelineId, config=$config, rows=$rows, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"

fun toBuilder() = Builder().from(this)

companion object {
Expand All @@ -191,12 +178,14 @@ constructor(
@JvmSynthetic
internal fun from(inferencePipelineDataStreamParams: InferencePipelineDataStreamParams) =
apply {
this.inferencePipelineId = inferencePipelineDataStreamParams.inferencePipelineId
this.config = inferencePipelineDataStreamParams.config
this.rows(inferencePipelineDataStreamParams.rows)
additionalHeaders(inferencePipelineDataStreamParams.additionalHeaders)
additionalQueryParams(inferencePipelineDataStreamParams.additionalQueryParams)
additionalBodyProperties(inferencePipelineDataStreamParams.additionalBodyProperties)
inferencePipelineId = inferencePipelineDataStreamParams.inferencePipelineId
config = inferencePipelineDataStreamParams.config
rows = inferencePipelineDataStreamParams.rows.toMutableList()
additionalHeaders = inferencePipelineDataStreamParams.additionalHeaders.toBuilder()
additionalQueryParams =
inferencePipelineDataStreamParams.additionalQueryParams.toBuilder()
additionalBodyProperties =
inferencePipelineDataStreamParams.additionalBodyProperties.toMutableMap()
}

fun inferencePipelineId(inferencePipelineId: String) = apply {
Expand Down Expand Up @@ -359,7 +348,7 @@ constructor(
"`inferencePipelineId` is required but was not set"
},
checkNotNull(config) { "`config` is required but was not set" },
checkNotNull(rows) { "`rows` is required but was not set" }.toImmutable(),
rows.toImmutable(),
additionalHeaders.build(),
additionalQueryParams.build(),
additionalBodyProperties.toImmutable(),
Expand Down Expand Up @@ -2148,4 +2137,17 @@ constructor(

override fun toString() = "Row{additionalProperties=$additionalProperties}"
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is InferencePipelineDataStreamParams && inferencePipelineId == other.inferencePipelineId && config == other.config && rows == other.rows && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(inferencePipelineId, config, rows, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */

override fun toString() =
"InferencePipelineDataStreamParams{inferencePipelineId=$inferencePipelineId, config=$config, rows=$rows, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ constructor(

fun inferencePipelineId(): String = inferencePipelineId

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties

@JvmSynthetic
internal fun getBody(): Optional<Map<String, JsonValue>> {
return Optional.ofNullable(additionalBodyProperties.ifEmpty { null })
Expand All @@ -37,25 +43,6 @@ constructor(
}
}

fun _additionalHeaders(): Headers = additionalHeaders

fun _additionalQueryParams(): QueryParams = additionalQueryParams

fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is InferencePipelineDeleteParams && inferencePipelineId == other.inferencePipelineId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(inferencePipelineId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */

override fun toString() =
"InferencePipelineDeleteParams{inferencePipelineId=$inferencePipelineId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"

fun toBuilder() = Builder().from(this)

companion object {
Expand All @@ -73,10 +60,11 @@ constructor(

@JvmSynthetic
internal fun from(inferencePipelineDeleteParams: InferencePipelineDeleteParams) = apply {
this.inferencePipelineId = inferencePipelineDeleteParams.inferencePipelineId
additionalHeaders(inferencePipelineDeleteParams.additionalHeaders)
additionalQueryParams(inferencePipelineDeleteParams.additionalQueryParams)
additionalBodyProperties(inferencePipelineDeleteParams.additionalBodyProperties)
inferencePipelineId = inferencePipelineDeleteParams.inferencePipelineId
additionalHeaders = inferencePipelineDeleteParams.additionalHeaders.toBuilder()
additionalQueryParams = inferencePipelineDeleteParams.additionalQueryParams.toBuilder()
additionalBodyProperties =
inferencePipelineDeleteParams.additionalBodyProperties.toMutableMap()
}

fun inferencePipelineId(inferencePipelineId: String) = apply {
Expand Down Expand Up @@ -213,4 +201,17 @@ constructor(
additionalBodyProperties.toImmutable(),
)
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is InferencePipelineDeleteParams && inferencePipelineId == other.inferencePipelineId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(inferencePipelineId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */

override fun toString() =
"InferencePipelineDeleteParams{inferencePipelineId=$inferencePipelineId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
}
Loading
Loading