Sha256: 8276a25ef8d6ffe2f34c55c0632fdc02988dea5bdd9eff42c64fa0c1d328a424

Contents?: true

Size: 832 Bytes

Versions: 54

Compression:

Stored size: 832 Bytes

Contents

class Ey::Core::Client
  class Real
    def update_alert(_params={})
      params = Cistern::Hash.stringify_keys(_params)
      id = params.delete("id")
      body = { alert: params["alert"] }

      request(
        :method => :put,
        :path   => "/alerts/#{id}",
        :body   => body,
      )
    end
  end

  class Mock
    def update_alert(_params={})
      params = Cistern::Hash.stringify_keys(_params)
      identity = params["id"]
      alert  = find(:alerts, identity)

      update_params = Cistern::Hash.slice(params["alert"],
                                          "acknowledged", "ignored", "severity", "finished_at", "external_id", "started_at", "message")

      alert.merge!(update_params.merge!("updated_at" => Time.now))

      response(
        :body => { "alert" => alert },
      )
    end
  end
end

Version data entries

54 entries across 54 versions & 3 rubygems

Version Path
ey-core-3.6.0.autoscaling1 lib/ey-core/requests/update_alert.rb
ey-core-3.6.4 lib/ey-core/requests/update_alert.rb
ey-core-3.6.3 lib/ey-core/requests/update_alert.rb
ey-core-3.6.1 lib/ey-core/requests/update_alert.rb
groove-ey-core-3.6.3 lib/ey-core/requests/update_alert.rb
groove-ey-core-3.6.2 lib/ey-core/requests/update_alert.rb
groove-ey-core-3.6.1 lib/ey-core/requests/update_alert.rb
ey-core-3.5.0 lib/ey-core/requests/update_alert.rb
ey-core-3.4.4 lib/ey-core/requests/update_alert.rb
ey-core-3.4.2 lib/ey-core/requests/update_alert.rb
ey-core-3.4.1 lib/ey-core/requests/update_alert.rb
ey-core-3.4.0 lib/ey-core/requests/update_alert.rb
ey-core-3.3.1 lib/ey-core/requests/update_alert.rb
ey-core-3.3.0 lib/ey-core/requests/update_alert.rb
ey-core-3.2.6 lib/ey-core/requests/update_alert.rb
ey-core-3.2.5 lib/ey-core/requests/update_alert.rb
ey-core-3.2.4 lib/ey-core/requests/update_alert.rb
ey-core-3.2.3 lib/ey-core/requests/update_alert.rb
ey-core-3.2.2 lib/ey-core/requests/update_alert.rb
ey-core-3.2.1 lib/ey-core/requests/update_alert.rb