pub struct Agents<'a> { /* private fields */ }Available on crate feature
managed-agents-preview only.Expand description
Namespace handle for the Agents API.
Implementations§
Source§impl<'a> Agents<'a>
impl<'a> Agents<'a>
Sourcepub async fn create(&self, request: CreateAgentRequest) -> Result<Agent>
pub async fn create(&self, request: CreateAgentRequest) -> Result<Agent>
POST /v1/agents.
Sourcepub async fn retrieve(
&self,
agent_id: &str,
version: Option<u32>,
) -> Result<Agent>
pub async fn retrieve( &self, agent_id: &str, version: Option<u32>, ) -> Result<Agent>
GET /v1/agents/{id}. Pass version = Some(n) to retrieve a
specific historical version; None returns the latest.
Sourcepub async fn update(
&self,
agent_id: &str,
request: UpdateAgentRequest,
) -> Result<Agent>
pub async fn update( &self, agent_id: &str, request: UpdateAgentRequest, ) -> Result<Agent>
POST /v1/agents/{id} (update). Bumps the version on success.
Fails with HTTP 409 if request.version doesn’t match the
server’s current version.
Sourcepub async fn list_versions(
&self,
agent_id: &str,
params: ListAgentVersionsParams,
) -> Result<Paginated<Agent>>
pub async fn list_versions( &self, agent_id: &str, params: ListAgentVersionsParams, ) -> Result<Paginated<Agent>>
GET /v1/agents/{id}/versions. Returns the agent’s full version
history, newest first.
Auto Trait Implementations§
impl<'a> Freeze for Agents<'a>
impl<'a> !RefUnwindSafe for Agents<'a>
impl<'a> Send for Agents<'a>
impl<'a> Sync for Agents<'a>
impl<'a> Unpin for Agents<'a>
impl<'a> UnsafeUnpin for Agents<'a>
impl<'a> !UnwindSafe for Agents<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.