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.

Implements

Constructors

constructor

new IntervalSpec(properties?): IntervalSpec

Constructs a new IntervalSpec.

Parameters

NameTypeDescription
properties?IIntervalSpecProperties to set

Returns

IntervalSpec

Properties

interval

Optional interval: null | IDuration

IntervalSpec interval.

Implementation of

IIntervalSpec.interval


phase

Optional phase: null | IDuration

IntervalSpec phase.

Implementation of

IIntervalSpec.phase

Methods

toJSON

toJSON(): Object

Converts this IntervalSpec to JSON.

Returns

Object

JSON object


create

create(properties?): IntervalSpec

Creates a new IntervalSpec instance using the specified properties.

Parameters

NameTypeDescription
properties?IIntervalSpecProperties to set

Returns

IntervalSpec

IntervalSpec instance


decode

decode(reader, length?): IntervalSpec

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

IntervalSpec

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): IntervalSpec

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

IntervalSpec

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


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for IntervalSpec

Parameters

NameTypeDescription
typeUrlPrefix?stringyour custom typeUrlPrefix(default "type.googleapis.com")

Returns

string

The default type url


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