pub struct ZohoClient { /* private fields */ }
Expand description

ZohoClient initialises and manages the details with which we can make a connection to the Zoho API. It holds the information required which is then passed down into the various ModelRequests for use with a specific endpoint.

Implementations§

source§

impl ZohoClient

source

pub fn new(client_id: &str, client_secret: &str) -> Self

Generate new ZohoClient which may be used to make requests

source

pub fn access_token(&self) -> String

Returns the access token for this Client.

Panics

Will panic if an access token has not been set for this client. As a ZohoClient cannot be constructed other than via new and that calls the necessary API endpoint to set the access token, this is not recoverable.

source

pub fn set_portal(self, portal_name: &str) -> Result<Self>

Set the Portal to which this ZohoClient should make requests. This takes a Portal name; these are typically human-friendly strings and should be known by the Zoho Portal users.

source

pub fn set_project(self, project_name: &str) -> Result<Self>

Set the Project to which this ZohoClient should refer when making requests. All entities requested will be within this Project; if multiple Projects are to be queried this can be called a second time to re-use the client. The Project names are typically human-friendly strings and should be known by the Zoho Project users.

source

pub fn activities(&self) -> ActivityRequest

Construct a Request for retrieving multiple Activities. Activities cannot be requested singly, therefore there is no id-parameterised counterpart.

source

pub fn bug(&self, id: i64) -> BugRequest

Construct a Request for retrieving a Bug by numeric ID

source

pub fn bugs(&self) -> BugRequest

Construct a Request for retrieving multiple Bugs

source

pub fn category(&self, id: i64) -> CategoryRequest

Construct a Request for retrieving a Category by ID

source

pub fn categories(&self) -> CategoryRequest

Construct a Request for retrieving multiple Categories

source

pub fn event(&self, id: i64) -> EventRequest

Construct a Request for retrieving an Event by ID

source

pub fn events(&self) -> EventRequest

Construct a Request for retrieving multiple Events

source

pub fn forum(&self, id: i64) -> ForumRequest

Construct a Request for retrieving a Forum by ID

source

pub fn forums(&self) -> ForumRequest

Construct a Request for retrieving multiple Fora

source

pub fn forum_comment(&self, forum_id: i64, id: i64) -> CommentRequest

Construct a Request for retrieving a Comment within a Forum, referencing the ID of both the Forum and Comment

source

pub fn forum_comments(&self, forum_id: i64) -> CommentRequest

Construct a Request for retrieving multiple Comments within a Forum, referencing the Forum ID

source

pub fn milestone(&self, id: i64) -> MilestoneRequest

Construct a Request for retrieving a Milestone by ID

source

pub fn milestones(&self) -> MilestoneRequest

Construct a Request for retrieving multiple Milestones

source

pub fn portals(&self) -> PortalRequest

Construct a Request for retrieving the available Portals for this Client. Used when initializing a new Client.

source

pub fn portal_users(&self) -> PortalUserRequest

Construct a Request for retrieving the users with access to this Client’s Portal.

source

pub fn project(&self, id: i64) -> ProjectRequest

Construct a Request for retrieving a Project by ID

source

pub fn projects(&self) -> ProjectRequest

Construct a Request for retrieving multiple Projects

source

pub fn project_users(&self) -> ProjectUserRequest

Construct a Request for retrieving the Users with access to this Client’s Project

source

pub fn statuses(&self) -> StatusRequest

Construct a Request for retrieving multiple Statuses. There is no singular counterpart.

source

pub fn task(&self, id: i64) -> TaskRequest

Construct a Request for retrieving a Task by ID

source

pub fn tasks(&self) -> TaskRequest

Construct a Request for retrieving multiple Tasks

source

pub fn tasklist(&self, id: i64) -> TasklistRequest

Construct a Request for retrieving a Tasklist by ID

source

pub fn tasklists(&self) -> TasklistRequest

Construct a Request for retrieving multiple Tasklists

source

pub fn tasklist_task(&self, tasklist_id: usize, id: i64) -> TasklistTaskRequest

Construct a Request for retrieving a Task belonging to a specific Tasklist

source

pub fn tasklist_tasks(&self, tasklist_id: usize) -> TasklistTaskRequest

Construct a Request for retrieving Tasks belonging to a specific Tasklist

source

pub fn timesheet(&self, id: i64) -> TimesheetRequest

Construct a Request for retrieving a Timesheet by ID

source

pub fn timesheets(&self) -> TimesheetRequest

Construct a Request for retrieving multiple Timesheets

Trait Implementations§

source§

impl Clone for ZohoClient

source§

fn clone(&self) -> ZohoClient

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for ZohoClient

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

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