Skip to main content

Class: 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?: $Properties | null

IntervalSpec interval.


phase?​

optional phase?: $Properties | null

IntervalSpec phase.

Methods​

toJSON()​

toJSON(): object

Converts this IntervalSpec to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): IntervalSpec & $Properties

Creates a new IntervalSpec instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

IntervalSpec & $Properties

IntervalSpec instance

Call Signature​

static create(properties?): IntervalSpec

Creates a new IntervalSpec instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

IntervalSpec

IntervalSpec instance


decode()​

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

Decodes an IntervalSpec message from the specified reader or buffer.

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

length?​

number

Message 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()​

static decodeDelimited(reader): IntervalSpec & $Properties

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

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader 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()​

static encode(message, writer?): Writer

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

Parameters​

message​

$Properties

IntervalSpec message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

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

Parameters​

message​

$Properties

IntervalSpec message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): IntervalSpec

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

Parameters​

object​

Plain object

Returns​

IntervalSpec

IntervalSpec


toObject()​

static toObject(message, options?): object

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

Parameters​

message​

IntervalSpec

IntervalSpec

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object