Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Sep 23, 2024
1 parent c270d7b commit 36ccf26
Show file tree
Hide file tree
Showing 40 changed files with 2,002 additions and 769 deletions.
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 96
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/manugoyal%2Fbraintrust-sdk-938d5abfeeda9e7cb58c9ad6df1cd7bb663715a79310601559b12230fca1cced.yml
configured_endpoints: 97
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/manugoyal%2Fbraintrust-sdk-35ca662bf69021273747db3b70d40b924819af0f6e01b38001c7c1ae2f8a4712.yml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ if (field.isMissing()) {
Sometimes, the server response may include additional properties that are not yet available in this library's types. You can access them using the model's `_additionalProperties` method:

```kotlin
val secret = acl._additionalProperties().get("secret_field")
val secret = aISecret._additionalProperties().get("secret_field")
```

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ interface BraintrustClient {

fun apiKeyResource(): ApiKeyResourceService

fun orgSecret(): OrgSecretService
fun aiSecret(): AiSecretService
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ interface BraintrustClientAsync {

fun apiKeyResource(): ApiKeyResourceServiceAsync

fun orgSecret(): OrgSecretServiceAsync
fun aiSecret(): AiSecretServiceAsync
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ constructor(
ApiKeyResourceServiceAsyncImpl(clientOptions)
}

private val orgSecret: OrgSecretServiceAsync by lazy {
OrgSecretServiceAsyncImpl(clientOptions)
}
private val aiSecret: AiSecretServiceAsync by lazy { AiSecretServiceAsyncImpl(clientOptions) }

override fun sync(): BraintrustClient = sync

Expand Down Expand Up @@ -94,5 +92,5 @@ constructor(

override fun apiKeyResource(): ApiKeyResourceServiceAsync = apiKeyResource

override fun orgSecret(): OrgSecretServiceAsync = orgSecret
override fun aiSecret(): AiSecretServiceAsync = aiSecret
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ constructor(
ApiKeyResourceServiceImpl(clientOptions)
}

private val orgSecret: OrgSecretService by lazy { OrgSecretServiceImpl(clientOptions) }
private val aiSecret: AiSecretService by lazy { AiSecretServiceImpl(clientOptions) }

override fun async(): BraintrustClientAsync = async

Expand Down Expand Up @@ -84,5 +84,5 @@ constructor(

override fun apiKeyResource(): ApiKeyResourceService = apiKeyResource

override fun orgSecret(): OrgSecretService = orgSecret
override fun aiSecret(): AiSecretService = aiSecret
}
56 changes: 28 additions & 28 deletions ...om/braintrustdata/api/models/OrgSecret.kt → ...com/braintrustdata/api/models/AiSecret.kt
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import java.time.OffsetDateTime
import java.util.Objects

@JsonDeserialize(builder = OrgSecret.Builder::class)
@JsonDeserialize(builder = AISecret.Builder::class)
@NoAutoDetect
class OrgSecret
class AISecret
private constructor(
private val id: JsonField<String>,
private val created: JsonField<OffsetDateTime>,
Expand All @@ -33,16 +33,16 @@ private constructor(

private var hashCode: Int = 0

/** Unique identifier for the org secret */
/** Unique identifier for the AI secret */
fun id(): String = id.getRequired("id")

/** Date of org secret creation */
/** Date of AI secret creation */
fun created(): OffsetDateTime? = created.getNullable("created")

/** Unique identifier for the organization */
fun orgId(): String = orgId.getRequired("org_id")

/** Name of the org secret */
/** Name of the AI secret */
fun name(): String = name.getRequired("name")

fun type(): String? = type.getNullable("type")
Expand All @@ -51,16 +51,16 @@ private constructor(

fun previewSecret(): String? = previewSecret.getNullable("preview_secret")

/** Unique identifier for the org secret */
/** Unique identifier for the AI secret */
@JsonProperty("id") @ExcludeMissing fun _id() = id

/** Date of org secret creation */
/** Date of AI secret creation */
@JsonProperty("created") @ExcludeMissing fun _created() = created

/** Unique identifier for the organization */
@JsonProperty("org_id") @ExcludeMissing fun _orgId() = orgId

/** Name of the org secret */
/** Name of the AI secret */
@JsonProperty("name") @ExcludeMissing fun _name() = name

@JsonProperty("type") @ExcludeMissing fun _type() = type
Expand All @@ -73,7 +73,7 @@ private constructor(
@ExcludeMissing
fun _additionalProperties(): Map<String, JsonValue> = additionalProperties

fun validate(): OrgSecret = apply {
fun validate(): AISecret = apply {
if (!validated) {
id()
created()
Expand All @@ -93,7 +93,7 @@ private constructor(
return true
}

return other is OrgSecret &&
return other is AISecret &&
this.id == other.id &&
this.created == other.created &&
this.orgId == other.orgId &&
Expand Down Expand Up @@ -122,7 +122,7 @@ private constructor(
}

override fun toString() =
"OrgSecret{id=$id, created=$created, orgId=$orgId, name=$name, type=$type, metadata=$metadata, previewSecret=$previewSecret, additionalProperties=$additionalProperties}"
"AISecret{id=$id, created=$created, orgId=$orgId, name=$name, type=$type, metadata=$metadata, previewSecret=$previewSecret, additionalProperties=$additionalProperties}"

companion object {

Expand All @@ -140,27 +140,27 @@ private constructor(
private var previewSecret: JsonField<String> = JsonMissing.of()
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

internal fun from(orgSecret: OrgSecret) = apply {
this.id = orgSecret.id
this.created = orgSecret.created
this.orgId = orgSecret.orgId
this.name = orgSecret.name
this.type = orgSecret.type
this.metadata = orgSecret.metadata
this.previewSecret = orgSecret.previewSecret
additionalProperties(orgSecret.additionalProperties)
internal fun from(aiSecret: AISecret) = apply {
this.id = aiSecret.id
this.created = aiSecret.created
this.orgId = aiSecret.orgId
this.name = aiSecret.name
this.type = aiSecret.type
this.metadata = aiSecret.metadata
this.previewSecret = aiSecret.previewSecret
additionalProperties(aiSecret.additionalProperties)
}

/** Unique identifier for the org secret */
/** Unique identifier for the AI secret */
fun id(id: String) = id(JsonField.of(id))

/** Unique identifier for the org secret */
/** Unique identifier for the AI secret */
@JsonProperty("id") @ExcludeMissing fun id(id: JsonField<String>) = apply { this.id = id }

/** Date of org secret creation */
/** Date of AI secret creation */
fun created(created: OffsetDateTime) = created(JsonField.of(created))

/** Date of org secret creation */
/** Date of AI secret creation */
@JsonProperty("created")
@ExcludeMissing
fun created(created: JsonField<OffsetDateTime>) = apply { this.created = created }
Expand All @@ -173,10 +173,10 @@ private constructor(
@ExcludeMissing
fun orgId(orgId: JsonField<String>) = apply { this.orgId = orgId }

/** Name of the org secret */
/** Name of the AI secret */
fun name(name: String) = name(JsonField.of(name))

/** Name of the org secret */
/** Name of the AI secret */
@JsonProperty("name")
@ExcludeMissing
fun name(name: JsonField<String>) = apply { this.name = name }
Expand Down Expand Up @@ -215,8 +215,8 @@ private constructor(
this.additionalProperties.putAll(additionalProperties)
}

fun build(): OrgSecret =
OrgSecret(
fun build(): AISecret =
AISecret(
id,
created,
orgId,
Expand Down
70 changes: 35 additions & 35 deletions ...data/api/models/OrgSecretReplaceParams.kt → ...stdata/api/models/AiSecretCreateParams.kt
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import java.util.Objects

class OrgSecretReplaceParams
class AiSecretCreateParams
constructor(
private val name: String,
private val metadata: Metadata?,
Expand All @@ -35,8 +35,8 @@ constructor(

fun type(): String? = type

internal fun getBody(): OrgSecretReplaceBody {
return OrgSecretReplaceBody(
internal fun getBody(): AiSecretCreateBody {
return AiSecretCreateBody(
name,
metadata,
orgName,
Expand All @@ -50,9 +50,9 @@ constructor(

internal fun getHeaders(): Map<String, List<String>> = additionalHeaders

@JsonDeserialize(builder = OrgSecretReplaceBody.Builder::class)
@JsonDeserialize(builder = AiSecretCreateBody.Builder::class)
@NoAutoDetect
class OrgSecretReplaceBody
class AiSecretCreateBody
internal constructor(
private val name: String?,
private val metadata: Metadata?,
Expand All @@ -64,15 +64,15 @@ constructor(

private var hashCode: Int = 0

/** Name of the org secret */
/** Name of the AI secret */
@JsonProperty("name") fun name(): String? = name

@JsonProperty("metadata") fun metadata(): Metadata? = metadata

/**
* For nearly all users, this parameter should be unnecessary. But in the rare case that
* your API key belongs to multiple organizations, you may specify the name of the
* organization the Org Secret belongs in.
* organization the AI Secret belongs in.
*/
@JsonProperty("org_name") fun orgName(): String? = orgName

Expand All @@ -95,7 +95,7 @@ constructor(
return true
}

return other is OrgSecretReplaceBody &&
return other is AiSecretCreateBody &&
this.name == other.name &&
this.metadata == other.metadata &&
this.orgName == other.orgName &&
Expand All @@ -120,7 +120,7 @@ constructor(
}

override fun toString() =
"OrgSecretReplaceBody{name=$name, metadata=$metadata, orgName=$orgName, secret=$secret, type=$type, additionalProperties=$additionalProperties}"
"AiSecretCreateBody{name=$name, metadata=$metadata, orgName=$orgName, secret=$secret, type=$type, additionalProperties=$additionalProperties}"

companion object {

Expand All @@ -136,16 +136,16 @@ constructor(
private var type: String? = null
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

internal fun from(orgSecretReplaceBody: OrgSecretReplaceBody) = apply {
this.name = orgSecretReplaceBody.name
this.metadata = orgSecretReplaceBody.metadata
this.orgName = orgSecretReplaceBody.orgName
this.secret = orgSecretReplaceBody.secret
this.type = orgSecretReplaceBody.type
additionalProperties(orgSecretReplaceBody.additionalProperties)
internal fun from(aiSecretCreateBody: AiSecretCreateBody) = apply {
this.name = aiSecretCreateBody.name
this.metadata = aiSecretCreateBody.metadata
this.orgName = aiSecretCreateBody.orgName
this.secret = aiSecretCreateBody.secret
this.type = aiSecretCreateBody.type
additionalProperties(aiSecretCreateBody.additionalProperties)
}

/** Name of the org secret */
/** Name of the AI secret */
@JsonProperty("name") fun name(name: String) = apply { this.name = name }

@JsonProperty("metadata")
Expand All @@ -154,7 +154,7 @@ constructor(
/**
* For nearly all users, this parameter should be unnecessary. But in the rare case that
* your API key belongs to multiple organizations, you may specify the name of the
* organization the Org Secret belongs in.
* organization the AI Secret belongs in.
*/
@JsonProperty("org_name")
fun orgName(orgName: String) = apply { this.orgName = orgName }
Expand All @@ -181,8 +181,8 @@ constructor(
this.additionalProperties.putAll(additionalProperties)
}

fun build(): OrgSecretReplaceBody =
OrgSecretReplaceBody(
fun build(): AiSecretCreateBody =
AiSecretCreateBody(
checkNotNull(name) { "`name` is required but was not set" },
metadata,
orgName,
Expand All @@ -204,7 +204,7 @@ constructor(
return true
}

return other is OrgSecretReplaceParams &&
return other is AiSecretCreateParams &&
this.name == other.name &&
this.metadata == other.metadata &&
this.orgName == other.orgName &&
Expand All @@ -229,7 +229,7 @@ constructor(
}

override fun toString() =
"OrgSecretReplaceParams{name=$name, metadata=$metadata, orgName=$orgName, secret=$secret, type=$type, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}"
"AiSecretCreateParams{name=$name, metadata=$metadata, orgName=$orgName, secret=$secret, type=$type, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}"

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

Expand All @@ -250,26 +250,26 @@ constructor(
private var additionalHeaders: MutableMap<String, MutableList<String>> = mutableMapOf()
private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf()

internal fun from(orgSecretReplaceParams: OrgSecretReplaceParams) = apply {
this.name = orgSecretReplaceParams.name
this.metadata = orgSecretReplaceParams.metadata
this.orgName = orgSecretReplaceParams.orgName
this.secret = orgSecretReplaceParams.secret
this.type = orgSecretReplaceParams.type
additionalQueryParams(orgSecretReplaceParams.additionalQueryParams)
additionalHeaders(orgSecretReplaceParams.additionalHeaders)
additionalBodyProperties(orgSecretReplaceParams.additionalBodyProperties)
internal fun from(aiSecretCreateParams: AiSecretCreateParams) = apply {
this.name = aiSecretCreateParams.name
this.metadata = aiSecretCreateParams.metadata
this.orgName = aiSecretCreateParams.orgName
this.secret = aiSecretCreateParams.secret
this.type = aiSecretCreateParams.type
additionalQueryParams(aiSecretCreateParams.additionalQueryParams)
additionalHeaders(aiSecretCreateParams.additionalHeaders)
additionalBodyProperties(aiSecretCreateParams.additionalBodyProperties)
}

/** Name of the org secret */
/** Name of the AI secret */
fun name(name: String) = apply { this.name = name }

fun metadata(metadata: Metadata) = apply { this.metadata = metadata }

/**
* For nearly all users, this parameter should be unnecessary. But in the rare case that
* your API key belongs to multiple organizations, you may specify the name of the
* organization the Org Secret belongs in.
* organization the AI Secret belongs in.
*/
fun orgName(orgName: String) = apply { this.orgName = orgName }

Expand Down Expand Up @@ -335,8 +335,8 @@ constructor(
this.additionalBodyProperties.putAll(additionalBodyProperties)
}

fun build(): OrgSecretReplaceParams =
OrgSecretReplaceParams(
fun build(): AiSecretCreateParams =
AiSecretCreateParams(
checkNotNull(name) { "`name` is required but was not set" },
metadata,
orgName,
Expand Down
Loading

0 comments on commit 36ccf26

Please sign in to comment.