Skip to main content

ServiceDesk

Struct ServiceDesk 

Source
pub struct ServiceDesk {
    pub base_url: Url,
    pub credentials: Credentials,
    /* private fields */
}
Expand description

Main client for interacting with ServiceDesk Plus API.

Use tickets() for search/create operations, or ticket(id) for single-ticket operations.

Fields§

§base_url: Url§credentials: Credentials

Implementations§

Source§

impl ServiceDesk

Source

pub fn tickets(&self) -> TicketsClient<'_>

Get a client for ticket collection operations.

Source

pub fn ticket(&self, id: impl Into<TicketID>) -> TicketClient<'_>

Get a client for single ticket operations.

Source§

impl ServiceDesk

Source

pub async fn ticket_details( &self, ticket_id: impl Into<TicketID>, ) -> Result<DetailedTicket, Error>

Source

pub async fn edit( &self, ticket_id: impl Into<TicketID>, data: &EditTicketData, ) -> Result<(), Error>

Edit an existing ticket. Some of the fields are optional and can be left as None if not being changed. Some fields might be missing due to SDP API restrictions, like account assignment to a given ticket being immutable after creation.

Source

pub async fn add_note( &self, ticket_id: impl Into<TicketID>, note: &NoteData, ) -> Result<Note, Error>

Add a note to a ticket (creates a new note).

Source

pub async fn get_note( &self, ticket_id: impl Into<TicketID>, note_id: impl Into<NoteID>, ) -> Result<Note, Error>

Get a specific note from a ticket.

Source

pub async fn list_notes( &self, ticket_id: impl Into<TicketID>, row_count: Option<u32>, start_index: Option<u32>, ) -> Result<Vec<Note>, Error>

List all notes for a ticket.

Source

pub async fn edit_note( &self, ticket_id: impl Into<TicketID>, note_id: impl Into<NoteID>, note: &NoteData, ) -> Result<Note, Error>

Edit an existing note.

Source

pub async fn delete_note( &self, ticket_id: impl Into<TicketID>, note_id: impl Into<NoteID>, ) -> Result<(), Error>

Delete a note from a ticket.

Source

pub async fn assign_ticket( &self, ticket_id: impl Into<TicketID>, technician_name: &str, ) -> Result<(), Error>

Assign a ticket to a technician.

Source

pub async fn create_ticket( &self, data: &CreateTicketData, ) -> Result<TicketResponse, Error>

Create a new ticket.

Source

pub async fn search_tickets( &self, criteria: Criteria, ) -> Result<Vec<DetailedTicket>, Error>

Search for tickets based on specified criteria. The criteria can be built using the Criteria struct. The default method of querying is not straightforward, Criteria struct on the ‘root’ level contains a single condition, to combine multiple conditions use the ‘children’ field with appropriate ‘logical_operator’.

Source

pub async fn close_ticket( &self, ticket_id: impl Into<TicketID>, closure_comments: &str, ) -> Result<(), Error>

Close a ticket with closure comments.

Source

pub async fn merge( &self, ticket_id: usize, merge_ids: &[usize], ) -> Result<(), Error>

Merge multiple tickets into a single ticket. Key point to note is that the maximum number of tickets that can be merged at once is 49 + 1 (the target ticket), so the merge_ids slice must not exceed 49 IDs.

Source§

impl ServiceDesk

Source

pub fn new( base_url: Url, credentials: Credentials, options: ServiceDeskOptions, ) -> Self

Create a new ServiceDesk client instance

Trait Implementations§

Source§

impl Clone for ServiceDesk

Source§

fn clone(&self) -> ServiceDesk

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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: 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: 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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