From 2f92a48d5e6b7dde8efebc493c96def5ddcbe523 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 21:42:10 +0000 Subject: [PATCH 1/2] chore(api): remove some nonfunctional types from the SDKs --- .stats.yml | 6 +- .../environments/work/BetaSelfHostedWork.kt | 47 +- .../memorystores/memories/MemoryListParams.kt | 57 +- .../messages/BetaFallbackRefusalTrigger.kt | 6 - .../beta/messages/BetaRefusalStopDetails.kt | 6 - .../models/beta/skills/SkillCreateParams.kt | 151 ++-- .../skills/versions/VersionCreateParams.kt | 63 +- ...BetaWebhookEnvironmentArchivedEventData.kt | 304 ------- .../BetaWebhookEnvironmentCreatedEventData.kt | 304 ------- .../BetaWebhookEnvironmentDeletedEventData.kt | 308 ------- .../BetaWebhookEnvironmentDeletedEventType.kt | 143 ---- .../BetaWebhookEnvironmentUpdatedEventData.kt | 304 ------- .../models/beta/webhooks/BetaWebhookEvent.kt | 49 -- .../beta/webhooks/BetaWebhookEventData.kt | 281 +------ ...BetaWebhookMemoryStoreArchivedEventData.kt | 304 ------- .../BetaWebhookMemoryStoreCreatedEventData.kt | 304 ------- .../BetaWebhookMemoryStoreDeletedEventData.kt | 304 ------- .../beta/webhooks/UnwrapWebhookEvent.kt | 49 -- .../models/messages/RefusalStopDetails.kt | 6 - .../services/async/beta/SkillServiceAsync.kt | 32 +- .../async/beta/skills/VersionServiceAsync.kt | 50 +- .../services/blocking/beta/SkillService.kt | 29 +- .../blocking/beta/skills/VersionService.kt | 46 +- .../BetaSelfHostedWorkListResponseTest.kt | 3 - .../work/BetaSelfHostedWorkTest.kt | 3 - .../beta/skills/SkillCreateParamsTest.kt | 50 +- .../versions/VersionCreateParamsTest.kt | 50 +- ...WebhookEnvironmentArchivedEventDataTest.kt | 46 - ...aWebhookEnvironmentCreatedEventDataTest.kt | 46 - ...aWebhookEnvironmentDeletedEventDataTest.kt | 50 -- ...aWebhookEnvironmentUpdatedEventDataTest.kt | 46 - .../beta/webhooks/BetaWebhookEventDataTest.kt | 793 ------------------ ...WebhookMemoryStoreArchivedEventDataTest.kt | 46 - ...aWebhookMemoryStoreCreatedEventDataTest.kt | 46 - ...aWebhookMemoryStoreDeletedEventDataTest.kt | 46 - .../async/beta/SkillServiceAsyncTest.kt | 2 +- .../blocking/beta/SkillServiceTest.kt | 2 +- 37 files changed, 285 insertions(+), 4097 deletions(-) delete mode 100644 anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentArchivedEventData.kt delete mode 100644 anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentCreatedEventData.kt delete mode 100644 anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentDeletedEventData.kt delete mode 100644 anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentDeletedEventType.kt delete mode 100644 anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentUpdatedEventData.kt delete mode 100644 anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreArchivedEventData.kt delete mode 100644 anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreCreatedEventData.kt delete mode 100644 anthropic-java-core/src/main/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreDeletedEventData.kt delete mode 100644 anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentArchivedEventDataTest.kt delete mode 100644 anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentCreatedEventDataTest.kt delete mode 100644 anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentDeletedEventDataTest.kt delete mode 100644 anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentUpdatedEventDataTest.kt delete mode 100644 anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreArchivedEventDataTest.kt delete mode 100644 anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreCreatedEventDataTest.kt delete mode 100644 anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreDeletedEventDataTest.kt 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/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> = - create(SkillCreateParams.none()) - - /** @see create */ - fun create( - params: SkillCreateParams = SkillCreateParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see create */ fun create( - params: SkillCreateParams = SkillCreateParams.none() + params: SkillCreateParams ): CompletableFuture> = create(params, RequestOptions.none()) /** @see create */ fun create( - requestOptions: RequestOptions - ): CompletableFuture> = - create(SkillCreateParams.none(), requestOptions) + params: SkillCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> /** * Returns a raw HTTP response for `get /v1/skills/{skill_id}?beta=true`, but is otherwise diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/services/async/beta/skills/VersionServiceAsync.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/services/async/beta/skills/VersionServiceAsync.kt index 251e80d20..00e7f30df 100644 --- a/anthropic-java-core/src/main/kotlin/com/anthropic/services/async/beta/skills/VersionServiceAsync.kt +++ b/anthropic-java-core/src/main/kotlin/com/anthropic/services/async/beta/skills/VersionServiceAsync.kt @@ -33,28 +33,18 @@ interface VersionServiceAsync { fun withOptions(modifier: Consumer): VersionServiceAsync /** Create Skill Version */ - fun create(skillId: String): CompletableFuture = - create(skillId, VersionCreateParams.none()) - - /** @see create */ - fun create( - skillId: String, - params: VersionCreateParams = VersionCreateParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture = - create(params.toBuilder().skillId(skillId).build(), requestOptions) - - /** @see create */ fun create( skillId: String, - params: VersionCreateParams = VersionCreateParams.none(), + params: VersionCreateParams, ): CompletableFuture = create(skillId, params, RequestOptions.none()) /** @see create */ fun create( + skillId: String, params: VersionCreateParams, requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture = + create(params.toBuilder().skillId(skillId).build(), requestOptions) /** @see create */ fun create(params: VersionCreateParams): CompletableFuture = @@ -62,10 +52,9 @@ interface VersionServiceAsync { /** @see create */ fun create( - skillId: String, - requestOptions: RequestOptions, - ): CompletableFuture = - create(skillId, VersionCreateParams.none(), requestOptions) + params: VersionCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture /** Get Skill Version */ fun retrieve( @@ -190,29 +179,19 @@ interface VersionServiceAsync { * Returns a raw HTTP response for `post /v1/skills/{skill_id}/versions?beta=true`, but is * otherwise the same as [VersionServiceAsync.create]. */ - fun create(skillId: String): CompletableFuture> = - create(skillId, VersionCreateParams.none()) - - /** @see create */ - fun create( - skillId: String, - params: VersionCreateParams = VersionCreateParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> = - create(params.toBuilder().skillId(skillId).build(), requestOptions) - - /** @see create */ fun create( skillId: String, - params: VersionCreateParams = VersionCreateParams.none(), + params: VersionCreateParams, ): CompletableFuture> = create(skillId, params, RequestOptions.none()) /** @see create */ fun create( + skillId: String, params: VersionCreateParams, requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> = + create(params.toBuilder().skillId(skillId).build(), requestOptions) /** @see create */ fun create( @@ -222,10 +201,9 @@ interface VersionServiceAsync { /** @see create */ fun create( - skillId: String, - requestOptions: RequestOptions, - ): CompletableFuture> = - create(skillId, VersionCreateParams.none(), requestOptions) + params: VersionCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> /** * Returns a raw HTTP response for `get /v1/skills/{skill_id}/versions/{version}?beta=true`, diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/services/blocking/beta/SkillService.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/services/blocking/beta/SkillService.kt index afb95f1d8..fb0286257 100644 --- a/anthropic-java-core/src/main/kotlin/com/anthropic/services/blocking/beta/SkillService.kt +++ b/anthropic-java-core/src/main/kotlin/com/anthropic/services/blocking/beta/SkillService.kt @@ -34,22 +34,15 @@ interface SkillService { fun versions(): VersionService /** Create Skill */ - fun create(): SkillCreateResponse = create(SkillCreateParams.none()) + fun create(params: SkillCreateParams): SkillCreateResponse = + create(params, RequestOptions.none()) /** @see create */ fun create( - params: SkillCreateParams = SkillCreateParams.none(), + params: SkillCreateParams, requestOptions: RequestOptions = RequestOptions.none(), ): SkillCreateResponse - /** @see create */ - fun create(params: SkillCreateParams = SkillCreateParams.none()): SkillCreateResponse = - create(params, RequestOptions.none()) - - /** @see create */ - fun create(requestOptions: RequestOptions): SkillCreateResponse = - create(SkillCreateParams.none(), requestOptions) - /** Get Skill */ fun retrieve(skillId: String): SkillRetrieveResponse = retrieve(skillId, SkillRetrieveParams.none()) @@ -145,26 +138,16 @@ interface SkillService { * [SkillService.create]. */ @MustBeClosed - fun create(): HttpResponseFor = create(SkillCreateParams.none()) + fun create(params: SkillCreateParams): HttpResponseFor = + create(params, RequestOptions.none()) /** @see create */ @MustBeClosed fun create( - params: SkillCreateParams = SkillCreateParams.none(), + params: SkillCreateParams, requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor - /** @see create */ - @MustBeClosed - fun create( - params: SkillCreateParams = SkillCreateParams.none() - ): HttpResponseFor = create(params, RequestOptions.none()) - - /** @see create */ - @MustBeClosed - fun create(requestOptions: RequestOptions): HttpResponseFor = - create(SkillCreateParams.none(), requestOptions) - /** * Returns a raw HTTP response for `get /v1/skills/{skill_id}?beta=true`, but is otherwise * the same as [SkillService.retrieve]. diff --git a/anthropic-java-core/src/main/kotlin/com/anthropic/services/blocking/beta/skills/VersionService.kt b/anthropic-java-core/src/main/kotlin/com/anthropic/services/blocking/beta/skills/VersionService.kt index bac7a502c..8f4a9cf3f 100644 --- a/anthropic-java-core/src/main/kotlin/com/anthropic/services/blocking/beta/skills/VersionService.kt +++ b/anthropic-java-core/src/main/kotlin/com/anthropic/services/blocking/beta/skills/VersionService.kt @@ -33,20 +33,19 @@ interface VersionService { fun withOptions(modifier: Consumer): VersionService /** Create Skill Version */ - fun create(skillId: String): VersionCreateResponse = create(skillId, VersionCreateParams.none()) + fun create(skillId: String, params: VersionCreateParams): VersionCreateResponse = + create(skillId, params, RequestOptions.none()) /** @see create */ fun create( skillId: String, - params: VersionCreateParams = VersionCreateParams.none(), + params: VersionCreateParams, requestOptions: RequestOptions = RequestOptions.none(), ): VersionCreateResponse = create(params.toBuilder().skillId(skillId).build(), requestOptions) /** @see create */ - fun create( - skillId: String, - params: VersionCreateParams = VersionCreateParams.none(), - ): VersionCreateResponse = create(skillId, params, RequestOptions.none()) + fun create(params: VersionCreateParams): VersionCreateResponse = + create(params, RequestOptions.none()) /** @see create */ fun create( @@ -54,14 +53,6 @@ interface VersionService { requestOptions: RequestOptions = RequestOptions.none(), ): VersionCreateResponse - /** @see create */ - fun create(params: VersionCreateParams): VersionCreateResponse = - create(params, RequestOptions.none()) - - /** @see create */ - fun create(skillId: String, requestOptions: RequestOptions): VersionCreateResponse = - create(skillId, VersionCreateParams.none(), requestOptions) - /** Get Skill Version */ fun retrieve(version: String, params: VersionRetrieveParams): VersionRetrieveResponse = retrieve(version, params, RequestOptions.none()) @@ -174,31 +165,19 @@ interface VersionService { * otherwise the same as [VersionService.create]. */ @MustBeClosed - fun create(skillId: String): HttpResponseFor = - create(skillId, VersionCreateParams.none()) - - /** @see create */ - @MustBeClosed fun create( skillId: String, - params: VersionCreateParams = VersionCreateParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - create(params.toBuilder().skillId(skillId).build(), requestOptions) - - /** @see create */ - @MustBeClosed - fun create( - skillId: String, - params: VersionCreateParams = VersionCreateParams.none(), + params: VersionCreateParams, ): HttpResponseFor = create(skillId, params, RequestOptions.none()) /** @see create */ @MustBeClosed fun create( + skillId: String, params: VersionCreateParams, requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor = + create(params.toBuilder().skillId(skillId).build(), requestOptions) /** @see create */ @MustBeClosed @@ -208,10 +187,9 @@ interface VersionService { /** @see create */ @MustBeClosed fun create( - skillId: String, - requestOptions: RequestOptions, - ): HttpResponseFor = - create(skillId, VersionCreateParams.none(), requestOptions) + params: VersionCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor /** * Returns a raw HTTP response for `get /v1/skills/{skill_id}/versions/{version}?beta=true`, diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/environments/work/BetaSelfHostedWorkListResponseTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/environments/work/BetaSelfHostedWorkListResponseTest.kt index 3fe087665..39aacb42a 100644 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/environments/work/BetaSelfHostedWorkListResponseTest.kt +++ b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/environments/work/BetaSelfHostedWorkListResponseTest.kt @@ -27,7 +27,6 @@ internal class BetaSelfHostedWorkListResponseTest { .putAdditionalProperty("foo", JsonValue.from("string")) .build() ) - .secret("secret") .startedAt("started_at") .state(BetaSelfHostedWork.State.QUEUED) .stopRequestedAt("stop_requested_at") @@ -51,7 +50,6 @@ internal class BetaSelfHostedWorkListResponseTest { .putAdditionalProperty("foo", JsonValue.from("string")) .build() ) - .secret("secret") .startedAt("started_at") .state(BetaSelfHostedWork.State.QUEUED) .stopRequestedAt("stop_requested_at") @@ -79,7 +77,6 @@ internal class BetaSelfHostedWorkListResponseTest { .putAdditionalProperty("foo", JsonValue.from("string")) .build() ) - .secret("secret") .startedAt("started_at") .state(BetaSelfHostedWork.State.QUEUED) .stopRequestedAt("stop_requested_at") diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/environments/work/BetaSelfHostedWorkTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/environments/work/BetaSelfHostedWorkTest.kt index a5789f596..c15cb5908 100644 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/environments/work/BetaSelfHostedWorkTest.kt +++ b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/environments/work/BetaSelfHostedWorkTest.kt @@ -25,7 +25,6 @@ internal class BetaSelfHostedWorkTest { .putAdditionalProperty("foo", JsonValue.from("string")) .build() ) - .secret("secret") .startedAt("started_at") .state(BetaSelfHostedWork.State.QUEUED) .stopRequestedAt("stop_requested_at") @@ -45,7 +44,6 @@ internal class BetaSelfHostedWorkTest { .putAdditionalProperty("foo", JsonValue.from("string")) .build() ) - assertThat(betaSelfHostedWork.secret()).contains("secret") assertThat(betaSelfHostedWork.startedAt()).contains("started_at") assertThat(betaSelfHostedWork.state()).isEqualTo(BetaSelfHostedWork.State.QUEUED) assertThat(betaSelfHostedWork.stopRequestedAt()).contains("stop_requested_at") @@ -68,7 +66,6 @@ internal class BetaSelfHostedWorkTest { .putAdditionalProperty("foo", JsonValue.from("string")) .build() ) - .secret("secret") .startedAt("started_at") .state(BetaSelfHostedWork.State.QUEUED) .stopRequestedAt("stop_requested_at") diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/skills/SkillCreateParamsTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/skills/SkillCreateParamsTest.kt index f800fb450..02d7c754a 100644 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/skills/SkillCreateParamsTest.kt +++ b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/skills/SkillCreateParamsTest.kt @@ -15,8 +15,8 @@ internal class SkillCreateParamsTest { fun create() { SkillCreateParams.builder() .addBeta(AnthropicBeta.MESSAGE_BATCHES_2024_09_24) - .displayTitle("display_title") .addFile(MultipartField.of("Example data".byteInputStream())) + .displayTitle("display_title") .build() } @@ -25,8 +25,8 @@ internal class SkillCreateParamsTest { val params = SkillCreateParams.builder() .addBeta(AnthropicBeta.MESSAGE_BATCHES_2024_09_24) - .displayTitle("display_title") .addFile(MultipartField.of("Example data".byteInputStream())) + .displayTitle("display_title") .build() val headers = params._headers() @@ -39,7 +39,10 @@ internal class SkillCreateParamsTest { @Test fun headersWithoutOptionalFields() { - val params = SkillCreateParams.builder().build() + val params = + SkillCreateParams.builder() + .addFile(MultipartField.of("Example data".byteInputStream())) + .build() val headers = params._headers() @@ -51,42 +54,51 @@ internal class SkillCreateParamsTest { val params = SkillCreateParams.builder() .addBeta(AnthropicBeta.MESSAGE_BATCHES_2024_09_24) - .displayTitle("display_title") .addFile(MultipartField.of("Example data".byteInputStream())) + .displayTitle("display_title") .build() val body = params._body() assertThat(body.filterValues { !it.value.isNull() }) .usingRecursiveComparison() - // TODO(AssertJ): Replace this and the `mapValues` below with: - // https://github.com/assertj/assertj/issues/3165 .withEqualsForType( { a, b -> a.readBytes() contentEquals b.readBytes() }, InputStream::class.java, ) .isEqualTo( mapOf( - "display_title" to MultipartField.of("display_title"), - "files" to - MultipartField.of( - listOf( - MultipartField.of("Example data".byteInputStream()) - ) - ), - ) - .mapValues { (_, field) -> - field.map { (it as? ByteArray)?.inputStream() ?: it } - } + "display_title" to MultipartField.of("display_title"), + "files" to + MultipartField.of( + listOf(MultipartField.of("Example data".byteInputStream())) + ), + ) ) } @Test fun bodyWithoutOptionalFields() { - val params = SkillCreateParams.builder().build() + val params = + SkillCreateParams.builder() + .addFile(MultipartField.of("Example data".byteInputStream())) + .build() val body = params._body() - assertThat(body.filterValues { !it.value.isNull() }).isEmpty() + assertThat(body.filterValues { !it.value.isNull() }) + .usingRecursiveComparison() + .withEqualsForType( + { a, b -> a.readBytes() contentEquals b.readBytes() }, + InputStream::class.java, + ) + .isEqualTo( + mapOf( + "files" to + MultipartField.of( + listOf(MultipartField.of("Example data".byteInputStream())) + ) + ) + ) } } diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/skills/versions/VersionCreateParamsTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/skills/versions/VersionCreateParamsTest.kt index 52c1baf89..f30675430 100644 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/skills/versions/VersionCreateParamsTest.kt +++ b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/skills/versions/VersionCreateParamsTest.kt @@ -22,7 +22,11 @@ internal class VersionCreateParamsTest { @Test fun pathParams() { - val params = VersionCreateParams.builder().skillId("skill_id").build() + val params = + VersionCreateParams.builder() + .skillId("skill_id") + .addFile(MultipartField.of("Example data".byteInputStream())) + .build() assertThat(params._pathParam(0)).isEqualTo("skill_id") // out-of-bound path param @@ -48,7 +52,11 @@ internal class VersionCreateParamsTest { @Test fun headersWithoutOptionalFields() { - val params = VersionCreateParams.builder().skillId("skill_id").build() + val params = + VersionCreateParams.builder() + .skillId("skill_id") + .addFile(MultipartField.of("Example data".byteInputStream())) + .build() val headers = params._headers() @@ -68,33 +76,43 @@ internal class VersionCreateParamsTest { assertThat(body.filterValues { !it.value.isNull() }) .usingRecursiveComparison() - // TODO(AssertJ): Replace this and the `mapValues` below with: - // https://github.com/assertj/assertj/issues/3165 .withEqualsForType( { a, b -> a.readBytes() contentEquals b.readBytes() }, InputStream::class.java, ) .isEqualTo( mapOf( - "files" to - MultipartField.of( - listOf( - MultipartField.of("Example data".byteInputStream()) - ) - ) - ) - .mapValues { (_, field) -> - field.map { (it as? ByteArray)?.inputStream() ?: it } - } + "files" to + MultipartField.of( + listOf(MultipartField.of("Example data".byteInputStream())) + ) + ) ) } @Test fun bodyWithoutOptionalFields() { - val params = VersionCreateParams.builder().skillId("skill_id").build() + val params = + VersionCreateParams.builder() + .skillId("skill_id") + .addFile(MultipartField.of("Example data".byteInputStream())) + .build() val body = params._body() - assertThat(body.filterValues { !it.value.isNull() }).isEmpty() + assertThat(body.filterValues { !it.value.isNull() }) + .usingRecursiveComparison() + .withEqualsForType( + { a, b -> a.readBytes() contentEquals b.readBytes() }, + InputStream::class.java, + ) + .isEqualTo( + mapOf( + "files" to + MultipartField.of( + listOf(MultipartField.of("Example data".byteInputStream())) + ) + ) + ) } } diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentArchivedEventDataTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentArchivedEventDataTest.kt deleted file mode 100644 index 0a25685d0..000000000 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentArchivedEventDataTest.kt +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.anthropic.models.beta.webhooks - -import com.anthropic.core.jsonMapper -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class BetaWebhookEnvironmentArchivedEventDataTest { - - @Test - fun create() { - val betaWebhookEnvironmentArchivedEventData = - BetaWebhookEnvironmentArchivedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - assertThat(betaWebhookEnvironmentArchivedEventData.id()).isEqualTo("id") - assertThat(betaWebhookEnvironmentArchivedEventData.organizationId()) - .isEqualTo("organization_id") - assertThat(betaWebhookEnvironmentArchivedEventData.workspaceId()).isEqualTo("workspace_id") - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookEnvironmentArchivedEventData = - BetaWebhookEnvironmentArchivedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - val roundtrippedBetaWebhookEnvironmentArchivedEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookEnvironmentArchivedEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookEnvironmentArchivedEventData) - .isEqualTo(betaWebhookEnvironmentArchivedEventData) - } -} diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentCreatedEventDataTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentCreatedEventDataTest.kt deleted file mode 100644 index 047de2d43..000000000 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentCreatedEventDataTest.kt +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.anthropic.models.beta.webhooks - -import com.anthropic.core.jsonMapper -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class BetaWebhookEnvironmentCreatedEventDataTest { - - @Test - fun create() { - val betaWebhookEnvironmentCreatedEventData = - BetaWebhookEnvironmentCreatedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - assertThat(betaWebhookEnvironmentCreatedEventData.id()).isEqualTo("id") - assertThat(betaWebhookEnvironmentCreatedEventData.organizationId()) - .isEqualTo("organization_id") - assertThat(betaWebhookEnvironmentCreatedEventData.workspaceId()).isEqualTo("workspace_id") - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookEnvironmentCreatedEventData = - BetaWebhookEnvironmentCreatedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - val roundtrippedBetaWebhookEnvironmentCreatedEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookEnvironmentCreatedEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookEnvironmentCreatedEventData) - .isEqualTo(betaWebhookEnvironmentCreatedEventData) - } -} diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentDeletedEventDataTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentDeletedEventDataTest.kt deleted file mode 100644 index 982963906..000000000 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentDeletedEventDataTest.kt +++ /dev/null @@ -1,50 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.anthropic.models.beta.webhooks - -import com.anthropic.core.jsonMapper -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class BetaWebhookEnvironmentDeletedEventDataTest { - - @Test - fun create() { - val betaWebhookEnvironmentDeletedEventData = - BetaWebhookEnvironmentDeletedEventData.builder() - .id("id") - .organizationId("organization_id") - .type(BetaWebhookEnvironmentDeletedEventType.ENVIRONMENT_DELETED) - .workspaceId("workspace_id") - .build() - - assertThat(betaWebhookEnvironmentDeletedEventData.id()).isEqualTo("id") - assertThat(betaWebhookEnvironmentDeletedEventData.organizationId()) - .isEqualTo("organization_id") - assertThat(betaWebhookEnvironmentDeletedEventData.type()) - .isEqualTo(BetaWebhookEnvironmentDeletedEventType.ENVIRONMENT_DELETED) - assertThat(betaWebhookEnvironmentDeletedEventData.workspaceId()).isEqualTo("workspace_id") - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookEnvironmentDeletedEventData = - BetaWebhookEnvironmentDeletedEventData.builder() - .id("id") - .organizationId("organization_id") - .type(BetaWebhookEnvironmentDeletedEventType.ENVIRONMENT_DELETED) - .workspaceId("workspace_id") - .build() - - val roundtrippedBetaWebhookEnvironmentDeletedEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookEnvironmentDeletedEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookEnvironmentDeletedEventData) - .isEqualTo(betaWebhookEnvironmentDeletedEventData) - } -} diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentUpdatedEventDataTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentUpdatedEventDataTest.kt deleted file mode 100644 index 7d86a08e6..000000000 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEnvironmentUpdatedEventDataTest.kt +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.anthropic.models.beta.webhooks - -import com.anthropic.core.jsonMapper -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class BetaWebhookEnvironmentUpdatedEventDataTest { - - @Test - fun create() { - val betaWebhookEnvironmentUpdatedEventData = - BetaWebhookEnvironmentUpdatedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - assertThat(betaWebhookEnvironmentUpdatedEventData.id()).isEqualTo("id") - assertThat(betaWebhookEnvironmentUpdatedEventData.organizationId()) - .isEqualTo("organization_id") - assertThat(betaWebhookEnvironmentUpdatedEventData.workspaceId()).isEqualTo("workspace_id") - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookEnvironmentUpdatedEventData = - BetaWebhookEnvironmentUpdatedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - val roundtrippedBetaWebhookEnvironmentUpdatedEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookEnvironmentUpdatedEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookEnvironmentUpdatedEventData) - .isEqualTo(betaWebhookEnvironmentUpdatedEventData) - } -} diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEventDataTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEventDataTest.kt index 812d60bac..99869c43b 100644 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEventDataTest.kt +++ b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookEventDataTest.kt @@ -61,13 +61,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -138,13 +131,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -215,13 +201,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -292,13 +271,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -370,13 +342,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -447,13 +412,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -524,13 +482,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -603,13 +554,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -681,13 +625,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -758,13 +695,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -836,13 +766,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -914,13 +837,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -993,13 +909,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -1073,13 +982,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -1153,13 +1055,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -1230,13 +1125,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -1307,13 +1195,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -1384,13 +1265,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -1463,13 +1337,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -1543,13 +1410,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -1623,13 +1483,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -1704,13 +1557,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -1782,13 +1628,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -1859,13 +1698,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -1936,13 +1768,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -2013,13 +1838,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -2090,13 +1908,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -2167,13 +1978,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -2244,13 +2048,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -2321,13 +2118,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -2398,13 +2188,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -2475,13 +2258,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -2552,13 +2328,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -2629,13 +2398,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).contains(deploymentRunStarted) assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -2706,13 +2468,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).contains(deploymentDeleted) assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -2784,13 +2539,6 @@ internal class BetaWebhookEventDataTest { assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty assertThat(betaWebhookEventData.deploymentRunSucceeded()).contains(deploymentRunSucceeded) - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty } @Test @@ -2814,547 +2562,6 @@ internal class BetaWebhookEventDataTest { assertThat(roundtrippedBetaWebhookEventData).isEqualTo(betaWebhookEventData) } - @Test - fun ofEnvironmentCreated() { - val environmentCreated = - BetaWebhookEnvironmentCreatedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - val betaWebhookEventData = BetaWebhookEventData.ofEnvironmentCreated(environmentCreated) - - assertThat(betaWebhookEventData.sessionCreated()).isEmpty - assertThat(betaWebhookEventData.sessionPending()).isEmpty - assertThat(betaWebhookEventData.sessionRunning()).isEmpty - assertThat(betaWebhookEventData.sessionIdled()).isEmpty - assertThat(betaWebhookEventData.sessionRequiresAction()).isEmpty - assertThat(betaWebhookEventData.sessionArchived()).isEmpty - assertThat(betaWebhookEventData.sessionDeleted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRescheduled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRunStarted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusIdled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadCreated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadIdled()).isEmpty - assertThat(betaWebhookEventData.sessionThreadTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionOutcomeEvaluationEnded()).isEmpty - assertThat(betaWebhookEventData.vaultCreated()).isEmpty - assertThat(betaWebhookEventData.vaultArchived()).isEmpty - assertThat(betaWebhookEventData.vaultDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialCreated()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialArchived()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialRefreshFailed()).isEmpty - assertThat(betaWebhookEventData.sessionUpdated()).isEmpty - assertThat(betaWebhookEventData.agentCreated()).isEmpty - assertThat(betaWebhookEventData.agentArchived()).isEmpty - assertThat(betaWebhookEventData.agentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentPaused()).isEmpty - assertThat(betaWebhookEventData.deploymentRunFailed()).isEmpty - assertThat(betaWebhookEventData.deploymentCreated()).isEmpty - assertThat(betaWebhookEventData.deploymentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentUnpaused()).isEmpty - assertThat(betaWebhookEventData.agentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentArchived()).isEmpty - assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty - assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).contains(environmentCreated) - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty - } - - @Test - fun ofEnvironmentCreatedRoundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookEventData = - BetaWebhookEventData.ofEnvironmentCreated( - BetaWebhookEnvironmentCreatedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - ) - - val roundtrippedBetaWebhookEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookEventData).isEqualTo(betaWebhookEventData) - } - - @Test - fun ofEnvironmentUpdated() { - val environmentUpdated = - BetaWebhookEnvironmentUpdatedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - val betaWebhookEventData = BetaWebhookEventData.ofEnvironmentUpdated(environmentUpdated) - - assertThat(betaWebhookEventData.sessionCreated()).isEmpty - assertThat(betaWebhookEventData.sessionPending()).isEmpty - assertThat(betaWebhookEventData.sessionRunning()).isEmpty - assertThat(betaWebhookEventData.sessionIdled()).isEmpty - assertThat(betaWebhookEventData.sessionRequiresAction()).isEmpty - assertThat(betaWebhookEventData.sessionArchived()).isEmpty - assertThat(betaWebhookEventData.sessionDeleted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRescheduled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRunStarted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusIdled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadCreated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadIdled()).isEmpty - assertThat(betaWebhookEventData.sessionThreadTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionOutcomeEvaluationEnded()).isEmpty - assertThat(betaWebhookEventData.vaultCreated()).isEmpty - assertThat(betaWebhookEventData.vaultArchived()).isEmpty - assertThat(betaWebhookEventData.vaultDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialCreated()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialArchived()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialRefreshFailed()).isEmpty - assertThat(betaWebhookEventData.sessionUpdated()).isEmpty - assertThat(betaWebhookEventData.agentCreated()).isEmpty - assertThat(betaWebhookEventData.agentArchived()).isEmpty - assertThat(betaWebhookEventData.agentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentPaused()).isEmpty - assertThat(betaWebhookEventData.deploymentRunFailed()).isEmpty - assertThat(betaWebhookEventData.deploymentCreated()).isEmpty - assertThat(betaWebhookEventData.deploymentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentUnpaused()).isEmpty - assertThat(betaWebhookEventData.agentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentArchived()).isEmpty - assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty - assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).contains(environmentUpdated) - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty - } - - @Test - fun ofEnvironmentUpdatedRoundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookEventData = - BetaWebhookEventData.ofEnvironmentUpdated( - BetaWebhookEnvironmentUpdatedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - ) - - val roundtrippedBetaWebhookEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookEventData).isEqualTo(betaWebhookEventData) - } - - @Test - fun ofEnvironmentArchived() { - val environmentArchived = - BetaWebhookEnvironmentArchivedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - val betaWebhookEventData = BetaWebhookEventData.ofEnvironmentArchived(environmentArchived) - - assertThat(betaWebhookEventData.sessionCreated()).isEmpty - assertThat(betaWebhookEventData.sessionPending()).isEmpty - assertThat(betaWebhookEventData.sessionRunning()).isEmpty - assertThat(betaWebhookEventData.sessionIdled()).isEmpty - assertThat(betaWebhookEventData.sessionRequiresAction()).isEmpty - assertThat(betaWebhookEventData.sessionArchived()).isEmpty - assertThat(betaWebhookEventData.sessionDeleted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRescheduled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRunStarted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusIdled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadCreated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadIdled()).isEmpty - assertThat(betaWebhookEventData.sessionThreadTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionOutcomeEvaluationEnded()).isEmpty - assertThat(betaWebhookEventData.vaultCreated()).isEmpty - assertThat(betaWebhookEventData.vaultArchived()).isEmpty - assertThat(betaWebhookEventData.vaultDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialCreated()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialArchived()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialRefreshFailed()).isEmpty - assertThat(betaWebhookEventData.sessionUpdated()).isEmpty - assertThat(betaWebhookEventData.agentCreated()).isEmpty - assertThat(betaWebhookEventData.agentArchived()).isEmpty - assertThat(betaWebhookEventData.agentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentPaused()).isEmpty - assertThat(betaWebhookEventData.deploymentRunFailed()).isEmpty - assertThat(betaWebhookEventData.deploymentCreated()).isEmpty - assertThat(betaWebhookEventData.deploymentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentUnpaused()).isEmpty - assertThat(betaWebhookEventData.agentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentArchived()).isEmpty - assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty - assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).contains(environmentArchived) - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty - } - - @Test - fun ofEnvironmentArchivedRoundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookEventData = - BetaWebhookEventData.ofEnvironmentArchived( - BetaWebhookEnvironmentArchivedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - ) - - val roundtrippedBetaWebhookEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookEventData).isEqualTo(betaWebhookEventData) - } - - @Test - fun ofEnvironmentDeleted() { - val environmentDeleted = - BetaWebhookEnvironmentDeletedEventData.builder() - .id("id") - .organizationId("organization_id") - .type(BetaWebhookEnvironmentDeletedEventType.ENVIRONMENT_DELETED) - .workspaceId("workspace_id") - .build() - - val betaWebhookEventData = BetaWebhookEventData.ofEnvironmentDeleted(environmentDeleted) - - assertThat(betaWebhookEventData.sessionCreated()).isEmpty - assertThat(betaWebhookEventData.sessionPending()).isEmpty - assertThat(betaWebhookEventData.sessionRunning()).isEmpty - assertThat(betaWebhookEventData.sessionIdled()).isEmpty - assertThat(betaWebhookEventData.sessionRequiresAction()).isEmpty - assertThat(betaWebhookEventData.sessionArchived()).isEmpty - assertThat(betaWebhookEventData.sessionDeleted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRescheduled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRunStarted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusIdled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadCreated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadIdled()).isEmpty - assertThat(betaWebhookEventData.sessionThreadTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionOutcomeEvaluationEnded()).isEmpty - assertThat(betaWebhookEventData.vaultCreated()).isEmpty - assertThat(betaWebhookEventData.vaultArchived()).isEmpty - assertThat(betaWebhookEventData.vaultDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialCreated()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialArchived()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialRefreshFailed()).isEmpty - assertThat(betaWebhookEventData.sessionUpdated()).isEmpty - assertThat(betaWebhookEventData.agentCreated()).isEmpty - assertThat(betaWebhookEventData.agentArchived()).isEmpty - assertThat(betaWebhookEventData.agentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentPaused()).isEmpty - assertThat(betaWebhookEventData.deploymentRunFailed()).isEmpty - assertThat(betaWebhookEventData.deploymentCreated()).isEmpty - assertThat(betaWebhookEventData.deploymentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentUnpaused()).isEmpty - assertThat(betaWebhookEventData.agentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentArchived()).isEmpty - assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty - assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).contains(environmentDeleted) - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty - } - - @Test - fun ofEnvironmentDeletedRoundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookEventData = - BetaWebhookEventData.ofEnvironmentDeleted( - BetaWebhookEnvironmentDeletedEventData.builder() - .id("id") - .organizationId("organization_id") - .type(BetaWebhookEnvironmentDeletedEventType.ENVIRONMENT_DELETED) - .workspaceId("workspace_id") - .build() - ) - - val roundtrippedBetaWebhookEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookEventData).isEqualTo(betaWebhookEventData) - } - - @Test - fun ofMemoryStoreCreated() { - val memoryStoreCreated = - BetaWebhookMemoryStoreCreatedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - val betaWebhookEventData = BetaWebhookEventData.ofMemoryStoreCreated(memoryStoreCreated) - - assertThat(betaWebhookEventData.sessionCreated()).isEmpty - assertThat(betaWebhookEventData.sessionPending()).isEmpty - assertThat(betaWebhookEventData.sessionRunning()).isEmpty - assertThat(betaWebhookEventData.sessionIdled()).isEmpty - assertThat(betaWebhookEventData.sessionRequiresAction()).isEmpty - assertThat(betaWebhookEventData.sessionArchived()).isEmpty - assertThat(betaWebhookEventData.sessionDeleted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRescheduled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRunStarted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusIdled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadCreated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadIdled()).isEmpty - assertThat(betaWebhookEventData.sessionThreadTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionOutcomeEvaluationEnded()).isEmpty - assertThat(betaWebhookEventData.vaultCreated()).isEmpty - assertThat(betaWebhookEventData.vaultArchived()).isEmpty - assertThat(betaWebhookEventData.vaultDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialCreated()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialArchived()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialRefreshFailed()).isEmpty - assertThat(betaWebhookEventData.sessionUpdated()).isEmpty - assertThat(betaWebhookEventData.agentCreated()).isEmpty - assertThat(betaWebhookEventData.agentArchived()).isEmpty - assertThat(betaWebhookEventData.agentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentPaused()).isEmpty - assertThat(betaWebhookEventData.deploymentRunFailed()).isEmpty - assertThat(betaWebhookEventData.deploymentCreated()).isEmpty - assertThat(betaWebhookEventData.deploymentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentUnpaused()).isEmpty - assertThat(betaWebhookEventData.agentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentArchived()).isEmpty - assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty - assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).contains(memoryStoreCreated) - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty - } - - @Test - fun ofMemoryStoreCreatedRoundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookEventData = - BetaWebhookEventData.ofMemoryStoreCreated( - BetaWebhookMemoryStoreCreatedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - ) - - val roundtrippedBetaWebhookEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookEventData).isEqualTo(betaWebhookEventData) - } - - @Test - fun ofMemoryStoreArchived() { - val memoryStoreArchived = - BetaWebhookMemoryStoreArchivedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - val betaWebhookEventData = BetaWebhookEventData.ofMemoryStoreArchived(memoryStoreArchived) - - assertThat(betaWebhookEventData.sessionCreated()).isEmpty - assertThat(betaWebhookEventData.sessionPending()).isEmpty - assertThat(betaWebhookEventData.sessionRunning()).isEmpty - assertThat(betaWebhookEventData.sessionIdled()).isEmpty - assertThat(betaWebhookEventData.sessionRequiresAction()).isEmpty - assertThat(betaWebhookEventData.sessionArchived()).isEmpty - assertThat(betaWebhookEventData.sessionDeleted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRescheduled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRunStarted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusIdled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadCreated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadIdled()).isEmpty - assertThat(betaWebhookEventData.sessionThreadTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionOutcomeEvaluationEnded()).isEmpty - assertThat(betaWebhookEventData.vaultCreated()).isEmpty - assertThat(betaWebhookEventData.vaultArchived()).isEmpty - assertThat(betaWebhookEventData.vaultDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialCreated()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialArchived()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialRefreshFailed()).isEmpty - assertThat(betaWebhookEventData.sessionUpdated()).isEmpty - assertThat(betaWebhookEventData.agentCreated()).isEmpty - assertThat(betaWebhookEventData.agentArchived()).isEmpty - assertThat(betaWebhookEventData.agentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentPaused()).isEmpty - assertThat(betaWebhookEventData.deploymentRunFailed()).isEmpty - assertThat(betaWebhookEventData.deploymentCreated()).isEmpty - assertThat(betaWebhookEventData.deploymentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentUnpaused()).isEmpty - assertThat(betaWebhookEventData.agentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentArchived()).isEmpty - assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty - assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).contains(memoryStoreArchived) - assertThat(betaWebhookEventData.memoryStoreDeleted()).isEmpty - } - - @Test - fun ofMemoryStoreArchivedRoundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookEventData = - BetaWebhookEventData.ofMemoryStoreArchived( - BetaWebhookMemoryStoreArchivedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - ) - - val roundtrippedBetaWebhookEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookEventData).isEqualTo(betaWebhookEventData) - } - - @Test - fun ofMemoryStoreDeleted() { - val memoryStoreDeleted = - BetaWebhookMemoryStoreDeletedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - val betaWebhookEventData = BetaWebhookEventData.ofMemoryStoreDeleted(memoryStoreDeleted) - - assertThat(betaWebhookEventData.sessionCreated()).isEmpty - assertThat(betaWebhookEventData.sessionPending()).isEmpty - assertThat(betaWebhookEventData.sessionRunning()).isEmpty - assertThat(betaWebhookEventData.sessionIdled()).isEmpty - assertThat(betaWebhookEventData.sessionRequiresAction()).isEmpty - assertThat(betaWebhookEventData.sessionArchived()).isEmpty - assertThat(betaWebhookEventData.sessionDeleted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRescheduled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusRunStarted()).isEmpty - assertThat(betaWebhookEventData.sessionStatusIdled()).isEmpty - assertThat(betaWebhookEventData.sessionStatusTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadCreated()).isEmpty - assertThat(betaWebhookEventData.sessionThreadIdled()).isEmpty - assertThat(betaWebhookEventData.sessionThreadTerminated()).isEmpty - assertThat(betaWebhookEventData.sessionOutcomeEvaluationEnded()).isEmpty - assertThat(betaWebhookEventData.vaultCreated()).isEmpty - assertThat(betaWebhookEventData.vaultArchived()).isEmpty - assertThat(betaWebhookEventData.vaultDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialCreated()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialArchived()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialDeleted()).isEmpty - assertThat(betaWebhookEventData.vaultCredentialRefreshFailed()).isEmpty - assertThat(betaWebhookEventData.sessionUpdated()).isEmpty - assertThat(betaWebhookEventData.agentCreated()).isEmpty - assertThat(betaWebhookEventData.agentArchived()).isEmpty - assertThat(betaWebhookEventData.agentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentPaused()).isEmpty - assertThat(betaWebhookEventData.deploymentRunFailed()).isEmpty - assertThat(betaWebhookEventData.deploymentCreated()).isEmpty - assertThat(betaWebhookEventData.deploymentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentUnpaused()).isEmpty - assertThat(betaWebhookEventData.agentUpdated()).isEmpty - assertThat(betaWebhookEventData.deploymentArchived()).isEmpty - assertThat(betaWebhookEventData.deploymentRunStarted()).isEmpty - assertThat(betaWebhookEventData.deploymentDeleted()).isEmpty - assertThat(betaWebhookEventData.deploymentRunSucceeded()).isEmpty - assertThat(betaWebhookEventData.environmentCreated()).isEmpty - assertThat(betaWebhookEventData.environmentUpdated()).isEmpty - assertThat(betaWebhookEventData.environmentArchived()).isEmpty - assertThat(betaWebhookEventData.environmentDeleted()).isEmpty - assertThat(betaWebhookEventData.memoryStoreCreated()).isEmpty - assertThat(betaWebhookEventData.memoryStoreArchived()).isEmpty - assertThat(betaWebhookEventData.memoryStoreDeleted()).contains(memoryStoreDeleted) - } - - @Test - fun ofMemoryStoreDeletedRoundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookEventData = - BetaWebhookEventData.ofMemoryStoreDeleted( - BetaWebhookMemoryStoreDeletedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - ) - - val roundtrippedBetaWebhookEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookEventData).isEqualTo(betaWebhookEventData) - } - enum class IncompatibleJsonShapeTestCase(val value: JsonValue) { BOOLEAN(JsonValue.from(false)), STRING(JsonValue.from("invalid")), diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreArchivedEventDataTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreArchivedEventDataTest.kt deleted file mode 100644 index cdcaa36fc..000000000 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreArchivedEventDataTest.kt +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.anthropic.models.beta.webhooks - -import com.anthropic.core.jsonMapper -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class BetaWebhookMemoryStoreArchivedEventDataTest { - - @Test - fun create() { - val betaWebhookMemoryStoreArchivedEventData = - BetaWebhookMemoryStoreArchivedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - assertThat(betaWebhookMemoryStoreArchivedEventData.id()).isEqualTo("id") - assertThat(betaWebhookMemoryStoreArchivedEventData.organizationId()) - .isEqualTo("organization_id") - assertThat(betaWebhookMemoryStoreArchivedEventData.workspaceId()).isEqualTo("workspace_id") - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookMemoryStoreArchivedEventData = - BetaWebhookMemoryStoreArchivedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - val roundtrippedBetaWebhookMemoryStoreArchivedEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookMemoryStoreArchivedEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookMemoryStoreArchivedEventData) - .isEqualTo(betaWebhookMemoryStoreArchivedEventData) - } -} diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreCreatedEventDataTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreCreatedEventDataTest.kt deleted file mode 100644 index cfc4ad701..000000000 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreCreatedEventDataTest.kt +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.anthropic.models.beta.webhooks - -import com.anthropic.core.jsonMapper -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class BetaWebhookMemoryStoreCreatedEventDataTest { - - @Test - fun create() { - val betaWebhookMemoryStoreCreatedEventData = - BetaWebhookMemoryStoreCreatedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - assertThat(betaWebhookMemoryStoreCreatedEventData.id()).isEqualTo("id") - assertThat(betaWebhookMemoryStoreCreatedEventData.organizationId()) - .isEqualTo("organization_id") - assertThat(betaWebhookMemoryStoreCreatedEventData.workspaceId()).isEqualTo("workspace_id") - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookMemoryStoreCreatedEventData = - BetaWebhookMemoryStoreCreatedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - val roundtrippedBetaWebhookMemoryStoreCreatedEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookMemoryStoreCreatedEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookMemoryStoreCreatedEventData) - .isEqualTo(betaWebhookMemoryStoreCreatedEventData) - } -} diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreDeletedEventDataTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreDeletedEventDataTest.kt deleted file mode 100644 index 9dbe5ff8c..000000000 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/models/beta/webhooks/BetaWebhookMemoryStoreDeletedEventDataTest.kt +++ /dev/null @@ -1,46 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.anthropic.models.beta.webhooks - -import com.anthropic.core.jsonMapper -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class BetaWebhookMemoryStoreDeletedEventDataTest { - - @Test - fun create() { - val betaWebhookMemoryStoreDeletedEventData = - BetaWebhookMemoryStoreDeletedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - assertThat(betaWebhookMemoryStoreDeletedEventData.id()).isEqualTo("id") - assertThat(betaWebhookMemoryStoreDeletedEventData.organizationId()) - .isEqualTo("organization_id") - assertThat(betaWebhookMemoryStoreDeletedEventData.workspaceId()).isEqualTo("workspace_id") - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val betaWebhookMemoryStoreDeletedEventData = - BetaWebhookMemoryStoreDeletedEventData.builder() - .id("id") - .organizationId("organization_id") - .workspaceId("workspace_id") - .build() - - val roundtrippedBetaWebhookMemoryStoreDeletedEventData = - jsonMapper.readValue( - jsonMapper.writeValueAsString(betaWebhookMemoryStoreDeletedEventData), - jacksonTypeRef(), - ) - - assertThat(roundtrippedBetaWebhookMemoryStoreDeletedEventData) - .isEqualTo(betaWebhookMemoryStoreDeletedEventData) - } -} diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/services/async/beta/SkillServiceAsyncTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/services/async/beta/SkillServiceAsyncTest.kt index f695f26d4..2c6a26746 100644 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/services/async/beta/SkillServiceAsyncTest.kt +++ b/anthropic-java-core/src/test/kotlin/com/anthropic/services/async/beta/SkillServiceAsyncTest.kt @@ -29,8 +29,8 @@ internal class SkillServiceAsyncTest { skillServiceAsync.create( SkillCreateParams.builder() .addBeta(AnthropicBeta.MESSAGE_BATCHES_2024_09_24) - .displayTitle("display_title") .addFile(MultipartField.of("Example data".byteInputStream())) + .displayTitle("display_title") .build() ) diff --git a/anthropic-java-core/src/test/kotlin/com/anthropic/services/blocking/beta/SkillServiceTest.kt b/anthropic-java-core/src/test/kotlin/com/anthropic/services/blocking/beta/SkillServiceTest.kt index a49576ead..69bbf875c 100644 --- a/anthropic-java-core/src/test/kotlin/com/anthropic/services/blocking/beta/SkillServiceTest.kt +++ b/anthropic-java-core/src/test/kotlin/com/anthropic/services/blocking/beta/SkillServiceTest.kt @@ -29,8 +29,8 @@ internal class SkillServiceTest { skillService.create( SkillCreateParams.builder() .addBeta(AnthropicBeta.MESSAGE_BATCHES_2024_09_24) - .displayTitle("display_title") .addFile(MultipartField.of("Example data".byteInputStream())) + .displayTitle("display_title") .build() ) From 5a5f7b00f6877a24d4d9e85b45b984b73c6c26cf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 21:50:14 +0000 Subject: [PATCH 2/2] release: 2.47.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ README.md | 4 ++-- build.gradle.kts | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) 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/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/build.gradle.kts b/build.gradle.kts index 5425576c9..ccc88b27f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,4 @@ allprojects { group = "com.anthropic" - version = "2.47.0" // x-release-please-version + version = "2.47.1" // x-release-please-version }