diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index ac031714..1b77f506 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.6.1"
+ ".": "0.7.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index e670c774..6a74fe0f 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 97
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-bf3e71b33372f4a9307f4b6cb689ea46b3cf583ecc5d79eee9601cd0b0467c9a.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0f43f737c6520ed2a2407628511350362959997f89a868c50aa38d47d5791171.yml
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 09bfd166..86c25819 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,22 @@
# Changelog
+## 0.7.0 (2024-11-25)
+
+Full Changelog: [v0.6.1...v0.7.0](https://github.com/orbcorp/orb-java/compare/v0.6.1...v0.7.0)
+
+### Features
+
+* **api:** api update ([#125](https://github.com/orbcorp/orb-java/issues/125)) ([4b935c7](https://github.com/orbcorp/orb-java/commit/4b935c7382677f2fe81ebd260e234751769444a9))
+* **client:** add logging when debug env is set ([#124](https://github.com/orbcorp/orb-java/issues/124)) ([3000c2e](https://github.com/orbcorp/orb-java/commit/3000c2ecb971be9285631e42ae4c5871605df0a1))
+
+
+### Chores
+
+* **internal:** codegen related update ([#123](https://github.com/orbcorp/orb-java/issues/123)) ([c08609a](https://github.com/orbcorp/orb-java/commit/c08609aa223cd9cdc77f3179da506d1f35252fe5))
+* **internal:** version bump ([#119](https://github.com/orbcorp/orb-java/issues/119)) ([bfcad34](https://github.com/orbcorp/orb-java/commit/bfcad34e9c6a1d3c21812c89f83c528487ab1e1b))
+* **internal:** version bump ([#121](https://github.com/orbcorp/orb-java/issues/121)) ([6388030](https://github.com/orbcorp/orb-java/commit/638803028321775a8581fa525354e55503a12edd))
+* **internal:** version bump ([#122](https://github.com/orbcorp/orb-java/issues/122)) ([3163e60](https://github.com/orbcorp/orb-java/commit/3163e60efb09dd43e751a32ad299688c0fa2bfe3))
+
## 0.6.1 (2024-11-19)
Full Changelog: [v0.6.0...v0.6.1](https://github.com/orbcorp/orb-java/compare/v0.6.0...v0.6.1)
diff --git a/README.md b/README.md
index 7c3c35d5..95895667 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.6.1)
+[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.7.0)
@@ -25,7 +25,7 @@ The REST API documentation can be foundĀ on [docs.withorb.com](https://docs.with
```kotlin
-implementation("com.withorb.api:orb-java:0.6.1")
+implementation("com.withorb.api:orb-java:0.7.0")
```
#### Maven
@@ -34,7 +34,7 @@ implementation("com.withorb.api:orb-java:0.6.1")
com.withorb.api
orb-java
- 0.6.1
+ 0.7.0
```
@@ -322,6 +322,22 @@ get a map of untyped fields of type `Map`. 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 `ORB_LOG` to `info`.
+
+```sh
+$ export ORB_LOG=info
+```
+
+Or to `debug` for more verbose logging.
+
+```sh
+$ export ORB_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:
diff --git a/build.gradle.kts b/build.gradle.kts
index 5a25aaed..ae7b1bc9 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -4,7 +4,7 @@ plugins {
allprojects {
group = "com.withorb.api"
- version = "0.6.1" // x-release-please-version
+ version = "0.7.0" // x-release-please-version
}
diff --git a/orb-java-client-okhttp/build.gradle.kts b/orb-java-client-okhttp/build.gradle.kts
index 5c208c38..9bb088c2 100644
--- a/orb-java-client-okhttp/build.gradle.kts
+++ b/orb-java-client-okhttp/build.gradle.kts
@@ -7,6 +7,7 @@ dependencies {
api(project(":orb-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")
diff --git a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OkHttpClient.kt b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OkHttpClient.kt
index 55ceddea..1e01314f 100644
--- a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OkHttpClient.kt
+++ b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OkHttpClient.kt
@@ -23,6 +23,7 @@ import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
+import okhttp3.logging.HttpLoggingInterceptor
import okio.BufferedSink
class OkHttpClient
@@ -30,14 +31,30 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
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("ORB_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(
diff --git a/orb-java-core/build.gradle.kts b/orb-java-core/build.gradle.kts
index b4f33a94..8d804375 100644
--- a/orb-java-core/build.gradle.kts
+++ b/orb-java-core/build.gradle.kts
@@ -4,13 +4,13 @@ plugins {
}
dependencies {
- api("com.fasterxml.jackson.core:jackson-core:2.14.3")
- api("com.fasterxml.jackson.core:jackson-databind:2.14.3")
+ api("com.fasterxml.jackson.core:jackson-core:2.18.1")
+ api("com.fasterxml.jackson.core:jackson-databind:2.18.1")
- implementation("com.fasterxml.jackson.core:jackson-annotations:2.14.3")
- implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.14.3")
- implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.3")
- implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.3")
+ implementation("com.fasterxml.jackson.core:jackson-annotations:2.18.1")
+ implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.1")
+ implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.1")
+ implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.1")
implementation("org.apache.httpcomponents.core5:httpcore5:5.2.4")
implementation("org.apache.httpcomponents.client5:httpclient5:5.3.1")
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt b/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt
index bf1b22ae..e84d496a 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt
@@ -19,20 +19,6 @@ private constructor(
val additionalProperties: Map,
) {
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is OrbError && this.additionalProperties == other.additionalProperties /* spotless:on */
- }
-
- override fun hashCode(): Int {
- return /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */
- }
-
- override fun toString() = "OrbError{additionalProperties=$additionalProperties}"
-
fun toBuilder() = Builder().from(this)
companion object {
@@ -71,4 +57,16 @@ private constructor(
fun build(): OrbError = OrbError(additionalProperties.toImmutable())
}
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is OrbError && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ override fun hashCode(): Int = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */
+
+ override fun toString() = "OrbError{additionalProperties=$additionalProperties}"
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Alert.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Alert.kt
index 99745bd5..6447e41f 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Alert.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Alert.kt
@@ -337,17 +337,14 @@ private constructor(
return true
}
- return /* spotless:off */ other is Customer && this.additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Customer && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() = "Customer{additionalProperties=$additionalProperties}"
}
@@ -410,17 +407,14 @@ private constructor(
return true
}
- return /* spotless:off */ other is Metric && this.additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Metric && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() = "Metric{additionalProperties=$additionalProperties}"
}
@@ -483,17 +477,14 @@ private constructor(
return true
}
- return /* spotless:off */ other is Plan && this.additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Plan && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() = "Plan{additionalProperties=$additionalProperties}"
}
@@ -556,17 +547,14 @@ private constructor(
return true
}
- return /* spotless:off */ other is Subscription && this.additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Subscription && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() = "Subscription{additionalProperties=$additionalProperties}"
}
@@ -663,17 +651,14 @@ private constructor(
return true
}
- return /* spotless:off */ other is Threshold && this.value == other.value && this.additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Threshold && value == other.value && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(value, additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(value, additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() =
"Threshold{value=$value, additionalProperties=$additionalProperties}"
@@ -692,7 +677,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */
+ return /* spotless:off */ other is Type && value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
@@ -759,17 +744,14 @@ private constructor(
return true
}
- return /* spotless:off */ other is Alert && this.id == other.id && this.type == other.type && this.createdAt == other.createdAt && this.enabled == other.enabled && this.thresholds == other.thresholds && this.customer == other.customer && this.plan == other.plan && this.subscription == other.subscription && this.metric == other.metric && this.currency == other.currency && this.additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Alert && id == other.id && type == other.type && createdAt == other.createdAt && enabled == other.enabled && thresholds == other.thresholds && customer == other.customer && plan == other.plan && subscription == other.subscription && metric == other.metric && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(id, type, createdAt, enabled, thresholds, customer, plan, subscription, metric, currency, additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(id, type, createdAt, enabled, thresholds, customer, plan, subscription, metric, currency, additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() =
"Alert{id=$id, type=$type, createdAt=$createdAt, enabled=$enabled, thresholds=$thresholds, customer=$customer, plan=$plan, subscription=$subscription, metric=$metric, currency=$currency, additionalProperties=$additionalProperties}"
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForCustomerParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForCustomerParams.kt
index 9a78a633..c3aaaf21 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForCustomerParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForCustomerParams.kt
@@ -39,6 +39,12 @@ constructor(
fun thresholds(): Optional> = Optional.ofNullable(thresholds)
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun _additionalBodyProperties(): Map = additionalBodyProperties
+
@JvmSynthetic
internal fun getBody(): AlertCreateForCustomerBody {
return AlertCreateForCustomerBody(
@@ -144,43 +150,19 @@ constructor(
return true
}
- return /* spotless:off */ other is AlertCreateForCustomerBody && this.currency == other.currency && this.type == other.type && this.thresholds == other.thresholds && this.additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is AlertCreateForCustomerBody && currency == other.currency && type == other.type && thresholds == other.thresholds && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(currency, type, thresholds, additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(currency, type, thresholds, additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() =
"AlertCreateForCustomerBody{currency=$currency, type=$type, thresholds=$thresholds, additionalProperties=$additionalProperties}"
}
- fun _additionalHeaders(): Headers = additionalHeaders
-
- fun _additionalQueryParams(): QueryParams = additionalQueryParams
-
- fun _additionalBodyProperties(): Map = additionalBodyProperties
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is AlertCreateForCustomerParams && this.customerId == other.customerId && this.currency == other.currency && this.type == other.type && this.thresholds == other.thresholds && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
- }
-
- override fun hashCode(): Int {
- return /* spotless:off */ Objects.hash(customerId, currency, type, thresholds, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
- }
-
- override fun toString() =
- "AlertCreateForCustomerParams{customerId=$customerId, currency=$currency, type=$type, thresholds=$thresholds, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
-
fun toBuilder() = Builder().from(this)
companion object {
@@ -201,13 +183,14 @@ constructor(
@JvmSynthetic
internal fun from(alertCreateForCustomerParams: AlertCreateForCustomerParams) = apply {
- this.customerId = alertCreateForCustomerParams.customerId
- this.currency = alertCreateForCustomerParams.currency
- this.type = alertCreateForCustomerParams.type
- this.thresholds(alertCreateForCustomerParams.thresholds ?: listOf())
- additionalHeaders(alertCreateForCustomerParams.additionalHeaders)
- additionalQueryParams(alertCreateForCustomerParams.additionalQueryParams)
- additionalBodyProperties(alertCreateForCustomerParams.additionalBodyProperties)
+ customerId = alertCreateForCustomerParams.customerId
+ currency = alertCreateForCustomerParams.currency
+ type = alertCreateForCustomerParams.type
+ thresholds = alertCreateForCustomerParams.thresholds?.toMutableList() ?: mutableListOf()
+ additionalHeaders = alertCreateForCustomerParams.additionalHeaders.toBuilder()
+ additionalQueryParams = alertCreateForCustomerParams.additionalQueryParams.toBuilder()
+ additionalBodyProperties =
+ alertCreateForCustomerParams.additionalBodyProperties.toMutableMap()
}
fun customerId(customerId: String) = apply { this.customerId = customerId }
@@ -352,7 +335,7 @@ constructor(
checkNotNull(customerId) { "`customerId` is required but was not set" },
checkNotNull(currency) { "`currency` is required but was not set" },
checkNotNull(type) { "`type` is required but was not set" },
- if (thresholds.size == 0) null else thresholds.toImmutable(),
+ thresholds.toImmutable().ifEmpty { null },
additionalHeaders.build(),
additionalQueryParams.build(),
additionalBodyProperties.toImmutable(),
@@ -372,7 +355,7 @@ constructor(
return true
}
- return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */
+ return /* spotless:off */ other is Type && value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
@@ -505,19 +488,29 @@ constructor(
return true
}
- return /* spotless:off */ other is Threshold && this.value == other.value && this.additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Threshold && value == other.value && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(value, additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(value, additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() =
"Threshold{value=$value, additionalProperties=$additionalProperties}"
}
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is AlertCreateForCustomerParams && customerId == other.customerId && currency == other.currency && type == other.type && thresholds == other.thresholds && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
+ }
+
+ override fun hashCode(): Int = /* spotless:off */ Objects.hash(customerId, currency, type, thresholds, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
+
+ override fun toString() =
+ "AlertCreateForCustomerParams{customerId=$customerId, currency=$currency, type=$type, thresholds=$thresholds, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParams.kt
index 058f5396..d64d82ad 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParams.kt
@@ -39,6 +39,12 @@ constructor(
fun thresholds(): Optional> = Optional.ofNullable(thresholds)
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun _additionalBodyProperties(): Map = additionalBodyProperties
+
@JvmSynthetic
internal fun getBody(): AlertCreateForExternalCustomerBody {
return AlertCreateForExternalCustomerBody(
@@ -146,43 +152,19 @@ constructor(
return true
}
- return /* spotless:off */ other is AlertCreateForExternalCustomerBody && this.currency == other.currency && this.type == other.type && this.thresholds == other.thresholds && this.additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is AlertCreateForExternalCustomerBody && currency == other.currency && type == other.type && thresholds == other.thresholds && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(currency, type, thresholds, additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(currency, type, thresholds, additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() =
"AlertCreateForExternalCustomerBody{currency=$currency, type=$type, thresholds=$thresholds, additionalProperties=$additionalProperties}"
}
- fun _additionalHeaders(): Headers = additionalHeaders
-
- fun _additionalQueryParams(): QueryParams = additionalQueryParams
-
- fun _additionalBodyProperties(): Map = additionalBodyProperties
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is AlertCreateForExternalCustomerParams && this.externalCustomerId == other.externalCustomerId && this.currency == other.currency && this.type == other.type && this.thresholds == other.thresholds && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
- }
-
- override fun hashCode(): Int {
- return /* spotless:off */ Objects.hash(externalCustomerId, currency, type, thresholds, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
- }
-
- override fun toString() =
- "AlertCreateForExternalCustomerParams{externalCustomerId=$externalCustomerId, currency=$currency, type=$type, thresholds=$thresholds, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
-
fun toBuilder() = Builder().from(this)
companion object {
@@ -205,13 +187,16 @@ constructor(
internal fun from(
alertCreateForExternalCustomerParams: AlertCreateForExternalCustomerParams
) = apply {
- this.externalCustomerId = alertCreateForExternalCustomerParams.externalCustomerId
- this.currency = alertCreateForExternalCustomerParams.currency
- this.type = alertCreateForExternalCustomerParams.type
- this.thresholds(alertCreateForExternalCustomerParams.thresholds ?: listOf())
- additionalHeaders(alertCreateForExternalCustomerParams.additionalHeaders)
- additionalQueryParams(alertCreateForExternalCustomerParams.additionalQueryParams)
- additionalBodyProperties(alertCreateForExternalCustomerParams.additionalBodyProperties)
+ externalCustomerId = alertCreateForExternalCustomerParams.externalCustomerId
+ currency = alertCreateForExternalCustomerParams.currency
+ type = alertCreateForExternalCustomerParams.type
+ thresholds =
+ alertCreateForExternalCustomerParams.thresholds?.toMutableList() ?: mutableListOf()
+ additionalHeaders = alertCreateForExternalCustomerParams.additionalHeaders.toBuilder()
+ additionalQueryParams =
+ alertCreateForExternalCustomerParams.additionalQueryParams.toBuilder()
+ additionalBodyProperties =
+ alertCreateForExternalCustomerParams.additionalBodyProperties.toMutableMap()
}
fun externalCustomerId(externalCustomerId: String) = apply {
@@ -360,7 +345,7 @@ constructor(
},
checkNotNull(currency) { "`currency` is required but was not set" },
checkNotNull(type) { "`type` is required but was not set" },
- if (thresholds.size == 0) null else thresholds.toImmutable(),
+ thresholds.toImmutable().ifEmpty { null },
additionalHeaders.build(),
additionalQueryParams.build(),
additionalBodyProperties.toImmutable(),
@@ -380,7 +365,7 @@ constructor(
return true
}
- return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */
+ return /* spotless:off */ other is Type && value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
@@ -513,19 +498,29 @@ constructor(
return true
}
- return /* spotless:off */ other is Threshold && this.value == other.value && this.additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Threshold && value == other.value && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(value, additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(value, additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() =
"Threshold{value=$value, additionalProperties=$additionalProperties}"
}
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is AlertCreateForExternalCustomerParams && externalCustomerId == other.externalCustomerId && currency == other.currency && type == other.type && thresholds == other.thresholds && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
+ }
+
+ override fun hashCode(): Int = /* spotless:off */ Objects.hash(externalCustomerId, currency, type, thresholds, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
+
+ override fun toString() =
+ "AlertCreateForExternalCustomerParams{externalCustomerId=$externalCustomerId, currency=$currency, type=$type, thresholds=$thresholds, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForSubscriptionParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForSubscriptionParams.kt
index a89d7314..b7998a9f 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForSubscriptionParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertCreateForSubscriptionParams.kt
@@ -39,6 +39,12 @@ constructor(
fun metricId(): Optional = Optional.ofNullable(metricId)
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun _additionalBodyProperties(): Map = additionalBodyProperties
+
@JvmSynthetic
internal fun getBody(): AlertCreateForSubscriptionBody {
return AlertCreateForSubscriptionBody(
@@ -146,43 +152,19 @@ constructor(
return true
}
- return /* spotless:off */ other is AlertCreateForSubscriptionBody && this.thresholds == other.thresholds && this.type == other.type && this.metricId == other.metricId && this.additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is AlertCreateForSubscriptionBody && thresholds == other.thresholds && type == other.type && metricId == other.metricId && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(thresholds, type, metricId, additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(thresholds, type, metricId, additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() =
"AlertCreateForSubscriptionBody{thresholds=$thresholds, type=$type, metricId=$metricId, additionalProperties=$additionalProperties}"
}
- fun _additionalHeaders(): Headers = additionalHeaders
-
- fun _additionalQueryParams(): QueryParams = additionalQueryParams
-
- fun _additionalBodyProperties(): Map = additionalBodyProperties
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is AlertCreateForSubscriptionParams && this.subscriptionId == other.subscriptionId && this.thresholds == other.thresholds && this.type == other.type && this.metricId == other.metricId && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
- }
-
- override fun hashCode(): Int {
- return /* spotless:off */ Objects.hash(subscriptionId, thresholds, type, metricId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
- }
-
- override fun toString() =
- "AlertCreateForSubscriptionParams{subscriptionId=$subscriptionId, thresholds=$thresholds, type=$type, metricId=$metricId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
-
fun toBuilder() = Builder().from(this)
companion object {
@@ -204,13 +186,15 @@ constructor(
@JvmSynthetic
internal fun from(alertCreateForSubscriptionParams: AlertCreateForSubscriptionParams) =
apply {
- this.subscriptionId = alertCreateForSubscriptionParams.subscriptionId
- this.thresholds(alertCreateForSubscriptionParams.thresholds)
- this.type = alertCreateForSubscriptionParams.type
- this.metricId = alertCreateForSubscriptionParams.metricId
- additionalHeaders(alertCreateForSubscriptionParams.additionalHeaders)
- additionalQueryParams(alertCreateForSubscriptionParams.additionalQueryParams)
- additionalBodyProperties(alertCreateForSubscriptionParams.additionalBodyProperties)
+ subscriptionId = alertCreateForSubscriptionParams.subscriptionId
+ thresholds = alertCreateForSubscriptionParams.thresholds.toMutableList()
+ type = alertCreateForSubscriptionParams.type
+ metricId = alertCreateForSubscriptionParams.metricId
+ additionalHeaders = alertCreateForSubscriptionParams.additionalHeaders.toBuilder()
+ additionalQueryParams =
+ alertCreateForSubscriptionParams.additionalQueryParams.toBuilder()
+ additionalBodyProperties =
+ alertCreateForSubscriptionParams.additionalBodyProperties.toMutableMap()
}
fun subscriptionId(subscriptionId: String) = apply { this.subscriptionId = subscriptionId }
@@ -353,8 +337,7 @@ constructor(
fun build(): AlertCreateForSubscriptionParams =
AlertCreateForSubscriptionParams(
checkNotNull(subscriptionId) { "`subscriptionId` is required but was not set" },
- checkNotNull(thresholds) { "`thresholds` is required but was not set" }
- .toImmutable(),
+ thresholds.toImmutable(),
checkNotNull(type) { "`type` is required but was not set" },
metricId,
additionalHeaders.build(),
@@ -434,17 +417,14 @@ constructor(
return true
}
- return /* spotless:off */ other is Threshold && this.value == other.value && this.additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is Threshold && value == other.value && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(value, additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(value, additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() =
"Threshold{value=$value, additionalProperties=$additionalProperties}"
@@ -463,7 +443,7 @@ constructor(
return true
}
- return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */
+ return /* spotless:off */ other is Type && value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
@@ -524,4 +504,17 @@ constructor(
fun asString(): String = _value().asStringOrThrow()
}
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is AlertCreateForSubscriptionParams && subscriptionId == other.subscriptionId && thresholds == other.thresholds && type == other.type && metricId == other.metricId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
+ }
+
+ override fun hashCode(): Int = /* spotless:off */ Objects.hash(subscriptionId, thresholds, type, metricId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
+
+ override fun toString() =
+ "AlertCreateForSubscriptionParams{subscriptionId=$subscriptionId, thresholds=$thresholds, type=$type, metricId=$metricId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
}
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt
index b3c5323b..d4f89539 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt
@@ -21,6 +21,12 @@ constructor(
fun alertConfigurationId(): String = alertConfigurationId
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun _additionalBodyProperties(): Map = additionalBodyProperties
+
@JvmSynthetic
internal fun getBody(): Optional