[−][src]Struct domo_pitchfork::pitchfork::GroupsRequestBuilder
Request Builder for all Group API interactions
Fields
auth: &'t str
method: Method
url: String
resp_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]
self,
limit: u32,
offset: u32
) -> Result<Vec<GroupInfo>, PitchforkError>
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]
self,
group_id: u64,
group: &GroupInfo
) -> Result<(), PitchforkError>
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]
self,
group_id: u64,
user_id: u64
) -> Result<(), PitchforkError>
Removes a specified user from a specified Group.
Trait Implementations
impl<'t, T> BaseRequest for GroupsRequestBuilder<'t, T> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
fn auth(&self) -> &str
[src]
fn url(&self) -> &str
[src]
fn method(&self) -> Method
[src]
fn body(&self) -> Option<String>
[src]
impl<'t, T> DomoRequest<T> for GroupsRequestBuilder<'t, T> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
fn run(&self) -> Result<T, PitchforkError> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
fn retrieve_and_deserialize_json(&self) -> Result<T, PitchforkError> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
fn send_csv(&self) -> Result<Response, PitchforkError>
[src]
fn send_json(&self) -> Result<Response, PitchforkError>
[src]
impl<'t, T> From<DomoRequestBuilder<'t, T>> for GroupsRequestBuilder<'t, T> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
fn from(drb: DomoRequestBuilder<'t, T>) -> Self
[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,
T: RefUnwindSafe,
impl<'t, T> RefUnwindSafe for GroupsRequestBuilder<'t, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,