diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 1d0616cb..cd6d5c95 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-beta.27"
+ ".": "0.1.0-beta.28"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index a87492aa..f1d55cd4 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 110
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stigg/stigg-7dccccd9c809d3fcc5f0ba477228a67b5f1fc5352b282081131f9fa0d90577d4.yml
-openapi_spec_hash: 43d3823a6e045c2fd0b832877f2d8739
-config_hash: 0eca08dde117ac62155a012abb0ecac7
+configured_endpoints: 111
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stigg/stigg-adaad2912e291814c93ac60d21f83f15a49cfd8d8ee8dc07b5f4b4a961d74904.yml
+openapi_spec_hash: 1bbed365dc0b25763e34f2869ab08593
+config_hash: 2e65c1178cfd5d688faf5c9b1a48a732
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1dc756b4..155fb75c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.1.0-beta.28 (2026-06-23)
+
+Full Changelog: [v0.1.0-beta.27...v0.1.0-beta.28](https://github.com/stiggio/stigg-java/compare/v0.1.0-beta.27...v0.1.0-beta.28)
+
+### Features
+
+* **api:** add update method to data export destinations ([9a94a14](https://github.com/stiggio/stigg-java/commit/9a94a14cff1d576e5adf891c29a82727ee935fb7))
+
## 0.1.0-beta.27 (2026-06-23)
Full Changelog: [v0.1.0-beta.26...v0.1.0-beta.27](https://github.com/stiggio/stigg-java/compare/v0.1.0-beta.26...v0.1.0-beta.27)
diff --git a/README.md b/README.md
index 29f2a9c3..9b867fe0 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/io.stigg/stigg-java/0.1.0-beta.27)
-[](https://javadoc.io/doc/io.stigg/stigg-java/0.1.0-beta.27)
+[](https://central.sonatype.com/artifact/io.stigg/stigg-java/0.1.0-beta.28)
+[](https://javadoc.io/doc/io.stigg/stigg-java/0.1.0-beta.28)
@@ -22,7 +22,7 @@ Use the Stigg MCP Server to enable AI assistants to interact with this API, allo
-Javadocs are available on [javadoc.io](https://javadoc.io/doc/io.stigg/stigg-java/0.1.0-beta.27).
+Javadocs are available on [javadoc.io](https://javadoc.io/doc/io.stigg/stigg-java/0.1.0-beta.28).
@@ -33,7 +33,7 @@ Javadocs are available on [javadoc.io](https://javadoc.io/doc/io.stigg/stigg-jav
### Gradle
```kotlin
-implementation("io.stigg:stigg-java:0.1.0-beta.27")
+implementation("io.stigg:stigg-java:0.1.0-beta.28")
```
### Maven
@@ -42,7 +42,7 @@ implementation("io.stigg:stigg-java:0.1.0-beta.27")
io.stigg
stigg-java
- 0.1.0-beta.27
+ 0.1.0-beta.28
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 91756151..f2f61149 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "io.stigg"
- version = "0.1.0-beta.27" // x-release-please-version
+ version = "0.1.0-beta.28" // x-release-please-version
}
subprojects {
diff --git a/stigg-java-core/src/main/kotlin/io/stigg/models/v1/events/dataexport/destinations/DestinationUpdateParams.kt b/stigg-java-core/src/main/kotlin/io/stigg/models/v1/events/dataexport/destinations/DestinationUpdateParams.kt
new file mode 100644
index 00000000..9cc0ca49
--- /dev/null
+++ b/stigg-java-core/src/main/kotlin/io/stigg/models/v1/events/dataexport/destinations/DestinationUpdateParams.kt
@@ -0,0 +1,598 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package io.stigg.models.v1.events.dataexport.destinations
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import io.stigg.core.ExcludeMissing
+import io.stigg.core.JsonField
+import io.stigg.core.JsonMissing
+import io.stigg.core.JsonValue
+import io.stigg.core.Params
+import io.stigg.core.checkKnown
+import io.stigg.core.checkRequired
+import io.stigg.core.http.Headers
+import io.stigg.core.http.QueryParams
+import io.stigg.core.toImmutable
+import io.stigg.errors.StiggInvalidDataException
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/**
+ * Update a destination's entity selection. Pushes the new enabled_models to the provider first,
+ * then persists the selection. Applies on the next scheduled transfer.
+ */
+class DestinationUpdateParams
+private constructor(
+ private val destinationId: String?,
+ private val xAccountId: String?,
+ private val xEnvironmentId: String?,
+ private val body: Body,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ fun destinationId(): Optional = Optional.ofNullable(destinationId)
+
+ fun xAccountId(): Optional = Optional.ofNullable(xAccountId)
+
+ fun xEnvironmentId(): Optional = Optional.ofNullable(xEnvironmentId)
+
+ /**
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type or is unexpectedly
+ * missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun enabledModels(): List = body.enabledModels()
+
+ /**
+ * Target integration row hosting the destination
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type or is unexpectedly
+ * missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun integrationId(): String = body.integrationId()
+
+ /**
+ * Returns the raw JSON value of [enabledModels].
+ *
+ * Unlike [enabledModels], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _enabledModels(): JsonField> = body._enabledModels()
+
+ /**
+ * Returns the raw JSON value of [integrationId].
+ *
+ * Unlike [integrationId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _integrationId(): JsonField = body._integrationId()
+
+ fun _additionalBodyProperties(): Map = body._additionalProperties()
+
+ /** Additional headers to send with the request. */
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ /** Additional query param to send with the request. */
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [DestinationUpdateParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .enabledModels()
+ * .integrationId()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [DestinationUpdateParams]. */
+ class Builder internal constructor() {
+
+ private var destinationId: String? = null
+ private var xAccountId: String? = null
+ private var xEnvironmentId: String? = null
+ private var body: Body.Builder = Body.builder()
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(destinationUpdateParams: DestinationUpdateParams) = apply {
+ destinationId = destinationUpdateParams.destinationId
+ xAccountId = destinationUpdateParams.xAccountId
+ xEnvironmentId = destinationUpdateParams.xEnvironmentId
+ body = destinationUpdateParams.body.toBuilder()
+ additionalHeaders = destinationUpdateParams.additionalHeaders.toBuilder()
+ additionalQueryParams = destinationUpdateParams.additionalQueryParams.toBuilder()
+ }
+
+ fun destinationId(destinationId: String?) = apply { this.destinationId = destinationId }
+
+ /** Alias for calling [Builder.destinationId] with `destinationId.orElse(null)`. */
+ fun destinationId(destinationId: Optional) =
+ destinationId(destinationId.getOrNull())
+
+ fun xAccountId(xAccountId: String?) = apply { this.xAccountId = xAccountId }
+
+ /** Alias for calling [Builder.xAccountId] with `xAccountId.orElse(null)`. */
+ fun xAccountId(xAccountId: Optional) = xAccountId(xAccountId.getOrNull())
+
+ fun xEnvironmentId(xEnvironmentId: String?) = apply { this.xEnvironmentId = xEnvironmentId }
+
+ /** Alias for calling [Builder.xEnvironmentId] with `xEnvironmentId.orElse(null)`. */
+ fun xEnvironmentId(xEnvironmentId: Optional) =
+ xEnvironmentId(xEnvironmentId.getOrNull())
+
+ /**
+ * Sets the entire request body.
+ *
+ * This is generally only useful if you are already constructing the body separately.
+ * Otherwise, it's more convenient to use the top-level setters instead:
+ * - [enabledModels]
+ * - [integrationId]
+ */
+ fun body(body: Body) = apply { this.body = body.toBuilder() }
+
+ fun enabledModels(enabledModels: List) = apply { body.enabledModels(enabledModels) }
+
+ /**
+ * Sets [Builder.enabledModels] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.enabledModels] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun enabledModels(enabledModels: JsonField>) = apply {
+ body.enabledModels(enabledModels)
+ }
+
+ /**
+ * Adds a single [String] to [enabledModels].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addEnabledModel(enabledModel: String) = apply { body.addEnabledModel(enabledModel) }
+
+ /** Target integration row hosting the destination */
+ fun integrationId(integrationId: String) = apply { body.integrationId(integrationId) }
+
+ /**
+ * Sets [Builder.integrationId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.integrationId] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun integrationId(integrationId: JsonField) = apply {
+ body.integrationId(integrationId)
+ }
+
+ fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
+ body.additionalProperties(additionalBodyProperties)
+ }
+
+ fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
+ body.putAdditionalProperty(key, value)
+ }
+
+ fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
+ apply {
+ body.putAllAdditionalProperties(additionalBodyProperties)
+ }
+
+ fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) }
+
+ fun removeAllAdditionalBodyProperties(keys: Set) = apply {
+ body.removeAllAdditionalProperties(keys)
+ }
+
+ fun additionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun additionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun putAdditionalHeader(name: String, value: String) = apply {
+ additionalHeaders.put(name, value)
+ }
+
+ fun putAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.put(name, values)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun replaceAdditionalHeaders(name: String, value: String) = apply {
+ additionalHeaders.replace(name, value)
+ }
+
+ fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.replace(name, values)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
+
+ fun removeAllAdditionalHeaders(names: Set) = apply {
+ additionalHeaders.removeAll(names)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: Map>) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun putAdditionalQueryParam(key: String, value: String) = apply {
+ additionalQueryParams.put(key, value)
+ }
+
+ fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.put(key, values)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, value: String) = apply {
+ additionalQueryParams.replace(key, value)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.replace(key, values)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
+
+ fun removeAllAdditionalQueryParams(keys: Set) = apply {
+ additionalQueryParams.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [DestinationUpdateParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .enabledModels()
+ * .integrationId()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): DestinationUpdateParams =
+ DestinationUpdateParams(
+ destinationId,
+ xAccountId,
+ xEnvironmentId,
+ body.build(),
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ fun _body(): Body = body
+
+ fun _pathParam(index: Int): String =
+ when (index) {
+ 0 -> destinationId ?: ""
+ else -> ""
+ }
+
+ override fun _headers(): Headers =
+ Headers.builder()
+ .apply {
+ xAccountId?.let { put("X-ACCOUNT-ID", it) }
+ xEnvironmentId?.let { put("X-ENVIRONMENT-ID", it) }
+ putAll(additionalHeaders)
+ }
+ .build()
+
+ override fun _queryParams(): QueryParams = additionalQueryParams
+
+ /** Update a destination's entity selection and push it to the provider. */
+ class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val enabledModels: JsonField>,
+ private val integrationId: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("enabledModels")
+ @ExcludeMissing
+ enabledModels: JsonField> = JsonMissing.of(),
+ @JsonProperty("integrationId")
+ @ExcludeMissing
+ integrationId: JsonField = JsonMissing.of(),
+ ) : this(enabledModels, integrationId, mutableMapOf())
+
+ /**
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun enabledModels(): List = enabledModels.getRequired("enabledModels")
+
+ /**
+ * Target integration row hosting the destination
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun integrationId(): String = integrationId.getRequired("integrationId")
+
+ /**
+ * Returns the raw JSON value of [enabledModels].
+ *
+ * Unlike [enabledModels], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("enabledModels")
+ @ExcludeMissing
+ fun _enabledModels(): JsonField> = enabledModels
+
+ /**
+ * Returns the raw JSON value of [integrationId].
+ *
+ * Unlike [integrationId], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("integrationId")
+ @ExcludeMissing
+ fun _integrationId(): JsonField = integrationId
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [Body].
+ *
+ * The following fields are required:
+ * ```java
+ * .enabledModels()
+ * .integrationId()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Body]. */
+ class Builder internal constructor() {
+
+ private var enabledModels: JsonField>? = null
+ private var integrationId: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(body: Body) = apply {
+ enabledModels = body.enabledModels.map { it.toMutableList() }
+ integrationId = body.integrationId
+ additionalProperties = body.additionalProperties.toMutableMap()
+ }
+
+ fun enabledModels(enabledModels: List) =
+ enabledModels(JsonField.of(enabledModels))
+
+ /**
+ * Sets [Builder.enabledModels] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.enabledModels] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun enabledModels(enabledModels: JsonField>) = apply {
+ this.enabledModels = enabledModels.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [enabledModels].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addEnabledModel(enabledModel: String) = apply {
+ enabledModels =
+ (enabledModels ?: JsonField.of(mutableListOf())).also {
+ checkKnown("enabledModels", it).add(enabledModel)
+ }
+ }
+
+ /** Target integration row hosting the destination */
+ fun integrationId(integrationId: String) = integrationId(JsonField.of(integrationId))
+
+ /**
+ * Sets [Builder.integrationId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.integrationId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun integrationId(integrationId: JsonField) = apply {
+ this.integrationId = integrationId
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [Body].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .enabledModels()
+ * .integrationId()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Body =
+ Body(
+ checkRequired("enabledModels", enabledModels).map { it.toImmutable() },
+ checkRequired("integrationId", integrationId),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws StiggInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): Body = apply {
+ if (validated) {
+ return@apply
+ }
+
+ enabledModels()
+ integrationId()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: StiggInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (enabledModels.asKnown().getOrNull()?.size ?: 0) +
+ (if (integrationId.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Body &&
+ enabledModels == other.enabledModels &&
+ integrationId == other.integrationId &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(enabledModels, integrationId, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Body{enabledModels=$enabledModels, integrationId=$integrationId, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is DestinationUpdateParams &&
+ destinationId == other.destinationId &&
+ xAccountId == other.xAccountId &&
+ xEnvironmentId == other.xEnvironmentId &&
+ body == other.body &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int =
+ Objects.hash(
+ destinationId,
+ xAccountId,
+ xEnvironmentId,
+ body,
+ additionalHeaders,
+ additionalQueryParams,
+ )
+
+ override fun toString() =
+ "DestinationUpdateParams{destinationId=$destinationId, xAccountId=$xAccountId, xEnvironmentId=$xEnvironmentId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/stigg-java-core/src/main/kotlin/io/stigg/models/v1/events/dataexport/destinations/DestinationUpdateResponse.kt b/stigg-java-core/src/main/kotlin/io/stigg/models/v1/events/dataexport/destinations/DestinationUpdateResponse.kt
new file mode 100644
index 00000000..3c5aac41
--- /dev/null
+++ b/stigg-java-core/src/main/kotlin/io/stigg/models/v1/events/dataexport/destinations/DestinationUpdateResponse.kt
@@ -0,0 +1,1221 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package io.stigg.models.v1.events.dataexport.destinations
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import io.stigg.core.ExcludeMissing
+import io.stigg.core.JsonField
+import io.stigg.core.JsonMissing
+import io.stigg.core.JsonValue
+import io.stigg.core.checkKnown
+import io.stigg.core.checkRequired
+import io.stigg.core.toImmutable
+import io.stigg.errors.StiggInvalidDataException
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** Response object */
+class DestinationUpdateResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
+private constructor(
+ private val data: JsonField,
+ private val additionalProperties: MutableMap,
+) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("data") @ExcludeMissing data: JsonField = JsonMissing.of()
+ ) : this(data, mutableMapOf())
+
+ /**
+ * Current destinations under the DATA_EXPORT integration.
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type or is unexpectedly
+ * missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun data(): Data = data.getRequired("data")
+
+ /**
+ * Returns the raw JSON value of [data].
+ *
+ * Unlike [data], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("data") @ExcludeMissing fun _data(): JsonField = data
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [DestinationUpdateResponse].
+ *
+ * The following fields are required:
+ * ```java
+ * .data()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [DestinationUpdateResponse]. */
+ class Builder internal constructor() {
+
+ private var data: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(destinationUpdateResponse: DestinationUpdateResponse) = apply {
+ data = destinationUpdateResponse.data
+ additionalProperties = destinationUpdateResponse.additionalProperties.toMutableMap()
+ }
+
+ /** Current destinations under the DATA_EXPORT integration. */
+ fun data(data: Data) = data(JsonField.of(data))
+
+ /**
+ * Sets [Builder.data] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.data] with a well-typed [Data] value instead. This
+ * method is primarily for setting the field to an undocumented or not yet supported value.
+ */
+ fun data(data: JsonField) = apply { this.data = data }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [DestinationUpdateResponse].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .data()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): DestinationUpdateResponse =
+ DestinationUpdateResponse(
+ checkRequired("data", data),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws StiggInvalidDataException if any value type in this object doesn't match its expected
+ * type.
+ */
+ fun validate(): DestinationUpdateResponse = apply {
+ if (validated) {
+ return@apply
+ }
+
+ data().validate()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: StiggInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic internal fun validity(): Int = (data.asKnown().getOrNull()?.validity() ?: 0)
+
+ /** Current destinations under the DATA_EXPORT integration. */
+ class Data
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val destinations: JsonField>,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("destinations")
+ @ExcludeMissing
+ destinations: JsonField> = JsonMissing.of()
+ ) : this(destinations, mutableMapOf())
+
+ /**
+ * Current destinations under the DATA_EXPORT integration
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun destinations(): List = destinations.getRequired("destinations")
+
+ /**
+ * Returns the raw JSON value of [destinations].
+ *
+ * Unlike [destinations], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("destinations")
+ @ExcludeMissing
+ fun _destinations(): JsonField> = destinations
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [Data].
+ *
+ * The following fields are required:
+ * ```java
+ * .destinations()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Data]. */
+ class Builder internal constructor() {
+
+ private var destinations: JsonField>? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(data: Data) = apply {
+ destinations = data.destinations.map { it.toMutableList() }
+ additionalProperties = data.additionalProperties.toMutableMap()
+ }
+
+ /** Current destinations under the DATA_EXPORT integration */
+ fun destinations(destinations: List) =
+ destinations(JsonField.of(destinations))
+
+ /**
+ * Sets [Builder.destinations] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.destinations] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun destinations(destinations: JsonField>) = apply {
+ this.destinations = destinations.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Destination] to [destinations].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addDestination(destination: Destination) = apply {
+ destinations =
+ (destinations ?: JsonField.of(mutableListOf())).also {
+ checkKnown("destinations", it).add(destination)
+ }
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [Data].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .destinations()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Data =
+ Data(
+ checkRequired("destinations", destinations).map { it.toImmutable() },
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing fields.
+ *
+ * @throws StiggInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): Data = apply {
+ if (validated) {
+ return@apply
+ }
+
+ destinations().forEach { it.validate() }
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: StiggInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (destinations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+
+ /** A single destination entry under the DATA_EXPORT integration. */
+ class Destination
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val connectedAt: JsonField,
+ private val destinationId: JsonField,
+ private val type: JsonField,
+ private val connectionStatus: JsonField,
+ private val enabledModels: JsonField>,
+ private val lastSyncStatus: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("connectedAt")
+ @ExcludeMissing
+ connectedAt: JsonField = JsonMissing.of(),
+ @JsonProperty("destinationId")
+ @ExcludeMissing
+ destinationId: JsonField = JsonMissing.of(),
+ @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
+ @JsonProperty("connectionStatus")
+ @ExcludeMissing
+ connectionStatus: JsonField = JsonMissing.of(),
+ @JsonProperty("enabledModels")
+ @ExcludeMissing
+ enabledModels: JsonField> = JsonMissing.of(),
+ @JsonProperty("lastSyncStatus")
+ @ExcludeMissing
+ lastSyncStatus: JsonField = JsonMissing.of(),
+ ) : this(
+ connectedAt,
+ destinationId,
+ type,
+ connectionStatus,
+ enabledModels,
+ lastSyncStatus,
+ mutableMapOf(),
+ )
+
+ /**
+ * ISO8601 timestamp of when the destination was connected
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
+ */
+ fun connectedAt(): String = connectedAt.getRequired("connectedAt")
+
+ /**
+ * Provider destination ID
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
+ */
+ fun destinationId(): String = destinationId.getRequired("destinationId")
+
+ /**
+ * Destination type (snowflake, bigquery, ...)
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
+ */
+ fun type(): String = type.getRequired("type")
+
+ /**
+ * Connection status of the destination (connected, failed)
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun connectionStatus(): Optional =
+ connectionStatus.getOptional("connectionStatus")
+
+ /**
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun enabledModels(): Optional> = enabledModels.getOptional("enabledModels")
+
+ /**
+ * Latest sync snapshot for the destination, refreshed by the provider webhook
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun lastSyncStatus(): Optional =
+ lastSyncStatus.getOptional("lastSyncStatus")
+
+ /**
+ * Returns the raw JSON value of [connectedAt].
+ *
+ * Unlike [connectedAt], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("connectedAt")
+ @ExcludeMissing
+ fun _connectedAt(): JsonField = connectedAt
+
+ /**
+ * Returns the raw JSON value of [destinationId].
+ *
+ * Unlike [destinationId], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("destinationId")
+ @ExcludeMissing
+ fun _destinationId(): JsonField = destinationId
+
+ /**
+ * Returns the raw JSON value of [type].
+ *
+ * Unlike [type], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type
+
+ /**
+ * Returns the raw JSON value of [connectionStatus].
+ *
+ * Unlike [connectionStatus], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("connectionStatus")
+ @ExcludeMissing
+ fun _connectionStatus(): JsonField = connectionStatus
+
+ /**
+ * Returns the raw JSON value of [enabledModels].
+ *
+ * Unlike [enabledModels], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("enabledModels")
+ @ExcludeMissing
+ fun _enabledModels(): JsonField> = enabledModels
+
+ /**
+ * Returns the raw JSON value of [lastSyncStatus].
+ *
+ * Unlike [lastSyncStatus], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("lastSyncStatus")
+ @ExcludeMissing
+ fun _lastSyncStatus(): JsonField = lastSyncStatus
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [Destination].
+ *
+ * The following fields are required:
+ * ```java
+ * .connectedAt()
+ * .destinationId()
+ * .type()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Destination]. */
+ class Builder internal constructor() {
+
+ private var connectedAt: JsonField? = null
+ private var destinationId: JsonField? = null
+ private var type: JsonField? = null
+ private var connectionStatus: JsonField = JsonMissing.of()
+ private var enabledModels: JsonField>? = null
+ private var lastSyncStatus: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(destination: Destination) = apply {
+ connectedAt = destination.connectedAt
+ destinationId = destination.destinationId
+ type = destination.type
+ connectionStatus = destination.connectionStatus
+ enabledModels = destination.enabledModels.map { it.toMutableList() }
+ lastSyncStatus = destination.lastSyncStatus
+ additionalProperties = destination.additionalProperties.toMutableMap()
+ }
+
+ /** ISO8601 timestamp of when the destination was connected */
+ fun connectedAt(connectedAt: String) = connectedAt(JsonField.of(connectedAt))
+
+ /**
+ * Sets [Builder.connectedAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.connectedAt] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun connectedAt(connectedAt: JsonField) = apply {
+ this.connectedAt = connectedAt
+ }
+
+ /** Provider destination ID */
+ fun destinationId(destinationId: String) =
+ destinationId(JsonField.of(destinationId))
+
+ /**
+ * Sets [Builder.destinationId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.destinationId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun destinationId(destinationId: JsonField) = apply {
+ this.destinationId = destinationId
+ }
+
+ /** Destination type (snowflake, bigquery, ...) */
+ fun type(type: String) = type(JsonField.of(type))
+
+ /**
+ * Sets [Builder.type] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.type] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun type(type: JsonField) = apply { this.type = type }
+
+ /** Connection status of the destination (connected, failed) */
+ fun connectionStatus(connectionStatus: String) =
+ connectionStatus(JsonField.of(connectionStatus))
+
+ /**
+ * Sets [Builder.connectionStatus] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.connectionStatus] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an undocumented
+ * or not yet supported value.
+ */
+ fun connectionStatus(connectionStatus: JsonField) = apply {
+ this.connectionStatus = connectionStatus
+ }
+
+ fun enabledModels(enabledModels: List) =
+ enabledModels(JsonField.of(enabledModels))
+
+ /**
+ * Sets [Builder.enabledModels] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.enabledModels] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented
+ * or not yet supported value.
+ */
+ fun enabledModels(enabledModels: JsonField>) = apply {
+ this.enabledModels = enabledModels.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [String] to [enabledModels].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addEnabledModel(enabledModel: String) = apply {
+ enabledModels =
+ (enabledModels ?: JsonField.of(mutableListOf())).also {
+ checkKnown("enabledModels", it).add(enabledModel)
+ }
+ }
+
+ /** Latest sync snapshot for the destination, refreshed by the provider webhook */
+ fun lastSyncStatus(lastSyncStatus: LastSyncStatus) =
+ lastSyncStatus(JsonField.of(lastSyncStatus))
+
+ /**
+ * Sets [Builder.lastSyncStatus] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.lastSyncStatus] with a well-typed
+ * [LastSyncStatus] value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun lastSyncStatus(lastSyncStatus: JsonField) = apply {
+ this.lastSyncStatus = lastSyncStatus
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) =
+ apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply {
+ additionalProperties.remove(key)
+ }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [Destination].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .connectedAt()
+ * .destinationId()
+ * .type()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Destination =
+ Destination(
+ checkRequired("connectedAt", connectedAt),
+ checkRequired("destinationId", destinationId),
+ checkRequired("type", type),
+ connectionStatus,
+ (enabledModels ?: JsonMissing.of()).map { it.toImmutable() },
+ lastSyncStatus,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws StiggInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): Destination = apply {
+ if (validated) {
+ return@apply
+ }
+
+ connectedAt()
+ destinationId()
+ type()
+ connectionStatus()
+ enabledModels()
+ lastSyncStatus().ifPresent { it.validate() }
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: StiggInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (connectedAt.asKnown().isPresent) 1 else 0) +
+ (if (destinationId.asKnown().isPresent) 1 else 0) +
+ (if (type.asKnown().isPresent) 1 else 0) +
+ (if (connectionStatus.asKnown().isPresent) 1 else 0) +
+ (enabledModels.asKnown().getOrNull()?.size ?: 0) +
+ (lastSyncStatus.asKnown().getOrNull()?.validity() ?: 0)
+
+ /** Latest sync snapshot for the destination, refreshed by the provider webhook */
+ class LastSyncStatus
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val finishedAt: JsonField,
+ private val status: JsonField,
+ private val transferId: JsonField,
+ private val blamedParty: JsonField,
+ private val failureMessage: JsonField,
+ private val rowsTransferred: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("finishedAt")
+ @ExcludeMissing
+ finishedAt: JsonField = JsonMissing.of(),
+ @JsonProperty("status")
+ @ExcludeMissing
+ status: JsonField = JsonMissing.of(),
+ @JsonProperty("transferId")
+ @ExcludeMissing
+ transferId: JsonField = JsonMissing.of(),
+ @JsonProperty("blamedParty")
+ @ExcludeMissing
+ blamedParty: JsonField = JsonMissing.of(),
+ @JsonProperty("failureMessage")
+ @ExcludeMissing
+ failureMessage: JsonField = JsonMissing.of(),
+ @JsonProperty("rowsTransferred")
+ @ExcludeMissing
+ rowsTransferred: JsonField = JsonMissing.of(),
+ ) : this(
+ finishedAt,
+ status,
+ transferId,
+ blamedParty,
+ failureMessage,
+ rowsTransferred,
+ mutableMapOf(),
+ )
+
+ /**
+ * ISO8601 timestamp of when the latest sync finished
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
+ */
+ fun finishedAt(): String = finishedAt.getRequired("finishedAt")
+
+ /**
+ * Sync status (PENDING, RUNNING, INCOMPLETE, FAILED, SUCCEEDED, CANCELLED)
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
+ */
+ fun status(): String = status.getRequired("status")
+
+ /**
+ * Provider transfer ID of the latest sync
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
+ */
+ fun transferId(): String = transferId.getRequired("transferId")
+
+ /**
+ * Party responsible for a failed sync, as reported by the data-export provider
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun blamedParty(): Optional = blamedParty.getOptional("blamedParty")
+
+ /**
+ * Customer-friendly failure message, when the latest sync failed
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun failureMessage(): Optional =
+ failureMessage.getOptional("failureMessage")
+
+ /**
+ * Number of rows transferred in the latest sync
+ *
+ * @throws StiggInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun rowsTransferred(): Optional =
+ rowsTransferred.getOptional("rowsTransferred")
+
+ /**
+ * Returns the raw JSON value of [finishedAt].
+ *
+ * Unlike [finishedAt], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("finishedAt")
+ @ExcludeMissing
+ fun _finishedAt(): JsonField = finishedAt
+
+ /**
+ * Returns the raw JSON value of [status].
+ *
+ * Unlike [status], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+
+ /**
+ * Returns the raw JSON value of [transferId].
+ *
+ * Unlike [transferId], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("transferId")
+ @ExcludeMissing
+ fun _transferId(): JsonField = transferId
+
+ /**
+ * Returns the raw JSON value of [blamedParty].
+ *
+ * Unlike [blamedParty], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("blamedParty")
+ @ExcludeMissing
+ fun _blamedParty(): JsonField = blamedParty
+
+ /**
+ * Returns the raw JSON value of [failureMessage].
+ *
+ * Unlike [failureMessage], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("failureMessage")
+ @ExcludeMissing
+ fun _failureMessage(): JsonField = failureMessage
+
+ /**
+ * Returns the raw JSON value of [rowsTransferred].
+ *
+ * Unlike [rowsTransferred], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("rowsTransferred")
+ @ExcludeMissing
+ fun _rowsTransferred(): JsonField = rowsTransferred
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [LastSyncStatus].
+ *
+ * The following fields are required:
+ * ```java
+ * .finishedAt()
+ * .status()
+ * .transferId()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [LastSyncStatus]. */
+ class Builder internal constructor() {
+
+ private var finishedAt: JsonField? = null
+ private var status: JsonField? = null
+ private var transferId: JsonField? = null
+ private var blamedParty: JsonField = JsonMissing.of()
+ private var failureMessage: JsonField = JsonMissing.of()
+ private var rowsTransferred: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(lastSyncStatus: LastSyncStatus) = apply {
+ finishedAt = lastSyncStatus.finishedAt
+ status = lastSyncStatus.status
+ transferId = lastSyncStatus.transferId
+ blamedParty = lastSyncStatus.blamedParty
+ failureMessage = lastSyncStatus.failureMessage
+ rowsTransferred = lastSyncStatus.rowsTransferred
+ additionalProperties = lastSyncStatus.additionalProperties.toMutableMap()
+ }
+
+ /** ISO8601 timestamp of when the latest sync finished */
+ fun finishedAt(finishedAt: String) = finishedAt(JsonField.of(finishedAt))
+
+ /**
+ * Sets [Builder.finishedAt] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.finishedAt] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun finishedAt(finishedAt: JsonField) = apply {
+ this.finishedAt = finishedAt
+ }
+
+ /** Sync status (PENDING, RUNNING, INCOMPLETE, FAILED, SUCCEEDED, CANCELLED) */
+ fun status(status: String) = status(JsonField.of(status))
+
+ /**
+ * Sets [Builder.status] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.status] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun status(status: JsonField) = apply { this.status = status }
+
+ /** Provider transfer ID of the latest sync */
+ fun transferId(transferId: String) = transferId(JsonField.of(transferId))
+
+ /**
+ * Sets [Builder.transferId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.transferId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun transferId(transferId: JsonField) = apply {
+ this.transferId = transferId
+ }
+
+ /**
+ * Party responsible for a failed sync, as reported by the data-export provider
+ */
+ fun blamedParty(blamedParty: String) = blamedParty(JsonField.of(blamedParty))
+
+ /**
+ * Sets [Builder.blamedParty] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.blamedParty] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun blamedParty(blamedParty: JsonField) = apply {
+ this.blamedParty = blamedParty
+ }
+
+ /** Customer-friendly failure message, when the latest sync failed */
+ fun failureMessage(failureMessage: String) =
+ failureMessage(JsonField.of(failureMessage))
+
+ /**
+ * Sets [Builder.failureMessage] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.failureMessage] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun failureMessage(failureMessage: JsonField) = apply {
+ this.failureMessage = failureMessage
+ }
+
+ /** Number of rows transferred in the latest sync */
+ fun rowsTransferred(rowsTransferred: Double) =
+ rowsTransferred(JsonField.of(rowsTransferred))
+
+ /**
+ * Sets [Builder.rowsTransferred] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.rowsTransferred] with a well-typed [Double]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun rowsTransferred(rowsTransferred: JsonField) = apply {
+ this.rowsTransferred = rowsTransferred
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) =
+ apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply {
+ additionalProperties.remove(key)
+ }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [LastSyncStatus].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .finishedAt()
+ * .status()
+ * .transferId()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): LastSyncStatus =
+ LastSyncStatus(
+ checkRequired("finishedAt", finishedAt),
+ checkRequired("status", status),
+ checkRequired("transferId", transferId),
+ blamedParty,
+ failureMessage,
+ rowsTransferred,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ /**
+ * Validates that the types of all values in this object match their expected types
+ * recursively.
+ *
+ * This method is _not_ forwards compatible with new types from the API for existing
+ * fields.
+ *
+ * @throws StiggInvalidDataException if any value type in this object doesn't match
+ * its expected type.
+ */
+ fun validate(): LastSyncStatus = apply {
+ if (validated) {
+ return@apply
+ }
+
+ finishedAt()
+ status()
+ transferId()
+ blamedParty()
+ failureMessage()
+ rowsTransferred()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: StiggInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (finishedAt.asKnown().isPresent) 1 else 0) +
+ (if (status.asKnown().isPresent) 1 else 0) +
+ (if (transferId.asKnown().isPresent) 1 else 0) +
+ (if (blamedParty.asKnown().isPresent) 1 else 0) +
+ (if (failureMessage.asKnown().isPresent) 1 else 0) +
+ (if (rowsTransferred.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is LastSyncStatus &&
+ finishedAt == other.finishedAt &&
+ status == other.status &&
+ transferId == other.transferId &&
+ blamedParty == other.blamedParty &&
+ failureMessage == other.failureMessage &&
+ rowsTransferred == other.rowsTransferred &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ finishedAt,
+ status,
+ transferId,
+ blamedParty,
+ failureMessage,
+ rowsTransferred,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "LastSyncStatus{finishedAt=$finishedAt, status=$status, transferId=$transferId, blamedParty=$blamedParty, failureMessage=$failureMessage, rowsTransferred=$rowsTransferred, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Destination &&
+ connectedAt == other.connectedAt &&
+ destinationId == other.destinationId &&
+ type == other.type &&
+ connectionStatus == other.connectionStatus &&
+ enabledModels == other.enabledModels &&
+ lastSyncStatus == other.lastSyncStatus &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ connectedAt,
+ destinationId,
+ type,
+ connectionStatus,
+ enabledModels,
+ lastSyncStatus,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Destination{connectedAt=$connectedAt, destinationId=$destinationId, type=$type, connectionStatus=$connectionStatus, enabledModels=$enabledModels, lastSyncStatus=$lastSyncStatus, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Data &&
+ destinations == other.destinations &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(destinations, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Data{destinations=$destinations, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is DestinationUpdateResponse &&
+ data == other.data &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(data, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "DestinationUpdateResponse{data=$data, additionalProperties=$additionalProperties}"
+}
diff --git a/stigg-java-core/src/main/kotlin/io/stigg/services/async/v1/events/dataexport/DestinationServiceAsync.kt b/stigg-java-core/src/main/kotlin/io/stigg/services/async/v1/events/dataexport/DestinationServiceAsync.kt
index 69bb9c47..e6b69230 100644
--- a/stigg-java-core/src/main/kotlin/io/stigg/services/async/v1/events/dataexport/DestinationServiceAsync.kt
+++ b/stigg-java-core/src/main/kotlin/io/stigg/services/async/v1/events/dataexport/DestinationServiceAsync.kt
@@ -9,6 +9,8 @@ import io.stigg.models.v1.events.dataexport.destinations.DestinationCreateParams
import io.stigg.models.v1.events.dataexport.destinations.DestinationCreateResponse
import io.stigg.models.v1.events.dataexport.destinations.DestinationDeleteParams
import io.stigg.models.v1.events.dataexport.destinations.DestinationDeleteResponse
+import io.stigg.models.v1.events.dataexport.destinations.DestinationUpdateParams
+import io.stigg.models.v1.events.dataexport.destinations.DestinationUpdateResponse
import java.util.concurrent.CompletableFuture
import java.util.function.Consumer
@@ -39,6 +41,34 @@ interface DestinationServiceAsync {
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture
+ /**
+ * Update a destination's entity selection. Pushes the new enabled_models to the provider first,
+ * then persists the selection. Applies on the next scheduled transfer.
+ */
+ fun update(
+ destinationId: String,
+ params: DestinationUpdateParams,
+ ): CompletableFuture =
+ update(destinationId, params, RequestOptions.none())
+
+ /** @see update */
+ fun update(
+ destinationId: String,
+ params: DestinationUpdateParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): CompletableFuture =
+ update(params.toBuilder().destinationId(destinationId).build(), requestOptions)
+
+ /** @see update */
+ fun update(params: DestinationUpdateParams): CompletableFuture =
+ update(params, RequestOptions.none())
+
+ /** @see update */
+ fun update(
+ params: DestinationUpdateParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): CompletableFuture
+
/** Remove a destination from the DATA_EXPORT integration metadata. Idempotent. */
fun delete(destinationId: String): CompletableFuture =
delete(destinationId, DestinationDeleteParams.none())
@@ -105,6 +135,36 @@ interface DestinationServiceAsync {
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture>
+ /**
+ * Returns a raw HTTP response for `patch /api/v1/data-export/destinations/{destinationId}`,
+ * but is otherwise the same as [DestinationServiceAsync.update].
+ */
+ fun update(
+ destinationId: String,
+ params: DestinationUpdateParams,
+ ): CompletableFuture> =
+ update(destinationId, params, RequestOptions.none())
+
+ /** @see update */
+ fun update(
+ destinationId: String,
+ params: DestinationUpdateParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): CompletableFuture> =
+ update(params.toBuilder().destinationId(destinationId).build(), requestOptions)
+
+ /** @see update */
+ fun update(
+ params: DestinationUpdateParams
+ ): CompletableFuture> =
+ update(params, RequestOptions.none())
+
+ /** @see update */
+ fun update(
+ params: DestinationUpdateParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): CompletableFuture>
+
/**
* Returns a raw HTTP response for `delete
* /api/v1/data-export/destinations/{destinationId}`, but is otherwise the same as
diff --git a/stigg-java-core/src/main/kotlin/io/stigg/services/async/v1/events/dataexport/DestinationServiceAsyncImpl.kt b/stigg-java-core/src/main/kotlin/io/stigg/services/async/v1/events/dataexport/DestinationServiceAsyncImpl.kt
index 044d2559..318a0ee1 100644
--- a/stigg-java-core/src/main/kotlin/io/stigg/services/async/v1/events/dataexport/DestinationServiceAsyncImpl.kt
+++ b/stigg-java-core/src/main/kotlin/io/stigg/services/async/v1/events/dataexport/DestinationServiceAsyncImpl.kt
@@ -20,6 +20,8 @@ import io.stigg.models.v1.events.dataexport.destinations.DestinationCreateParams
import io.stigg.models.v1.events.dataexport.destinations.DestinationCreateResponse
import io.stigg.models.v1.events.dataexport.destinations.DestinationDeleteParams
import io.stigg.models.v1.events.dataexport.destinations.DestinationDeleteResponse
+import io.stigg.models.v1.events.dataexport.destinations.DestinationUpdateParams
+import io.stigg.models.v1.events.dataexport.destinations.DestinationUpdateResponse
import java.util.concurrent.CompletableFuture
import java.util.function.Consumer
import kotlin.jvm.optionals.getOrNull
@@ -43,6 +45,13 @@ class DestinationServiceAsyncImpl internal constructor(private val clientOptions
// post /api/v1/data-export/destinations
withRawResponse().create(params, requestOptions).thenApply { it.parse() }
+ override fun update(
+ params: DestinationUpdateParams,
+ requestOptions: RequestOptions,
+ ): CompletableFuture =
+ // patch /api/v1/data-export/destinations/{destinationId}
+ withRawResponse().update(params, requestOptions).thenApply { it.parse() }
+
override fun delete(
params: DestinationDeleteParams,
requestOptions: RequestOptions,
@@ -94,6 +103,46 @@ class DestinationServiceAsyncImpl internal constructor(private val clientOptions
}
}
+ private val updateHandler: Handler =
+ jsonHandler(clientOptions.jsonMapper)
+
+ override fun update(
+ params: DestinationUpdateParams,
+ requestOptions: RequestOptions,
+ ): CompletableFuture> {
+ // We check here instead of in the params builder because this can be specified
+ // positionally or in the params class.
+ checkRequired("destinationId", params.destinationId().getOrNull())
+ val request =
+ HttpRequest.builder()
+ .method(HttpMethod.PATCH)
+ .baseUrl(clientOptions.baseUrl())
+ .addPathSegments(
+ "api",
+ "v1",
+ "data-export",
+ "destinations",
+ params._pathParam(0),
+ )
+ .body(json(clientOptions.jsonMapper, params._body()))
+ .build()
+ .prepareAsync(clientOptions, params)
+ val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
+ return request
+ .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
+ .thenApply { response ->
+ errorHandler.handle(response).parseable {
+ response
+ .use { updateHandler.handle(it) }
+ .also {
+ if (requestOptions.responseValidation!!) {
+ it.validate()
+ }
+ }
+ }
+ }
+ }
+
private val deleteHandler: Handler =
jsonHandler(clientOptions.jsonMapper)
diff --git a/stigg-java-core/src/main/kotlin/io/stigg/services/blocking/v1/events/dataexport/DestinationService.kt b/stigg-java-core/src/main/kotlin/io/stigg/services/blocking/v1/events/dataexport/DestinationService.kt
index 302304a9..0afdc4dc 100644
--- a/stigg-java-core/src/main/kotlin/io/stigg/services/blocking/v1/events/dataexport/DestinationService.kt
+++ b/stigg-java-core/src/main/kotlin/io/stigg/services/blocking/v1/events/dataexport/DestinationService.kt
@@ -10,6 +10,8 @@ import io.stigg.models.v1.events.dataexport.destinations.DestinationCreateParams
import io.stigg.models.v1.events.dataexport.destinations.DestinationCreateResponse
import io.stigg.models.v1.events.dataexport.destinations.DestinationDeleteParams
import io.stigg.models.v1.events.dataexport.destinations.DestinationDeleteResponse
+import io.stigg.models.v1.events.dataexport.destinations.DestinationUpdateParams
+import io.stigg.models.v1.events.dataexport.destinations.DestinationUpdateResponse
import java.util.function.Consumer
interface DestinationService {
@@ -39,6 +41,31 @@ interface DestinationService {
requestOptions: RequestOptions = RequestOptions.none(),
): DestinationCreateResponse
+ /**
+ * Update a destination's entity selection. Pushes the new enabled_models to the provider first,
+ * then persists the selection. Applies on the next scheduled transfer.
+ */
+ fun update(destinationId: String, params: DestinationUpdateParams): DestinationUpdateResponse =
+ update(destinationId, params, RequestOptions.none())
+
+ /** @see update */
+ fun update(
+ destinationId: String,
+ params: DestinationUpdateParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): DestinationUpdateResponse =
+ update(params.toBuilder().destinationId(destinationId).build(), requestOptions)
+
+ /** @see update */
+ fun update(params: DestinationUpdateParams): DestinationUpdateResponse =
+ update(params, RequestOptions.none())
+
+ /** @see update */
+ fun update(
+ params: DestinationUpdateParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): DestinationUpdateResponse
+
/** Remove a destination from the DATA_EXPORT integration metadata. Idempotent. */
fun delete(destinationId: String): DestinationDeleteResponse =
delete(destinationId, DestinationDeleteParams.none())
@@ -100,6 +127,38 @@ interface DestinationService {
requestOptions: RequestOptions = RequestOptions.none(),
): HttpResponseFor
+ /**
+ * Returns a raw HTTP response for `patch /api/v1/data-export/destinations/{destinationId}`,
+ * but is otherwise the same as [DestinationService.update].
+ */
+ @MustBeClosed
+ fun update(
+ destinationId: String,
+ params: DestinationUpdateParams,
+ ): HttpResponseFor =
+ update(destinationId, params, RequestOptions.none())
+
+ /** @see update */
+ @MustBeClosed
+ fun update(
+ destinationId: String,
+ params: DestinationUpdateParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): HttpResponseFor =
+ update(params.toBuilder().destinationId(destinationId).build(), requestOptions)
+
+ /** @see update */
+ @MustBeClosed
+ fun update(params: DestinationUpdateParams): HttpResponseFor =
+ update(params, RequestOptions.none())
+
+ /** @see update */
+ @MustBeClosed
+ fun update(
+ params: DestinationUpdateParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): HttpResponseFor
+
/**
* Returns a raw HTTP response for `delete
* /api/v1/data-export/destinations/{destinationId}`, but is otherwise the same as
diff --git a/stigg-java-core/src/main/kotlin/io/stigg/services/blocking/v1/events/dataexport/DestinationServiceImpl.kt b/stigg-java-core/src/main/kotlin/io/stigg/services/blocking/v1/events/dataexport/DestinationServiceImpl.kt
index 67132dbe..a6cad8da 100644
--- a/stigg-java-core/src/main/kotlin/io/stigg/services/blocking/v1/events/dataexport/DestinationServiceImpl.kt
+++ b/stigg-java-core/src/main/kotlin/io/stigg/services/blocking/v1/events/dataexport/DestinationServiceImpl.kt
@@ -20,6 +20,8 @@ import io.stigg.models.v1.events.dataexport.destinations.DestinationCreateParams
import io.stigg.models.v1.events.dataexport.destinations.DestinationCreateResponse
import io.stigg.models.v1.events.dataexport.destinations.DestinationDeleteParams
import io.stigg.models.v1.events.dataexport.destinations.DestinationDeleteResponse
+import io.stigg.models.v1.events.dataexport.destinations.DestinationUpdateParams
+import io.stigg.models.v1.events.dataexport.destinations.DestinationUpdateResponse
import java.util.function.Consumer
import kotlin.jvm.optionals.getOrNull
@@ -42,6 +44,13 @@ class DestinationServiceImpl internal constructor(private val clientOptions: Cli
// post /api/v1/data-export/destinations
withRawResponse().create(params, requestOptions).parse()
+ override fun update(
+ params: DestinationUpdateParams,
+ requestOptions: RequestOptions,
+ ): DestinationUpdateResponse =
+ // patch /api/v1/data-export/destinations/{destinationId}
+ withRawResponse().update(params, requestOptions).parse()
+
override fun delete(
params: DestinationDeleteParams,
requestOptions: RequestOptions,
@@ -90,6 +99,43 @@ class DestinationServiceImpl internal constructor(private val clientOptions: Cli
}
}
+ private val updateHandler: Handler =
+ jsonHandler(clientOptions.jsonMapper)
+
+ override fun update(
+ params: DestinationUpdateParams,
+ requestOptions: RequestOptions,
+ ): HttpResponseFor {
+ // We check here instead of in the params builder because this can be specified
+ // positionally or in the params class.
+ checkRequired("destinationId", params.destinationId().getOrNull())
+ val request =
+ HttpRequest.builder()
+ .method(HttpMethod.PATCH)
+ .baseUrl(clientOptions.baseUrl())
+ .addPathSegments(
+ "api",
+ "v1",
+ "data-export",
+ "destinations",
+ params._pathParam(0),
+ )
+ .body(json(clientOptions.jsonMapper, params._body()))
+ .build()
+ .prepare(clientOptions, params)
+ val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
+ val response = clientOptions.httpClient.execute(request, requestOptions)
+ return errorHandler.handle(response).parseable {
+ response
+ .use { updateHandler.handle(it) }
+ .also {
+ if (requestOptions.responseValidation!!) {
+ it.validate()
+ }
+ }
+ }
+ }
+
private val deleteHandler: Handler =
jsonHandler(clientOptions.jsonMapper)
diff --git a/stigg-java-core/src/test/kotlin/io/stigg/models/v1/events/dataexport/destinations/DestinationUpdateParamsTest.kt b/stigg-java-core/src/test/kotlin/io/stigg/models/v1/events/dataexport/destinations/DestinationUpdateParamsTest.kt
new file mode 100644
index 00000000..de9fffae
--- /dev/null
+++ b/stigg-java-core/src/test/kotlin/io/stigg/models/v1/events/dataexport/destinations/DestinationUpdateParamsTest.kt
@@ -0,0 +1,103 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package io.stigg.models.v1.events.dataexport.destinations
+
+import io.stigg.core.http.Headers
+import org.assertj.core.api.Assertions.assertThat
+import org.junit.jupiter.api.Test
+
+internal class DestinationUpdateParamsTest {
+
+ @Test
+ fun create() {
+ DestinationUpdateParams.builder()
+ .destinationId("x")
+ .xAccountId("X-ACCOUNT-ID")
+ .xEnvironmentId("X-ENVIRONMENT-ID")
+ .addEnabledModel("x")
+ .integrationId("x")
+ .build()
+ }
+
+ @Test
+ fun pathParams() {
+ val params =
+ DestinationUpdateParams.builder()
+ .destinationId("x")
+ .addEnabledModel("x")
+ .integrationId("x")
+ .build()
+
+ assertThat(params._pathParam(0)).isEqualTo("x")
+ // out-of-bound path param
+ assertThat(params._pathParam(1)).isEqualTo("")
+ }
+
+ @Test
+ fun headers() {
+ val params =
+ DestinationUpdateParams.builder()
+ .destinationId("x")
+ .xAccountId("X-ACCOUNT-ID")
+ .xEnvironmentId("X-ENVIRONMENT-ID")
+ .addEnabledModel("x")
+ .integrationId("x")
+ .build()
+
+ val headers = params._headers()
+
+ assertThat(headers)
+ .isEqualTo(
+ Headers.builder()
+ .put("X-ACCOUNT-ID", "X-ACCOUNT-ID")
+ .put("X-ENVIRONMENT-ID", "X-ENVIRONMENT-ID")
+ .build()
+ )
+ }
+
+ @Test
+ fun headersWithoutOptionalFields() {
+ val params =
+ DestinationUpdateParams.builder()
+ .destinationId("x")
+ .addEnabledModel("x")
+ .integrationId("x")
+ .build()
+
+ val headers = params._headers()
+
+ assertThat(headers).isEqualTo(Headers.builder().build())
+ }
+
+ @Test
+ fun body() {
+ val params =
+ DestinationUpdateParams.builder()
+ .destinationId("x")
+ .xAccountId("X-ACCOUNT-ID")
+ .xEnvironmentId("X-ENVIRONMENT-ID")
+ .addEnabledModel("x")
+ .integrationId("x")
+ .build()
+
+ val body = params._body()
+
+ assertThat(body.enabledModels()).containsExactly("x")
+ assertThat(body.integrationId()).isEqualTo("x")
+ }
+
+ @Test
+ fun bodyWithoutOptionalFields() {
+ val params =
+ DestinationUpdateParams.builder()
+ .destinationId("x")
+ .addEnabledModel("x")
+ .integrationId("x")
+ .build()
+
+ val body = params._body()
+
+ assertThat(body.enabledModels()).containsExactly("x")
+ assertThat(body.integrationId()).isEqualTo("x")
+ }
+}
diff --git a/stigg-java-core/src/test/kotlin/io/stigg/models/v1/events/dataexport/destinations/DestinationUpdateResponseTest.kt b/stigg-java-core/src/test/kotlin/io/stigg/models/v1/events/dataexport/destinations/DestinationUpdateResponseTest.kt
new file mode 100644
index 00000000..9f2412b5
--- /dev/null
+++ b/stigg-java-core/src/test/kotlin/io/stigg/models/v1/events/dataexport/destinations/DestinationUpdateResponseTest.kt
@@ -0,0 +1,107 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package io.stigg.models.v1.events.dataexport.destinations
+
+import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
+import io.stigg.core.jsonMapper
+import org.assertj.core.api.Assertions.assertThat
+import org.junit.jupiter.api.Test
+
+internal class DestinationUpdateResponseTest {
+
+ @Test
+ fun create() {
+ val destinationUpdateResponse =
+ DestinationUpdateResponse.builder()
+ .data(
+ DestinationUpdateResponse.Data.builder()
+ .addDestination(
+ DestinationUpdateResponse.Data.Destination.builder()
+ .connectedAt("connectedAt")
+ .destinationId("destinationId")
+ .type("type")
+ .connectionStatus("connectionStatus")
+ .addEnabledModel("string")
+ .lastSyncStatus(
+ DestinationUpdateResponse.Data.Destination.LastSyncStatus
+ .builder()
+ .finishedAt("finishedAt")
+ .status("status")
+ .transferId("transferId")
+ .blamedParty("blamedParty")
+ .failureMessage("failureMessage")
+ .rowsTransferred(0.0)
+ .build()
+ )
+ .build()
+ )
+ .build()
+ )
+ .build()
+
+ assertThat(destinationUpdateResponse.data())
+ .isEqualTo(
+ DestinationUpdateResponse.Data.builder()
+ .addDestination(
+ DestinationUpdateResponse.Data.Destination.builder()
+ .connectedAt("connectedAt")
+ .destinationId("destinationId")
+ .type("type")
+ .connectionStatus("connectionStatus")
+ .addEnabledModel("string")
+ .lastSyncStatus(
+ DestinationUpdateResponse.Data.Destination.LastSyncStatus.builder()
+ .finishedAt("finishedAt")
+ .status("status")
+ .transferId("transferId")
+ .blamedParty("blamedParty")
+ .failureMessage("failureMessage")
+ .rowsTransferred(0.0)
+ .build()
+ )
+ .build()
+ )
+ .build()
+ )
+ }
+
+ @Test
+ fun roundtrip() {
+ val jsonMapper = jsonMapper()
+ val destinationUpdateResponse =
+ DestinationUpdateResponse.builder()
+ .data(
+ DestinationUpdateResponse.Data.builder()
+ .addDestination(
+ DestinationUpdateResponse.Data.Destination.builder()
+ .connectedAt("connectedAt")
+ .destinationId("destinationId")
+ .type("type")
+ .connectionStatus("connectionStatus")
+ .addEnabledModel("string")
+ .lastSyncStatus(
+ DestinationUpdateResponse.Data.Destination.LastSyncStatus
+ .builder()
+ .finishedAt("finishedAt")
+ .status("status")
+ .transferId("transferId")
+ .blamedParty("blamedParty")
+ .failureMessage("failureMessage")
+ .rowsTransferred(0.0)
+ .build()
+ )
+ .build()
+ )
+ .build()
+ )
+ .build()
+
+ val roundtrippedDestinationUpdateResponse =
+ jsonMapper.readValue(
+ jsonMapper.writeValueAsString(destinationUpdateResponse),
+ jacksonTypeRef(),
+ )
+
+ assertThat(roundtrippedDestinationUpdateResponse).isEqualTo(destinationUpdateResponse)
+ }
+}
diff --git a/stigg-java-core/src/test/kotlin/io/stigg/services/async/v1/events/dataexport/DestinationServiceAsyncTest.kt b/stigg-java-core/src/test/kotlin/io/stigg/services/async/v1/events/dataexport/DestinationServiceAsyncTest.kt
index eb596385..a4acb473 100644
--- a/stigg-java-core/src/test/kotlin/io/stigg/services/async/v1/events/dataexport/DestinationServiceAsyncTest.kt
+++ b/stigg-java-core/src/test/kotlin/io/stigg/services/async/v1/events/dataexport/DestinationServiceAsyncTest.kt
@@ -5,6 +5,7 @@ package io.stigg.services.async.v1.events.dataexport
import io.stigg.client.okhttp.StiggOkHttpClientAsync
import io.stigg.models.v1.events.dataexport.destinations.DestinationCreateParams
import io.stigg.models.v1.events.dataexport.destinations.DestinationDeleteParams
+import io.stigg.models.v1.events.dataexport.destinations.DestinationUpdateParams
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
@@ -31,6 +32,27 @@ internal class DestinationServiceAsyncTest {
destination.validate()
}
+ @Disabled("Mock server tests are disabled")
+ @Test
+ fun update() {
+ val client = StiggOkHttpClientAsync.builder().apiKey("My API Key").build()
+ val destinationServiceAsync = client.v1().events().dataExport().destinations()
+
+ val destinationFuture =
+ destinationServiceAsync.update(
+ DestinationUpdateParams.builder()
+ .destinationId("x")
+ .xAccountId("X-ACCOUNT-ID")
+ .xEnvironmentId("X-ENVIRONMENT-ID")
+ .addEnabledModel("x")
+ .integrationId("x")
+ .build()
+ )
+
+ val destination = destinationFuture.get()
+ destination.validate()
+ }
+
@Disabled("Mock server tests are disabled")
@Test
fun delete() {
diff --git a/stigg-java-core/src/test/kotlin/io/stigg/services/blocking/v1/events/dataexport/DestinationServiceTest.kt b/stigg-java-core/src/test/kotlin/io/stigg/services/blocking/v1/events/dataexport/DestinationServiceTest.kt
index b46e39eb..eee9ef2f 100644
--- a/stigg-java-core/src/test/kotlin/io/stigg/services/blocking/v1/events/dataexport/DestinationServiceTest.kt
+++ b/stigg-java-core/src/test/kotlin/io/stigg/services/blocking/v1/events/dataexport/DestinationServiceTest.kt
@@ -5,6 +5,7 @@ package io.stigg.services.blocking.v1.events.dataexport
import io.stigg.client.okhttp.StiggOkHttpClient
import io.stigg.models.v1.events.dataexport.destinations.DestinationCreateParams
import io.stigg.models.v1.events.dataexport.destinations.DestinationDeleteParams
+import io.stigg.models.v1.events.dataexport.destinations.DestinationUpdateParams
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
@@ -30,6 +31,26 @@ internal class DestinationServiceTest {
destination.validate()
}
+ @Disabled("Mock server tests are disabled")
+ @Test
+ fun update() {
+ val client = StiggOkHttpClient.builder().apiKey("My API Key").build()
+ val destinationService = client.v1().events().dataExport().destinations()
+
+ val destination =
+ destinationService.update(
+ DestinationUpdateParams.builder()
+ .destinationId("x")
+ .xAccountId("X-ACCOUNT-ID")
+ .xEnvironmentId("X-ENVIRONMENT-ID")
+ .addEnabledModel("x")
+ .integrationId("x")
+ .build()
+ )
+
+ destination.validate()
+ }
+
@Disabled("Mock server tests are disabled")
@Test
fun delete() {