Class LocalInventory.Builder (2.1.0)

public static final class LocalInventory.Builder extends GeneratedMessageV3.Builder<LocalInventory.Builder> implements LocalInventoryOrBuilder

The inventory information at a place (e.g. a store) identified by a place ID.

Protobuf type google.cloud.retail.v2.LocalInventory

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllFulfillmentTypes(Iterable<String> values)

public LocalInventory.Builder addAllFulfillmentTypes(Iterable<String> values)

Input only. Supported fulfillment types. Valid fulfillment type values include commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI. Supported values:

  • "pickup-in-store"
  • "ship-to-store"
  • "same-day-delivery"
  • "next-day-delivery"
  • "custom-type-1"
  • "custom-type-2"
  • "custom-type-3"
  • "custom-type-4"
  • "custom-type-5" If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is returned.

repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY];

Parameter
NameDescription
valuesIterable<String>

The fulfillmentTypes to add.

Returns
TypeDescription
LocalInventory.Builder

This builder for chaining.

addFulfillmentTypes(String value)

public LocalInventory.Builder addFulfillmentTypes(String value)

Input only. Supported fulfillment types. Valid fulfillment type values include commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI. Supported values:

  • "pickup-in-store"
  • "ship-to-store"
  • "same-day-delivery"
  • "next-day-delivery"
  • "custom-type-1"
  • "custom-type-2"
  • "custom-type-3"
  • "custom-type-4"
  • "custom-type-5" If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is returned.

repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY];

Parameter
NameDescription
valueString

The fulfillmentTypes to add.

Returns
TypeDescription
LocalInventory.Builder

This builder for chaining.

addFulfillmentTypesBytes(ByteString value)

public LocalInventory.Builder addFulfillmentTypesBytes(ByteString value)

Input only. Supported fulfillment types. Valid fulfillment type values include commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI. Supported values:

  • "pickup-in-store"
  • "ship-to-store"
  • "same-day-delivery"
  • "next-day-delivery"
  • "custom-type-1"
  • "custom-type-2"
  • "custom-type-3"
  • "custom-type-4"
  • "custom-type-5" If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is returned.

repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY];

Parameter
NameDescription
valueByteString

The bytes of the fulfillmentTypes to add.

Returns
TypeDescription
LocalInventory.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public LocalInventory.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
LocalInventory.Builder
Overrides

build()

public LocalInventory build()
Returns
TypeDescription
LocalInventory

buildPartial()

public LocalInventory buildPartial()
Returns
TypeDescription
LocalInventory

clear()

public LocalInventory.Builder clear()
Returns
TypeDescription
LocalInventory.Builder
Overrides

clearAttributes()

public LocalInventory.Builder clearAttributes()
Returns
TypeDescription
LocalInventory.Builder

clearField(Descriptors.FieldDescriptor field)

public LocalInventory.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
LocalInventory.Builder
Overrides

clearFulfillmentTypes()

public LocalInventory.Builder clearFulfillmentTypes()

Input only. Supported fulfillment types. Valid fulfillment type values include commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI. Supported values:

  • "pickup-in-store"
  • "ship-to-store"
  • "same-day-delivery"
  • "next-day-delivery"
  • "custom-type-1"
  • "custom-type-2"
  • "custom-type-3"
  • "custom-type-4"
  • "custom-type-5" If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is returned.

repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
TypeDescription
LocalInventory.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public LocalInventory.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
LocalInventory.Builder
Overrides

clearPlaceId()

public LocalInventory.Builder clearPlaceId()

The place ID for the current set of inventory information.

string place_id = 1;

Returns
TypeDescription
LocalInventory.Builder

This builder for chaining.

clearPriceInfo()

public LocalInventory.Builder clearPriceInfo()

Product price and cost information. Google Merchant Center property price.

.google.cloud.retail.v2.PriceInfo price_info = 2;

Returns
TypeDescription
LocalInventory.Builder

clone()

public LocalInventory.Builder clone()
Returns
TypeDescription
LocalInventory.Builder
Overrides

containsAttributes(String key)

public boolean containsAttributes(String key)

