pub struct Groups {
pub client: Client,
}requests only.Fields§
§client: ClientImplementations§
Source§impl Groups
impl Groups
Sourcepub async fn get<'a>(&'a self) -> Result<Vec<Group>, Error>
pub async fn get<'a>(&'a self) -> Result<Vec<Group>, Error>
GET Groups
Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.
Lists the current third-party groups for an organization.
async fn example_groups_get() -> anyhow::Result<()> {
let client = rippling_base_api::Client::new_from_env();
let result: Vec<rippling_base_api::types::Group> = client.groups().get().await?;
println!("{:?}", result);
Ok(())
}Sourcepub async fn post<'a>(
&'a self,
body: &PostGroupsRequestBody,
) -> Result<Group, Error>
pub async fn post<'a>( &'a self, body: &PostGroupsRequestBody, ) -> Result<Group, Error>
POST Groups
Creates a generic group, that can be associated within the third-party application.
async fn example_groups_post() -> anyhow::Result<()> {
let client = rippling_base_api::Client::new_from_env();
let result: rippling_base_api::types::Group = client
.groups()
.post(&rippling_base_api::types::PostGroupsRequestBody {
name: Some("some-string".to_string()),
spoke_id: Some("some-string".to_string()),
users: Some(vec!["some-string".to_string()]),
})
.await?;
println!("{:?}", result);
Ok(())
}Sourcepub async fn get_id<'a>(
&'a self,
group_id: i64,
body: &GroupUpdatePayload,
) -> Result<Group, Error>
pub async fn get_id<'a>( &'a self, group_id: i64, body: &GroupUpdatePayload, ) -> Result<Group, Error>
GET Group
Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.
Parameters:
group_id: i64: Unique identifier for the group within Rippling. (required)
async fn example_groups_get_id() -> anyhow::Result<()> {
let client = rippling_base_api::Client::new_from_env();
let result: rippling_base_api::types::Group = client
.groups()
.get_id(
4 as i64,
&rippling_base_api::types::GroupUpdatePayload {
name: Some("some-string".to_string()),
spoke_id: Some("some-string".to_string()),
users: Some(vec![serde_json::Value::String("some-string".to_string())]),
version: Some("some-string".to_string()),
},
)
.await?;
println!("{:?}", result);
Ok(())
}Sourcepub async fn put_id<'a>(
&'a self,
group_id: i64,
body: &GroupUpdatePayload,
) -> Result<Group, Error>
pub async fn put_id<'a>( &'a self, group_id: i64, body: &GroupUpdatePayload, ) -> Result<Group, Error>
PUT Group
Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.
Using the PUT method, all of the group fields will be updated, even if the corresponding parameter is missing. If the PATCH method is used, and a param is missing, its value won’t be changed.
Parameters:
group_id: i64: Unique identifier for the group within Rippling. (required)
async fn example_groups_put_id() -> anyhow::Result<()> {
let client = rippling_base_api::Client::new_from_env();
let result: rippling_base_api::types::Group = client
.groups()
.put_id(
4 as i64,
&rippling_base_api::types::GroupUpdatePayload {
name: Some("some-string".to_string()),
spoke_id: Some("some-string".to_string()),
users: Some(vec![serde_json::Value::String("some-string".to_string())]),
version: Some("some-string".to_string()),
},
)
.await?;
println!("{:?}", result);
Ok(())
}Sourcepub async fn delete_id<'a>(&'a self, group_id: i64) -> Result<(), Error>
pub async fn delete_id<'a>(&'a self, group_id: i64) -> Result<(), Error>
DELETE Group
Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.
Deletes the specified group.
Parameters:
group_id: i64: Unique identifier for the group within Rippling. (required)
async fn example_groups_delete_id() -> anyhow::Result<()> {
let client = rippling_base_api::Client::new_from_env();
client.groups().delete_id(4 as i64).await?;
Ok(())
}Sourcepub async fn patch_id<'a>(
&'a self,
group_id: i64,
body: &GroupUpdatePayload,
) -> Result<Group, Error>
pub async fn patch_id<'a>( &'a self, group_id: i64, body: &GroupUpdatePayload, ) -> Result<Group, Error>
PATCH Group
Please note, the Groups endpoint requires an OAuth application (i.e. approved 3rd party partners), as the end point is intended for mapping third-party application “Groups” within Rippling organizations.
Using the PUT method, all of the group fields will be updated, even if the corresponding parameter is missing. If the PATCH method is used, and a param is missing, its value won’t be changed.
Parameters:
group_id: i64: Unique identifier for the group within Rippling. (required)
async fn example_groups_patch_id() -> anyhow::Result<()> {
let client = rippling_base_api::Client::new_from_env();
let result: rippling_base_api::types::Group = client
.groups()
.patch_id(
4 as i64,
&rippling_base_api::types::GroupUpdatePayload {
name: Some("some-string".to_string()),
spoke_id: Some("some-string".to_string()),
users: Some(vec![serde_json::Value::String("some-string".to_string())]),
version: Some("some-string".to_string()),
},
)
.await?;
println!("{:?}", result);
Ok(())
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Groups
impl !RefUnwindSafe for Groups
impl Send for Groups
impl Sync for Groups
impl Unpin for Groups
impl !UnwindSafe for Groups
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more