Class: SFRest::Security_settings

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

Overview

We need to keep this naming due to the way connection.rb autoloads things. rubocop: disable Naming/ClassAndModuleCamelCase Manage the factory security settings.

Instance Method Summary collapse

Constructor Details

#initialize(conn) ⇒ Security_settings

Returns a new instance of Security_settings.

Parameters:



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

def initialize(conn)
  @conn = conn
end

Instance Method Details

#change_security_settings(data) ⇒ Array

Change security settings.

Parameters:

  • data (Hash)

    Options to the security settings

Options Hash (data):

  • 'minimum_password_length' (Integer)
  • 'minimum_required_password_strength' (String)
  • 'two_step_verification' (Boolean)
  • 'sign_out_inactive_user_accounts' (Boolean)
  • 'sign_out_inactivity_time' (Integer)
  • 'automatically_disable_accounts' (Boolean)
  • 'automatically_disable_accounts_after_days' (Integer)

Returns:

  • (Array)

    an array containing the message given by the server.



34
35
36
# File 'lib/sfrest/security_settings.rb', line 34

def change_security_settings(data)
  @conn.put('/api/v1/security', data.to_json)
end

#current_security_settingsArray

Get current security settings.

Returns:

  • (Array)

    an array containing current security settings.



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

def current_security_settings
  @conn.get('/api/v1/security')
end

#reset_security_settingsArray

Reset current security settings.

Returns:

  • (Array)

    an array containing the message given by the server.



41
42
43
# File 'lib/sfrest/security_settings.rb', line 41

def reset_security_settings
  @conn.delete('/api/v1/security')
end