Additional local inventory attributes, for example, store name, promotion tags, etc. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:

  • At most 30 attributes are allowed.
  • The key must be a UTF-8 encoded string with a length limit of 32 characters.
  • The key must match the pattern: a-zA-Z0-9*. For example, key0LikeThis or KEY_1_LIKE_THIS.
  • The attribute values must be of the same type (text or number).
  • Only 1 value is allowed for each attribute.
  • For text values, the length limit is 256 UTF-8 characters.
  • The attribute does not support search. The searchable field should be unset or set to false.
  • The max summed total bytes of custom attribute keys and values per product is 5MiB.

map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getAttributes()

public Map<String,CustomAttribute> getAttributes()

Use #getAttributesMap() instead.

Returns
TypeDescription
Map<String,CustomAttribute>

getAttributesCount()

public int getAttributesCount()

Additional local inventory attributes, for example, store name, promotion tags, etc. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:

  • At most 30 attributes are allowed.
  • The key must be a UTF-8 encoded string with a length limit of 32 characters.
  • The key must match the pattern: a-zA-Z0-9*. For example, key0LikeThis or KEY_1_LIKE_THIS.
  • The attribute values must be of the same type (text or number).
  • Only 1 value is allowed for each attribute.
  • For text values, the length limit is 256 UTF-8 characters.
  • The attribute does not support search. The searchable field should be unset or set to false.
  • The max summed total bytes of custom attribute keys and values per product is 5MiB.

map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 3;

Returns
TypeDescription
int

getAttributesMap()

public Map<String,CustomAttribute> getAttributesMap()

Additional local inventory attributes, for example, store name, promotion tags, etc. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:

  • At most 30 attributes are allowed.
  • The key must be a UTF-8 encoded string with a length limit of 32 characters.
  • The key must match the pattern: a-zA-Z0-9*. For example, key0LikeThis or KEY_1_LIKE_THIS.
  • The attribute values must be of the same type (text or number).
  • Only 1 value is allowed for each attribute.
  • For text values, the length limit is 256 UTF-8 characters.
  • The attribute does not support search. The searchable field should be unset or set to false.
  • The max summed total bytes of custom attribute keys and values per product is 5MiB.

map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 3;

Returns
TypeDescription
Map<String,CustomAttribute>

getAttributesOrDefault(String key, CustomAttribute defaultValue)

public CustomAttribute getAttributesOrDefault(String key, CustomAttribute defaultValue)

Additional local inventory attributes, for example, store name, promotion tags, etc. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:

  • At most 30 attributes are allowed.
  • The key must be a UTF-8 encoded string with a length limit of 32 characters.
  • The key must match the pattern: a-zA-Z0-9*. For example, key0LikeThis or KEY_1_LIKE_THIS.
  • The attribute values must be of the same type (text or number).
  • Only 1 value is allowed for each attribute.
  • For text values, the length limit is 256 UTF-8 characters.
  • The attribute does not support search. The searchable field should be unset or set to false.
  • The max summed total bytes of custom attribute keys and values per product is 5MiB.

map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 3;

Parameters
NameDescription
keyString
defaultValueCustomAttribute
Returns
TypeDescription
CustomAttribute

getAttributesOrThrow(String key)

public CustomAttribute getAttributesOrThrow(String key)

Additional local inventory attributes, for example, store name, promotion tags, etc. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:

  • At most 30 attributes are allowed.
  • The key must be a UTF-8 encoded string with a length limit of 32 characters.
  • The key must match the pattern: a-zA-Z0-9*. For example, key0LikeThis or KEY_1_LIKE_THIS.
  • The attribute values must be of the same type (text or number).
  • Only 1 value is allowed for each attribute.
  • For text values, the length limit is 256 UTF-8 characters.
  • The attribute does not support search. The searchable field should be unset or set to false.
  • The max summed total bytes of custom attribute keys and values per product is 5MiB.

map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
CustomAttribute

getDefaultInstanceForType()

public LocalInventory getDefaultInstanceForType()
Returns
TypeDescription
LocalInventory

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getFulfillmentTypes(int index)

public String getFulfillmentTypes(int index)

Input only. Supported fulfillment types. Valid fulfillment type values include commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI. Supported values:

  • "pickup-in-store"
  • "ship-to-store"
  • "same-day-delivery"
  • "next-day-delivery"
  • "custom-type-1"
  • "custom-type-2"
  • "custom-type-3"
  • "custom-type-4"
  • "custom-type-5" If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is returned.

repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The fulfillmentTypes at the given index.

getFulfillmentTypesBytes(int index)

public ByteString getFulfillmentTypesBytes(int index)

