All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.recommendationengine.v1beta1.UserInfo Maven / Gradle / Ivy

/*
 * Copyright 2024 Google LLC
 *
 * 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
 *
 *     https://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.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/recommendationengine/v1beta1/user_event.proto

// Protobuf Java Version: 3.25.5
package com.google.cloud.recommendationengine.v1beta1;

/**
 *
 *
 * 
 * Information of end users.
 * 
* * Protobuf type {@code google.cloud.recommendationengine.v1beta1.UserInfo} */ public final class UserInfo extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.recommendationengine.v1beta1.UserInfo) UserInfoOrBuilder { private static final long serialVersionUID = 0L; // Use UserInfo.newBuilder() to construct. private UserInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private UserInfo() { visitorId_ = ""; userId_ = ""; ipAddress_ = ""; userAgent_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new UserInfo(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass .internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass .internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.recommendationengine.v1beta1.UserInfo.class, com.google.cloud.recommendationengine.v1beta1.UserInfo.Builder.class); } public static final int VISITOR_ID_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object visitorId_ = ""; /** * * *
   * Required. A unique identifier for tracking visitors with a length limit of
   * 128 bytes.
   *
   * For example, this could be implemented with a 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.
   * Maximum length 128 bytes. Cannot be empty.
   * 
* * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The visitorId. */ @java.lang.Override public java.lang.String getVisitorId() { java.lang.Object ref = visitorId_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); visitorId_ = s; return s; } } /** * * *
   * Required. A unique identifier for tracking visitors with a length limit of
   * 128 bytes.
   *
   * For example, this could be implemented with a 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.
   * Maximum length 128 bytes. Cannot be empty.
   * 
* * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for visitorId. */ @java.lang.Override public com.google.protobuf.ByteString getVisitorIdBytes() { java.lang.Object ref = visitorId_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); visitorId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int USER_ID_FIELD_NUMBER = 2; @SuppressWarnings("serial") private volatile java.lang.Object userId_ = ""; /** * * *
   * Optional. Unique identifier for logged-in user with a length limit of 128
   * bytes. Required only for logged-in users.
   * 
* * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The userId. */ @java.lang.Override public java.lang.String getUserId() { java.lang.Object ref = userId_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); userId_ = s; return s; } } /** * * *
   * Optional. Unique identifier for logged-in user with a length limit of 128
   * bytes. Required only for logged-in users.
   * 
* * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for userId. */ @java.lang.Override public com.google.protobuf.ByteString getUserIdBytes() { java.lang.Object ref = userId_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); userId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int IP_ADDRESS_FIELD_NUMBER = 3; @SuppressWarnings("serial") private volatile java.lang.Object ipAddress_ = ""; /** * * *
   * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
   * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
   * set when using the javascript pixel or if `direct_user_request` is set.
   * Used to extract location information for personalization.
   * 
* * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The ipAddress. */ @java.lang.Override public java.lang.String getIpAddress() { java.lang.Object ref = ipAddress_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); ipAddress_ = s; return s; } } /** * * *
   * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
   * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
   * set when using the javascript pixel or if `direct_user_request` is set.
   * Used to extract location information for personalization.
   * 
* * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for ipAddress. */ @java.lang.Override public com.google.protobuf.ByteString getIpAddressBytes() { java.lang.Object ref = ipAddress_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); ipAddress_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int USER_AGENT_FIELD_NUMBER = 4; @SuppressWarnings("serial") private volatile java.lang.Object userAgent_ = ""; /** * * *
   * Optional. User agent as included in the HTTP header. UTF-8 encoded string
   * with a length limit of 1 KiB.
   *
   * This should *not* be set when using the JavaScript pixel or if
   * `directUserRequest` is set.
   * 
* * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The userAgent. */ @java.lang.Override public java.lang.String getUserAgent() { java.lang.Object ref = userAgent_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); userAgent_ = s; return s; } } /** * * *
   * Optional. User agent as included in the HTTP header. UTF-8 encoded string
   * with a length limit of 1 KiB.
   *
   * This should *not* be set when using the JavaScript pixel or if
   * `directUserRequest` is set.
   * 
* * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for userAgent. */ @java.lang.Override public com.google.protobuf.ByteString getUserAgentBytes() { java.lang.Object ref = userAgent_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); userAgent_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DIRECT_USER_REQUEST_FIELD_NUMBER = 5; private boolean directUserRequest_ = false; /** * * *
   * Optional. Indicates if the request is made directly from the end user
   * in which case the user_agent and ip_address fields can be populated
   * from the HTTP request. This should *not* be set when using the javascript
   * pixel. 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).
   * 
* * bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The directUserRequest. */ @java.lang.Override public boolean getDirectUserRequest() { return directUserRequest_; } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, visitorId_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userId_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, userId_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, ipAddress_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userAgent_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, userAgent_); } if (directUserRequest_ != false) { output.writeBool(5, directUserRequest_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(visitorId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, visitorId_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userId_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, userId_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, ipAddress_); } if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(userAgent_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, userAgent_); } if (directUserRequest_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, directUserRequest_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.recommendationengine.v1beta1.UserInfo)) { return super.equals(obj); } com.google.cloud.recommendationengine.v1beta1.UserInfo other = (com.google.cloud.recommendationengine.v1beta1.UserInfo) obj; if (!getVisitorId().equals(other.getVisitorId())) return false; if (!getUserId().equals(other.getUserId())) return false; if (!getIpAddress().equals(other.getIpAddress())) return false; if (!getUserAgent().equals(other.getUserAgent())) return false; if (getDirectUserRequest() != other.getDirectUserRequest()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + VISITOR_ID_FIELD_NUMBER; hash = (53 * hash) + getVisitorId().hashCode(); hash = (37 * hash) + USER_ID_FIELD_NUMBER; hash = (53 * hash) + getUserId().hashCode(); hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; hash = (53 * hash) + getIpAddress().hashCode(); hash = (37 * hash) + USER_AGENT_FIELD_NUMBER; hash = (53 * hash) + getUserAgent().hashCode(); hash = (37 * hash) + DIRECT_USER_REQUEST_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDirectUserRequest()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.recommendationengine.v1beta1.UserInfo parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder( com.google.cloud.recommendationengine.v1beta1.UserInfo prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * * *
   * Information of end users.
   * 
* * Protobuf type {@code google.cloud.recommendationengine.v1beta1.UserInfo} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.recommendationengine.v1beta1.UserInfo) com.google.cloud.recommendationengine.v1beta1.UserInfoOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass .internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass .internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.recommendationengine.v1beta1.UserInfo.class, com.google.cloud.recommendationengine.v1beta1.UserInfo.Builder.class); } // Construct using com.google.cloud.recommendationengine.v1beta1.UserInfo.newBuilder() private Builder() {} private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; visitorId_ = ""; userId_ = ""; ipAddress_ = ""; userAgent_ = ""; directUserRequest_ = false; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.recommendationengine.v1beta1.UserEventOuterClass .internal_static_google_cloud_recommendationengine_v1beta1_UserInfo_descriptor; } @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.UserInfo getDefaultInstanceForType() { return com.google.cloud.recommendationengine.v1beta1.UserInfo.getDefaultInstance(); } @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.UserInfo build() { com.google.cloud.recommendationengine.v1beta1.UserInfo result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.UserInfo buildPartial() { com.google.cloud.recommendationengine.v1beta1.UserInfo result = new com.google.cloud.recommendationengine.v1beta1.UserInfo(this); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartial0(com.google.cloud.recommendationengine.v1beta1.UserInfo result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.visitorId_ = visitorId_; } if (((from_bitField0_ & 0x00000002) != 0)) { result.userId_ = userId_; } if (((from_bitField0_ & 0x00000004) != 0)) { result.ipAddress_ = ipAddress_; } if (((from_bitField0_ & 0x00000008) != 0)) { result.userAgent_ = userAgent_; } if (((from_bitField0_ & 0x00000010) != 0)) { result.directUserRequest_ = directUserRequest_; } } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.recommendationengine.v1beta1.UserInfo) { return mergeFrom((com.google.cloud.recommendationengine.v1beta1.UserInfo) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloud.recommendationengine.v1beta1.UserInfo other) { if (other == com.google.cloud.recommendationengine.v1beta1.UserInfo.getDefaultInstance()) return this; if (!other.getVisitorId().isEmpty()) { visitorId_ = other.visitorId_; bitField0_ |= 0x00000001; onChanged(); } if (!other.getUserId().isEmpty()) { userId_ = other.userId_; bitField0_ |= 0x00000002; onChanged(); } if (!other.getIpAddress().isEmpty()) { ipAddress_ = other.ipAddress_; bitField0_ |= 0x00000004; onChanged(); } if (!other.getUserAgent().isEmpty()) { userAgent_ = other.userAgent_; bitField0_ |= 0x00000008; onChanged(); } if (other.getDirectUserRequest() != false) { setDirectUserRequest(other.getDirectUserRequest()); } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { visitorId_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { userId_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000002; break; } // case 18 case 26: { ipAddress_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000004; break; } // case 26 case 34: { userAgent_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000008; break; } // case 34 case 40: { directUserRequest_ = input.readBool(); bitField0_ |= 0x00000010; break; } // case 40 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag } break; } // default: } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private java.lang.Object visitorId_ = ""; /** * * *
     * Required. A unique identifier for tracking visitors with a length limit of
     * 128 bytes.
     *
     * For example, this could be implemented with a 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.
     * Maximum length 128 bytes. Cannot be empty.
     * 
* * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The visitorId. */ public java.lang.String getVisitorId() { java.lang.Object ref = visitorId_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); visitorId_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * Required. A unique identifier for tracking visitors with a length limit of
     * 128 bytes.
     *
     * For example, this could be implemented with a 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.
     * Maximum length 128 bytes. Cannot be empty.
     * 
* * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return The bytes for visitorId. */ public com.google.protobuf.ByteString getVisitorIdBytes() { java.lang.Object ref = visitorId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); visitorId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * Required. A unique identifier for tracking visitors with a length limit of
     * 128 bytes.
     *
     * For example, this could be implemented with a 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.
     * Maximum length 128 bytes. Cannot be empty.
     * 
* * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The visitorId to set. * @return This builder for chaining. */ public Builder setVisitorId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } visitorId_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
     * Required. A unique identifier for tracking visitors with a length limit of
     * 128 bytes.
     *
     * For example, this could be implemented with a 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.
     * Maximum length 128 bytes. Cannot be empty.
     * 
* * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; * * @return This builder for chaining. */ public Builder clearVisitorId() { visitorId_ = getDefaultInstance().getVisitorId(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * *
     * Required. A unique identifier for tracking visitors with a length limit of
     * 128 bytes.
     *
     * For example, this could be implemented with a 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.
     * Maximum length 128 bytes. Cannot be empty.
     * 
* * string visitor_id = 1 [(.google.api.field_behavior) = REQUIRED]; * * @param value The bytes for visitorId to set. * @return This builder for chaining. */ public Builder setVisitorIdBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); visitorId_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } private java.lang.Object userId_ = ""; /** * * *
     * Optional. Unique identifier for logged-in user with a length limit of 128
     * bytes. Required only for logged-in users.
     * 
* * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The userId. */ public java.lang.String getUserId() { java.lang.Object ref = userId_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); userId_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * Optional. Unique identifier for logged-in user with a length limit of 128
     * bytes. Required only for logged-in users.
     * 
* * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for userId. */ public com.google.protobuf.ByteString getUserIdBytes() { java.lang.Object ref = userId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); userId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * Optional. Unique identifier for logged-in user with a length limit of 128
     * bytes. Required only for logged-in users.
     * 
* * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The userId to set. * @return This builder for chaining. */ public Builder setUserId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } userId_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
     * Optional. Unique identifier for logged-in user with a length limit of 128
     * bytes. Required only for logged-in users.
     * 
* * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ public Builder clearUserId() { userId_ = getDefaultInstance().getUserId(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } /** * * *
     * Optional. Unique identifier for logged-in user with a length limit of 128
     * bytes. Required only for logged-in users.
     * 
* * string user_id = 2 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for userId to set. * @return This builder for chaining. */ public Builder setUserIdBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); userId_ = value; bitField0_ |= 0x00000002; onChanged(); return this; } private java.lang.Object ipAddress_ = ""; /** * * *
     * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
     * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
     * set when using the javascript pixel or if `direct_user_request` is set.
     * Used to extract location information for personalization.
     * 
* * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The ipAddress. */ public java.lang.String getIpAddress() { java.lang.Object ref = ipAddress_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); ipAddress_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
     * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
     * set when using the javascript pixel or if `direct_user_request` is set.
     * Used to extract location information for personalization.
     * 
* * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for ipAddress. */ public com.google.protobuf.ByteString getIpAddressBytes() { java.lang.Object ref = ipAddress_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); ipAddress_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
     * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
     * set when using the javascript pixel or if `direct_user_request` is set.
     * Used to extract location information for personalization.
     * 
* * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The ipAddress to set. * @return This builder for chaining. */ public Builder setIpAddress(java.lang.String value) { if (value == null) { throw new NullPointerException(); } ipAddress_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } /** * * *
     * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
     * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
     * set when using the javascript pixel or if `direct_user_request` is set.
     * Used to extract location information for personalization.
     * 
* * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ public Builder clearIpAddress() { ipAddress_ = getDefaultInstance().getIpAddress(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } /** * * *
     * Optional. IP address of the user. This could be either IPv4 (e.g. 104.133.9.80) or
     * IPv6 (e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This should *not* be
     * set when using the javascript pixel or if `direct_user_request` is set.
     * Used to extract location information for personalization.
     * 
* * string ip_address = 3 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for ipAddress to set. * @return This builder for chaining. */ public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); ipAddress_ = value; bitField0_ |= 0x00000004; onChanged(); return this; } private java.lang.Object userAgent_ = ""; /** * * *
     * Optional. User agent as included in the HTTP header. UTF-8 encoded string
     * with a length limit of 1 KiB.
     *
     * This should *not* be set when using the JavaScript pixel or if
     * `directUserRequest` is set.
     * 
* * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The userAgent. */ public java.lang.String getUserAgent() { java.lang.Object ref = userAgent_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); userAgent_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * Optional. User agent as included in the HTTP header. UTF-8 encoded string
     * with a length limit of 1 KiB.
     *
     * This should *not* be set when using the JavaScript pixel or if
     * `directUserRequest` is set.
     * 
* * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return The bytes for userAgent. */ public com.google.protobuf.ByteString getUserAgentBytes() { java.lang.Object ref = userAgent_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); userAgent_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * Optional. User agent as included in the HTTP header. UTF-8 encoded string
     * with a length limit of 1 KiB.
     *
     * This should *not* be set when using the JavaScript pixel or if
     * `directUserRequest` is set.
     * 
* * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The userAgent to set. * @return This builder for chaining. */ public Builder setUserAgent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } userAgent_ = value; bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
     * Optional. User agent as included in the HTTP header. UTF-8 encoded string
     * with a length limit of 1 KiB.
     *
     * This should *not* be set when using the JavaScript pixel or if
     * `directUserRequest` is set.
     * 
* * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ public Builder clearUserAgent() { userAgent_ = getDefaultInstance().getUserAgent(); bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } /** * * *
     * Optional. User agent as included in the HTTP header. UTF-8 encoded string
     * with a length limit of 1 KiB.
     *
     * This should *not* be set when using the JavaScript pixel or if
     * `directUserRequest` is set.
     * 
* * string user_agent = 4 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The bytes for userAgent to set. * @return This builder for chaining. */ public Builder setUserAgentBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); userAgent_ = value; bitField0_ |= 0x00000008; onChanged(); return this; } private boolean directUserRequest_; /** * * *
     * Optional. Indicates if the request is made directly from the end user
     * in which case the user_agent and ip_address fields can be populated
     * from the HTTP request. This should *not* be set when using the javascript
     * pixel. 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).
     * 
* * bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return The directUserRequest. */ @java.lang.Override public boolean getDirectUserRequest() { return directUserRequest_; } /** * * *
     * Optional. Indicates if the request is made directly from the end user
     * in which case the user_agent and ip_address fields can be populated
     * from the HTTP request. This should *not* be set when using the javascript
     * pixel. 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).
     * 
* * bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @param value The directUserRequest to set. * @return This builder for chaining. */ public Builder setDirectUserRequest(boolean value) { directUserRequest_ = value; bitField0_ |= 0x00000010; onChanged(); return this; } /** * * *
     * Optional. Indicates if the request is made directly from the end user
     * in which case the user_agent and ip_address fields can be populated
     * from the HTTP request. This should *not* be set when using the javascript
     * pixel. 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).
     * 
* * bool direct_user_request = 5 [(.google.api.field_behavior) = OPTIONAL]; * * @return This builder for chaining. */ public Builder clearDirectUserRequest() { bitField0_ = (bitField0_ & ~0x00000010); directUserRequest_ = false; onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.cloud.recommendationengine.v1beta1.UserInfo) } // @@protoc_insertion_point(class_scope:google.cloud.recommendationengine.v1beta1.UserInfo) private static final com.google.cloud.recommendationengine.v1beta1.UserInfo DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.recommendationengine.v1beta1.UserInfo(); } public static com.google.cloud.recommendationengine.v1beta1.UserInfo getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public UserInfo parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override public com.google.cloud.recommendationengine.v1beta1.UserInfo getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy