diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 3ab3b9e3d..fb4dd24fb 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "2.47.0"
+ ".": "2.47.1"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index c45ebbf3c..960a55512 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 116
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-dffbd6e37f0be6d218800cdb283e5ad958c715021986d788e10c89c0a80a9f44.yml
-openapi_spec_hash: 753042938edfcbf43eb60c63c3369a30
-config_hash: 2fc184efddefac872a2f58876711b4f5
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-22e4e7c84b8efa6d1777ad68e350fe88205ca55933c9b1042bcf04fc6437825f.yml
+openapi_spec_hash: f61203a73768b7175003b648c986e3f9
+config_hash: 6850143d4cb11e40948430dd9ee88369
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d5cf57085..8726fc696 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 2.47.1 (2026-07-01)
+
+Full Changelog: [v2.47.0...v2.47.1](https://github.com/anthropics/anthropic-sdk-java/compare/v2.47.0...v2.47.1)
+
+### Chores
+
+* **api:** remove some nonfunctional types from the SDKs ([2f92a48](https://github.com/anthropics/anthropic-sdk-java/commit/2f92a48d5e6b7dde8efebc493c96def5ddcbe523))
+
## 2.47.0 (2026-06-30)
Full Changelog: [v2.46.0...v2.47.0](https://github.com/anthropics/anthropic-sdk-java/compare/v2.46.0...v2.47.0)
diff --git a/README.md b/README.md
index 468ca10a8..eb2eb194d 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ Full documentation is available at **[platform.claude.com/docs/en/api/sdks/java]
### Gradle
```kotlin
-implementation("com.anthropic:anthropic-java:2.47.0")
+implementation("com.anthropic:anthropic-java:2.47.1")
```
### Maven
@@ -24,7 +24,7 @@ implementation("com.anthropic:anthropic-java:2.47.0")
com.anthropic
anthropic-java
- 2.47.0
+ 2.47.1
```
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/environments/work/BetaSelfHostedWork.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/environments/work/BetaSelfHostedWork.kt
index f5e067341..d8eb3071d 100644
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/environments/work/BetaSelfHostedWork.kt
+++ b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/environments/work/BetaSelfHostedWork.kt
@@ -35,7 +35,6 @@ private constructor(
private val environmentId: JsonField,
private val latestHeartbeatAt: JsonField,
private val metadata: JsonField,
- private val secret: JsonField,
private val startedAt: JsonField,
private val state: JsonField,
private val stopRequestedAt: JsonField,
@@ -61,7 +60,6 @@ private constructor(
@ExcludeMissing
latestHeartbeatAt: JsonField = JsonMissing.of(),
@JsonProperty("metadata") @ExcludeMissing metadata: JsonField = JsonMissing.of(),
- @JsonProperty("secret") @ExcludeMissing secret: JsonField = JsonMissing.of(),
@JsonProperty("started_at") @ExcludeMissing startedAt: JsonField = JsonMissing.of(),
@JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(),
@JsonProperty("stop_requested_at")
@@ -77,7 +75,6 @@ private constructor(
environmentId,
latestHeartbeatAt,
metadata,
- secret,
startedAt,
state,
stopRequestedAt,
@@ -142,15 +139,6 @@ private constructor(
*/
fun metadata(): Metadata = metadata.getRequired("metadata")
- /**
- * Credential payload used by the environment worker to execute this work item. May be populated
- * when polling for work; null on all other retrieval paths.
- *
- * @throws AnthropicInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun secret(): Optional = secret.getOptional("secret")
-
/**
* RFC 3339 timestamp when work execution started
*
@@ -252,13 +240,6 @@ private constructor(
*/
@JsonProperty("metadata") @ExcludeMissing fun _metadata(): JsonField = metadata
- /**
- * Returns the raw JSON value of [secret].
- *
- * Unlike [secret], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("secret") @ExcludeMissing fun _secret(): JsonField = secret
-
/**
* Returns the raw JSON value of [startedAt].
*
@@ -315,7 +296,6 @@ private constructor(
* .environmentId()
* .latestHeartbeatAt()
* .metadata()
- * .secret()
* .startedAt()
* .state()
* .stopRequestedAt()
@@ -335,7 +315,6 @@ private constructor(
private var environmentId: JsonField? = null
private var latestHeartbeatAt: JsonField? = null
private var metadata: JsonField? = null
- private var secret: JsonField? = null
private var startedAt: JsonField? = null
private var state: JsonField? = null
private var stopRequestedAt: JsonField? = null
@@ -352,7 +331,6 @@ private constructor(
environmentId = betaSelfHostedWork.environmentId
latestHeartbeatAt = betaSelfHostedWork.latestHeartbeatAt
metadata = betaSelfHostedWork.metadata
- secret = betaSelfHostedWork.secret
startedAt = betaSelfHostedWork.startedAt
state = betaSelfHostedWork.state
stopRequestedAt = betaSelfHostedWork.stopRequestedAt
@@ -463,23 +441,6 @@ private constructor(
*/
fun metadata(metadata: JsonField) = apply { this.metadata = metadata }
- /**
- * Credential payload used by the environment worker to execute this work item. May be
- * populated when polling for work; null on all other retrieval paths.
- */
- fun secret(secret: String?) = secret(JsonField.ofNullable(secret))
-
- /** Alias for calling [Builder.secret] with `secret.orElse(null)`. */
- fun secret(secret: Optional) = secret(secret.getOrNull())
-
- /**
- * Sets [Builder.secret] to an arbitrary JSON value.
- *
- * You should usually call [Builder.secret] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun secret(secret: JsonField) = apply { this.secret = secret }
-
/** RFC 3339 timestamp when work execution started */
fun startedAt(startedAt: String?) = startedAt(JsonField.ofNullable(startedAt))
@@ -587,7 +548,6 @@ private constructor(
* .environmentId()
* .latestHeartbeatAt()
* .metadata()
- * .secret()
* .startedAt()
* .state()
* .stopRequestedAt()
@@ -605,7 +565,6 @@ private constructor(
checkRequired("environmentId", environmentId),
checkRequired("latestHeartbeatAt", latestHeartbeatAt),
checkRequired("metadata", metadata),
- checkRequired("secret", secret),
checkRequired("startedAt", startedAt),
checkRequired("state", state),
checkRequired("stopRequestedAt", stopRequestedAt),
@@ -637,7 +596,6 @@ private constructor(
environmentId()
latestHeartbeatAt()
metadata().validate()
- secret()
startedAt()
state().validate()
stopRequestedAt()
@@ -672,7 +630,6 @@ private constructor(
(if (environmentId.asKnown().isPresent) 1 else 0) +
(if (latestHeartbeatAt.asKnown().isPresent) 1 else 0) +
(metadata.asKnown().getOrNull()?.validity() ?: 0) +
- (if (secret.asKnown().isPresent) 1 else 0) +
(if (startedAt.asKnown().isPresent) 1 else 0) +
(state.asKnown().getOrNull()?.validity() ?: 0) +
(if (stopRequestedAt.asKnown().isPresent) 1 else 0) +
@@ -956,7 +913,6 @@ private constructor(
environmentId == other.environmentId &&
latestHeartbeatAt == other.latestHeartbeatAt &&
metadata == other.metadata &&
- secret == other.secret &&
startedAt == other.startedAt &&
state == other.state &&
stopRequestedAt == other.stopRequestedAt &&
@@ -974,7 +930,6 @@ private constructor(
environmentId,
latestHeartbeatAt,
metadata,
- secret,
startedAt,
state,
stopRequestedAt,
@@ -987,5 +942,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "BetaSelfHostedWork{id=$id, acknowledgedAt=$acknowledgedAt, createdAt=$createdAt, data=$data, environmentId=$environmentId, latestHeartbeatAt=$latestHeartbeatAt, metadata=$metadata, secret=$secret, startedAt=$startedAt, state=$state, stopRequestedAt=$stopRequestedAt, stoppedAt=$stoppedAt, type=$type, additionalProperties=$additionalProperties}"
+ "BetaSelfHostedWork{id=$id, acknowledgedAt=$acknowledgedAt, createdAt=$createdAt, data=$data, environmentId=$environmentId, latestHeartbeatAt=$latestHeartbeatAt, metadata=$metadata, startedAt=$startedAt, state=$state, stopRequestedAt=$stopRequestedAt, stoppedAt=$stoppedAt, type=$type, additionalProperties=$additionalProperties}"
}
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/memorystores/memories/MemoryListParams.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/memorystores/memories/MemoryListParams.kt
index 350959acd..becce37c2 100644
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/memorystores/memories/MemoryListParams.kt
+++ b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/memorystores/memories/MemoryListParams.kt
@@ -33,10 +33,18 @@ private constructor(
fun memoryStoreId(): Optional = Optional.ofNullable(memoryStoreId)
- /** Query parameter for depth */
+ /**
+ * `0` (or omitted) returns all descendants below `path_prefix` (recursive). `1` returns
+ * immediate children only; deeper entries roll up as `memory_prefix` items. `depth=1` behaves
+ * like `ls`; omitting `depth` behaves like `find`.
+ */
fun depth(): Optional = Optional.ofNullable(depth)
- /** Query parameter for limit */
+ /**
+ * Maximum number of items to return per page. Must be between 1 and 100. Defaults to 20 when
+ * omitted. Capped at 20 when `view=full`. Both `memory` and `memory_prefix` items count toward
+ * the limit.
+ */
fun limit(): Optional = Optional.ofNullable(limit)
/** Query parameter for order */
@@ -45,17 +53,23 @@ private constructor(
/** Query parameter for order_by */
fun orderBy(): Optional = Optional.ofNullable(orderBy)
- /** Query parameter for page */
+ /**
+ * Opaque pagination cursor (a `page_...` value). Pass the `next_page` value from a previous
+ * response to fetch the next page; omit for the first page.
+ */
fun page(): Optional = Optional.ofNullable(page)
/**
- * Optional path prefix filter (raw string-prefix match; include a trailing slash for
- * directory-scoped lists). This value appears in request URLs. Do not include secrets or
- * personally identifiable information.
+ * Optional path prefix filter. Must end with `/` (segment-aligned), e.g., `/notes/`. This value
+ * appears in request URLs. Do not include secrets or personally identifiable information.
*/
fun pathPrefix(): Optional = Optional.ofNullable(pathPrefix)
- /** Query parameter for view */
+ /**
+ * Which projection of each `memory` to return. Defaults to `basic` (content omitted). `full`
+ * populates `content` on each item and caps `limit` at 20; use this as the bulk-read path for
+ * export and sync.
+ */
fun view(): Optional = Optional.ofNullable(view)
/** Optional header to specify the beta version(s) you want to use. */
@@ -113,7 +127,11 @@ private constructor(
fun memoryStoreId(memoryStoreId: Optional) =
memoryStoreId(memoryStoreId.getOrNull())
- /** Query parameter for depth */
+ /**
+ * `0` (or omitted) returns all descendants below `path_prefix` (recursive). `1` returns
+ * immediate children only; deeper entries roll up as `memory_prefix` items. `depth=1`
+ * behaves like `ls`; omitting `depth` behaves like `find`.
+ */
fun depth(depth: Int?) = apply { this.depth = depth }
/**
@@ -126,7 +144,11 @@ private constructor(
/** Alias for calling [Builder.depth] with `depth.orElse(null)`. */
fun depth(depth: Optional) = depth(depth.getOrNull())
- /** Query parameter for limit */
+ /**
+ * Maximum number of items to return per page. Must be between 1 and 100. Defaults to 20
+ * when omitted. Capped at 20 when `view=full`. Both `memory` and `memory_prefix` items
+ * count toward the limit.
+ */
fun limit(limit: Int?) = apply { this.limit = limit }
/**
@@ -151,23 +173,30 @@ private constructor(
/** Alias for calling [Builder.orderBy] with `orderBy.orElse(null)`. */
fun orderBy(orderBy: Optional) = orderBy(orderBy.getOrNull())
- /** Query parameter for page */
+ /**
+ * Opaque pagination cursor (a `page_...` value). Pass the `next_page` value from a previous
+ * response to fetch the next page; omit for the first page.
+ */
fun page(page: String?) = apply { this.page = page }
/** Alias for calling [Builder.page] with `page.orElse(null)`. */
fun page(page: Optional) = page(page.getOrNull())
/**
- * Optional path prefix filter (raw string-prefix match; include a trailing slash for
- * directory-scoped lists). This value appears in request URLs. Do not include secrets or
- * personally identifiable information.
+ * Optional path prefix filter. Must end with `/` (segment-aligned), e.g., `/notes/`. This
+ * value appears in request URLs. Do not include secrets or personally identifiable
+ * information.
*/
fun pathPrefix(pathPrefix: String?) = apply { this.pathPrefix = pathPrefix }
/** Alias for calling [Builder.pathPrefix] with `pathPrefix.orElse(null)`. */
fun pathPrefix(pathPrefix: Optional) = pathPrefix(pathPrefix.getOrNull())
- /** Query parameter for view */
+ /**
+ * Which projection of each `memory` to return. Defaults to `basic` (content omitted).
+ * `full` populates `content` on each item and caps `limit` at 20; use this as the bulk-read
+ * path for export and sync.
+ */
fun view(view: BetaManagedAgentsMemoryView?) = apply { this.view = view }
/** Alias for calling [Builder.view] with `view.orElse(null)`. */
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/messages/BetaFallbackRefusalTrigger.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/messages/BetaFallbackRefusalTrigger.kt
index 7cc0bc837..68b06c292 100644
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/messages/BetaFallbackRefusalTrigger.kt
+++ b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/messages/BetaFallbackRefusalTrigger.kt
@@ -231,8 +231,6 @@ private constructor(
@JvmField val REASONING_EXTRACTION = of("reasoning_extraction")
- @JvmField val MILITARY_WEAPONS = of("military_weapons")
-
@JvmStatic fun of(value: String) = Category(JsonField.of(value))
}
@@ -242,7 +240,6 @@ private constructor(
BIO,
FRONTIER_LLM,
REASONING_EXTRACTION,
- MILITARY_WEAPONS,
}
/**
@@ -259,7 +256,6 @@ private constructor(
BIO,
FRONTIER_LLM,
REASONING_EXTRACTION,
- MILITARY_WEAPONS,
/** An enum member indicating that [Category] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -277,7 +273,6 @@ private constructor(
BIO -> Value.BIO
FRONTIER_LLM -> Value.FRONTIER_LLM
REASONING_EXTRACTION -> Value.REASONING_EXTRACTION
- MILITARY_WEAPONS -> Value.MILITARY_WEAPONS
else -> Value._UNKNOWN
}
@@ -296,7 +291,6 @@ private constructor(
BIO -> Known.BIO
FRONTIER_LLM -> Known.FRONTIER_LLM
REASONING_EXTRACTION -> Known.REASONING_EXTRACTION
- MILITARY_WEAPONS -> Known.MILITARY_WEAPONS
else -> throw AnthropicInvalidDataException("Unknown Category: $value")
}
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/messages/BetaRefusalStopDetails.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/messages/BetaRefusalStopDetails.kt
index 7b7503da9..ef4568ec1 100644
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/messages/BetaRefusalStopDetails.kt
+++ b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/messages/BetaRefusalStopDetails.kt
@@ -520,8 +520,6 @@ private constructor(
@JvmField val REASONING_EXTRACTION = of("reasoning_extraction")
- @JvmField val MILITARY_WEAPONS = of("military_weapons")
-
@JvmStatic fun of(value: String) = Category(JsonField.of(value))
}
@@ -531,7 +529,6 @@ private constructor(
BIO,
FRONTIER_LLM,
REASONING_EXTRACTION,
- MILITARY_WEAPONS,
}
/**
@@ -548,7 +545,6 @@ private constructor(
BIO,
FRONTIER_LLM,
REASONING_EXTRACTION,
- MILITARY_WEAPONS,
/** An enum member indicating that [Category] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -566,7 +562,6 @@ private constructor(
BIO -> Value.BIO
FRONTIER_LLM -> Value.FRONTIER_LLM
REASONING_EXTRACTION -> Value.REASONING_EXTRACTION
- MILITARY_WEAPONS -> Value.MILITARY_WEAPONS
else -> Value._UNKNOWN
}
@@ -585,7 +580,6 @@ private constructor(
BIO -> Known.BIO
FRONTIER_LLM -> Known.FRONTIER_LLM
REASONING_EXTRACTION -> Known.REASONING_EXTRACTION
- MILITARY_WEAPONS -> Known.MILITARY_WEAPONS
else -> throw AnthropicInvalidDataException("Unknown Category: $value")
}
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/skills/SkillCreateParams.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/skills/SkillCreateParams.kt
index 25a9a77b3..6f03d9bed 100644
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/skills/SkillCreateParams.kt
+++ b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/skills/SkillCreateParams.kt
@@ -6,6 +6,7 @@ import com.anthropic.core.ExcludeMissing
import com.anthropic.core.JsonValue
import com.anthropic.core.MultipartField
import com.anthropic.core.Params
+import com.anthropic.core.checkRequired
import com.anthropic.core.http.Headers
import com.anthropic.core.http.QueryParams
import com.anthropic.core.toImmutable
@@ -32,6 +33,14 @@ private constructor(
/** Optional header to specify the beta version(s) you want to use. */
fun betas(): Optional> = Optional.ofNullable(betas)
+ /**
+ * Files to upload for the skill.
+ *
+ * All files must be in the same top-level directory and must include a SKILL.md file at the
+ * root of that directory.
+ */
+ fun files(): List> = body.files()
+
/**
* Display title for the skill.
*
@@ -42,14 +51,6 @@ private constructor(
*/
fun displayTitle(): Optional = body.displayTitle()
- /**
- * Files to upload for the skill.
- *
- * All files must be in the same top-level directory and must include a SKILL.md file at the
- * root of that directory.
- */
- fun files(): Optional>> = body.files()
-
/**
* Returns the raw multipart value of [displayTitle].
*
@@ -70,9 +71,14 @@ private constructor(
companion object {
- @JvmStatic fun none(): SkillCreateParams = builder().build()
-
- /** Returns a mutable builder for constructing an instance of [SkillCreateParams]. */
+ /**
+ * Returns a mutable builder for constructing an instance of [SkillCreateParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .files()
+ * ```
+ */
@JvmStatic fun builder() = Builder()
}
@@ -121,11 +127,22 @@ private constructor(
*
* 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:
- * - [displayTitle]
* - [files]
+ * - [displayTitle]
*/
fun body(body: Body) = apply { this.body = body.toBuilder() }
+ /**
+ * Files to upload for the skill.
+ *
+ * All files must be in the same top-level directory and must include a SKILL.md file at the
+ * root of that directory.
+ */
+ fun files(files: List>) = apply { body.files(files) }
+
+ /** Adds a single [MultipartField] to [files]. */
+ fun addFile(file: MultipartField) = apply { body.addFile(file) }
+
/**
* Display title for the skill.
*
@@ -147,20 +164,6 @@ private constructor(
body.displayTitle(displayTitle)
}
- /**
- * Files to upload for the skill.
- *
- * All files must be in the same top-level directory and must include a SKILL.md file at the
- * root of that directory.
- */
- fun files(files: List>?) = apply { body.files(files) }
-
- /** Alias for calling [Builder.files] with `files.orElse(null)`. */
- fun files(files: Optional>>) = files(files.getOrNull())
-
- /** Adds a single [MultipartField] to [files]. */
- fun addFile(file: MultipartField) = apply { body.addFile(file) }
-
fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
body.additionalProperties(additionalBodyProperties)
}
@@ -282,6 +285,13 @@ private constructor(
* Returns an immutable instance of [SkillCreateParams].
*
* Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .files()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
*/
fun build(): SkillCreateParams =
SkillCreateParams(
@@ -293,10 +303,8 @@ private constructor(
}
fun _body(): Map> =
- (mapOf(
- "display_title" to _displayTitle(),
- "files" to MultipartField.of(files().getOrNull()),
- ) + _additionalBodyProperties().mapValues { (_, value) -> MultipartField.of(value) })
+ (mapOf("display_title" to _displayTitle(), "files" to MultipartField.of(files())) +
+ _additionalBodyProperties().mapValues { (_, value) -> MultipartField.of(value) })
.toImmutable()
override fun _headers(): Headers =
@@ -312,10 +320,18 @@ private constructor(
class Body
private constructor(
private val displayTitle: MultipartField,
- private val files: List>?,
+ private val files: List>,
private val additionalProperties: MutableMap,
) {
+ /**
+ * Files to upload for the skill.
+ *
+ * All files must be in the same top-level directory and must include a SKILL.md file at the
+ * root of that directory.
+ */
+ fun files(): List> = files
+
/**
* Display title for the skill.
*
@@ -326,14 +342,6 @@ private constructor(
*/
fun displayTitle(): Optional = displayTitle.value.getOptional("display_title")
- /**
- * Files to upload for the skill.
- *
- * All files must be in the same top-level directory and must include a SKILL.md file at the
- * root of that directory.
- */
- fun files(): Optional>> = Optional.ofNullable(files)
-
/**
* Returns the raw multipart value of [displayTitle].
*
@@ -358,7 +366,14 @@ private constructor(
companion object {
- /** Returns a mutable builder for constructing an instance of [Body]. */
+ /**
+ * Returns a mutable builder for constructing an instance of [Body].
+ *
+ * The following fields are required:
+ * ```java
+ * .files()
+ * ```
+ */
@JvmStatic fun builder() = Builder()
}
@@ -372,10 +387,25 @@ private constructor(
@JvmSynthetic
internal fun from(body: Body) = apply {
displayTitle = body.displayTitle
- files = body.files?.toMutableList()
+ files = body.files.toMutableList()
additionalProperties = body.additionalProperties.toMutableMap()
}
+ /**
+ * Files to upload for the skill.
+ *
+ * All files must be in the same top-level directory and must include a SKILL.md file at
+ * the root of that directory.
+ */
+ fun files(files: List>) = apply {
+ this.files = files.toMutableList()
+ }
+
+ /** Adds a single [MultipartField] to [files]. */
+ fun addFile(file: MultipartField) = apply {
+ files = (files ?: mutableListOf()).apply { add(file) }
+ }
+
/**
* Display title for the skill.
*
@@ -398,24 +428,6 @@ private constructor(
this.displayTitle = displayTitle
}
- /**
- * Files to upload for the skill.
- *
- * All files must be in the same top-level directory and must include a SKILL.md file at
- * the root of that directory.
- */
- fun files(files: List>?) = apply {
- this.files = files?.toMutableList()
- }
-
- /** Alias for calling [Builder.files] with `files.orElse(null)`. */
- fun files(files: Optional>>) = files(files.getOrNull())
-
- /** Adds a single [MultipartField] to [files]. */
- fun addFile(file: MultipartField) = apply {
- files = (files ?: mutableListOf()).apply { add(file) }
- }
-
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -439,9 +451,20 @@ private constructor(
* Returns an immutable instance of [Body].
*
* Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .files()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
*/
fun build(): Body =
- Body(displayTitle, files?.toImmutable(), additionalProperties.toMutableMap())
+ Body(
+ displayTitle,
+ checkRequired("files", files).toImmutable(),
+ additionalProperties.toMutableMap(),
+ )
}
private var validated: Boolean = false
@@ -460,8 +483,8 @@ private constructor(
return@apply
}
- displayTitle()
files()
+ displayTitle()
validated = true
}
@@ -479,19 +502,19 @@ private constructor(
}
return other is Body &&
- displayTitle == other.displayTitle &&
files == other.files &&
+ displayTitle == other.displayTitle &&
additionalProperties == other.additionalProperties
}
private val hashCode: Int by lazy {
- Objects.hash(displayTitle, files, additionalProperties)
+ Objects.hash(files, displayTitle, additionalProperties)
}
override fun hashCode(): Int = hashCode
override fun toString() =
- "Body{displayTitle=$displayTitle, files=$files, additionalProperties=$additionalProperties}"
+ "Body{files=$files, displayTitle=$displayTitle, additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/skills/versions/VersionCreateParams.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/skills/versions/VersionCreateParams.kt
index 1a566ba3e..969d41bd1 100644
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/skills/versions/VersionCreateParams.kt
+++ b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/skills/versions/VersionCreateParams.kt
@@ -6,6 +6,7 @@ import com.anthropic.core.ExcludeMissing
import com.anthropic.core.JsonValue
import com.anthropic.core.MultipartField
import com.anthropic.core.Params
+import com.anthropic.core.checkRequired
import com.anthropic.core.http.Headers
import com.anthropic.core.http.QueryParams
import com.anthropic.core.toImmutable
@@ -45,7 +46,7 @@ private constructor(
* All files must be in the same top-level directory and must include a SKILL.md file at the
* root of that directory.
*/
- fun files(): Optional>> = body.files()
+ fun files(): List> = body.files()
fun _additionalBodyProperties(): Map = body._additionalProperties()
@@ -59,9 +60,14 @@ private constructor(
companion object {
- @JvmStatic fun none(): VersionCreateParams = builder().build()
-
- /** Returns a mutable builder for constructing an instance of [VersionCreateParams]. */
+ /**
+ * Returns a mutable builder for constructing an instance of [VersionCreateParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .files()
+ * ```
+ */
@JvmStatic fun builder() = Builder()
}
@@ -132,10 +138,7 @@ private constructor(
* All files must be in the same top-level directory and must include a SKILL.md file at the
* root of that directory.
*/
- fun files(files: List>?) = apply { body.files(files) }
-
- /** Alias for calling [Builder.files] with `files.orElse(null)`. */
- fun files(files: Optional>>) = files(files.getOrNull())
+ fun files(files: List>) = apply { body.files(files) }
/** Adds a single [MultipartField] to [files]. */
fun addFile(file: MultipartField) = apply { body.addFile(file) }
@@ -261,6 +264,13 @@ private constructor(
* Returns an immutable instance of [VersionCreateParams].
*
* Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .files()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
*/
fun build(): VersionCreateParams =
VersionCreateParams(
@@ -273,7 +283,7 @@ private constructor(
}
fun _body(): Map> =
- (mapOf("files" to MultipartField.of(files().getOrNull())) +
+ (mapOf("files" to MultipartField.of(files())) +
_additionalBodyProperties().mapValues { (_, value) -> MultipartField.of(value) })
.toImmutable()
@@ -295,7 +305,7 @@ private constructor(
class Body
private constructor(
- private val files: List>?,
+ private val files: List>,
private val additionalProperties: MutableMap,
) {
@@ -305,7 +315,7 @@ private constructor(
* All files must be in the same top-level directory and must include a SKILL.md file at the
* root of that directory.
*/
- fun files(): Optional>> = Optional.ofNullable(files)
+ fun files(): List> = files
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -321,7 +331,14 @@ private constructor(
companion object {
- /** Returns a mutable builder for constructing an instance of [Body]. */
+ /**
+ * Returns a mutable builder for constructing an instance of [Body].
+ *
+ * The following fields are required:
+ * ```java
+ * .files()
+ * ```
+ */
@JvmStatic fun builder() = Builder()
}
@@ -333,7 +350,7 @@ private constructor(
@JvmSynthetic
internal fun from(body: Body) = apply {
- files = body.files?.toMutableList()
+ files = body.files.toMutableList()
additionalProperties = body.additionalProperties.toMutableMap()
}
@@ -343,13 +360,10 @@ private constructor(
* All files must be in the same top-level directory and must include a SKILL.md file at
* the root of that directory.
*/
- fun files(files: List>?) = apply {
- this.files = files?.toMutableList()
+ fun files(files: List>) = apply {
+ this.files = files.toMutableList()
}
- /** Alias for calling [Builder.files] with `files.orElse(null)`. */
- fun files(files: Optional>>) = files(files.getOrNull())
-
/** Adds a single [MultipartField] to [files]. */
fun addFile(file: MultipartField) = apply {
files = (files ?: mutableListOf()).apply { add(file) }
@@ -378,8 +392,19 @@ private constructor(
* Returns an immutable instance of [Body].
*
* Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .files()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
*/
- fun build(): Body = Body(files?.toImmutable(), additionalProperties.toMutableMap())
+ fun build(): Body =
+ Body(
+ checkRequired("files", files).toImmutable(),
+ additionalProperties.toMutableMap(),
+ )
}
private var validated: Boolean = false
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentArchivedEventData.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentArchivedEventData.kt
deleted file mode 100644
index d0229556a..000000000
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentArchivedEventData.kt
+++ /dev/null
@@ -1,304 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.anthropic.models.beta.webhooks
-
-import com.anthropic.core.ExcludeMissing
-import com.anthropic.core.JsonField
-import com.anthropic.core.JsonMissing
-import com.anthropic.core.JsonValue
-import com.anthropic.core.checkRequired
-import com.anthropic.errors.AnthropicInvalidDataException
-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 java.util.Collections
-import java.util.Objects
-
-class BetaWebhookEnvironmentArchivedEventData
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(
- private val id: JsonField,
- private val organizationId: JsonField,
- private val type: JsonValue,
- private val workspaceId: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("organization_id")
- @ExcludeMissing
- organizationId: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(),
- @JsonProperty("workspace_id")
- @ExcludeMissing
- workspaceId: JsonField = JsonMissing.of(),
- ) : this(id, organizationId, type, workspaceId, mutableMapOf())
-
- /**
- * ID of the environment that triggered the event.
- *
- * @throws AnthropicInvalidDataException 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 id(): String = id.getRequired("id")
-
- /**
- * @throws AnthropicInvalidDataException 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 organizationId(): String = organizationId.getRequired("organization_id")
-
- /**
- * Expected to always return the following:
- * ```java
- * JsonValue.from("environment.archived")
- * ```
- *
- * However, this method can be useful for debugging and logging (e.g. if the server responded
- * with an unexpected value).
- */
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type
-
- /**
- * @throws AnthropicInvalidDataException 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 workspaceId(): String = workspaceId.getRequired("workspace_id")
-
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
-
- /**
- * Returns the raw JSON value of [organizationId].
- *
- * Unlike [organizationId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("organization_id")
- @ExcludeMissing
- fun _organizationId(): JsonField = organizationId
-
- /**
- * Returns the raw JSON value of [workspaceId].
- *
- * Unlike [workspaceId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("workspace_id")
- @ExcludeMissing
- fun _workspaceId(): JsonField = workspaceId
-
- @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
- * [BetaWebhookEnvironmentArchivedEventData].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .workspaceId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BetaWebhookEnvironmentArchivedEventData]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var organizationId: JsonField? = null
- private var type: JsonValue = JsonValue.from("environment.archived")
- private var workspaceId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(
- betaWebhookEnvironmentArchivedEventData: BetaWebhookEnvironmentArchivedEventData
- ) = apply {
- id = betaWebhookEnvironmentArchivedEventData.id
- organizationId = betaWebhookEnvironmentArchivedEventData.organizationId
- type = betaWebhookEnvironmentArchivedEventData.type
- workspaceId = betaWebhookEnvironmentArchivedEventData.workspaceId
- additionalProperties =
- betaWebhookEnvironmentArchivedEventData.additionalProperties.toMutableMap()
- }
-
- /** ID of the environment that triggered the event. */
- fun id(id: String) = id(JsonField.of(id))
-
- /**
- * Sets [Builder.id] to an arbitrary JSON value.
- *
- * You should usually call [Builder.id] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun id(id: JsonField) = apply { this.id = id }
-
- fun organizationId(organizationId: String) = organizationId(JsonField.of(organizationId))
-
- /**
- * Sets [Builder.organizationId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.organizationId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun organizationId(organizationId: JsonField) = apply {
- this.organizationId = organizationId
- }
-
- /**
- * Sets the field to an arbitrary JSON value.
- *
- * It is usually unnecessary to call this method because the field defaults to the
- * following:
- * ```java
- * JsonValue.from("environment.archived")
- * ```
- *
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun type(type: JsonValue) = apply { this.type = type }
-
- fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId))
-
- /**
- * Sets [Builder.workspaceId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.workspaceId] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun workspaceId(workspaceId: JsonField) = apply { this.workspaceId = workspaceId }
-
- 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 [BetaWebhookEnvironmentArchivedEventData].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .workspaceId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): BetaWebhookEnvironmentArchivedEventData =
- BetaWebhookEnvironmentArchivedEventData(
- checkRequired("id", id),
- checkRequired("organizationId", organizationId),
- type,
- checkRequired("workspaceId", workspaceId),
- 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 AnthropicInvalidDataException if any value type in this object doesn't match its
- * expected type.
- */
- fun validate(): BetaWebhookEnvironmentArchivedEventData = apply {
- if (validated) {
- return@apply
- }
-
- id()
- organizationId()
- _type().let {
- if (it != JsonValue.from("environment.archived")) {
- throw AnthropicInvalidDataException("'type' is invalid, received $it")
- }
- }
- workspaceId()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: AnthropicInvalidDataException) {
- 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 (id.asKnown().isPresent) 1 else 0) +
- (if (organizationId.asKnown().isPresent) 1 else 0) +
- type.let { if (it == JsonValue.from("environment.archived")) 1 else 0 } +
- (if (workspaceId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is BetaWebhookEnvironmentArchivedEventData &&
- id == other.id &&
- organizationId == other.organizationId &&
- type == other.type &&
- workspaceId == other.workspaceId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(id, organizationId, type, workspaceId, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "BetaWebhookEnvironmentArchivedEventData{id=$id, organizationId=$organizationId, type=$type, workspaceId=$workspaceId, additionalProperties=$additionalProperties}"
-}
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentCreatedEventData.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentCreatedEventData.kt
deleted file mode 100644
index 4ce80fbe8..000000000
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentCreatedEventData.kt
+++ /dev/null
@@ -1,304 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.anthropic.models.beta.webhooks
-
-import com.anthropic.core.ExcludeMissing
-import com.anthropic.core.JsonField
-import com.anthropic.core.JsonMissing
-import com.anthropic.core.JsonValue
-import com.anthropic.core.checkRequired
-import com.anthropic.errors.AnthropicInvalidDataException
-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 java.util.Collections
-import java.util.Objects
-
-class BetaWebhookEnvironmentCreatedEventData
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(
- private val id: JsonField,
- private val organizationId: JsonField,
- private val type: JsonValue,
- private val workspaceId: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("organization_id")
- @ExcludeMissing
- organizationId: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(),
- @JsonProperty("workspace_id")
- @ExcludeMissing
- workspaceId: JsonField = JsonMissing.of(),
- ) : this(id, organizationId, type, workspaceId, mutableMapOf())
-
- /**
- * ID of the environment that triggered the event.
- *
- * @throws AnthropicInvalidDataException 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 id(): String = id.getRequired("id")
-
- /**
- * @throws AnthropicInvalidDataException 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 organizationId(): String = organizationId.getRequired("organization_id")
-
- /**
- * Expected to always return the following:
- * ```java
- * JsonValue.from("environment.created")
- * ```
- *
- * However, this method can be useful for debugging and logging (e.g. if the server responded
- * with an unexpected value).
- */
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type
-
- /**
- * @throws AnthropicInvalidDataException 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 workspaceId(): String = workspaceId.getRequired("workspace_id")
-
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
-
- /**
- * Returns the raw JSON value of [organizationId].
- *
- * Unlike [organizationId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("organization_id")
- @ExcludeMissing
- fun _organizationId(): JsonField = organizationId
-
- /**
- * Returns the raw JSON value of [workspaceId].
- *
- * Unlike [workspaceId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("workspace_id")
- @ExcludeMissing
- fun _workspaceId(): JsonField = workspaceId
-
- @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
- * [BetaWebhookEnvironmentCreatedEventData].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .workspaceId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BetaWebhookEnvironmentCreatedEventData]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var organizationId: JsonField? = null
- private var type: JsonValue = JsonValue.from("environment.created")
- private var workspaceId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(
- betaWebhookEnvironmentCreatedEventData: BetaWebhookEnvironmentCreatedEventData
- ) = apply {
- id = betaWebhookEnvironmentCreatedEventData.id
- organizationId = betaWebhookEnvironmentCreatedEventData.organizationId
- type = betaWebhookEnvironmentCreatedEventData.type
- workspaceId = betaWebhookEnvironmentCreatedEventData.workspaceId
- additionalProperties =
- betaWebhookEnvironmentCreatedEventData.additionalProperties.toMutableMap()
- }
-
- /** ID of the environment that triggered the event. */
- fun id(id: String) = id(JsonField.of(id))
-
- /**
- * Sets [Builder.id] to an arbitrary JSON value.
- *
- * You should usually call [Builder.id] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun id(id: JsonField) = apply { this.id = id }
-
- fun organizationId(organizationId: String) = organizationId(JsonField.of(organizationId))
-
- /**
- * Sets [Builder.organizationId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.organizationId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun organizationId(organizationId: JsonField) = apply {
- this.organizationId = organizationId
- }
-
- /**
- * Sets the field to an arbitrary JSON value.
- *
- * It is usually unnecessary to call this method because the field defaults to the
- * following:
- * ```java
- * JsonValue.from("environment.created")
- * ```
- *
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun type(type: JsonValue) = apply { this.type = type }
-
- fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId))
-
- /**
- * Sets [Builder.workspaceId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.workspaceId] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun workspaceId(workspaceId: JsonField) = apply { this.workspaceId = workspaceId }
-
- 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 [BetaWebhookEnvironmentCreatedEventData].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .workspaceId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): BetaWebhookEnvironmentCreatedEventData =
- BetaWebhookEnvironmentCreatedEventData(
- checkRequired("id", id),
- checkRequired("organizationId", organizationId),
- type,
- checkRequired("workspaceId", workspaceId),
- 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 AnthropicInvalidDataException if any value type in this object doesn't match its
- * expected type.
- */
- fun validate(): BetaWebhookEnvironmentCreatedEventData = apply {
- if (validated) {
- return@apply
- }
-
- id()
- organizationId()
- _type().let {
- if (it != JsonValue.from("environment.created")) {
- throw AnthropicInvalidDataException("'type' is invalid, received $it")
- }
- }
- workspaceId()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: AnthropicInvalidDataException) {
- 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 (id.asKnown().isPresent) 1 else 0) +
- (if (organizationId.asKnown().isPresent) 1 else 0) +
- type.let { if (it == JsonValue.from("environment.created")) 1 else 0 } +
- (if (workspaceId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is BetaWebhookEnvironmentCreatedEventData &&
- id == other.id &&
- organizationId == other.organizationId &&
- type == other.type &&
- workspaceId == other.workspaceId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(id, organizationId, type, workspaceId, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "BetaWebhookEnvironmentCreatedEventData{id=$id, organizationId=$organizationId, type=$type, workspaceId=$workspaceId, additionalProperties=$additionalProperties}"
-}
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentDeletedEventData.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentDeletedEventData.kt
deleted file mode 100644
index 2a898a6ec..000000000
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentDeletedEventData.kt
+++ /dev/null
@@ -1,308 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.anthropic.models.beta.webhooks
-
-import com.anthropic.core.ExcludeMissing
-import com.anthropic.core.JsonField
-import com.anthropic.core.JsonMissing
-import com.anthropic.core.JsonValue
-import com.anthropic.core.checkRequired
-import com.anthropic.errors.AnthropicInvalidDataException
-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 java.util.Collections
-import java.util.Objects
-import kotlin.jvm.optionals.getOrNull
-
-class BetaWebhookEnvironmentDeletedEventData
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(
- private val id: JsonField,
- private val organizationId: JsonField,
- private val type: JsonField,
- private val workspaceId: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("organization_id")
- @ExcludeMissing
- organizationId: JsonField = JsonMissing.of(),
- @JsonProperty("type")
- @ExcludeMissing
- type: JsonField = JsonMissing.of(),
- @JsonProperty("workspace_id")
- @ExcludeMissing
- workspaceId: JsonField = JsonMissing.of(),
- ) : this(id, organizationId, type, workspaceId, mutableMapOf())
-
- /**
- * ID of the environment that triggered the event.
- *
- * @throws AnthropicInvalidDataException 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 id(): String = id.getRequired("id")
-
- /**
- * @throws AnthropicInvalidDataException 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 organizationId(): String = organizationId.getRequired("organization_id")
-
- /**
- * @throws AnthropicInvalidDataException 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(): BetaWebhookEnvironmentDeletedEventType = type.getRequired("type")
-
- /**
- * @throws AnthropicInvalidDataException 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 workspaceId(): String = workspaceId.getRequired("workspace_id")
-
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
-
- /**
- * Returns the raw JSON value of [organizationId].
- *
- * Unlike [organizationId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("organization_id")
- @ExcludeMissing
- fun _organizationId(): JsonField = organizationId
-
- /**
- * 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 [workspaceId].
- *
- * Unlike [workspaceId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("workspace_id")
- @ExcludeMissing
- fun _workspaceId(): JsonField = workspaceId
-
- @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
- * [BetaWebhookEnvironmentDeletedEventData].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .type()
- * .workspaceId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BetaWebhookEnvironmentDeletedEventData]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var organizationId: JsonField? = null
- private var type: JsonField? = null
- private var workspaceId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(
- betaWebhookEnvironmentDeletedEventData: BetaWebhookEnvironmentDeletedEventData
- ) = apply {
- id = betaWebhookEnvironmentDeletedEventData.id
- organizationId = betaWebhookEnvironmentDeletedEventData.organizationId
- type = betaWebhookEnvironmentDeletedEventData.type
- workspaceId = betaWebhookEnvironmentDeletedEventData.workspaceId
- additionalProperties =
- betaWebhookEnvironmentDeletedEventData.additionalProperties.toMutableMap()
- }
-
- /** ID of the environment that triggered the event. */
- fun id(id: String) = id(JsonField.of(id))
-
- /**
- * Sets [Builder.id] to an arbitrary JSON value.
- *
- * You should usually call [Builder.id] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun id(id: JsonField) = apply { this.id = id }
-
- fun organizationId(organizationId: String) = organizationId(JsonField.of(organizationId))
-
- /**
- * Sets [Builder.organizationId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.organizationId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun organizationId(organizationId: JsonField) = apply {
- this.organizationId = organizationId
- }
-
- fun type(type: BetaWebhookEnvironmentDeletedEventType) = type(JsonField.of(type))
-
- /**
- * Sets [Builder.type] to an arbitrary JSON value.
- *
- * You should usually call [Builder.type] with a well-typed
- * [BetaWebhookEnvironmentDeletedEventType] 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
- }
-
- fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId))
-
- /**
- * Sets [Builder.workspaceId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.workspaceId] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun workspaceId(workspaceId: JsonField) = apply { this.workspaceId = workspaceId }
-
- 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 [BetaWebhookEnvironmentDeletedEventData].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .type()
- * .workspaceId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): BetaWebhookEnvironmentDeletedEventData =
- BetaWebhookEnvironmentDeletedEventData(
- checkRequired("id", id),
- checkRequired("organizationId", organizationId),
- checkRequired("type", type),
- checkRequired("workspaceId", workspaceId),
- 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 AnthropicInvalidDataException if any value type in this object doesn't match its
- * expected type.
- */
- fun validate(): BetaWebhookEnvironmentDeletedEventData = apply {
- if (validated) {
- return@apply
- }
-
- id()
- organizationId()
- type().validate()
- workspaceId()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: AnthropicInvalidDataException) {
- 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 (id.asKnown().isPresent) 1 else 0) +
- (if (organizationId.asKnown().isPresent) 1 else 0) +
- (type.asKnown().getOrNull()?.validity() ?: 0) +
- (if (workspaceId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is BetaWebhookEnvironmentDeletedEventData &&
- id == other.id &&
- organizationId == other.organizationId &&
- type == other.type &&
- workspaceId == other.workspaceId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(id, organizationId, type, workspaceId, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "BetaWebhookEnvironmentDeletedEventData{id=$id, organizationId=$organizationId, type=$type, workspaceId=$workspaceId, additionalProperties=$additionalProperties}"
-}
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentDeletedEventType.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentDeletedEventType.kt
deleted file mode 100644
index e354b861e..000000000
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentDeletedEventType.kt
+++ /dev/null
@@ -1,143 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.anthropic.models.beta.webhooks
-
-import com.anthropic.core.Enum
-import com.anthropic.core.JsonField
-import com.anthropic.errors.AnthropicInvalidDataException
-import com.fasterxml.jackson.annotation.JsonCreator
-
-class BetaWebhookEnvironmentDeletedEventType
-@JsonCreator
-private constructor(private val value: JsonField) : Enum {
-
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from data that doesn't match
- * any known member, and you want to know that value. For example, if the SDK is on an older
- * version than the API, then the API may respond with new members that the SDK is unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val ENVIRONMENT_DELETED = of("environment.deleted")
-
- @JvmStatic
- fun of(value: String) = BetaWebhookEnvironmentDeletedEventType(JsonField.of(value))
- }
-
- /** An enum containing [BetaWebhookEnvironmentDeletedEventType]'s known values. */
- enum class Known {
- ENVIRONMENT_DELETED
- }
-
- /**
- * An enum containing [BetaWebhookEnvironmentDeletedEventType]'s known values, as well as an
- * [_UNKNOWN] member.
- *
- * An instance of [BetaWebhookEnvironmentDeletedEventType] can contain an unknown value in a
- * couple of cases:
- * - It was deserialized from data that doesn't match any known member. For example, if the SDK
- * is on an older version than the API, then the API may respond with new members that the SDK
- * is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
- */
- enum class Value {
- ENVIRONMENT_DELETED,
- /**
- * An enum member indicating that [BetaWebhookEnvironmentDeletedEventType] was instantiated
- * with an unknown value.
- */
- _UNKNOWN,
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if
- * the class was instantiated with an unknown value.
- *
- * Use the [known] method instead if you're certain the value is always known or if you want to
- * throw for the unknown case.
- */
- fun value(): Value =
- when (this) {
- ENVIRONMENT_DELETED -> Value.ENVIRONMENT_DELETED
- else -> Value._UNKNOWN
- }
-
- /**
- * Returns an enum member corresponding to this class instance's value.
- *
- * Use the [value] method instead if you're uncertain the value is always known and don't want
- * to throw for the unknown case.
- *
- * @throws AnthropicInvalidDataException if this class instance's value is a not a known member.
- */
- fun known(): Known =
- when (this) {
- ENVIRONMENT_DELETED -> Known.ENVIRONMENT_DELETED
- else ->
- throw AnthropicInvalidDataException(
- "Unknown BetaWebhookEnvironmentDeletedEventType: $value"
- )
- }
-
- /**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is primarily for debugging and
- * generally doesn't throw.
- *
- * @throws AnthropicInvalidDataException if this class instance's value does not have the
- * expected primitive type.
- */
- fun asString(): String =
- _value().asString().orElseThrow { AnthropicInvalidDataException("Value is not a String") }
-
- 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 AnthropicInvalidDataException if any value type in this object doesn't match its
- * expected type.
- */
- fun validate(): BetaWebhookEnvironmentDeletedEventType = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: AnthropicInvalidDataException) {
- 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 (value() == Value._UNKNOWN) 0 else 1
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is BetaWebhookEnvironmentDeletedEventType && value == other.value
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
-}
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentUpdatedEventData.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentUpdatedEventData.kt
deleted file mode 100644
index 881386cab..000000000
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentUpdatedEventData.kt
+++ /dev/null
@@ -1,304 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.anthropic.models.beta.webhooks
-
-import com.anthropic.core.ExcludeMissing
-import com.anthropic.core.JsonField
-import com.anthropic.core.JsonMissing
-import com.anthropic.core.JsonValue
-import com.anthropic.core.checkRequired
-import com.anthropic.errors.AnthropicInvalidDataException
-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 java.util.Collections
-import java.util.Objects
-
-class BetaWebhookEnvironmentUpdatedEventData
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(
- private val id: JsonField,
- private val organizationId: JsonField,
- private val type: JsonValue,
- private val workspaceId: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("organization_id")
- @ExcludeMissing
- organizationId: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(),
- @JsonProperty("workspace_id")
- @ExcludeMissing
- workspaceId: JsonField = JsonMissing.of(),
- ) : this(id, organizationId, type, workspaceId, mutableMapOf())
-
- /**
- * ID of the environment that triggered the event.
- *
- * @throws AnthropicInvalidDataException 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 id(): String = id.getRequired("id")
-
- /**
- * @throws AnthropicInvalidDataException 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 organizationId(): String = organizationId.getRequired("organization_id")
-
- /**
- * Expected to always return the following:
- * ```java
- * JsonValue.from("environment.updated")
- * ```
- *
- * However, this method can be useful for debugging and logging (e.g. if the server responded
- * with an unexpected value).
- */
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type
-
- /**
- * @throws AnthropicInvalidDataException 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 workspaceId(): String = workspaceId.getRequired("workspace_id")
-
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
-
- /**
- * Returns the raw JSON value of [organizationId].
- *
- * Unlike [organizationId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("organization_id")
- @ExcludeMissing
- fun _organizationId(): JsonField = organizationId
-
- /**
- * Returns the raw JSON value of [workspaceId].
- *
- * Unlike [workspaceId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("workspace_id")
- @ExcludeMissing
- fun _workspaceId(): JsonField = workspaceId
-
- @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
- * [BetaWebhookEnvironmentUpdatedEventData].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .workspaceId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BetaWebhookEnvironmentUpdatedEventData]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var organizationId: JsonField? = null
- private var type: JsonValue = JsonValue.from("environment.updated")
- private var workspaceId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(
- betaWebhookEnvironmentUpdatedEventData: BetaWebhookEnvironmentUpdatedEventData
- ) = apply {
- id = betaWebhookEnvironmentUpdatedEventData.id
- organizationId = betaWebhookEnvironmentUpdatedEventData.organizationId
- type = betaWebhookEnvironmentUpdatedEventData.type
- workspaceId = betaWebhookEnvironmentUpdatedEventData.workspaceId
- additionalProperties =
- betaWebhookEnvironmentUpdatedEventData.additionalProperties.toMutableMap()
- }
-
- /** ID of the environment that triggered the event. */
- fun id(id: String) = id(JsonField.of(id))
-
- /**
- * Sets [Builder.id] to an arbitrary JSON value.
- *
- * You should usually call [Builder.id] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun id(id: JsonField) = apply { this.id = id }
-
- fun organizationId(organizationId: String) = organizationId(JsonField.of(organizationId))
-
- /**
- * Sets [Builder.organizationId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.organizationId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun organizationId(organizationId: JsonField) = apply {
- this.organizationId = organizationId
- }
-
- /**
- * Sets the field to an arbitrary JSON value.
- *
- * It is usually unnecessary to call this method because the field defaults to the
- * following:
- * ```java
- * JsonValue.from("environment.updated")
- * ```
- *
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun type(type: JsonValue) = apply { this.type = type }
-
- fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId))
-
- /**
- * Sets [Builder.workspaceId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.workspaceId] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun workspaceId(workspaceId: JsonField) = apply { this.workspaceId = workspaceId }
-
- 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 [BetaWebhookEnvironmentUpdatedEventData].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .workspaceId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): BetaWebhookEnvironmentUpdatedEventData =
- BetaWebhookEnvironmentUpdatedEventData(
- checkRequired("id", id),
- checkRequired("organizationId", organizationId),
- type,
- checkRequired("workspaceId", workspaceId),
- 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 AnthropicInvalidDataException if any value type in this object doesn't match its
- * expected type.
- */
- fun validate(): BetaWebhookEnvironmentUpdatedEventData = apply {
- if (validated) {
- return@apply
- }
-
- id()
- organizationId()
- _type().let {
- if (it != JsonValue.from("environment.updated")) {
- throw AnthropicInvalidDataException("'type' is invalid, received $it")
- }
- }
- workspaceId()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: AnthropicInvalidDataException) {
- 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 (id.asKnown().isPresent) 1 else 0) +
- (if (organizationId.asKnown().isPresent) 1 else 0) +
- type.let { if (it == JsonValue.from("environment.updated")) 1 else 0 } +
- (if (workspaceId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is BetaWebhookEnvironmentUpdatedEventData &&
- id == other.id &&
- organizationId == other.organizationId &&
- type == other.type &&
- workspaceId == other.workspaceId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(id, organizationId, type, workspaceId, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "BetaWebhookEnvironmentUpdatedEventData{id=$id, organizationId=$organizationId, type=$type, workspaceId=$workspaceId, additionalProperties=$additionalProperties}"
-}
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEvent.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEvent.kt
index c8a0e8353..608a6a6f1 100644
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEvent.kt
+++ b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEvent.kt
@@ -400,55 +400,6 @@ private constructor(
fun data(deploymentRunSucceeded: BetaWebhookDeploymentRunSucceededEventData) =
data(BetaWebhookEventData.ofDeploymentRunSucceeded(deploymentRunSucceeded))
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofEnvironmentCreated(environmentCreated)`.
- */
- fun data(environmentCreated: BetaWebhookEnvironmentCreatedEventData) =
- data(BetaWebhookEventData.ofEnvironmentCreated(environmentCreated))
-
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofEnvironmentUpdated(environmentUpdated)`.
- */
- fun data(environmentUpdated: BetaWebhookEnvironmentUpdatedEventData) =
- data(BetaWebhookEventData.ofEnvironmentUpdated(environmentUpdated))
-
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofEnvironmentArchived(environmentArchived)`.
- */
- fun data(environmentArchived: BetaWebhookEnvironmentArchivedEventData) =
- data(BetaWebhookEventData.ofEnvironmentArchived(environmentArchived))
-
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofEnvironmentDeleted(environmentDeleted)`.
- */
- fun data(environmentDeleted: BetaWebhookEnvironmentDeletedEventData) =
- data(BetaWebhookEventData.ofEnvironmentDeleted(environmentDeleted))
-
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofMemoryStoreCreated(memoryStoreCreated)`.
- */
- fun data(memoryStoreCreated: BetaWebhookMemoryStoreCreatedEventData) =
- data(BetaWebhookEventData.ofMemoryStoreCreated(memoryStoreCreated))
-
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofMemoryStoreArchived(memoryStoreArchived)`.
- */
- fun data(memoryStoreArchived: BetaWebhookMemoryStoreArchivedEventData) =
- data(BetaWebhookEventData.ofMemoryStoreArchived(memoryStoreArchived))
-
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofMemoryStoreDeleted(memoryStoreDeleted)`.
- */
- fun data(memoryStoreDeleted: BetaWebhookMemoryStoreDeletedEventData) =
- data(BetaWebhookEventData.ofMemoryStoreDeleted(memoryStoreDeleted))
-
/**
* Sets the field to an arbitrary JSON value.
*
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEventData.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEventData.kt
index 6b8ef15cb..e7e300b05 100644
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEventData.kt
+++ b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEventData.kt
@@ -60,13 +60,6 @@ private constructor(
private val deploymentRunStarted: BetaWebhookDeploymentRunStartedEventData? = null,
private val deploymentDeleted: BetaWebhookDeploymentDeletedEventData? = null,
private val deploymentRunSucceeded: BetaWebhookDeploymentRunSucceededEventData? = null,
- private val environmentCreated: BetaWebhookEnvironmentCreatedEventData? = null,
- private val environmentUpdated: BetaWebhookEnvironmentUpdatedEventData? = null,
- private val environmentArchived: BetaWebhookEnvironmentArchivedEventData? = null,
- private val environmentDeleted: BetaWebhookEnvironmentDeletedEventData? = null,
- private val memoryStoreCreated: BetaWebhookMemoryStoreCreatedEventData? = null,
- private val memoryStoreArchived: BetaWebhookMemoryStoreArchivedEventData? = null,
- private val memoryStoreDeleted: BetaWebhookMemoryStoreDeletedEventData? = null,
private val _json: JsonValue? = null,
) {
@@ -179,27 +172,6 @@ private constructor(
fun deploymentRunSucceeded(): Optional =
Optional.ofNullable(deploymentRunSucceeded)
- fun environmentCreated(): Optional =
- Optional.ofNullable(environmentCreated)
-
- fun environmentUpdated(): Optional =
- Optional.ofNullable(environmentUpdated)
-
- fun environmentArchived(): Optional =
- Optional.ofNullable(environmentArchived)
-
- fun environmentDeleted(): Optional =
- Optional.ofNullable(environmentDeleted)
-
- fun memoryStoreCreated(): Optional =
- Optional.ofNullable(memoryStoreCreated)
-
- fun memoryStoreArchived(): Optional =
- Optional.ofNullable(memoryStoreArchived)
-
- fun memoryStoreDeleted(): Optional =
- Optional.ofNullable(memoryStoreDeleted)
-
fun isSessionCreated(): Boolean = sessionCreated != null
fun isSessionPending(): Boolean = sessionPending != null
@@ -272,20 +244,6 @@ private constructor(
fun isDeploymentRunSucceeded(): Boolean = deploymentRunSucceeded != null
- fun isEnvironmentCreated(): Boolean = environmentCreated != null
-
- fun isEnvironmentUpdated(): Boolean = environmentUpdated != null
-
- fun isEnvironmentArchived(): Boolean = environmentArchived != null
-
- fun isEnvironmentDeleted(): Boolean = environmentDeleted != null
-
- fun isMemoryStoreCreated(): Boolean = memoryStoreCreated != null
-
- fun isMemoryStoreArchived(): Boolean = memoryStoreArchived != null
-
- fun isMemoryStoreDeleted(): Boolean = memoryStoreDeleted != null
-
fun asSessionCreated(): BetaWebhookSessionCreatedEventData =
sessionCreated.getOrThrow("sessionCreated")
@@ -388,27 +346,6 @@ private constructor(
fun asDeploymentRunSucceeded(): BetaWebhookDeploymentRunSucceededEventData =
deploymentRunSucceeded.getOrThrow("deploymentRunSucceeded")
- fun asEnvironmentCreated(): BetaWebhookEnvironmentCreatedEventData =
- environmentCreated.getOrThrow("environmentCreated")
-
- fun asEnvironmentUpdated(): BetaWebhookEnvironmentUpdatedEventData =
- environmentUpdated.getOrThrow("environmentUpdated")
-
- fun asEnvironmentArchived(): BetaWebhookEnvironmentArchivedEventData =
- environmentArchived.getOrThrow("environmentArchived")
-
- fun asEnvironmentDeleted(): BetaWebhookEnvironmentDeletedEventData =
- environmentDeleted.getOrThrow("environmentDeleted")
-
- fun asMemoryStoreCreated(): BetaWebhookMemoryStoreCreatedEventData =
- memoryStoreCreated.getOrThrow("memoryStoreCreated")
-
- fun asMemoryStoreArchived(): BetaWebhookMemoryStoreArchivedEventData =
- memoryStoreArchived.getOrThrow("memoryStoreArchived")
-
- fun asMemoryStoreDeleted(): BetaWebhookMemoryStoreDeletedEventData =
- memoryStoreDeleted.getOrThrow("memoryStoreDeleted")
-
fun _json(): Optional = Optional.ofNullable(_json)
/**
@@ -489,13 +426,6 @@ private constructor(
deploymentDeleted != null -> visitor.visitDeploymentDeleted(deploymentDeleted)
deploymentRunSucceeded != null ->
visitor.visitDeploymentRunSucceeded(deploymentRunSucceeded)
- environmentCreated != null -> visitor.visitEnvironmentCreated(environmentCreated)
- environmentUpdated != null -> visitor.visitEnvironmentUpdated(environmentUpdated)
- environmentArchived != null -> visitor.visitEnvironmentArchived(environmentArchived)
- environmentDeleted != null -> visitor.visitEnvironmentDeleted(environmentDeleted)
- memoryStoreCreated != null -> visitor.visitMemoryStoreCreated(memoryStoreCreated)
- memoryStoreArchived != null -> visitor.visitMemoryStoreArchived(memoryStoreArchived)
- memoryStoreDeleted != null -> visitor.visitMemoryStoreDeleted(memoryStoreDeleted)
else -> visitor.unknown(_json)
}
@@ -715,48 +645,6 @@ private constructor(
) {
deploymentRunSucceeded.validate()
}
-
- override fun visitEnvironmentCreated(
- environmentCreated: BetaWebhookEnvironmentCreatedEventData
- ) {
- environmentCreated.validate()
- }
-
- override fun visitEnvironmentUpdated(
- environmentUpdated: BetaWebhookEnvironmentUpdatedEventData
- ) {
- environmentUpdated.validate()
- }
-
- override fun visitEnvironmentArchived(
- environmentArchived: BetaWebhookEnvironmentArchivedEventData
- ) {
- environmentArchived.validate()
- }
-
- override fun visitEnvironmentDeleted(
- environmentDeleted: BetaWebhookEnvironmentDeletedEventData
- ) {
- environmentDeleted.validate()
- }
-
- override fun visitMemoryStoreCreated(
- memoryStoreCreated: BetaWebhookMemoryStoreCreatedEventData
- ) {
- memoryStoreCreated.validate()
- }
-
- override fun visitMemoryStoreArchived(
- memoryStoreArchived: BetaWebhookMemoryStoreArchivedEventData
- ) {
- memoryStoreArchived.validate()
- }
-
- override fun visitMemoryStoreDeleted(
- memoryStoreDeleted: BetaWebhookMemoryStoreDeletedEventData
- ) {
- memoryStoreDeleted.validate()
- }
}
)
validated = true
@@ -915,34 +803,6 @@ private constructor(
deploymentRunSucceeded: BetaWebhookDeploymentRunSucceededEventData
) = deploymentRunSucceeded.validity()
- override fun visitEnvironmentCreated(
- environmentCreated: BetaWebhookEnvironmentCreatedEventData
- ) = environmentCreated.validity()
-
- override fun visitEnvironmentUpdated(
- environmentUpdated: BetaWebhookEnvironmentUpdatedEventData
- ) = environmentUpdated.validity()
-
- override fun visitEnvironmentArchived(
- environmentArchived: BetaWebhookEnvironmentArchivedEventData
- ) = environmentArchived.validity()
-
- override fun visitEnvironmentDeleted(
- environmentDeleted: BetaWebhookEnvironmentDeletedEventData
- ) = environmentDeleted.validity()
-
- override fun visitMemoryStoreCreated(
- memoryStoreCreated: BetaWebhookMemoryStoreCreatedEventData
- ) = memoryStoreCreated.validity()
-
- override fun visitMemoryStoreArchived(
- memoryStoreArchived: BetaWebhookMemoryStoreArchivedEventData
- ) = memoryStoreArchived.validity()
-
- override fun visitMemoryStoreDeleted(
- memoryStoreDeleted: BetaWebhookMemoryStoreDeletedEventData
- ) = memoryStoreDeleted.validity()
-
override fun unknown(json: JsonValue?) = 0
}
)
@@ -988,14 +848,7 @@ private constructor(
deploymentArchived == other.deploymentArchived &&
deploymentRunStarted == other.deploymentRunStarted &&
deploymentDeleted == other.deploymentDeleted &&
- deploymentRunSucceeded == other.deploymentRunSucceeded &&
- environmentCreated == other.environmentCreated &&
- environmentUpdated == other.environmentUpdated &&
- environmentArchived == other.environmentArchived &&
- environmentDeleted == other.environmentDeleted &&
- memoryStoreCreated == other.memoryStoreCreated &&
- memoryStoreArchived == other.memoryStoreArchived &&
- memoryStoreDeleted == other.memoryStoreDeleted
+ deploymentRunSucceeded == other.deploymentRunSucceeded
}
override fun hashCode(): Int =
@@ -1036,13 +889,6 @@ private constructor(
deploymentRunStarted,
deploymentDeleted,
deploymentRunSucceeded,
- environmentCreated,
- environmentUpdated,
- environmentArchived,
- environmentDeleted,
- memoryStoreCreated,
- memoryStoreArchived,
- memoryStoreDeleted,
)
override fun toString(): String =
@@ -1104,20 +950,6 @@ private constructor(
"BetaWebhookEventData{deploymentDeleted=$deploymentDeleted}"
deploymentRunSucceeded != null ->
"BetaWebhookEventData{deploymentRunSucceeded=$deploymentRunSucceeded}"
- environmentCreated != null ->
- "BetaWebhookEventData{environmentCreated=$environmentCreated}"
- environmentUpdated != null ->
- "BetaWebhookEventData{environmentUpdated=$environmentUpdated}"
- environmentArchived != null ->
- "BetaWebhookEventData{environmentArchived=$environmentArchived}"
- environmentDeleted != null ->
- "BetaWebhookEventData{environmentDeleted=$environmentDeleted}"
- memoryStoreCreated != null ->
- "BetaWebhookEventData{memoryStoreCreated=$memoryStoreCreated}"
- memoryStoreArchived != null ->
- "BetaWebhookEventData{memoryStoreArchived=$memoryStoreArchived}"
- memoryStoreDeleted != null ->
- "BetaWebhookEventData{memoryStoreDeleted=$memoryStoreDeleted}"
_json != null -> "BetaWebhookEventData{_unknown=$_json}"
else -> throw IllegalStateException("Invalid BetaWebhookEventData")
}
@@ -1278,34 +1110,6 @@ private constructor(
fun ofDeploymentRunSucceeded(
deploymentRunSucceeded: BetaWebhookDeploymentRunSucceededEventData
) = BetaWebhookEventData(deploymentRunSucceeded = deploymentRunSucceeded)
-
- @JvmStatic
- fun ofEnvironmentCreated(environmentCreated: BetaWebhookEnvironmentCreatedEventData) =
- BetaWebhookEventData(environmentCreated = environmentCreated)
-
- @JvmStatic
- fun ofEnvironmentUpdated(environmentUpdated: BetaWebhookEnvironmentUpdatedEventData) =
- BetaWebhookEventData(environmentUpdated = environmentUpdated)
-
- @JvmStatic
- fun ofEnvironmentArchived(environmentArchived: BetaWebhookEnvironmentArchivedEventData) =
- BetaWebhookEventData(environmentArchived = environmentArchived)
-
- @JvmStatic
- fun ofEnvironmentDeleted(environmentDeleted: BetaWebhookEnvironmentDeletedEventData) =
- BetaWebhookEventData(environmentDeleted = environmentDeleted)
-
- @JvmStatic
- fun ofMemoryStoreCreated(memoryStoreCreated: BetaWebhookMemoryStoreCreatedEventData) =
- BetaWebhookEventData(memoryStoreCreated = memoryStoreCreated)
-
- @JvmStatic
- fun ofMemoryStoreArchived(memoryStoreArchived: BetaWebhookMemoryStoreArchivedEventData) =
- BetaWebhookEventData(memoryStoreArchived = memoryStoreArchived)
-
- @JvmStatic
- fun ofMemoryStoreDeleted(memoryStoreDeleted: BetaWebhookMemoryStoreDeletedEventData) =
- BetaWebhookEventData(memoryStoreDeleted = memoryStoreDeleted)
}
/**
@@ -1414,24 +1218,6 @@ private constructor(
deploymentRunSucceeded: BetaWebhookDeploymentRunSucceededEventData
): T
- fun visitEnvironmentCreated(environmentCreated: BetaWebhookEnvironmentCreatedEventData): T
-
- fun visitEnvironmentUpdated(environmentUpdated: BetaWebhookEnvironmentUpdatedEventData): T
-
- fun visitEnvironmentArchived(
- environmentArchived: BetaWebhookEnvironmentArchivedEventData
- ): T
-
- fun visitEnvironmentDeleted(environmentDeleted: BetaWebhookEnvironmentDeletedEventData): T
-
- fun visitMemoryStoreCreated(memoryStoreCreated: BetaWebhookMemoryStoreCreatedEventData): T
-
- fun visitMemoryStoreArchived(
- memoryStoreArchived: BetaWebhookMemoryStoreArchivedEventData
- ): T
-
- fun visitMemoryStoreDeleted(memoryStoreDeleted: BetaWebhookMemoryStoreDeletedEventData): T
-
/**
* Maps an unknown variant of [BetaWebhookEventData] to a value of type [T].
*
@@ -1721,62 +1507,6 @@ private constructor(
?.let { BetaWebhookEventData(deploymentRunSucceeded = it, _json = json) }
?: BetaWebhookEventData(_json = json)
}
- "environment.created" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { BetaWebhookEventData(environmentCreated = it, _json = json) }
- ?: BetaWebhookEventData(_json = json)
- }
- "environment.updated" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { BetaWebhookEventData(environmentUpdated = it, _json = json) }
- ?: BetaWebhookEventData(_json = json)
- }
- "environment.archived" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { BetaWebhookEventData(environmentArchived = it, _json = json) }
- ?: BetaWebhookEventData(_json = json)
- }
- "environment.deleted" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { BetaWebhookEventData(environmentDeleted = it, _json = json) }
- ?: BetaWebhookEventData(_json = json)
- }
- "memory_store.created" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { BetaWebhookEventData(memoryStoreCreated = it, _json = json) }
- ?: BetaWebhookEventData(_json = json)
- }
- "memory_store.archived" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { BetaWebhookEventData(memoryStoreArchived = it, _json = json) }
- ?: BetaWebhookEventData(_json = json)
- }
- "memory_store.deleted" -> {
- return tryDeserialize(
- node,
- jacksonTypeRef(),
- )
- ?.let { BetaWebhookEventData(memoryStoreDeleted = it, _json = json) }
- ?: BetaWebhookEventData(_json = json)
- }
}
return BetaWebhookEventData(_json = json)
@@ -1841,15 +1571,6 @@ private constructor(
value.deploymentDeleted != null -> generator.writeObject(value.deploymentDeleted)
value.deploymentRunSucceeded != null ->
generator.writeObject(value.deploymentRunSucceeded)
- value.environmentCreated != null -> generator.writeObject(value.environmentCreated)
- value.environmentUpdated != null -> generator.writeObject(value.environmentUpdated)
- value.environmentArchived != null ->
- generator.writeObject(value.environmentArchived)
- value.environmentDeleted != null -> generator.writeObject(value.environmentDeleted)
- value.memoryStoreCreated != null -> generator.writeObject(value.memoryStoreCreated)
- value.memoryStoreArchived != null ->
- generator.writeObject(value.memoryStoreArchived)
- value.memoryStoreDeleted != null -> generator.writeObject(value.memoryStoreDeleted)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid BetaWebhookEventData")
}
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreArchivedEventData.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreArchivedEventData.kt
deleted file mode 100644
index 983e708c8..000000000
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreArchivedEventData.kt
+++ /dev/null
@@ -1,304 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.anthropic.models.beta.webhooks
-
-import com.anthropic.core.ExcludeMissing
-import com.anthropic.core.JsonField
-import com.anthropic.core.JsonMissing
-import com.anthropic.core.JsonValue
-import com.anthropic.core.checkRequired
-import com.anthropic.errors.AnthropicInvalidDataException
-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 java.util.Collections
-import java.util.Objects
-
-class BetaWebhookMemoryStoreArchivedEventData
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(
- private val id: JsonField,
- private val organizationId: JsonField,
- private val type: JsonValue,
- private val workspaceId: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("organization_id")
- @ExcludeMissing
- organizationId: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(),
- @JsonProperty("workspace_id")
- @ExcludeMissing
- workspaceId: JsonField = JsonMissing.of(),
- ) : this(id, organizationId, type, workspaceId, mutableMapOf())
-
- /**
- * ID of the memory store that triggered the event.
- *
- * @throws AnthropicInvalidDataException 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 id(): String = id.getRequired("id")
-
- /**
- * @throws AnthropicInvalidDataException 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 organizationId(): String = organizationId.getRequired("organization_id")
-
- /**
- * Expected to always return the following:
- * ```java
- * JsonValue.from("memory_store.archived")
- * ```
- *
- * However, this method can be useful for debugging and logging (e.g. if the server responded
- * with an unexpected value).
- */
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type
-
- /**
- * @throws AnthropicInvalidDataException 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 workspaceId(): String = workspaceId.getRequired("workspace_id")
-
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
-
- /**
- * Returns the raw JSON value of [organizationId].
- *
- * Unlike [organizationId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("organization_id")
- @ExcludeMissing
- fun _organizationId(): JsonField = organizationId
-
- /**
- * Returns the raw JSON value of [workspaceId].
- *
- * Unlike [workspaceId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("workspace_id")
- @ExcludeMissing
- fun _workspaceId(): JsonField = workspaceId
-
- @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
- * [BetaWebhookMemoryStoreArchivedEventData].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .workspaceId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BetaWebhookMemoryStoreArchivedEventData]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var organizationId: JsonField? = null
- private var type: JsonValue = JsonValue.from("memory_store.archived")
- private var workspaceId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(
- betaWebhookMemoryStoreArchivedEventData: BetaWebhookMemoryStoreArchivedEventData
- ) = apply {
- id = betaWebhookMemoryStoreArchivedEventData.id
- organizationId = betaWebhookMemoryStoreArchivedEventData.organizationId
- type = betaWebhookMemoryStoreArchivedEventData.type
- workspaceId = betaWebhookMemoryStoreArchivedEventData.workspaceId
- additionalProperties =
- betaWebhookMemoryStoreArchivedEventData.additionalProperties.toMutableMap()
- }
-
- /** ID of the memory store that triggered the event. */
- fun id(id: String) = id(JsonField.of(id))
-
- /**
- * Sets [Builder.id] to an arbitrary JSON value.
- *
- * You should usually call [Builder.id] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun id(id: JsonField) = apply { this.id = id }
-
- fun organizationId(organizationId: String) = organizationId(JsonField.of(organizationId))
-
- /**
- * Sets [Builder.organizationId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.organizationId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun organizationId(organizationId: JsonField) = apply {
- this.organizationId = organizationId
- }
-
- /**
- * Sets the field to an arbitrary JSON value.
- *
- * It is usually unnecessary to call this method because the field defaults to the
- * following:
- * ```java
- * JsonValue.from("memory_store.archived")
- * ```
- *
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun type(type: JsonValue) = apply { this.type = type }
-
- fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId))
-
- /**
- * Sets [Builder.workspaceId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.workspaceId] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun workspaceId(workspaceId: JsonField) = apply { this.workspaceId = workspaceId }
-
- 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 [BetaWebhookMemoryStoreArchivedEventData].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .workspaceId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): BetaWebhookMemoryStoreArchivedEventData =
- BetaWebhookMemoryStoreArchivedEventData(
- checkRequired("id", id),
- checkRequired("organizationId", organizationId),
- type,
- checkRequired("workspaceId", workspaceId),
- 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 AnthropicInvalidDataException if any value type in this object doesn't match its
- * expected type.
- */
- fun validate(): BetaWebhookMemoryStoreArchivedEventData = apply {
- if (validated) {
- return@apply
- }
-
- id()
- organizationId()
- _type().let {
- if (it != JsonValue.from("memory_store.archived")) {
- throw AnthropicInvalidDataException("'type' is invalid, received $it")
- }
- }
- workspaceId()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: AnthropicInvalidDataException) {
- 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 (id.asKnown().isPresent) 1 else 0) +
- (if (organizationId.asKnown().isPresent) 1 else 0) +
- type.let { if (it == JsonValue.from("memory_store.archived")) 1 else 0 } +
- (if (workspaceId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is BetaWebhookMemoryStoreArchivedEventData &&
- id == other.id &&
- organizationId == other.organizationId &&
- type == other.type &&
- workspaceId == other.workspaceId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(id, organizationId, type, workspaceId, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "BetaWebhookMemoryStoreArchivedEventData{id=$id, organizationId=$organizationId, type=$type, workspaceId=$workspaceId, additionalProperties=$additionalProperties}"
-}
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreCreatedEventData.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreCreatedEventData.kt
deleted file mode 100644
index 486696d66..000000000
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreCreatedEventData.kt
+++ /dev/null
@@ -1,304 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.anthropic.models.beta.webhooks
-
-import com.anthropic.core.ExcludeMissing
-import com.anthropic.core.JsonField
-import com.anthropic.core.JsonMissing
-import com.anthropic.core.JsonValue
-import com.anthropic.core.checkRequired
-import com.anthropic.errors.AnthropicInvalidDataException
-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 java.util.Collections
-import java.util.Objects
-
-class BetaWebhookMemoryStoreCreatedEventData
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(
- private val id: JsonField,
- private val organizationId: JsonField,
- private val type: JsonValue,
- private val workspaceId: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("organization_id")
- @ExcludeMissing
- organizationId: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(),
- @JsonProperty("workspace_id")
- @ExcludeMissing
- workspaceId: JsonField = JsonMissing.of(),
- ) : this(id, organizationId, type, workspaceId, mutableMapOf())
-
- /**
- * ID of the memory store that triggered the event.
- *
- * @throws AnthropicInvalidDataException 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 id(): String = id.getRequired("id")
-
- /**
- * @throws AnthropicInvalidDataException 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 organizationId(): String = organizationId.getRequired("organization_id")
-
- /**
- * Expected to always return the following:
- * ```java
- * JsonValue.from("memory_store.created")
- * ```
- *
- * However, this method can be useful for debugging and logging (e.g. if the server responded
- * with an unexpected value).
- */
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type
-
- /**
- * @throws AnthropicInvalidDataException 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 workspaceId(): String = workspaceId.getRequired("workspace_id")
-
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
-
- /**
- * Returns the raw JSON value of [organizationId].
- *
- * Unlike [organizationId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("organization_id")
- @ExcludeMissing
- fun _organizationId(): JsonField = organizationId
-
- /**
- * Returns the raw JSON value of [workspaceId].
- *
- * Unlike [workspaceId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("workspace_id")
- @ExcludeMissing
- fun _workspaceId(): JsonField = workspaceId
-
- @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
- * [BetaWebhookMemoryStoreCreatedEventData].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .workspaceId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BetaWebhookMemoryStoreCreatedEventData]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var organizationId: JsonField? = null
- private var type: JsonValue = JsonValue.from("memory_store.created")
- private var workspaceId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(
- betaWebhookMemoryStoreCreatedEventData: BetaWebhookMemoryStoreCreatedEventData
- ) = apply {
- id = betaWebhookMemoryStoreCreatedEventData.id
- organizationId = betaWebhookMemoryStoreCreatedEventData.organizationId
- type = betaWebhookMemoryStoreCreatedEventData.type
- workspaceId = betaWebhookMemoryStoreCreatedEventData.workspaceId
- additionalProperties =
- betaWebhookMemoryStoreCreatedEventData.additionalProperties.toMutableMap()
- }
-
- /** ID of the memory store that triggered the event. */
- fun id(id: String) = id(JsonField.of(id))
-
- /**
- * Sets [Builder.id] to an arbitrary JSON value.
- *
- * You should usually call [Builder.id] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun id(id: JsonField) = apply { this.id = id }
-
- fun organizationId(organizationId: String) = organizationId(JsonField.of(organizationId))
-
- /**
- * Sets [Builder.organizationId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.organizationId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun organizationId(organizationId: JsonField) = apply {
- this.organizationId = organizationId
- }
-
- /**
- * Sets the field to an arbitrary JSON value.
- *
- * It is usually unnecessary to call this method because the field defaults to the
- * following:
- * ```java
- * JsonValue.from("memory_store.created")
- * ```
- *
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun type(type: JsonValue) = apply { this.type = type }
-
- fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId))
-
- /**
- * Sets [Builder.workspaceId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.workspaceId] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun workspaceId(workspaceId: JsonField) = apply { this.workspaceId = workspaceId }
-
- 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 [BetaWebhookMemoryStoreCreatedEventData].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .workspaceId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): BetaWebhookMemoryStoreCreatedEventData =
- BetaWebhookMemoryStoreCreatedEventData(
- checkRequired("id", id),
- checkRequired("organizationId", organizationId),
- type,
- checkRequired("workspaceId", workspaceId),
- 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 AnthropicInvalidDataException if any value type in this object doesn't match its
- * expected type.
- */
- fun validate(): BetaWebhookMemoryStoreCreatedEventData = apply {
- if (validated) {
- return@apply
- }
-
- id()
- organizationId()
- _type().let {
- if (it != JsonValue.from("memory_store.created")) {
- throw AnthropicInvalidDataException("'type' is invalid, received $it")
- }
- }
- workspaceId()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: AnthropicInvalidDataException) {
- 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 (id.asKnown().isPresent) 1 else 0) +
- (if (organizationId.asKnown().isPresent) 1 else 0) +
- type.let { if (it == JsonValue.from("memory_store.created")) 1 else 0 } +
- (if (workspaceId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is BetaWebhookMemoryStoreCreatedEventData &&
- id == other.id &&
- organizationId == other.organizationId &&
- type == other.type &&
- workspaceId == other.workspaceId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(id, organizationId, type, workspaceId, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "BetaWebhookMemoryStoreCreatedEventData{id=$id, organizationId=$organizationId, type=$type, workspaceId=$workspaceId, additionalProperties=$additionalProperties}"
-}
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreDeletedEventData.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreDeletedEventData.kt
deleted file mode 100644
index cdabfd2ce..000000000
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreDeletedEventData.kt
+++ /dev/null
@@ -1,304 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.anthropic.models.beta.webhooks
-
-import com.anthropic.core.ExcludeMissing
-import com.anthropic.core.JsonField
-import com.anthropic.core.JsonMissing
-import com.anthropic.core.JsonValue
-import com.anthropic.core.checkRequired
-import com.anthropic.errors.AnthropicInvalidDataException
-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 java.util.Collections
-import java.util.Objects
-
-class BetaWebhookMemoryStoreDeletedEventData
-@JsonCreator(mode = JsonCreator.Mode.DISABLED)
-private constructor(
- private val id: JsonField,
- private val organizationId: JsonField,
- private val type: JsonValue,
- private val workspaceId: JsonField,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("organization_id")
- @ExcludeMissing
- organizationId: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonValue = JsonMissing.of(),
- @JsonProperty("workspace_id")
- @ExcludeMissing
- workspaceId: JsonField = JsonMissing.of(),
- ) : this(id, organizationId, type, workspaceId, mutableMapOf())
-
- /**
- * ID of the memory store that triggered the event.
- *
- * @throws AnthropicInvalidDataException 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 id(): String = id.getRequired("id")
-
- /**
- * @throws AnthropicInvalidDataException 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 organizationId(): String = organizationId.getRequired("organization_id")
-
- /**
- * Expected to always return the following:
- * ```java
- * JsonValue.from("memory_store.deleted")
- * ```
- *
- * However, this method can be useful for debugging and logging (e.g. if the server responded
- * with an unexpected value).
- */
- @JsonProperty("type") @ExcludeMissing fun _type(): JsonValue = type
-
- /**
- * @throws AnthropicInvalidDataException 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 workspaceId(): String = workspaceId.getRequired("workspace_id")
-
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
-
- /**
- * Returns the raw JSON value of [organizationId].
- *
- * Unlike [organizationId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("organization_id")
- @ExcludeMissing
- fun _organizationId(): JsonField = organizationId
-
- /**
- * Returns the raw JSON value of [workspaceId].
- *
- * Unlike [workspaceId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("workspace_id")
- @ExcludeMissing
- fun _workspaceId(): JsonField = workspaceId
-
- @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
- * [BetaWebhookMemoryStoreDeletedEventData].
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .workspaceId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BetaWebhookMemoryStoreDeletedEventData]. */
- class Builder internal constructor() {
-
- private var id: JsonField? = null
- private var organizationId: JsonField? = null
- private var type: JsonValue = JsonValue.from("memory_store.deleted")
- private var workspaceId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(
- betaWebhookMemoryStoreDeletedEventData: BetaWebhookMemoryStoreDeletedEventData
- ) = apply {
- id = betaWebhookMemoryStoreDeletedEventData.id
- organizationId = betaWebhookMemoryStoreDeletedEventData.organizationId
- type = betaWebhookMemoryStoreDeletedEventData.type
- workspaceId = betaWebhookMemoryStoreDeletedEventData.workspaceId
- additionalProperties =
- betaWebhookMemoryStoreDeletedEventData.additionalProperties.toMutableMap()
- }
-
- /** ID of the memory store that triggered the event. */
- fun id(id: String) = id(JsonField.of(id))
-
- /**
- * Sets [Builder.id] to an arbitrary JSON value.
- *
- * You should usually call [Builder.id] with a well-typed [String] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun id(id: JsonField) = apply { this.id = id }
-
- fun organizationId(organizationId: String) = organizationId(JsonField.of(organizationId))
-
- /**
- * Sets [Builder.organizationId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.organizationId] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun organizationId(organizationId: JsonField) = apply {
- this.organizationId = organizationId
- }
-
- /**
- * Sets the field to an arbitrary JSON value.
- *
- * It is usually unnecessary to call this method because the field defaults to the
- * following:
- * ```java
- * JsonValue.from("memory_store.deleted")
- * ```
- *
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun type(type: JsonValue) = apply { this.type = type }
-
- fun workspaceId(workspaceId: String) = workspaceId(JsonField.of(workspaceId))
-
- /**
- * Sets [Builder.workspaceId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.workspaceId] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun workspaceId(workspaceId: JsonField) = apply { this.workspaceId = workspaceId }
-
- 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 [BetaWebhookMemoryStoreDeletedEventData].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- *
- * The following fields are required:
- * ```java
- * .id()
- * .organizationId()
- * .workspaceId()
- * ```
- *
- * @throws IllegalStateException if any required field is unset.
- */
- fun build(): BetaWebhookMemoryStoreDeletedEventData =
- BetaWebhookMemoryStoreDeletedEventData(
- checkRequired("id", id),
- checkRequired("organizationId", organizationId),
- type,
- checkRequired("workspaceId", workspaceId),
- 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 AnthropicInvalidDataException if any value type in this object doesn't match its
- * expected type.
- */
- fun validate(): BetaWebhookMemoryStoreDeletedEventData = apply {
- if (validated) {
- return@apply
- }
-
- id()
- organizationId()
- _type().let {
- if (it != JsonValue.from("memory_store.deleted")) {
- throw AnthropicInvalidDataException("'type' is invalid, received $it")
- }
- }
- workspaceId()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: AnthropicInvalidDataException) {
- 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 (id.asKnown().isPresent) 1 else 0) +
- (if (organizationId.asKnown().isPresent) 1 else 0) +
- type.let { if (it == JsonValue.from("memory_store.deleted")) 1 else 0 } +
- (if (workspaceId.asKnown().isPresent) 1 else 0)
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return other is BetaWebhookMemoryStoreDeletedEventData &&
- id == other.id &&
- organizationId == other.organizationId &&
- type == other.type &&
- workspaceId == other.workspaceId &&
- additionalProperties == other.additionalProperties
- }
-
- private val hashCode: Int by lazy {
- Objects.hash(id, organizationId, type, workspaceId, additionalProperties)
- }
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "BetaWebhookMemoryStoreDeletedEventData{id=$id, organizationId=$organizationId, type=$type, workspaceId=$workspaceId, additionalProperties=$additionalProperties}"
-}
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/UnwrapWebhookEvent.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/UnwrapWebhookEvent.kt
index 6656b234f..fa0f7235e 100644
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/UnwrapWebhookEvent.kt
+++ b/anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/UnwrapWebhookEvent.kt
@@ -400,55 +400,6 @@ private constructor(
fun data(deploymentRunSucceeded: BetaWebhookDeploymentRunSucceededEventData) =
data(BetaWebhookEventData.ofDeploymentRunSucceeded(deploymentRunSucceeded))
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofEnvironmentCreated(environmentCreated)`.
- */
- fun data(environmentCreated: BetaWebhookEnvironmentCreatedEventData) =
- data(BetaWebhookEventData.ofEnvironmentCreated(environmentCreated))
-
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofEnvironmentUpdated(environmentUpdated)`.
- */
- fun data(environmentUpdated: BetaWebhookEnvironmentUpdatedEventData) =
- data(BetaWebhookEventData.ofEnvironmentUpdated(environmentUpdated))
-
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofEnvironmentArchived(environmentArchived)`.
- */
- fun data(environmentArchived: BetaWebhookEnvironmentArchivedEventData) =
- data(BetaWebhookEventData.ofEnvironmentArchived(environmentArchived))
-
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofEnvironmentDeleted(environmentDeleted)`.
- */
- fun data(environmentDeleted: BetaWebhookEnvironmentDeletedEventData) =
- data(BetaWebhookEventData.ofEnvironmentDeleted(environmentDeleted))
-
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofMemoryStoreCreated(memoryStoreCreated)`.
- */
- fun data(memoryStoreCreated: BetaWebhookMemoryStoreCreatedEventData) =
- data(BetaWebhookEventData.ofMemoryStoreCreated(memoryStoreCreated))
-
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofMemoryStoreArchived(memoryStoreArchived)`.
- */
- fun data(memoryStoreArchived: BetaWebhookMemoryStoreArchivedEventData) =
- data(BetaWebhookEventData.ofMemoryStoreArchived(memoryStoreArchived))
-
- /**
- * Alias for calling [data] with
- * `BetaWebhookEventData.ofMemoryStoreDeleted(memoryStoreDeleted)`.
- */
- fun data(memoryStoreDeleted: BetaWebhookMemoryStoreDeletedEventData) =
- data(BetaWebhookEventData.ofMemoryStoreDeleted(memoryStoreDeleted))
-
/**
* Sets the field to an arbitrary JSON value.
*
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/models/messages/RefusalStopDetails.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/models/messages/RefusalStopDetails.kt
index bb29bc6e0..f6ed962a0 100644
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/models/messages/RefusalStopDetails.kt
+++ b/anthropic-java-core/src/main/kotlin/com/anthropic/models/messages/RefusalStopDetails.kt
@@ -280,8 +280,6 @@ private constructor(
@JvmField val REASONING_EXTRACTION = of("reasoning_extraction")
- @JvmField val MILITARY_WEAPONS = of("military_weapons")
-
@JvmStatic fun of(value: String) = Category(JsonField.of(value))
}
@@ -291,7 +289,6 @@ private constructor(
BIO,
FRONTIER_LLM,
REASONING_EXTRACTION,
- MILITARY_WEAPONS,
}
/**
@@ -308,7 +305,6 @@ private constructor(
BIO,
FRONTIER_LLM,
REASONING_EXTRACTION,
- MILITARY_WEAPONS,
/** An enum member indicating that [Category] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -326,7 +322,6 @@ private constructor(
BIO -> Value.BIO
FRONTIER_LLM -> Value.FRONTIER_LLM
REASONING_EXTRACTION -> Value.REASONING_EXTRACTION
- MILITARY_WEAPONS -> Value.MILITARY_WEAPONS
else -> Value._UNKNOWN
}
@@ -345,7 +340,6 @@ private constructor(
BIO -> Known.BIO
FRONTIER_LLM -> Known.FRONTIER_LLM
REASONING_EXTRACTION -> Known.REASONING_EXTRACTION
- MILITARY_WEAPONS -> Known.MILITARY_WEAPONS
else -> throw AnthropicInvalidDataException("Unknown Category: $value")
}
diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/services/async/beta/SkillServiceAsync.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/services/async/beta/SkillServiceAsync.kt
index d4df7b9f1..0a672daea 100644
--- a/anthropic-java-core/src/main/kotlin/com/anthropic/services/async/beta/SkillServiceAsync.kt
+++ b/anthropic-java-core/src/main/kotlin/com/anthropic/services/async/beta/SkillServiceAsync.kt
@@ -34,23 +34,15 @@ interface SkillServiceAsync {
fun versions(): VersionServiceAsync
/** Create Skill */
- fun create(): CompletableFuture = create(SkillCreateParams.none())
+ fun create(params: SkillCreateParams): CompletableFuture =
+ create(params, RequestOptions.none())
/** @see create */
fun create(
- params: SkillCreateParams = SkillCreateParams.none(),
+ params: SkillCreateParams,
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture
- /** @see create */
- fun create(
- params: SkillCreateParams = SkillCreateParams.none()
- ): CompletableFuture = create(params, RequestOptions.none())
-
- /** @see create */
- fun create(requestOptions: RequestOptions): CompletableFuture =
- create(SkillCreateParams.none(), requestOptions)
-
/** Get Skill */
fun retrieve(skillId: String): CompletableFuture =
retrieve(skillId, SkillRetrieveParams.none())
@@ -157,26 +149,16 @@ interface SkillServiceAsync {
* Returns a raw HTTP response for `post /v1/skills?beta=true`, but is otherwise the same as
* [SkillServiceAsync.create].
*/
- fun create(): CompletableFuture