Class protos.google.cloud.retail.v2alpha.Product (1.1.6)

Represents a Product.

Package

@google-cloud/retail!

Constructors

(constructor)(properties)

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

Constructs a new Product.

Parameter
NameDescription
properties IProduct

Properties to set

Properties

attributes

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

Product attributes.

Property Value
TypeDescription
{ [k: string]: google.cloud.retail.v2alpha.ICustomAttribute }

availability

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

Product availability.

Property Value
TypeDescription
(google.cloud.retail.v2alpha.Product.Availability|keyof typeof google.cloud.retail.v2alpha.Product.Availability)

availableQuantity

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

Product availableQuantity.

Property Value
TypeDescription
(google.protobuf.IInt32Value|null)

availableTime

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

Product availableTime.

Property Value
TypeDescription
(google.protobuf.ITimestamp|null)

categories

public categories: string[];

Product categories.

Property Value
TypeDescription
string[]

description

public description: string;

Product description.

Property Value
TypeDescription
string

id

public id: string;

Product id.

Property Value
TypeDescription
string

images

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

Product images.

Property Value
TypeDescription
google.cloud.retail.v2alpha.IImage[]

name

public name: string;

Product name.

Property Value
TypeDescription
string

priceInfo

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

Product priceInfo.

Property Value
TypeDescription
(google.cloud.retail.v2alpha.IPriceInfo|null)

primaryProductId

public primaryProductId: string;

Product primaryProductId.

Property Value
TypeDescription
string

tags

public tags: string[];

Product tags.

Property Value
TypeDescription
string[]

title

public title: string;

Product title.

Property Value
TypeDescription
string

type

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

Product type.

Property Value
TypeDescription
(google.cloud.retail.v2alpha.Product.Type|keyof typeof google.cloud.retail.v2alpha.Product.Type)

uri

public uri: string;

Product uri.

Property Value
TypeDescription
string

Methods

create(properties)

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

Creates a new Product instance using the specified properties.

Parameter
NameDescription
properties IProduct

Properties to set

Returns
TypeDescription
google.cloud.retail.v2alpha.Product

Product instance

decode(reader, length)

public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2alpha.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.v2alpha.Product

Product

decodeDelimited(reader)

public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2alpha.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.v2alpha.Product

Product

encode(message, writer)

public static encode(message: google.cloud.retail.v2alpha.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.v2alpha.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.v2alpha.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.v2alpha.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.v2alpha.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.v2alpha.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