pub struct ServiceDesk { /* 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.
Implementations§
Source§impl ServiceDesk
impl ServiceDesk
Sourcepub fn tickets(&self) -> TicketsClient<'_>
pub fn tickets(&self) -> TicketsClient<'_>
Get a client for ticket collection operations.
Sourcepub fn ticket(&self, id: impl Into<TicketID>) -> TicketClient<'_>
pub fn ticket(&self, id: impl Into<TicketID>) -> TicketClient<'_>
Get a client for single ticket operations.
Source§impl ServiceDesk
impl ServiceDesk
pub async fn add_attachment( &self, ticket_id: impl Into<TicketID>, file_path: impl AsRef<Path>, ) -> Result<(), Error>
pub async fn ticket_details( &self, ticket_id: impl Into<TicketID>, ) -> Result<DetailedTicket, Error>
pub async fn get_conversations( &self, ticket_id: impl Into<TicketID>, ) -> Result<Value, Error>
pub async fn get_conversation_content( &self, content_url: &str, ) -> Result<Value, Error>
Sourcepub async fn merged_ticket_ids(
&self,
ticket_id: impl Into<TicketID>,
) -> Result<Vec<TicketID>, Error>
pub async fn merged_ticket_ids( &self, ticket_id: impl Into<TicketID>, ) -> Result<Vec<TicketID>, Error>
List ticket IDs that were merged into the given parent ticket.
SDP exposes merge events only as MERGE entries in the parent’s conversation
history, there is no dedicated read endpoint. Each MERGE entry carries a
merged_request_id that identifies the absorbed child.
pub async fn get_conversation_attachment_urls( &self, ticket_id: impl Into<TicketID>, ) -> Result<Vec<String>, Error>
pub async fn download_attachment( &self, attachment_url: &str, ) -> Result<Vec<u8>, Error>
Sourcepub async fn edit(
&self,
ticket_id: impl Into<TicketID>,
data: &EditTicketData,
) -> Result<(), Error>
pub async fn edit( &self, ticket_id: impl Into<TicketID>, data: &EditTicketData, ) -> Result<(), Error>
Edit an existing ticket.
§Important
Read EditTicketData documentation for details on how the editing works and how to use it.
Sourcepub async fn add_note(
&self,
ticket_id: impl Into<TicketID>,
note: &NoteData,
) -> Result<Note, Error>
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).
pub async fn add_worklog( &self, ticket_id: impl Into<TicketID>, worklog: &WorklogData, ) -> Result<Value, Error>
Sourcepub async fn get_note(
&self,
ticket_id: impl Into<TicketID>,
note_id: impl Into<NoteID>,
) -> Result<Note, Error>
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.
Sourcepub async fn list_notes(
&self,
ticket_id: impl Into<TicketID>,
row_count: Option<u32>,
start_index: Option<u32>,
) -> Result<Vec<Note>, Error>
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.
Sourcepub async fn edit_note(
&self,
ticket_id: impl Into<TicketID>,
note_id: impl Into<NoteID>,
note: &NoteData,
) -> Result<Note, Error>
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.
Sourcepub async fn delete_note(
&self,
ticket_id: impl Into<TicketID>,
note_id: impl Into<NoteID>,
) -> Result<(), Error>
pub async fn delete_note( &self, ticket_id: impl Into<TicketID>, note_id: impl Into<NoteID>, ) -> Result<(), Error>
Delete a note from a ticket.
Sourcepub async fn assign_ticket(
&self,
ticket_id: impl Into<TicketID>,
technician_name: &str,
) -> Result<(), Error>
pub async fn assign_ticket( &self, ticket_id: impl Into<TicketID>, technician_name: &str, ) -> Result<(), Error>
Assign a ticket to a technician.
Sourcepub async fn create_ticket(
&self,
data: &CreateTicketData,
) -> Result<TicketData, Error>
pub async fn create_ticket( &self, data: &CreateTicketData, ) -> Result<TicketData, Error>
Create a new ticket.
Sourcepub async fn search_tickets(
&self,
criteria: Criteria,
) -> Result<Vec<DetailedTicket>, Error>
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 LogicalOp.
Sourcepub async fn close_ticket(
&self,
ticket_id: impl Into<TicketID>,
closure_comments: &str,
) -> Result<(), Error>
pub async fn close_ticket( &self, ticket_id: impl Into<TicketID>, closure_comments: &str, ) -> Result<(), Error>
Close a ticket with closure comments.
Sourcepub async fn merge(
&self,
ticket_id: impl Into<TicketID>,
merge_ids: &[TicketID],
) -> Result<(), Error>
pub async fn merge( &self, ticket_id: impl Into<TicketID>, merge_ids: &[TicketID], ) -> 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
impl ServiceDesk
Sourcepub fn new(
base_url: Url,
credentials: Credentials,
options: ServiceDeskOptions,
) -> Result<Self, Error>
pub fn new( base_url: Url, credentials: Credentials, options: ServiceDeskOptions, ) -> Result<Self, Error>
Create a new ServiceDesk client instance.
§Errors
Returns an error if the auth token contains invalid header characters or if the underlying HTTP client fails to build.
Trait Implementations§
Source§impl Clone for ServiceDesk
impl Clone for ServiceDesk
Source§fn clone(&self) -> ServiceDesk
fn clone(&self) -> ServiceDesk
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more