Input only. Supported fulfillment types. Valid fulfillment type values include commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI. Supported values:

  • "pickup-in-store"
  • "ship-to-store"
  • "same-day-delivery"
  • "next-day-delivery"
  • "custom-type-1"
  • "custom-type-2"
  • "custom-type-3"
  • "custom-type-4"
  • "custom-type-5" If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is returned.

repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY];

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the fulfillmentTypes at the given index.

getFulfillmentTypesCount()

public int getFulfillmentTypesCount()

Input only. Supported fulfillment types. Valid fulfillment type values include commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI. Supported values:

  • "pickup-in-store"
  • "ship-to-store"
  • "same-day-delivery"
  • "next-day-delivery"
  • "custom-type-1"
  • "custom-type-2"
  • "custom-type-3"
  • "custom-type-4"
  • "custom-type-5" If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is returned.

repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
TypeDescription
int

The count of fulfillmentTypes.

getFulfillmentTypesList()

public ProtocolStringList getFulfillmentTypesList()

Input only. Supported fulfillment types. Valid fulfillment type values include commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI. Supported values:

  • "pickup-in-store"
  • "ship-to-store"
  • "same-day-delivery"
  • "next-day-delivery"
  • "custom-type-1"
  • "custom-type-2"
  • "custom-type-3"
  • "custom-type-4"
  • "custom-type-5" If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is returned.

repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
TypeDescription
ProtocolStringList

A list containing the fulfillmentTypes.

getMutableAttributes()

public Map<String,CustomAttribute> getMutableAttributes()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,CustomAttribute>

getPlaceId()

public String getPlaceId()

The place ID for the current set of inventory information.

string place_id = 1;

Returns
TypeDescription
String

The placeId.

getPlaceIdBytes()

public ByteString getPlaceIdBytes()

The place ID for the current set of inventory information.

string place_id = 1;

Returns
TypeDescription
ByteString

The bytes for placeId.

getPriceInfo()

public PriceInfo getPriceInfo()

Product price and cost information. Google Merchant Center property price.

.google.cloud.retail.v2.PriceInfo price_info = 2;

Returns
TypeDescription
PriceInfo

The priceInfo.

getPriceInfoBuilder()

public PriceInfo.Builder getPriceInfoBuilder()

Product price and cost information. Google Merchant Center property price.

.google.cloud.retail.v2.PriceInfo price_info = 2;

Returns
TypeDescription
PriceInfo.Builder

getPriceInfoOrBuilder()

public PriceInfoOrBuilder getPriceInfoOrBuilder()

Product price and cost information. Google Merchant Center property price.

.google.cloud.retail.v2.PriceInfo price_info = 2;

Returns
TypeDescription
PriceInfoOrBuilder

hasPriceInfo()

public boolean hasPriceInfo()

Product price and cost information. Google Merchant Center property price.

.google.cloud.retail.v2.PriceInfo price_info = 2;

Returns
TypeDescription
boolean

Whether the priceInfo field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(LocalInventory other)

public LocalInventory.Builder mergeFrom(LocalInventory other)
Parameter
NameDescription
otherLocalInventory
Returns
TypeDescription
LocalInventory.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public LocalInventory.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
LocalInventory.Builder
Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public LocalInventory.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
LocalInventory.Builder
Overrides

mergePriceInfo(PriceInfo value)

public LocalInventory.Builder mergePriceInfo(PriceInfo value)

Product price and cost information. Google Merchant Center property price.

.google.cloud.retail.v2.PriceInfo price_info = 2;

Parameter
NameDescription
valuePriceInfo
Returns
TypeDescription
LocalInventory.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final LocalInventory.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
LocalInventory.Builder
Overrides

putAllAttributes(Map<String,CustomAttribute> values)

public LocalInventory.Builder putAllAttributes(Map<String,CustomAttribute> values)

Additional local inventory attributes, for example, store name, promotion tags, etc. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:

  • At most 30 attributes are allowed.
  • The key must be a UTF-8 encoded string with a length limit of 32 characters.
  • The key must match the pattern: a-zA-Z0-9*. For example, key0LikeThis or KEY_1_LIKE_THIS.
  • The attribute values must be of the same type (text or number).
  • Only 1 value is allowed for each attribute.
  • For text values, the length limit is 256 UTF-8 characters.
  • The attribute does not support search. The searchable field should be unset or set to false.
  • The max summed total bytes of custom attribute keys and values per product is 5MiB.

