pub struct AssociatedUser {
pub id: u64,
pub first_name: String,
pub last_name: String,
pub email: String,
pub email_verified: bool,
pub account_owner: bool,
pub locale: String,
pub collaborator: bool,
}Expand description
Represents a Shopify user associated with an online session.
This struct holds information about the user who authorized an app during the OAuth flow when using online access tokens.
§Thread Safety
AssociatedUser is Send + Sync, making it safe to share across threads.
§Serialization
The struct derives Serialize and Deserialize for easy storage and
transmission in JSON format.
§Example
use shopify_sdk::AssociatedUser;
let user = AssociatedUser::new(
12345,
"Jane".to_string(),
"Doe".to_string(),
"jane@example.com".to_string(),
true,
false,
"en".to_string(),
false,
);
// Serialize to JSON
let json = serde_json::to_string(&user).unwrap();
assert!(json.contains("12345"));
// Deserialize from JSON
let restored: AssociatedUser = serde_json::from_str(&json).unwrap();
assert_eq!(user, restored);Fields§
§id: u64The Shopify user ID (numeric).
first_name: StringThe user’s first name.
last_name: StringThe user’s last name.
email: StringThe user’s email address.
email_verified: boolWhether the user’s email has been verified.
account_owner: boolWhether the user is the account owner.
locale: StringThe user’s locale preference (e.g., “en”, “fr”).
collaborator: boolWhether the user is a collaborator.
Implementations§
Source§impl AssociatedUser
impl AssociatedUser
Sourcepub const fn new(
id: u64,
first_name: String,
last_name: String,
email: String,
email_verified: bool,
account_owner: bool,
locale: String,
collaborator: bool,
) -> Self
pub const fn new( id: u64, first_name: String, last_name: String, email: String, email_verified: bool, account_owner: bool, locale: String, collaborator: bool, ) -> Self
Creates a new AssociatedUser with all required fields.
§Arguments
id- The Shopify user IDfirst_name- The user’s first namelast_name- The user’s last nameemail- The user’s email addressemail_verified- Whether the email has been verifiedaccount_owner- Whether the user is the account ownerlocale- The user’s locale preferencecollaborator- Whether the user is a collaborator
§Example
use shopify_sdk::AssociatedUser;
let user = AssociatedUser::new(
12345,
"Jane".to_string(),
"Doe".to_string(),
"jane@example.com".to_string(),
true,
true,
"en".to_string(),
false,
);Trait Implementations§
Source§impl Clone for AssociatedUser
impl Clone for AssociatedUser
Source§fn clone(&self) -> AssociatedUser
fn clone(&self) -> AssociatedUser
Returns a duplicate 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 AssociatedUser
impl Debug for AssociatedUser
Source§impl<'de> Deserialize<'de> for AssociatedUser
impl<'de> Deserialize<'de> for AssociatedUser
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AssociatedUser
impl PartialEq for AssociatedUser
Source§impl Serialize for AssociatedUser
impl Serialize for AssociatedUser
impl Eq for AssociatedUser
impl StructuralPartialEq for AssociatedUser
Auto Trait Implementations§
impl Freeze for AssociatedUser
impl RefUnwindSafe for AssociatedUser
impl Send for AssociatedUser
impl Sync for AssociatedUser
impl Unpin for AssociatedUser
impl UnwindSafe for AssociatedUser
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.