Class: SFRest::Task_log_settings

Inherits:
Object
  • Object
show all
Defined in:
lib/sfrest/task_log_settings.rb

Overview

We need to keep this naming due to the way connection.rb autoloads things. rubocop: disable Naming/ClassAndModuleCamelCase Manage the site default ownership feature.

Instance Method Summary collapse

Constructor Details

#initialize(conn) ⇒ Task_log_settings

Returns a new instance of Task_log_settings.

Parameters:



11
12
13
# File 'lib/sfrest/task_log_settings.rb', line 11

def initialize(conn)
  @conn = conn
end

Instance Method Details

#current_task_log_settingsArray

Get current task log settings.

Returns:

  • (Array)

    an array containing current settings.



18
19
20
# File 'lib/sfrest/task_log_settings.rb', line 18

def current_task_log_settings
  @conn.get('/api/v1/task-log-settings')
end

#edit_task_log_settings(wip_log_maximum_level, wip_log_level) ⇒ Array

Set the site ownership settings.

Parameters:

  • The (String)

    maximum log level that will be written to the log.

  • Level (String)

    of Wip log messages to keep on successful completion.

Returns:

  • (Array)

    an array containing the message given by the server.



27
28
29
30
31
32
33
34
# File 'lib/sfrest/task_log_settings.rb', line 27

def edit_task_log_settings(wip_log_maximum_level, wip_log_level)
  payload = {
    'wip_log_maximum_level' => wip_log_maximum_level,
    'wip_log_level' => wip_log_level
  }

  @conn.put('/api/v1/task-log-settings', payload.to_json)
end

#reset_task_log_settingsArray

Reset current task log settings.

Returns:

  • (Array)

    an array containing the message given by the server.



39
40
41
# File 'lib/sfrest/task_log_settings.rb', line 39

def reset_task_log_settings
  @conn.delete('/api/v1/task-log-settings')
end