[][src]Struct domo_pitchfork::pitchfork::UsersRequestBuilder

pub struct UsersRequestBuilder<'t, T: 't> where
    T: DeserializeOwned
{ pub auth: &'t str, pub method: Method, pub url: String, pub resp_t: PhantomData<*const T>, pub body: Option<String>, }

Request Builder for all User API interactions

Fields

auth: &'t strmethod: Methodurl: Stringresp_t: PhantomData<*const T>body: Option<String>

Methods

impl<'t> UsersRequestBuilder<'t, User>[src]

pub fn info(self, user_id: u64) -> Result<User, PitchforkError>[src]

Returns a user object if valid user ID was provided. When requesting, if the user ID is related to a user that has been deleted, a subset of the user information will be returned, including a deleted property, which will be true.

Example

use domo_pitchfork::pitchfork::DomoPitchfork;
let domo = DomoPitchfork::with_token("token");
let user_id = 123; // user id for user to get details for.
let user_info = domo.users().info(user_id)?;
println!("User Details: \n{:#?}", user_info);

pub fn list(self, limit: u32, offset: u32) -> Result<Vec<User>, PitchforkError>[src]

List Users starting from a given offset up to a given limit. Max limit is 500. offset is the offset of the user ID to begin list of users within the response.

Example

use domo_pitchfork::pitchfork::DomoPitchfork;
let domo = DomoPitchfork::with_token("token");
let list = domo.users().list(5,0)?;
list.iter().map(|u| println!("User Name: {}", u.name.as_ref().unwrap()));

pub fn create(self, user: &User) -> Result<User, PitchforkError>[src]

pub fn delete(self, user_id: u64) -> Result<(), PitchforkError>[src]

Delete the User for the given id. This is destructive and cannot be reversed.

Example

let domo = DomoPitchfork::with_token(&token);

let user_id = 123; // user id of user to delete.
// if it fails to delete, print err msg.
if let Err(e) = domo.users().delete(user_id) {
    println!("{}", e)
}

pub fn modify(self, user_id: u64, user: &User) -> Result<(), PitchforkError>[src]

Update an existing user. Known Limitation: as of 4/10/19 all user fields are required by the Domo API

Trait Implementations

impl<'t, T> BaseRequest for UsersRequestBuilder<'t, T> where
    T: DeserializeOwned
[src]

impl<'t, T> DomoRequest<T> for UsersRequestBuilder<'t, T> where
    T: DeserializeOwned
[src]

impl<'t, T> From<DomoRequestBuilder<'t, T>> for UsersRequestBuilder<'t, T> where
    T: DeserializeOwned
[src]

Auto Trait Implementations

impl<'t, T> !Send for UsersRequestBuilder<'t, T>

impl<'t, T> !Sync for UsersRequestBuilder<'t, T>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

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

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