pub struct Users {
pub client: Client,
}Fields§
§client: ClientImplementations§
Source§impl Users
impl Users
Sourcepub async fn get_settings_v_3_get_page<'a>(
&'a self,
after: Option<String>,
limit: Option<i32>,
) -> Result<CollectionResponsePublicUserForwardPaging, Error>
pub async fn get_settings_v_3_get_page<'a>( &'a self, after: Option<String>, limit: Option<i32>, ) -> Result<CollectionResponsePublicUserForwardPaging, Error>
Retrieves a list of users from an account
Retrieves a list of users from an account
Parameters:
after: Option<String>: Results will display maximum 100 users per page. Additional results will be on the next page.limit: Option<i32>: The number of users to retrieve
async fn example_users_get_settings_v_3_get_page() -> anyhow::Result<()> {
let client = hubspot_users::Client::new_from_env();
let result: hubspot_users::types::CollectionResponsePublicUserForwardPaging = client
.users()
.get_settings_v_3_get_page(Some("some-string".to_string()), Some(4 as i32))
.await?;
println!("{:?}", result);
Ok(())
}Sourcepub async fn post_settings_v_3_create<'a>(
&'a self,
body: &UserProvisionRequest,
) -> Result<PublicUser, Error>
pub async fn post_settings_v_3_create<'a>( &'a self, body: &UserProvisionRequest, ) -> Result<PublicUser, Error>
Adds a user
New users will only have minimal permissions, which is contacts-base. A welcome email will prompt them to set a password and log in to HubSpot.
async fn example_users_post_settings_v_3_create() -> anyhow::Result<()> {
let client = hubspot_users::Client::new_from_env();
let result: hubspot_users::types::PublicUser = client
.users()
.post_settings_v_3_create(&hubspot_users::types::UserProvisionRequest {
first_name: Some("some-string".to_string()),
last_name: Some("some-string".to_string()),
primary_team_id: Some("some-string".to_string()),
send_welcome_email: Some(false),
role_id: Some("some-string".to_string()),
secondary_team_ids: Some(vec!["some-string".to_string()]),
email: "some-string".to_string(),
})
.await?;
println!("{:?}", result);
Ok(())
}Sourcepub async fn get_settings_v_3_id_get_by_id<'a>(
&'a self,
id_property: Option<IdProperty>,
user_id: &'a str,
) -> Result<PublicUser, Error>
pub async fn get_settings_v_3_id_get_by_id<'a>( &'a self, id_property: Option<IdProperty>, user_id: &'a str, ) -> Result<PublicUser, Error>
Retrieves a user
Retrieves a user identified by userId. userId refers to the user’s ID by default, or optionally email as specified by the IdProperty query param.
Parameters:
id_property: Option<crate::types::IdProperty>: The name of a property with unique user values. Valid values areUSER_ID(default) orEMAILuser_id: &'astr: Identifier of user to retrieve (required)
async fn example_users_get_settings_v_3_id_get_by_id() -> anyhow::Result<()> {
let client = hubspot_users::Client::new_from_env();
let result: hubspot_users::types::PublicUser = client
.users()
.get_settings_v_3_id_get_by_id(Some(hubspot_users::types::IdProperty::Email), "some-string")
.await?;
println!("{:?}", result);
Ok(())
}Sourcepub async fn put_settings_v_3_id_replace<'a>(
&'a self,
id_property: Option<IdProperty>,
user_id: &'a str,
body: &PublicUserUpdate,
) -> Result<PublicUser, Error>
pub async fn put_settings_v_3_id_replace<'a>( &'a self, id_property: Option<IdProperty>, user_id: &'a str, body: &PublicUserUpdate, ) -> Result<PublicUser, Error>
Modifies a user
Modifies a user identified by userId. userId refers to the user’s ID by default, or optionally email as specified by the IdProperty query param.
Parameters:
id_property: Option<crate::types::IdProperty>: The name of a property with unique user values. Valid values areUSER_ID(default) orEMAILuser_id: &'astr: Identifier of user to retrieve (required)
async fn example_users_put_settings_v_3_id_replace() -> anyhow::Result<()> {
let client = hubspot_users::Client::new_from_env();
let result: hubspot_users::types::PublicUser = client
.users()
.put_settings_v_3_id_replace(
Some(hubspot_users::types::IdProperty::Email),
"some-string",
&hubspot_users::types::PublicUserUpdate {
first_name: Some("some-string".to_string()),
last_name: Some("some-string".to_string()),
primary_team_id: Some("some-string".to_string()),
role_id: Some("some-string".to_string()),
secondary_team_ids: Some(vec!["some-string".to_string()]),
},
)
.await?;
println!("{:?}", result);
Ok(())
}Sourcepub async fn delete_settings_v_3_id_archive<'a>(
&'a self,
id_property: Option<IdProperty>,
user_id: &'a str,
) -> Result<(), Error>
pub async fn delete_settings_v_3_id_archive<'a>( &'a self, id_property: Option<IdProperty>, user_id: &'a str, ) -> Result<(), Error>
Removes a user
Removes a user identified by userId. userId refers to the user’s ID by default, or optionally email as specified by the IdProperty query param.
Parameters:
id_property: Option<crate::types::IdProperty>: The name of a property with unique user values. Valid values areUSER_ID(default) orEMAILuser_id: &'astr: Identifier of user to delete (required)
async fn example_users_delete_settings_v_3_id_archive() -> anyhow::Result<()> {
let client = hubspot_users::Client::new_from_env();
client
.users()
.delete_settings_v_3_id_archive(Some(hubspot_users::types::IdProperty::Email), "some-string")
.await?;
Ok(())
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Users
impl !RefUnwindSafe for Users
impl Send for Users
impl Sync for Users
impl Unpin for Users
impl !UnwindSafe for Users
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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