Class protos.google.cloud.optimization.v1.ShipmentRoute.TravelStep (2.1.1)

Represents a TravelStep.

Package

@google-cloud/optimization

Constructors

(constructor)(properties)

constructor(properties?: google.cloud.optimization.v1.ShipmentRoute.ITravelStep);

Constructs a new TravelStep.

Parameter
NameDescription
properties ITravelStep

Properties to set

Properties

distanceMeters

public distanceMeters: number;

TravelStep distanceMeters.

duration

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

TravelStep duration.

routePolyline

public routePolyline?: (google.cloud.optimization.v1.ShipmentRoute.IEncodedPolyline|null);

TravelStep routePolyline.

trafficInfoUnavailable

public trafficInfoUnavailable: boolean;

TravelStep trafficInfoUnavailable.

Methods

create(properties)

public static create(properties?: google.cloud.optimization.v1.ShipmentRoute.ITravelStep): google.cloud.optimization.v1.ShipmentRoute.TravelStep;

Creates a new TravelStep instance using the specified properties.

Parameter
NameDescription
properties ITravelStep

Properties to set

Returns
TypeDescription
google.cloud.optimization.v1.ShipmentRoute.TravelStep

TravelStep instance

decode(reader, length)

public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.optimization.v1.ShipmentRoute.TravelStep;

Decodes a TravelStep 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.optimization.v1.ShipmentRoute.TravelStep

TravelStep

decodeDelimited(reader)

public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.optimization.v1.ShipmentRoute.TravelStep;

Decodes a TravelStep 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.optimization.v1.ShipmentRoute.TravelStep

TravelStep

encode(message, writer)

public static encode(message: google.cloud.optimization.v1.ShipmentRoute.ITravelStep, writer?: $protobuf.Writer): $protobuf.Writer;

Encodes the specified TravelStep message. Does not implicitly messages.

Parameters
NameDescription
message ITravelStep

TravelStep 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.optimization.v1.ShipmentRoute.ITravelStep, writer?: $protobuf.Writer): $protobuf.Writer;

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

Parameters
NameDescription
message ITravelStep

TravelStep 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.optimization.v1.ShipmentRoute.TravelStep;

Creates a TravelStep 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.optimization.v1.ShipmentRoute.TravelStep

TravelStep

getTypeUrl(typeUrlPrefix)

public static getTypeUrl(typeUrlPrefix?: string): string;

Gets the default type url for TravelStep

Parameter
NameDescription
typeUrlPrefix string

your custom typeUrlPrefix(default "type.googleapis.com")

Returns
TypeDescription
string

The default type url

toJSON()

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

Converts this TravelStep to JSON.

Returns
TypeDescription
{ [k: string]: any }

JSON object

toObject(message, options)

public static toObject(message: google.cloud.optimization.v1.ShipmentRoute.TravelStep, options?: $protobuf.IConversionOptions): { [k: string]: any };

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

Parameters
NameDescription
message google.cloud.optimization.v1.ShipmentRoute.TravelStep

TravelStep

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 TravelStep 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