Skip to main content

AgentsResource

Struct AgentsResource 

Source
pub struct AgentsResource {
    pub groups: AgentGroupsResource,
    /* private fields */
}
Expand description

Agent management — /api/v2/agents, with a nested groups sub-resource.

Fields§

§groups: AgentGroupsResource

Agent groups — /api/v2/agents/groups.

Implementations§

Source§

impl AgentsResource

Source

pub async fn list( &self, query: ListAgentsQuery, ) -> Result<Vec<Agent>, ManagerError>

List agents matching query, auto-paginated across pages.

Stands in for the generated list_agents, whose groupIds/groups/tags parameters (anyOf string-or-array types) are JSON-serialized into the query — a single id would be sent as ?groupIds="…" with literal quotes, which the server does not match. The facade builds the form/explode query itself and decodes into the same generated response model.

Source

pub async fn list_all(&self) -> Result<Vec<Agent>, ManagerError>

List all agents (unfiltered, auto-paginated) — AgentsResource::list with no filters.

Source

pub async fn list_page( &self, page: i32, per_page: Option<i32>, query: ListAgentsQuery, ) -> Result<Page<Agent>, ManagerError>

List one page of agents, optionally filtered server-side.

Source

pub async fn create( &self, body: RestCreateAgent, ) -> Result<AgentItemResponse, ManagerError>

Create an agent.

Source

pub async fn get(&self, id: &str) -> Result<AgentItemResponse, ManagerError>

Get an agent by id.

Source

pub async fn update( &self, id: &str, body: RestUpdateAgent, ) -> Result<AgentItemResponse, ManagerError>

Update an agent.

Source

pub async fn delete(&self, id: &str) -> Result<(), ManagerError>

Delete an agent.

Source

pub async fn update_status( &self, id: &str, status: UpdateAgentStatusRequest, ) -> Result<AgentStatus, ManagerError>

Update an agent’s status.

Source

pub async fn presences(&self) -> Result<AgentPresenceListResponse, ManagerError>

List agent presences.

Source

pub async fn get_presence( &self, name: &str, ) -> Result<AgentPresenceItemResponse, ManagerError>

Get an agent presence by name.

Source

pub async fn create_presence( &self, body: AgentPresenceWriteBody, ) -> Result<AgentPresenceItemResponse, ManagerError>

Create an agent presence.

Source

pub async fn update_presence( &self, name: &str, body: AgentPresenceWriteBody, ) -> Result<AgentPresenceItemResponse, ManagerError>

Update an agent presence.

Source

pub async fn delete_presence( &self, name: &str, ) -> Result<DefaultV2MessageResponse, ManagerError>

Delete an agent presence.

Source

pub async fn get_status( &self, id: &str, ) -> Result<AgentTotalStatusResponse, ManagerError>

Get an agent’s total status by id.

Source

pub async fn available_statuses( &self, ) -> Result<AgentAvailabilityListResponse, ManagerError>

List available agent statuses.

Source

pub async fn enable( &self, id: &str, ) -> Result<DefaultV2MessageResponse, ManagerError>

Enable an agent.

Source

pub async fn disable( &self, id: &str, ) -> Result<DefaultV2MessageResponse, ManagerError>

Disable an agent.

Source

pub async fn hangup_call( &self, id: &str, ) -> Result<DefaultV2MessageResponse, ManagerError>

Hang up an agent’s active call.

Source

pub async fn bulk_action( &self, action: &str, body: AgentBulkRequest, ) -> Result<AgentBulkResponse, ManagerError>

Perform a bulk action (e.g. enable, disable, delete) on multiple agents.

Source

pub async fn export(&self, format: &str) -> Result<String, ManagerError>

Export all agents in the given format.

Source

pub async fn import_agents( &self, format: &str, file: PathBuf, async: Option<bool>, create_only: Option<bool>, update_only: Option<bool>, delete_unlisted: Option<bool>, ) -> Result<AgentImportValidationResults, ManagerError>

Import agents from a file in the given format.

Source

pub async fn validate_import( &self, file: PathBuf, ) -> Result<AgentImportValidationResults, ManagerError>

Validate an agent import file without applying it.

Source

pub async fn get_import_job( &self, id: &str, ) -> Result<AgentImportJobItemResponse, ManagerError>

Get an agent import job by id.

Source

pub async fn logs( &self, id: &str, from: Option<i32>, to: Option<i32>, ) -> Result<Vec<AgentLogEntry>, ManagerError>

List an agent’s logs (auto-paginated), optionally filtered by a from/to range.

Source

pub async fn all_logs(&self) -> Result<Vec<AgentLogEntry>, ManagerError>

List logs across all agents (auto-paginated).

Source

pub async fn push( &self, body: AgentPushRequest, ) -> Result<DefaultV2MessageResponse, ManagerError>

Push a message to an agent (or broadcast to all agents).

Source

pub async fn update_password( &self, id: &str, body: AgentPasswordUpdateRequest, ) -> Result<DefaultV2MessageResponse, ManagerError>

Update an agent’s password.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more