Method: MatrixSdk::Protocols::CS#set_pushrule_actions

Defined in:
lib/matrix_sdk/protocols/cs.rb

#set_pushrule_actions(actions, kind:, id:, scope: 'global') ⇒ Response

Replaces the list of actions for a push rule for the current user



1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
# File 'lib/matrix_sdk/protocols/cs.rb', line 1965

def set_pushrule_actions(actions, kind:, id:, scope: 'global')
  scope = ERB::Util.url_encode scope.to_s
  kind = ERB::Util.url_encode kind.to_s
  id = ERB::Util.url_encode id.to_s

  actions = [actions] unless actions.is_a? Array

  body = {
    actions: actions
  }

  request(:put, client_api_latest, "/pushrules/#{scope}/#{kind}/#{id}/actions", body: body)
end