Represents a Product.
Package
@google-cloud/retailConstructors
(constructor)(properties)
constructor(properties?: google.cloud.retail.v2.IProduct);
Constructs a new Product.
Parameter | |
---|---|
Name | Description |
properties |
IProduct
Properties to set |
Properties
attributes
public attributes: { [k: string]: google.cloud.retail.v2.ICustomAttribute };
Product attributes.
audience
public audience?: (google.cloud.retail.v2.IAudience|null);
Product audience.
availability
public availability: (google.cloud.retail.v2.Product.Availability|keyof typeof google.cloud.retail.v2.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.v2.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.v2.IFulfillmentInfo[];
Product fulfillmentInfo.
gtin
public gtin: string;
Product gtin.
id
public id: string;
Product id.
images
public images: google.cloud.retail.v2.IImage[];
Product images.
languageCode
public languageCode: string;
Product languageCode.
localInventories
public localInventories: google.cloud.retail.v2.ILocalInventory[];
Product localInventories.
materials
public materials: string[];
Product materials.
name
public name: string;
Product name.
patterns
public patterns: string[];
Product patterns.
priceInfo
public priceInfo?: (google.cloud.retail.v2.IPriceInfo|null);
Product priceInfo.
primaryProductId
public primaryProductId: string;
Product primaryProductId.
promotions
public promotions: google.cloud.retail.v2.IPromotion[];
Product promotions.
publishTime
public publishTime?: (google.protobuf.ITimestamp|null);
Product publishTime.
rating
public rating?: (google.cloud.retail.v2.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.v2.Product.Type|keyof typeof google.cloud.retail.v2.Product.Type);
Product type.
uri
public uri: string;
Product uri.
variants
public variants: google.cloud.retail.v2.IProduct[];
Product variants.
Methods
create(properties)
public static create(properties?: google.cloud.retail.v2.IProduct): google.cloud.retail.v2.Product;
Creates a new Product instance using the specified properties.
Parameter | |
---|---|
Name | Description |
properties |
IProduct
Properties to set |
Returns | |
---|---|
Type | Description |
google.cloud.retail.v2.Product | Product instance |
decode(reader, length)
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.retail.v2.Product;
Decodes a Product message from the specified reader or buffer.
Parameters | |
---|---|
Name | Description |
reader |
($protobuf.Reader|Uint8Array)
Reader or buffer to decode from |
length |
number
Message length if known beforehand |
Returns | |
---|---|
Type | Description |
google.cloud.retail.v2.Product | Product |
decodeDelimited(reader)
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.retail.v2.Product;
Decodes a Product message from the specified reader or buffer, length delimited.
Parameter | |
---|---|
Name | Description |
reader |
($protobuf.Reader|Uint8Array)
Reader or buffer to decode from |
Returns | |
---|---|
Type | Description |
google.cloud.retail.v2.Product | Product |
encode(message, writer)
public static encode(message: google.cloud.retail.v2.IProduct, writer?: $protobuf.Writer): $protobuf.Writer;
Encodes the specified Product message. Does not implicitly messages.
Parameters | |
---|---|
Name | Description |
message |
IProduct
Product message or plain object to encode |
writer |
$protobuf.Writer
Writer to encode to |
Returns | |
---|---|
Type | Description |
$protobuf.Writer | Writer |
encodeDelimited(message, writer)
public static encodeDelimited(message: google.cloud.retail.v2.IProduct, writer?: $protobuf.Writer): $protobuf.Writer;
Encodes the specified Product message, length delimited. Does not implicitly messages.
Parameters | |
---|---|
Name | Description |
message |
IProduct
Product message or plain object to encode |
writer |
$protobuf.Writer
Writer to encode to |
Returns | |
---|---|
Type | Description |
$protobuf.Writer | Writer |
fromObject(object)
public static fromObject(object: { [k: string]: any }): google.cloud.retail.v2.Product;
Creates a Product message from a plain object. Also converts values to their respective internal types.
Parameter | |
---|---|
Name | Description |
object |
{ [k: string]: any }
Plain object |
Returns | |
---|---|
Type | Description |
google.cloud.retail.v2.Product | Product |
getTypeUrl(typeUrlPrefix)
public static getTypeUrl(typeUrlPrefix?: string): string;
Gets the default type url for Product
Parameter | |
---|---|
Name | Description |
typeUrlPrefix |
string
your custom typeUrlPrefix(default "type.googleapis.com") |
Returns | |
---|---|
Type | Description |
string | The default type url |
toJSON()
public toJSON(): { [k: string]: any };
Converts this Product to JSON.
Returns | |
---|---|
Type | Description |
{ [k: string]: any } | JSON object |
toObject(message, options)
public static toObject(message: google.cloud.retail.v2.Product, options?: $protobuf.IConversionOptions): { [k: string]: any };
Creates a plain object from a Product message. Also converts values to other types if specified.
Parameters | |
---|---|
Name | Description |
message |
google.cloud.retail.v2.Product
Product |
options |
$protobuf.IConversionOptions
Conversion options |
Returns | |
---|---|
Type | Description |
{ [k: string]: any } | Plain object |
verify(message)
public static verify(message: { [k: string]: any }): (string|null);
Verifies a Product message.
Parameter | |
---|---|
Name | Description |
message |
{ [k: string]: any }
Plain object to verify |
Returns | |
---|---|
Type | Description |
(string|null) |
|