map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 3;

Parameter
NameDescription
valuesMap<String,CustomAttribute>
Returns
TypeDescription
LocalInventory.Builder

putAttributes(String key, CustomAttribute value)

public LocalInventory.Builder putAttributes(String key, CustomAttribute value)

Additional local inventory attributes, for example, store name, promotion tags, etc. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:

  • At most 30 attributes are allowed.
  • The key must be a UTF-8 encoded string with a length limit of 32 characters.
  • The key must match the pattern: a-zA-Z0-9*. For example, key0LikeThis or KEY_1_LIKE_THIS.
  • The attribute values must be of the same type (text or number).
  • Only 1 value is allowed for each attribute.
  • For text values, the length limit is 256 UTF-8 characters.
  • The attribute does not support search. The searchable field should be unset or set to false.
  • The max summed total bytes of custom attribute keys and values per product is 5MiB.

map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 3;

Parameters
NameDescription
keyString
valueCustomAttribute
Returns
TypeDescription
LocalInventory.Builder

removeAttributes(String key)

public LocalInventory.Builder removeAttributes(String key)

Additional local inventory attributes, for example, store name, promotion tags, etc. This field needs to pass all below criteria, otherwise an INVALID_ARGUMENT error is returned:

  • At most 30 attributes are allowed.
  • The key must be a UTF-8 encoded string with a length limit of 32 characters.
  • The key must match the pattern: a-zA-Z0-9*. For example, key0LikeThis or KEY_1_LIKE_THIS.
  • The attribute values must be of the same type (text or number).
  • Only 1 value is allowed for each attribute.
  • For text values, the length limit is 256 UTF-8 characters.
  • The attribute does not support search. The searchable field should be unset or set to false.
  • The max summed total bytes of custom attribute keys and values per product is 5MiB.

map<string, .google.cloud.retail.v2.CustomAttribute> attributes = 3;

Parameter
NameDescription
keyString
Returns
TypeDescription
LocalInventory.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public LocalInventory.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
LocalInventory.Builder
Overrides

setFulfillmentTypes(int index, String value)

public LocalInventory.Builder setFulfillmentTypes(int index, String value)

Input only. Supported fulfillment types. Valid fulfillment type values include commonly used types (such as pickup in store and same day delivery), and custom types. Customers have to map custom types to their display names before rendering UI. Supported values:

  • "pickup-in-store"
  • "ship-to-store"
  • "same-day-delivery"
  • "next-day-delivery"
  • "custom-type-1"
  • "custom-type-2"
  • "custom-type-3"
  • "custom-type-4"
  • "custom-type-5" If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. All the elements must be distinct. Otherwise, an INVALID_ARGUMENT error is returned.

repeated string fulfillment_types = 4 [(.google.api.field_behavior) = INPUT_ONLY];

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The fulfillmentTypes to set.

Returns
TypeDescription
LocalInventory.Builder

This builder for chaining.

setPlaceId(String value)

public LocalInventory.Builder setPlaceId(String value)

The place ID for the current set of inventory information.

string place_id = 1;

Parameter
NameDescription
valueString

The placeId to set.

Returns
TypeDescription
LocalInventory.Builder

This builder for chaining.

setPlaceIdBytes(ByteString value)

public LocalInventory.Builder setPlaceIdBytes(ByteString value)

The place ID for the current set of inventory information.

string place_id = 1;

Parameter
NameDescription
valueByteString

The bytes for placeId to set.

Returns
TypeDescription
LocalInventory.Builder

This builder for chaining.

setPriceInfo(PriceInfo value)

public LocalInventory.Builder setPriceInfo(PriceInfo value)

Product price and cost information. Google Merchant Center property price.

.google.cloud.retail.v2.PriceInfo price_info = 2;

Parameter
NameDescription
valuePriceInfo
Returns
TypeDescription
LocalInventory.Builder

setPriceInfo(PriceInfo.Builder builderForValue)

public LocalInventory.Builder setPriceInfo(PriceInfo.Builder builderForValue)

Product price and cost information. Google Merchant Center property price.

.google.cloud.retail.v2.PriceInfo price_info = 2;

Parameter
NameDescription
builderForValuePriceInfo.Builder
Returns
TypeDescription
LocalInventory.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public LocalInventory.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
LocalInventory.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final LocalInventory.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
LocalInventory.Builder
Overrides