commonMain.com.xebia.functional.openai.generated.api.AuditLogs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xef-openai-client Show documentation
Show all versions of xef-openai-client Show documentation
Building applications with LLMs through composability in Kotlin
The newest version!
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.xebia.functional.openai.generated.api
import com.xebia.functional.openai.generated.model.AuditLogEventType
import com.xebia.functional.openai.generated.model.ListAuditLogsEffectiveAtParameter
import com.xebia.functional.openai.generated.model.ListAuditLogsResponse
import com.xebia.functional.openai.Config
import com.xebia.functional.openai.UploadFile
import com.xebia.functional.openai.appendGen
import com.xebia.functional.openai.generated.api.AuditLogs.*
import com.xebia.functional.openai.streamEvents
import com.xebia.functional.openai.errors.serializeOrThrowWithResponseInfo
import io.ktor.client.HttpClient
import io.ktor.client.call.body
import io.ktor.client.plugins.timeout
import io.ktor.client.request.HttpRequestBuilder
import io.ktor.client.request.accept
import io.ktor.client.request.header
import io.ktor.client.request.forms.formData
import io.ktor.client.request.parameter
import io.ktor.client.request.prepareRequest
import io.ktor.client.request.request
import io.ktor.client.request.setBody
import io.ktor.client.statement.HttpResponse
import io.ktor.client.statement.HttpStatement
import io.ktor.http.ContentType
import io.ktor.http.HttpHeaders
import io.ktor.http.HttpMethod
import io.ktor.http.contentType
import io.ktor.http.path
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import kotlinx.serialization.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.JsonPrimitive
import kotlin.time.Duration.Companion.seconds
import kotlin.time.DurationUnit
/**
*
*/
interface AuditLogs {
/**
* List user actions and configuration changes within this organization.
*
* @param effectiveAt Return only events whose `effective_at` (Unix seconds) is in this range. (optional)
* @param projectIds Return only events for these projects. (optional)
* @param eventTypes Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](/docs/api-reference/audit-logs/object). (optional)
* @param actorIds Return only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID. (optional)
* @param actorEmails Return only events performed by users with these emails. (optional)
* @param resourceIds Return only events performed on these targets. For example, a project ID updated. (optional)
* @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. (optional, default to 20)
* @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. (optional)
* @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. (optional)
* @param configure optional configuration for the request, allows overriding the default configuration.
* @return ListAuditLogsResponse
*/
suspend fun listAuditLogs(effectiveAt: ListAuditLogsEffectiveAtParameter? = null, projectIds: kotlin.collections.List? = null, eventTypes: kotlin.collections.List? = null, actorIds: kotlin.collections.List? = null, actorEmails: kotlin.collections.List? = null, resourceIds: kotlin.collections.List? = null, limit: kotlin.Int? = 20, after: kotlin.String? = null, before: kotlin.String? = null, configure: HttpRequestBuilder.() -> Unit = {}): ListAuditLogsResponse
}
fun AuditLogs(client: HttpClient, config: Config): com.xebia.functional.openai.generated.api.AuditLogs = object : com.xebia.functional.openai.generated.api.AuditLogs {
override suspend fun listAuditLogs(effectiveAt: ListAuditLogsEffectiveAtParameter?,projectIds: kotlin.collections.List?,eventTypes: kotlin.collections.List?,actorIds: kotlin.collections.List?,actorEmails: kotlin.collections.List?,resourceIds: kotlin.collections.List?,limit: kotlin.Int?,after: kotlin.String?,before: kotlin.String?, configure: HttpRequestBuilder.() -> Unit): ListAuditLogsResponse =
client.request {
configure()
method = HttpMethod.Get
contentType(ContentType.Application.Json)
parameter("effective_at", effectiveAt)
parameter("project_ids[]", projectIds)
parameter("event_types[]", eventTypes)
parameter("actor_ids[]", actorIds)
parameter("actor_emails[]", actorEmails)
parameter("resource_ids[]", resourceIds)
parameter("limit", limit)
parameter("after", after)
parameter("before", before)
url { path("organization/audit_logs") }
setBody(
io.ktor.client.utils.EmptyContent
)
}.serializeOrThrowWithResponseInfo()
}