Class protos.google.cloud.retail.v2beta.Product

Represents a Product.

Package

@google-cloud/retail

Constructors

(constructor)(properties)

constructor(properties?: google.cloud.retail.v2beta.IProduct);

Constructs a new Product.

Parameter
NameDescription
properties IProduct

Properties to set

Properties

attributes

public attributes: { [k: string]: google.cloud.retail.v2beta.ICustomAttribute };

Product attributes.

audience

public audience?: (google.cloud.retail.v2beta.IAudience|null);

Product audience.

availability

public availability: (google.cloud.retail.v2beta.Product.Availability|keyof typeof google.cloud.retail.v2beta.Product.Availability);

Product availability.

availableQuantity

public availableQuantity?: (google.protobuf.IInt32Value|null);

Product availableQuantity.

availableTime

public availableTime?: (google.protobuf.ITimestamp|null);

Product availableTime.

brands

public brands: string[];

Product brands.

categories

public categories: string[];

Product categories.

collectionMemberIds

public collectionMemberIds: string[];

Product collectionMemberIds.

colorInfo

public colorInfo?: (google.cloud.retail.v2beta.IColorInfo|null);

Product colorInfo.

conditions

public conditions: string[];

Product conditions.

description

public description: string;

Product description.

expiration

public expiration?: ("expireTime"|"ttl");

Product expiration.

expireTime

public expireTime?: (google.protobuf.ITimestamp|null);

Product expireTime.

fulfillmentInfo

public fulfillmentInfo: google.cloud.retail.v2beta.IFulfillmentInfo[];

Product fulfillmentInfo.

gtin

public gtin: string;

Product gtin.

id

public id: string;

Product id.

images

public images: google.cloud.retail.v2beta.IImage[];

Product images.

languageCode

public languageCode: string;

Product languageCode.

materials

public materials: string[];

Product materials.

name

public name: string;

Product name.

patterns

public patterns: string[];

Product patterns.

priceInfo

public priceInfo?: (google.cloud.retail.v2beta.IPriceInfo|null);

Product priceInfo.

primaryProductId

public primaryProductId: string;

Product primaryProductId.

promotions

public promotions: google.cloud.retail.v2beta.IPromotion[];

Product promotions.

publishTime

public publishTime?: (google.protobuf.ITimestamp|null);

Product publishTime.

rating

public rating?: (google.cloud.retail.v2beta.IRating|null);

Product rating.

retrievableFields

public retrievableFields?: (google.protobuf.IFieldMask|null);

Product retrievableFields.

sizes

public sizes: string[];

Product sizes.

tags

public tags: string[];

Product tags.

title

public title: string;

Product title.

ttl

public ttl?: (google.protobuf.IDuration|null);

Product ttl.

type

public type: (google.cloud.retail.v2beta.Product.Type|keyof typeof google.cloud.retail.v2beta.Product.Type);

Product type.

uri

public uri: string;

Product uri.

variants

public variants: google.cloud.retail.v2beta.IProduct[];

Product variants.

Methods

create(properties)

public static create(properties?: google.cloud.retail.v2beta.IProduct): google.cloud.retail.v2beta.Product;

Creates a new Product instance using the specified properties.

Parameter
NameDescription
properties IProduct

Properties to set

Returns
TypeDescription
google.cloud.retail.v2beta.Product

Product instance

decode(reader, length)

public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2beta.Product;

Decodes a Product message from the specified reader or buffer.

Parameters
NameDescription
reader ($protobuf.Reader|Uint8Array)

Reader or buffer to decode from

length number

Message length if known beforehand

Returns
TypeDescription
google.cloud.retail.v2beta.Product

Product

decodeDelimited(reader)

public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2beta.Product;

Decodes a Product message from the specified reader or buffer, length delimited.

Parameter
NameDescription
reader ($protobuf.Reader|Uint8Array)

Reader or buffer to decode from

Returns
TypeDescription
google.cloud.retail.v2beta.Product

Product

encode(message, writer)

public static encode(message: google.cloud.retail.v2beta.IProduct, writer?: $protobuf.Writer): $protobuf.Writer;

Encodes the specified Product message. Does not implicitly messages.

Parameters
NameDescription
message IProduct

Product message or plain object to encode

writer $protobuf.Writer

Writer to encode to

Returns
TypeDescription
$protobuf.Writer

Writer

encodeDelimited(message, writer)

public static encodeDelimited(message: google.cloud.retail.v2beta.IProduct, writer?: $protobuf.Writer): $protobuf.Writer;

Encodes the specified Product message, length delimited. Does not implicitly messages.

Parameters
NameDescription
message IProduct

Product message or plain object to encode

writer $protobuf.Writer

Writer to encode to

Returns
TypeDescription
$protobuf.Writer

Writer

fromObject(object)

public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2beta.Product;

Creates a Product message from a plain object. Also converts values to their respective internal types.

Parameter
NameDescription
object { [k: string]: any }

Plain object

Returns
TypeDescription
google.cloud.retail.v2beta.Product

Product

toJSON()

public toJSON(): { [k: string]: any };

Converts this Product to JSON.

Returns
TypeDescription
{ [k: string]: any }

JSON object

toObject(message, options)

public static toObject(message: google.cloud.retail.v2beta.Product, options?: $protobuf.IConversionOptions): { [k: string]: any };

Creates a plain object from a Product message. Also converts values to other types if specified.

Parameters
NameDescription
message google.cloud.retail.v2beta.Product

Product

options $protobuf.IConversionOptions

Conversion options

Returns
TypeDescription
{ [k: string]: any }

Plain object

verify(message)

public static verify(message: { [k: string]: any }): (string|null);

Verifies a Product message.

Parameter
NameDescription
message { [k: string]: any }

Plain object to verify

Returns
TypeDescription
(string|null)

null if valid, otherwise the reason why it is not