Skip to main content

Class: IntervalSpec

schedule.v1.IntervalSpec

IntervalSpec matches times that can be expressed as: epoch + n * interval + phase where n is an integer. phase defaults to zero if missing. interval is required. Both interval and phase must be non-negative and are truncated to the nearest second before any calculations. For example, an interval of 1 hour with phase of zero would match every hour, on the hour. The same interval but a phase of 19 minutes would match every xx:19:00. An interval of 28 days with phase zero would match 2022-02-17T00:00:00Z (among other times). The same interval with a phase of 3 days, 5 hours, and 23 minutes would match 2022-02-20T05:23:00Z instead.

Properties​

interval​

• Optional interval: null | $Properties

IntervalSpec interval.


phase​

• Optional phase: null | $Properties

IntervalSpec phase.

Methods​

toJSON​

▸ toJSON(): Object

Converts this IntervalSpec to JSON.

Returns​

Object

JSON object


create​

▸ create(properties?): IntervalSpec & $Properties

Creates a new IntervalSpec instance using the specified properties.

Parameters​

NameTypeDescription
properties?$PropertiesProperties to set

Returns​

IntervalSpec & $Properties

IntervalSpec instance

▸ create(properties?): IntervalSpec

Parameters​

NameType
properties?$Properties

Returns​

IntervalSpec


decode​

▸ decode(reader, length?): IntervalSpec & $Properties

Decodes an IntervalSpec message from the specified reader or buffer.

Parameters​

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage length if known beforehand

Returns​

IntervalSpec & $Properties

IntervalSpec

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited​

▸ decodeDelimited(reader): IntervalSpec & $Properties

Decodes an IntervalSpec message from the specified reader or buffer, length delimited.

Parameters​

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns​

IntervalSpec & $Properties

IntervalSpec

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


encode​

▸ encode(message, writer?): Writer

Encodes the specified IntervalSpec message. Does not implicitly temporal.api.schedule.v1.IntervalSpec.verify|verify messages.

Parameters​

NameTypeDescription
message$PropertiesIntervalSpec message or plain object to encode
writer?WriterWriter to encode to

Returns​

Writer

Writer


encodeDelimited​

▸ encodeDelimited(message, writer?): Writer

Encodes the specified IntervalSpec message, length delimited. Does not implicitly temporal.api.schedule.v1.IntervalSpec.verify|verify messages.

Parameters​

NameTypeDescription
message$PropertiesIntervalSpec message or plain object to encode
writer?WriterWriter to encode to

Returns​

Writer

Writer


fromObject​

▸ fromObject(object): IntervalSpec

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

Parameters​

NameTypeDescription
objectObjectPlain object

Returns​

IntervalSpec

IntervalSpec


toObject​

▸ toObject(message, options?): Object

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

Parameters​

NameTypeDescription
messageIntervalSpecIntervalSpec
options?IConversionOptionsConversion options

Returns​

Object

Plain object