[][src]Struct domo_pitchfork::pitchfork::GroupsRequestBuilder

pub struct GroupsRequestBuilder<'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 Group API interactions

Fields

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

Methods

impl<'t> GroupsRequestBuilder<'t, GroupInfo>[src]

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

Returns a group object if valid group ID was provided. When requesting, if the group ID is related to a customer that has been deleted, a subset of the group's 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 ds_info = domo.groups().info(group_id);
match ds_info {
    Ok(ds) => println!("{:?}",ds),
    Err(e) => println!("{}", e)
};

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

List Groups starting from a given offset up to a given limit. Max limit is 500. Offset is the offset of the group ID to begin list of groups within the response.

Example

use domo_pitchfork::pitchfork::DomoPitchfork;
let domo = DomoPitchfork::with_token("token");
let group_list = domo.groups().list(5,0)?;
group_list.iter().map(|g| println!("Group Name: {}", g.name));

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

Creates a new Domo Group. Returns a group object when successful. The returned group will have user attributes based on the information that was provided when group was created.

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

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

Example

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

let group_id = 123; // group id to delete.
// if it fails to delete, print err msg.
if let Err(e) = domo.groups().delete(group_id) {
    println!("{}", e)
}

pub fn modify(
    self,
    group_id: u64,
    group: &GroupInfo
) -> Result<(), PitchforkError>
[src]

Modify an existing Domo Group. Updates the specified group by providing values to parameters passed. Any parameter left out of the request will cause the specific group’s attribute to remain unchanged.

pub fn users(self, group_id: u64) -> Result<Vec<u64>, PitchforkError>[src]

Returns a list of user id's that are in a Group Limit is 500.

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

Adds a specified user to a group.

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

Removes a specified user from a specified Group.

Trait Implementations

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

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

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

Auto Trait Implementations

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

impl<'t, T> Unpin for GroupsRequestBuilder<'t, T>

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

impl<'t, T> UnwindSafe for GroupsRequestBuilder<'t, T> where
    T: RefUnwindSafe

impl<'t, T> RefUnwindSafe for GroupsRequestBuilder<'t, T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> 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<U> for T where
    U: TryFrom<T>, 

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