Event Channels

An EventChannel is a named grouping of EventSubscriptions.

List Event Channels

SDK Method

Files::EventChannel.list

Return Object

List<EventChannel>

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

begin
  event_channels = Files::EventChannel.list
  event_channels.auto_paging_each do |event_channel|
    # Operate on event_channel
  end
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

Show Event Channel

SDK Method

Files::EventChannel.find

Return Object

EventChannel

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Method Arguments

ArgumentDescription
id
int64
Required
Event Channel ID.

Example Request

begin
  event_channel = Files::EventChannel.find(id)
  # Operate on event_channel
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

Create Event Channel

SDK Method

Files::EventChannel.create

Return Object

EventChannel

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Method Arguments

ArgumentDefaultDescription
name
string
Required
Event Channel name.
workspace_id
int64
0Workspace ID. 0 means the default workspace.
description
string
Event Channel description.
enabled
boolean
trueWhether this Event Channel can dispatch events.
default_channel
boolean
falseWhether this Event Channel is the default destination for newly published events.

Example Request

begin
  event_channel = Files::EventChannel.create(
    name: "example"
  )
  # Operate on event_channel
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

Update Event Channel

SDK Method

event_channel.update

Return Object

EventChannel

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Method Arguments

ArgumentDescription
name
string
Event Channel name.
workspace_id
int64
Workspace ID. 0 means the default workspace.
description
string
Event Channel description.
enabled
boolean
Whether this Event Channel can dispatch events.
default_channel
boolean
Whether this Event Channel is the default destination for newly published events.

Example Request

begin
  # Find the event_channel object by its id.
  event_channel = Files::EventChannel.find(id)
  event_channel.update(
    name: "example"
  )
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

Delete Event Channel

SDK Method

event_channel.delete

Return Object

nil

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Example Request

begin
  # Find the event_channel object by its id.
  event_channel = Files::EventChannel.find(id)
  event_channel.delete
rescue Files::NotAuthenticatedError => e
  puts "Authentication Error Occurred (#{e.class.to_s}): " + e.message
rescue Files::Error => e
  puts "Unknown Error Occurred (#{e.class.to_s}): " + e.message
end

The EventChannel Object

Some of the methods above return a EventChannel object. The attributes of this object are listed below.

AttributeDescription
id
int64
Event Channel ID
name
string
Event Channel name.
workspace_id
int64
Workspace ID. 0 means the default workspace.
description
string
Event Channel description.
enabled
boolean
Whether this Event Channel can dispatch events.
default_channel
boolean
Whether this Event Channel is the default destination for newly published events.
created_at
date-time
Event Channel create date/time.
updated_at
date-time
Event Channel update date/time.