recurrence
frequenz.client.dispatch.recurrence ¤
Types for recurrence rules.
Classes¤
frequenz.client.dispatch.recurrence.EndCriteria
dataclass
¤
Controls when a recurring dispatch should end.
Source code in frequenz/client/dispatch/recurrence.py
Attributes¤
count
class-attribute
instance-attribute
¤
count: int | None = None
The number of times this dispatch should recur.
until
class-attribute
instance-attribute
¤
until: datetime | None = None
The end time of this dispatch in UTC.
Functions¤
from_protobuf
classmethod
¤
from_protobuf(pb_criteria: EndCriteria) -> EndCriteria
Convert a protobuf end criteria to an end criteria.
PARAMETER | DESCRIPTION |
---|---|
pb_criteria
|
The protobuf end criteria to convert.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
EndCriteria
|
The converted end criteria. |
Source code in frequenz/client/dispatch/recurrence.py
to_protobuf ¤
to_protobuf() -> EndCriteria
Convert an end criteria to a protobuf end criteria.
RETURNS | DESCRIPTION |
---|---|
EndCriteria
|
The converted protobuf end criteria. |
Source code in frequenz/client/dispatch/recurrence.py
frequenz.client.dispatch.recurrence.Frequency ¤
Bases: IntEnum
Enum representing the frequency of the recurrence.
Source code in frequenz/client/dispatch/recurrence.py
frequenz.client.dispatch.recurrence.RecurrenceRule
dataclass
¤
Ruleset governing when and how a dispatch should re-occur.
Attributes follow the iCalendar specification (RFC5545) for recurrence rules.
Source code in frequenz/client/dispatch/recurrence.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
|
Attributes¤
byhours
class-attribute
instance-attribute
¤
On which hour(s) of the day the event occurs.
byminutes
class-attribute
instance-attribute
¤
On which minute(s) of the hour the event occurs.
bymonthdays
class-attribute
instance-attribute
¤
On which day(s) of the month the event occurs.
bymonths
class-attribute
instance-attribute
¤
On which month(s) of the year the event occurs.
byweekdays
class-attribute
instance-attribute
¤
On which day(s) of the week the event occurs.
end_criteria
class-attribute
instance-attribute
¤
end_criteria: EndCriteria | None = None
When this dispatch should end.
Can recur a fixed number of times or until a given timestamp.
frequency
class-attribute
instance-attribute
¤
frequency: Frequency = UNSPECIFIED
The frequency specifier of this recurring dispatch.
interval
class-attribute
instance-attribute
¤
interval: int = 0
How often this dispatch should recur, based on the frequency.
Functions¤
from_protobuf
classmethod
¤
from_protobuf(pb_rule: RecurrenceRule) -> RecurrenceRule
Convert a protobuf recurrence rule to a recurrence rule.
PARAMETER | DESCRIPTION |
---|---|
pb_rule
|
The protobuf recurrence rule to convert.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
RecurrenceRule
|
The converted recurrence rule. |
Source code in frequenz/client/dispatch/recurrence.py
to_protobuf ¤
to_protobuf() -> RecurrenceRule
Convert a recurrence rule to a protobuf recurrence rule.
RETURNS | DESCRIPTION |
---|---|
RecurrenceRule
|
The converted protobuf recurrence rule. |
Source code in frequenz/client/dispatch/recurrence.py
frequenz.client.dispatch.recurrence.Weekday ¤
Bases: IntEnum
Enum representing the day of the week.