/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.discoveryengine.v1alpha.model;

/**
 * UserEvent captures all metadata information Discovery Engine API needs to know about how end
 * users interact with customers' website.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Discovery Engine API. For a detailed explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class GoogleCloudDiscoveryengineV1alphaUserEvent extends com.google.api.client.json.GenericJson {

  /**
   * Extra user event features to include in the recommendation model. These attributes must NOT
   * contain data that needs to be parsed or processed further, e.g. JSON or other encodings. If you
   * provide custom attributes for ingested user events, also include them in the user events that
   * you associate with prediction requests. Custom attribute formatting must be consistent between
   * imported events and events provided with prediction requests. This lets the Discovery Engine
   * API use those custom attributes when training models and serving predictions, which helps
   * improve recommendation quality. This field needs to pass all below criteria, otherwise an
   * `INVALID_ARGUMENT` error is returned: * The key must be a UTF-8 encoded string with a length
   * limit of 5,000 characters. * For text attributes, at most 400 values are allowed. Empty values
   * are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256
   * characters. * For number attributes, at most 400 values are allowed. For product
   * recommendations, an example of extra user information is `traffic_channel`, which is how a user
   * arrives at the site. Users can arrive at the site by coming to the site directly, coming
   * through Google search, or in other ways.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.Map<String, GoogleCloudDiscoveryengineV1alphaCustomAttribute> attributes;

  static {
    // hack to force ProGuard to consider GoogleCloudDiscoveryengineV1alphaCustomAttribute used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(GoogleCloudDiscoveryengineV1alphaCustomAttribute.class);
  }

  /**
   * Token to attribute an API response to user action(s) to trigger the event. Highly recommended
   * for user events that are the result of RecommendationService.Recommend. This field enables
   * accurate attribution of recommendation model performance. The value must be one of: *
   * RecommendResponse.attribution_token for events that are the result of
   * RecommendationService.Recommend. * SearchResponse.attribution_token for events that are the
   * result of SearchService.Search. This token enables us to accurately attribute page view or
   * conversion completion back to the event and the particular predict response containing this
   * clicked/purchased product. If user clicks on product K in the recommendation results, pass
   * RecommendResponse.attribution_token as a URL parameter to product K's page. When recording
   * events on product K's page, log the RecommendResponse.attribution_token to this field.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String attributionToken;

  /**
   * CompletionService.CompleteQuery details related to the event. This field should be set for
   * `search` event when autocomplete function is enabled and the user clicks a suggestion for
   * search.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDiscoveryengineV1alphaCompletionInfo completionInfo;

  /**
   * Should set to true if the request is made directly from the end user, in which case the
   * UserEvent.user_info.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.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean directUserRequest;

  /**
   * List of Documents associated with this user event. This field is optional except for the
   * following event types: * `view-item` * `add-to-cart` * `purchase` * `media-play` * `media-
   * complete` In a `search` event, this field represents the documents returned to the end user on
   * the current page (the end user may have not finished browsing the whole page yet). When a new
   * page is returned to the end user, after pagination/filtering/ordering even for the same query,
   * a new `search` event with different UserEvent.documents is desired.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<GoogleCloudDiscoveryengineV1alphaDocumentInfo> documents;

  static {
    // hack to force ProGuard to consider GoogleCloudDiscoveryengineV1alphaDocumentInfo used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(GoogleCloudDiscoveryengineV1alphaDocumentInfo.class);
  }

  /**
   * Only required for UserEventService.ImportUserEvents method. Timestamp of when the user event
   * happened.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private String eventTime;

  /**
   * Required. User event type. Allowed values are: Generic values: * `search`: Search for
   * Documents. * `view-item`: Detailed page view of a Document. * `view-item-list`: View of a panel
   * or ordered list of Documents. * `view-home-page`: View of the home page. * `view-category-
   * page`: View of a category page, e.g. Home > Men > Jeans Retail-related values: * `add-to-cart`:
   * Add an item(s) to cart, e.g. in Retail online shopping * `purchase`: Purchase an item(s) Media-
   * related values: * `media-play`: Start/resume watching a video, playing a song, etc. * `media-
   * complete`: Finished or stopped midway through a video, song, etc.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String eventType;

  /**
   * The filter syntax consists of an expression language for constructing a predicate from one or
   * more fields of the documents being filtered. One example is for `search` events, the associated
   * SearchRequest may contain a filter expression in SearchRequest.filter conforming to
   * https://google.aip.dev/160#filtering. Similarly, for `view-item-list` events that are generated
   * from a RecommendationService.RecommendRequest, this field may be populated directly from
   * RecommendationService.RecommendRequest.filter conforming to
   * https://google.aip.dev/160#filtering. The value must be a UTF-8 encoded string with a length
   * limit of 1,000 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String filter;

  /**
   * Media-specific info.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDiscoveryengineV1alphaMediaInfo mediaInfo;

  /**
   * Page metadata such as categories and other critical information for certain event types such as
   * `view-category-page`.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDiscoveryengineV1alphaPageInfo pageInfo;

  /**
   * Panel metadata associated with this user event.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDiscoveryengineV1alphaPanelInfo panel;

  /**
   * The promotion IDs if this is an event associated with promotions. Currently, this field is
   * restricted to at most one ID.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.String> promotionIds;

  /**
   * SearchService.Search details related to the event. This field should be set for `search` event.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDiscoveryengineV1alphaSearchInfo searchInfo;

  /**
   * A unique identifier for tracking a visitor session with a length limit of 128 bytes. A session
   * is an aggregation of an end user behavior in a time span. A general guideline to populate the
   * session_id: 1. If user has no activity for 30 min, a new session_id should be assigned. 2. The
   * session_id should be unique across users, suggest use uuid or add UserEvent.user_pseudo_id as
   * prefix.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String sessionId;

  /**
   * A list of identifiers for the independent experiment groups this user event belongs to. This is
   * used to distinguish between user events associated with different experiment setups on the
   * customer end.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.String> tagIds;

  /**
   * The transaction metadata (if any) associated with this user event.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDiscoveryengineV1alphaTransactionInfo transactionInfo;

  /**
   * Information about the end user.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDiscoveryengineV1alphaUserInfo userInfo;

  /**
   * Required. A unique identifier for tracking visitors. For example, this could be implemented
   * with an HTTP cookie, which should be able to uniquely identify a visitor on a single device.
   * This unique identifier should not change if the visitor log in/out of the website. Do not set
   * the field to the same fixed ID for different users. This mixes the event history of those users
   * together, which results in degraded model quality. The field must be a UTF-8 encoded string
   * with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. The
   * field should not contain PII or user-data. We recommend to use Google Analytics [Client
   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-
   * reference#clientId) for this field.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String userPseudoId;

  /**
   * Extra user event features to include in the recommendation model. These attributes must NOT
   * contain data that needs to be parsed or processed further, e.g. JSON or other encodings. If you
   * provide custom attributes for ingested user events, also include them in the user events that
   * you associate with prediction requests. Custom attribute formatting must be consistent between
   * imported events and events provided with prediction requests. This lets the Discovery Engine
   * API use those custom attributes when training models and serving predictions, which helps
   * improve recommendation quality. This field needs to pass all below criteria, otherwise an
   * `INVALID_ARGUMENT` error is returned: * The key must be a UTF-8 encoded string with a length
   * limit of 5,000 characters. * For text attributes, at most 400 values are allowed. Empty values
   * are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256
   * characters. * For number attributes, at most 400 values are allowed. For product
   * recommendations, an example of extra user information is `traffic_channel`, which is how a user
   * arrives at the site. Users can arrive at the site by coming to the site directly, coming
   * through Google search, or in other ways.
   * @return value or {@code null} for none
   */
  public java.util.Map<String, GoogleCloudDiscoveryengineV1alphaCustomAttribute> getAttributes() {
    return attributes;
  }

  /**
   * Extra user event features to include in the recommendation model. These attributes must NOT
   * contain data that needs to be parsed or processed further, e.g. JSON or other encodings. If you
   * provide custom attributes for ingested user events, also include them in the user events that
   * you associate with prediction requests. Custom attribute formatting must be consistent between
   * imported events and events provided with prediction requests. This lets the Discovery Engine
   * API use those custom attributes when training models and serving predictions, which helps
   * improve recommendation quality. This field needs to pass all below criteria, otherwise an
   * `INVALID_ARGUMENT` error is returned: * The key must be a UTF-8 encoded string with a length
   * limit of 5,000 characters. * For text attributes, at most 400 values are allowed. Empty values
   * are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256
   * characters. * For number attributes, at most 400 values are allowed. For product
   * recommendations, an example of extra user information is `traffic_channel`, which is how a user
   * arrives at the site. Users can arrive at the site by coming to the site directly, coming
   * through Google search, or in other ways.
   * @param attributes attributes or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setAttributes(java.util.Map<String, GoogleCloudDiscoveryengineV1alphaCustomAttribute> attributes) {
    this.attributes = attributes;
    return this;
  }

  /**
   * Token to attribute an API response to user action(s) to trigger the event. Highly recommended
   * for user events that are the result of RecommendationService.Recommend. This field enables
   * accurate attribution of recommendation model performance. The value must be one of: *
   * RecommendResponse.attribution_token for events that are the result of
   * RecommendationService.Recommend. * SearchResponse.attribution_token for events that are the
   * result of SearchService.Search. This token enables us to accurately attribute page view or
   * conversion completion back to the event and the particular predict response containing this
   * clicked/purchased product. If user clicks on product K in the recommendation results, pass
   * RecommendResponse.attribution_token as a URL parameter to product K's page. When recording
   * events on product K's page, log the RecommendResponse.attribution_token to this field.
   * @return value or {@code null} for none
   */
  public java.lang.String getAttributionToken() {
    return attributionToken;
  }

  /**
   * Token to attribute an API response to user action(s) to trigger the event. Highly recommended
   * for user events that are the result of RecommendationService.Recommend. This field enables
   * accurate attribution of recommendation model performance. The value must be one of: *
   * RecommendResponse.attribution_token for events that are the result of
   * RecommendationService.Recommend. * SearchResponse.attribution_token for events that are the
   * result of SearchService.Search. This token enables us to accurately attribute page view or
   * conversion completion back to the event and the particular predict response containing this
   * clicked/purchased product. If user clicks on product K in the recommendation results, pass
   * RecommendResponse.attribution_token as a URL parameter to product K's page. When recording
   * events on product K's page, log the RecommendResponse.attribution_token to this field.
   * @param attributionToken attributionToken or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setAttributionToken(java.lang.String attributionToken) {
    this.attributionToken = attributionToken;
    return this;
  }

  /**
   * CompletionService.CompleteQuery details related to the event. This field should be set for
   * `search` event when autocomplete function is enabled and the user clicks a suggestion for
   * search.
   * @return value or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaCompletionInfo getCompletionInfo() {
    return completionInfo;
  }

  /**
   * CompletionService.CompleteQuery details related to the event. This field should be set for
   * `search` event when autocomplete function is enabled and the user clicks a suggestion for
   * search.
   * @param completionInfo completionInfo or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setCompletionInfo(GoogleCloudDiscoveryengineV1alphaCompletionInfo completionInfo) {
    this.completionInfo = completionInfo;
    return this;
  }

  /**
   * Should set to true if the request is made directly from the end user, in which case the
   * UserEvent.user_info.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.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getDirectUserRequest() {
    return directUserRequest;
  }

  /**
   * Should set to true if the request is made directly from the end user, in which case the
   * UserEvent.user_info.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.
   * @param directUserRequest directUserRequest or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setDirectUserRequest(java.lang.Boolean directUserRequest) {
    this.directUserRequest = directUserRequest;
    return this;
  }

  /**
   * List of Documents associated with this user event. This field is optional except for the
   * following event types: * `view-item` * `add-to-cart` * `purchase` * `media-play` * `media-
   * complete` In a `search` event, this field represents the documents returned to the end user on
   * the current page (the end user may have not finished browsing the whole page yet). When a new
   * page is returned to the end user, after pagination/filtering/ordering even for the same query,
   * a new `search` event with different UserEvent.documents is desired.
   * @return value or {@code null} for none
   */
  public java.util.List<GoogleCloudDiscoveryengineV1alphaDocumentInfo> getDocuments() {
    return documents;
  }

  /**
   * List of Documents associated with this user event. This field is optional except for the
   * following event types: * `view-item` * `add-to-cart` * `purchase` * `media-play` * `media-
   * complete` In a `search` event, this field represents the documents returned to the end user on
   * the current page (the end user may have not finished browsing the whole page yet). When a new
   * page is returned to the end user, after pagination/filtering/ordering even for the same query,
   * a new `search` event with different UserEvent.documents is desired.
   * @param documents documents or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setDocuments(java.util.List<GoogleCloudDiscoveryengineV1alphaDocumentInfo> documents) {
    this.documents = documents;
    return this;
  }

  /**
   * Only required for UserEventService.ImportUserEvents method. Timestamp of when the user event
   * happened.
   * @return value or {@code null} for none
   */
  public String getEventTime() {
    return eventTime;
  }

  /**
   * Only required for UserEventService.ImportUserEvents method. Timestamp of when the user event
   * happened.
   * @param eventTime eventTime or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setEventTime(String eventTime) {
    this.eventTime = eventTime;
    return this;
  }

  /**
   * Required. User event type. Allowed values are: Generic values: * `search`: Search for
   * Documents. * `view-item`: Detailed page view of a Document. * `view-item-list`: View of a panel
   * or ordered list of Documents. * `view-home-page`: View of the home page. * `view-category-
   * page`: View of a category page, e.g. Home > Men > Jeans Retail-related values: * `add-to-cart`:
   * Add an item(s) to cart, e.g. in Retail online shopping * `purchase`: Purchase an item(s) Media-
   * related values: * `media-play`: Start/resume watching a video, playing a song, etc. * `media-
   * complete`: Finished or stopped midway through a video, song, etc.
   * @return value or {@code null} for none
   */
  public java.lang.String getEventType() {
    return eventType;
  }

  /**
   * Required. User event type. Allowed values are: Generic values: * `search`: Search for
   * Documents. * `view-item`: Detailed page view of a Document. * `view-item-list`: View of a panel
   * or ordered list of Documents. * `view-home-page`: View of the home page. * `view-category-
   * page`: View of a category page, e.g. Home > Men > Jeans Retail-related values: * `add-to-cart`:
   * Add an item(s) to cart, e.g. in Retail online shopping * `purchase`: Purchase an item(s) Media-
   * related values: * `media-play`: Start/resume watching a video, playing a song, etc. * `media-
   * complete`: Finished or stopped midway through a video, song, etc.
   * @param eventType eventType or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setEventType(java.lang.String eventType) {
    this.eventType = eventType;
    return this;
  }

  /**
   * The filter syntax consists of an expression language for constructing a predicate from one or
   * more fields of the documents being filtered. One example is for `search` events, the associated
   * SearchRequest may contain a filter expression in SearchRequest.filter conforming to
   * https://google.aip.dev/160#filtering. Similarly, for `view-item-list` events that are generated
   * from a RecommendationService.RecommendRequest, this field may be populated directly from
   * RecommendationService.RecommendRequest.filter conforming to
   * https://google.aip.dev/160#filtering. The value must be a UTF-8 encoded string with a length
   * limit of 1,000 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
   * @return value or {@code null} for none
   */
  public java.lang.String getFilter() {
    return filter;
  }

  /**
   * The filter syntax consists of an expression language for constructing a predicate from one or
   * more fields of the documents being filtered. One example is for `search` events, the associated
   * SearchRequest may contain a filter expression in SearchRequest.filter conforming to
   * https://google.aip.dev/160#filtering. Similarly, for `view-item-list` events that are generated
   * from a RecommendationService.RecommendRequest, this field may be populated directly from
   * RecommendationService.RecommendRequest.filter conforming to
   * https://google.aip.dev/160#filtering. The value must be a UTF-8 encoded string with a length
   * limit of 1,000 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
   * @param filter filter or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setFilter(java.lang.String filter) {
    this.filter = filter;
    return this;
  }

  /**
   * Media-specific info.
   * @return value or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaMediaInfo getMediaInfo() {
    return mediaInfo;
  }

  /**
   * Media-specific info.
   * @param mediaInfo mediaInfo or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setMediaInfo(GoogleCloudDiscoveryengineV1alphaMediaInfo mediaInfo) {
    this.mediaInfo = mediaInfo;
    return this;
  }

  /**
   * Page metadata such as categories and other critical information for certain event types such as
   * `view-category-page`.
   * @return value or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaPageInfo getPageInfo() {
    return pageInfo;
  }

  /**
   * Page metadata such as categories and other critical information for certain event types such as
   * `view-category-page`.
   * @param pageInfo pageInfo or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setPageInfo(GoogleCloudDiscoveryengineV1alphaPageInfo pageInfo) {
    this.pageInfo = pageInfo;
    return this;
  }

  /**
   * Panel metadata associated with this user event.
   * @return value or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaPanelInfo getPanel() {
    return panel;
  }

  /**
   * Panel metadata associated with this user event.
   * @param panel panel or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setPanel(GoogleCloudDiscoveryengineV1alphaPanelInfo panel) {
    this.panel = panel;
    return this;
  }

  /**
   * The promotion IDs if this is an event associated with promotions. Currently, this field is
   * restricted to at most one ID.
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.String> getPromotionIds() {
    return promotionIds;
  }

  /**
   * The promotion IDs if this is an event associated with promotions. Currently, this field is
   * restricted to at most one ID.
   * @param promotionIds promotionIds or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setPromotionIds(java.util.List<java.lang.String> promotionIds) {
    this.promotionIds = promotionIds;
    return this;
  }

  /**
   * SearchService.Search details related to the event. This field should be set for `search` event.
   * @return value or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaSearchInfo getSearchInfo() {
    return searchInfo;
  }

  /**
   * SearchService.Search details related to the event. This field should be set for `search` event.
   * @param searchInfo searchInfo or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setSearchInfo(GoogleCloudDiscoveryengineV1alphaSearchInfo searchInfo) {
    this.searchInfo = searchInfo;
    return this;
  }

  /**
   * A unique identifier for tracking a visitor session with a length limit of 128 bytes. A session
   * is an aggregation of an end user behavior in a time span. A general guideline to populate the
   * session_id: 1. If user has no activity for 30 min, a new session_id should be assigned. 2. The
   * session_id should be unique across users, suggest use uuid or add UserEvent.user_pseudo_id as
   * prefix.
   * @return value or {@code null} for none
   */
  public java.lang.String getSessionId() {
    return sessionId;
  }

  /**
   * A unique identifier for tracking a visitor session with a length limit of 128 bytes. A session
   * is an aggregation of an end user behavior in a time span. A general guideline to populate the
   * session_id: 1. If user has no activity for 30 min, a new session_id should be assigned. 2. The
   * session_id should be unique across users, suggest use uuid or add UserEvent.user_pseudo_id as
   * prefix.
   * @param sessionId sessionId or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setSessionId(java.lang.String sessionId) {
    this.sessionId = sessionId;
    return this;
  }

  /**
   * A list of identifiers for the independent experiment groups this user event belongs to. This is
   * used to distinguish between user events associated with different experiment setups on the
   * customer end.
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.String> getTagIds() {
    return tagIds;
  }

  /**
   * A list of identifiers for the independent experiment groups this user event belongs to. This is
   * used to distinguish between user events associated with different experiment setups on the
   * customer end.
   * @param tagIds tagIds or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setTagIds(java.util.List<java.lang.String> tagIds) {
    this.tagIds = tagIds;
    return this;
  }

  /**
   * The transaction metadata (if any) associated with this user event.
   * @return value or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaTransactionInfo getTransactionInfo() {
    return transactionInfo;
  }

  /**
   * The transaction metadata (if any) associated with this user event.
   * @param transactionInfo transactionInfo or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setTransactionInfo(GoogleCloudDiscoveryengineV1alphaTransactionInfo transactionInfo) {
    this.transactionInfo = transactionInfo;
    return this;
  }

  /**
   * Information about the end user.
   * @return value or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserInfo getUserInfo() {
    return userInfo;
  }

  /**
   * Information about the end user.
   * @param userInfo userInfo or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setUserInfo(GoogleCloudDiscoveryengineV1alphaUserInfo userInfo) {
    this.userInfo = userInfo;
    return this;
  }

  /**
   * Required. A unique identifier for tracking visitors. For example, this could be implemented
   * with an HTTP cookie, which should be able to uniquely identify a visitor on a single device.
   * This unique identifier should not change if the visitor log in/out of the website. Do not set
   * the field to the same fixed ID for different users. This mixes the event history of those users
   * together, which results in degraded model quality. The field must be a UTF-8 encoded string
   * with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. The
   * field should not contain PII or user-data. We recommend to use Google Analytics [Client
   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-
   * reference#clientId) for this field.
   * @return value or {@code null} for none
   */
  public java.lang.String getUserPseudoId() {
    return userPseudoId;
  }

  /**
   * Required. A unique identifier for tracking visitors. For example, this could be implemented
   * with an HTTP cookie, which should be able to uniquely identify a visitor on a single device.
   * This unique identifier should not change if the visitor log in/out of the website. Do not set
   * the field to the same fixed ID for different users. This mixes the event history of those users
   * together, which results in degraded model quality. The field must be a UTF-8 encoded string
   * with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. The
   * field should not contain PII or user-data. We recommend to use Google Analytics [Client
   * ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-
   * reference#clientId) for this field.
   * @param userPseudoId userPseudoId or {@code null} for none
   */
  public GoogleCloudDiscoveryengineV1alphaUserEvent setUserPseudoId(java.lang.String userPseudoId) {
    this.userPseudoId = userPseudoId;
    return this;
  }

  @Override
  public GoogleCloudDiscoveryengineV1alphaUserEvent set(String fieldName, Object value) {
    return (GoogleCloudDiscoveryengineV1alphaUserEvent) super.set(fieldName, value);
  }

  @Override
  public GoogleCloudDiscoveryengineV1alphaUserEvent clone() {
    return (GoogleCloudDiscoveryengineV1alphaUserEvent) super.clone();
  }

}
