Liking cljdoc? Tell your friends :D

metabase.models.pulse-channel


channel-type?clj

(channel-type? channel-type)

Is CHANNEL-TYPE a valid value as a channel type? :tv:

Is CHANNEL-TYPE a valid value as a channel type? :tv:
sourceraw docstring

channel-typesclj

Map which contains the definitions for each type of pulse channel we allow. Each key is a channel type with a map which contains any other relevant information for defining the channel. E.g.

{:email {:name "Email", :recipients? true} :slack {:name "Slack", :recipients? false}}

Map which contains the definitions for each type of pulse channel we allow.  Each key is a channel type with a map
which contains any other relevant information for defining the channel.  E.g.

{:email {:name "Email", :recipients? true}
 :slack {:name "Slack", :recipients? false}}
sourceraw docstring

create-pulse-channel!clj

(create-pulse-channel! {:keys [channel_type details pulse_id recipients
                               schedule_type schedule_day schedule_hour
                               schedule_frame]
                        :or {details {} recipients []}})

Create a new PulseChannel along with all related data associated with the channel such as PulseChannelRecipients.

Create a new `PulseChannel` along with all related data associated with the channel such as `PulseChannelRecipients`.
sourceraw docstring

day-of-week?clj

(day-of-week? day)

Is DAY a valid day-of-week choice?

Is DAY a valid `day-of-week` choice?
sourceraw docstring

days-of-weekclj

Simple vector of the days in the week used for reference and lookups.

NOTE: order is important here!! we use the same ordering as the clj-time day-of-week function (1 = Monday, 7 = Sunday) except that we are 0 based instead.

Simple `vector` of the days in the week used for reference and lookups.

NOTE: order is important here!!
      we use the same ordering as the clj-time `day-of-week` function (1 = Monday, 7 = Sunday) except
      that we are 0 based instead.
sourceraw docstring

hour-of-day?clj

(hour-of-day? hour)

Predicate function which returns true if the given hour is a valid hour of the day (24 hour), false otherwise.

Predicate function which returns `true` if the given hour is a valid hour of the day (24 hour), `false` otherwise.
sourceraw docstring

PulseChannelclj

(PulseChannel)
(PulseChannel id)
(PulseChannel & kvs)

Entity for 'pulse_channel' table; instance of PulseChannelInstance.

Entity for 'pulse_channel' table; instance of PulseChannelInstance.
sourceraw docstring

recipientsclj

(recipients {:keys [id details]})

Return the PulseChannelRecipients associated with this PULSE-CHANNEL.

Return the `PulseChannelRecipients` associated with this PULSE-CHANNEL.
sourceraw docstring

retrieve-scheduled-channelsclj

(retrieve-scheduled-channels hour weekday monthday monthweek)

Fetch all PulseChannels that are scheduled to run at a given time described by HOUR, WEEKDAY, MONTHDAY, and MONTHWEEK.

Examples: (retrieve-scheduled-channels 14 "mon" :first :first) - 2pm on the first Monday of the month (retrieve-scheduled-channels 8 "wed" :other :last) - 8am on Wednesday of the last week of the month

Based on the given input the appropriate PulseChannels are returned:

  • HOURLY scheduled channels are always included.
  • DAILY scheduled channels are included if the HOUR matches.
  • WEEKLY scheduled channels are included if the WEEKDAY & HOUR match.
  • MONTHLY scheduled channels are included if the MONTHDAY, MONTHWEEK, WEEKDAY, & HOUR all match.
Fetch all `PulseChannels` that are scheduled to run at a given time described by HOUR, WEEKDAY, MONTHDAY, and MONTHWEEK.

Examples:
    (retrieve-scheduled-channels 14 "mon" :first :first)  -  2pm on the first Monday of the month
    (retrieve-scheduled-channels 8 "wed" :other :last)    -  8am on Wednesday of the last week of the month

Based on the given input the appropriate `PulseChannels` are returned:
  * HOURLY scheduled channels are always included.
  * DAILY scheduled channels are included if the HOUR matches.
  * WEEKLY scheduled channels are included if the WEEKDAY & HOUR match.
  * MONTHLY scheduled channels are included if the MONTHDAY, MONTHWEEK, WEEKDAY, & HOUR all match.
sourceraw docstring

schedule-frame?clj

(schedule-frame? frame)

Is FRAME a valid schedule frame?

Is FRAME a valid schedule frame?
sourceraw docstring

schedule-type?clj

(schedule-type? schedule-type)

Predicate function which returns true if the given argument is a valid value as a schedule-type, false otherwise.

Predicate function which returns `true` if the given argument is a valid value as a schedule-type, `false` otherwise.
sourceraw docstring

supports-recipients?clj

(supports-recipients? channel)

Does given CHANNEL type support a list of recipients? :tv:

Does given CHANNEL type support a list of recipients? :tv:
sourceraw docstring

update-pulse-channel!clj

(update-pulse-channel! {:keys [id channel_type enabled details recipients
                               schedule_type schedule_day schedule_hour
                               schedule_frame]
                        :or {details {} recipients []}})

Updates an existing PulseChannel along with all related data associated with the channel such as PulseChannelRecipients.

Updates an existing `PulseChannel` along with all related data associated with the channel such as `PulseChannelRecipients`.
sourceraw docstring

update-recipients!clj

(update-recipients! id user-ids)

Update the PulseChannelRecipients for PULSE-CHANNEL. USER-IDS should be a definitive collection of all IDs of users who should receive the pulse.

  • If an ID in USER-IDS has no corresponding existing PulseChannelRecipients object, one will be created.
  • If an existing PulseChannelRecipients has no corresponding ID in USER-IDs, it will be deleted.
Update the `PulseChannelRecipients` for PULSE-CHANNEL.
USER-IDS should be a definitive collection of *all* IDs of users who should receive the pulse.

*  If an ID in USER-IDS has no corresponding existing `PulseChannelRecipients` object, one will be created.
*  If an existing `PulseChannelRecipients` has no corresponding ID in USER-IDs, it will be deleted.
sourceraw docstring

valid-schedule?clj

(valid-schedule? schedule-type schedule-hour schedule-day schedule-frame)

Predicate function which returns true if the combination of scheduling choices is valid, false otherwise.

Predicate function which returns `true` if the combination of scheduling choices is valid, `false` otherwise.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close