Method: Gitlab::Client::BroadcastMessages#create_broadcast_message

Defined in:
lib/gitlab/client/broadcast_messages.rb

#create_broadcast_message(message, options = {}) ⇒ Gitlab::ObjectifiedHash

Create a broadcast message.

Examples:

Gitlab.create_broadcast_message('Mayday')
Gitlab.create_broadcast_message('Mayday', {starts_at: Time.zone.now, ends_at: Time.zone.now + 30.minutes, color: '#cecece', font: '#FFFFFF'})

Parameters:

  • message (String)

    Message to display

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :starts_at(optional) (DateTime)

    Starting time (defaults to current time)

  • :ends_at(optional) (DateTime)

    Ending time (defaults to one hour from current time)

  • :color(optional) (String)

    Background color hex code

  • :font(optional) (String)

    Foreground color hex code

Returns:



41
42
43
44
# File 'lib/gitlab/client/broadcast_messages.rb', line 41

def create_broadcast_message(message, options = {})
  body = { message: message }.merge(options)
  post('/broadcast_messages', body: body)
end