Struct gapi_grpc::google::cloud::retail::v2alpha::UserInfo[][src]

pub struct UserInfo {
    pub user_id: String,
    pub ip_address: String,
    pub user_agent: String,
    pub direct_user_request: bool,
}

Information of an end user.

Fields

user_id: String

Highly recommended for logged-in users. Unique identifier for logged-in user, such as a user name.

The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

ip_address: String

The end user’s IP address. This field is used to extract location information for personalization.

This field must be either an IPv4 address (e.g. “104.133.9.80”) or an IPv6 address (e.g. “2001:0db8:85a3:0000:0000:8a2e:0370:7334”). Otherwise, an INVALID_ARGUMENT error is returned.

This should not be set when using the JavaScript tag in [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent] or if [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request] is set.

user_agent: String

User agent as included in the HTTP header.

The field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.

This should not be set when using the client side event reporting with GTM or JavaScript tag in [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent] or if [direct_user_request][google.cloud.retail.v2alpha.UserInfo.direct_user_request] is set.

direct_user_request: bool

True if the request is made directly from the end user, in which case the [ip_address][google.cloud.retail.v2alpha.UserInfo.ip_address] and [user_agent][google.cloud.retail.v2alpha.UserInfo.user_agent] can be populated from the HTTP request. This flag should be set only if the API request is made directly from the end user such as a mobile app (and not if a gateway or a server is processing and pushing the user events).

This should not be set when using the JavaScript tag in [UserEventService.CollectUserEvent][google.cloud.retail.v2alpha.UserEventService.CollectUserEvent].

Trait Implementations

impl Clone for UserInfo[src]

impl Debug for UserInfo[src]

impl Default for UserInfo[src]

impl Message for UserInfo[src]

impl PartialEq<UserInfo> for UserInfo[src]

impl StructuralPartialEq for UserInfo[src]

Auto Trait Implementations

impl RefUnwindSafe for UserInfo

impl Send for UserInfo

impl Sync for UserInfo

impl Unpin for UserInfo

impl UnwindSafe for UserInfo

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> WithSubscriber for T[src]