REST Resource: projects.locations.channels.events

Resource: Event

Event is a sub-resource of a channel, which can be scheduled by the user to execute operations on a channel resource without having to stop the channel.

JSON representation
{
  "name": string,
  "createTime": string,
  "updateTime": string,
  "labels": {
    string: string,
    ...
  },
  "executeNow": boolean,
  "executionTime": string,
  "state": enum (State),
  "error": {
    object (Status)
  },

  // Union field task can be only one of the following:
  "inputSwitch": {
    object (InputSwitchTask)
  },
  "adBreak": {
    object (AdBreakTask)
  },
  "returnToProgram": {
    object (ReturnToProgramTask)
  },
  "slate": {
    object (SlateTask)
  },
  "mute": {
    object (MuteTask)
  },
  "unmute": {
    object (UnmuteTask)
  }
  // End of list of possible types for union field task.
}
Fields
name

string

The resource name of the event, in the form of: projects/{project}/locations/{location}/channels/{channelId}/events/{eventId}.

createTime

string (Timestamp format)

Output only. The creation time.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. The update time.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

labels

map (key: string, value: string)

User-defined key/value metadata.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

executeNow

boolean

When this field is set to true, the event will be executed at the earliest time that the server can schedule the event and executionTime will be populated with the time that the server actually schedules the event.

executionTime

string (Timestamp format)

The time to execute the event. If you set executeNow to true, then do not set this field in the events.create request. In this case, the server schedules the event and populates this field. If you set executeNow to false, then you must set this field to at least 10 seconds in the future or else the event can't be created.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

state

enum (State)

Output only. The state of the event.

error

object (Status)

Output only. An error object that describes the reason for the failure. This property is always present when state is FAILED.

Union field task. Required. Operation to be executed by this event. task can be only one of the following:
inputSwitch

object (InputSwitchTask)

Switches to another input stream.

adBreak

object (AdBreakTask)

Inserts a new ad opportunity.

returnToProgram

object (ReturnToProgramTask)

Stops any running ad break.

slate

object (SlateTask)

Inserts a slate.

mute

object (MuteTask)

Mutes the stream.

unmute

object (UnmuteTask)

Unmutes the stream.

InputSwitchTask

Switches to another input stream. Automatic failover is then disabled.

JSON representation
{
  "inputKey": string
}
Fields
inputKey

string

The InputAttachment.key of the input to switch to.

AdBreakTask

Inserts a new ad opportunity.

JSON representation
{
  "duration": string
}
Fields
duration

string (Duration format)

Duration of an ad opportunity. Must be greater than 0.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

ReturnToProgramTask

This type has no fields.

Stops any events which are currently running. This only applies to events with a duration.

SlateTask

Inserts a slate.

JSON representation
{
  "duration": string,
  "asset": string
}
Fields
duration

string (Duration format)

Optional. Duration of the slate. Must be greater than 0 if specified. Omit this field for a long running slate.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

asset

string

Slate asset to use for the duration. If its duration is less than the duration of the SlateTask, then the slate loops. The slate must be represented in the form of: projects/{project}/locations/{location}/assets/{assetId}.

MuteTask

Mutes the stream.

JSON representation
{
  "duration": string
}
Fields
duration

string (Duration format)

Duration for which the stream should be muted. If omitted, the stream will be muted until an UnmuteTask event is sent.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

UnmuteTask

This type has no fields.

Unmutes the stream. The task fails if the stream is not currently muted.

State

State of the event

Enums
STATE_UNSPECIFIED Event state is not specified.
SCHEDULED Event is scheduled but not executed yet.
RUNNING Event is being executed.
SUCCEEDED Event has been successfully executed.
FAILED Event fails to be executed.
PENDING Event has been created but not scheduled yet.
STOPPED Event was stopped before running for its full duration.

Methods

create

Creates an event with the provided unique ID in the specified channel.

delete

Deletes the specified event.

get

Returns the specified event.

list

Returns a list of all events in the specified channel.