pub struct UserUpdateBuilder { /* private fields */ }Expand description
Builder for UserUpdateRequest.
Implementations§
Source§impl UserUpdateBuilder
impl UserUpdateBuilder
Sourcepub fn user_id<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn user_id<VALUE: Into<String>>(self, value: VALUE) -> Self
User identifier (not serialized)
Sourcepub fn role<VALUE: Into<UserRole>>(self, value: VALUE) -> Self
pub fn role<VALUE: Into<UserRole>>(self, value: VALUE) -> Self
New role for the user (cannot be “admin”)
Sourcepub fn credentials<VALUE: Into<Credentials>>(self, value: VALUE) -> Self
pub fn credentials<VALUE: Into<Credentials>>(self, value: VALUE) -> Self
Credentials for authentication (not serialized)
Sourcepub fn build(self) -> Result<UserUpdateRequest, UserUpdateBuilderError>
pub fn build(self) -> Result<UserUpdateRequest, UserUpdateBuilderError>
Source§impl UserUpdateBuilder
impl UserUpdateBuilder
Sourcepub async fn create(self) -> ApiResponseOrError<User>
pub async fn create(self) -> ApiResponseOrError<User>
Creates a new user update request and returns the response.
This is a convenience method that builds the request from the builder and sends it to the Users API.
§Example
let credentials = Credentials::from_env();
let updated_user = User::update_builder("user_123456789")
.credentials(credentials)
.role(UserRole::Developer)
.create()
.await?;Trait Implementations§
Source§impl Clone for UserUpdateBuilder
impl Clone for UserUpdateBuilder
Source§fn clone(&self) -> UserUpdateBuilder
fn clone(&self) -> UserUpdateBuilder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UserUpdateBuilder
impl Debug for UserUpdateBuilder
Source§impl Default for UserUpdateBuilder
impl Default for UserUpdateBuilder
Source§impl PartialEq for UserUpdateBuilder
impl PartialEq for UserUpdateBuilder
impl StructuralPartialEq for UserUpdateBuilder
Auto Trait Implementations§
impl Freeze for UserUpdateBuilder
impl RefUnwindSafe for UserUpdateBuilder
impl Send for UserUpdateBuilder
impl Sync for UserUpdateBuilder
impl Unpin for UserUpdateBuilder
impl UnwindSafe for UserUpdateBuilder
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
Mutably borrows from an owned value. Read more