Class: SFRest::Factory_standard_domain

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

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(conn) ⇒ Factory_standard_domain

Returns a new instance of Factory_standard_domain.

Parameters:



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

def initialize(conn)
  @conn = conn
end

Instance Method Details

#backfill_domainsArray

Backfills the factory standard domains using the templates defined.

Returns:

  • (Array)

    an array containing the message and task_id for that operation.



45
46
47
# File 'lib/sfrest/factory_standard_domain.rb', line 45

def backfill_domains
  @conn.post('/api/v1/factory-standard-domains', {}.to_json)
end

#disable_factory_standard_domain_template(domain_template_name) ⇒ Array

Disable the centralized role management settings for a given role.

Parameters:

  • domain_template_name (String)

    the domain template name.

Returns:

  • (Array)

    an array of factory standard domains with their associated settings.



38
39
40
# File 'lib/sfrest/factory_standard_domain.rb', line 38

def disable_factory_standard_domain_template(domain_template_name)
  @conn.delete("/api/v1/factory-standard-domains/#{domain_template_name}")
end

#enable_factory_standard_domain_template(domain_template_name, new_template = []) ⇒ Array

Enable the factory standard domains settings for a given template name.

Parameters:

  • domain_template_name (String)

    the domain template name.

  • new_template (Array) (defaults to: [])

    the templates to be used.

Returns:

  • (Array)

    an array of factory standard domains with their associated settings.



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

def enable_factory_standard_domain_template(domain_template_name, new_template = [])
  payload = {
    'new_template' => new_template
  }.to_json
  @conn.put("/api/v1/factory-standard-domains/#{domain_template_name}", payload)
end

#factory_standard_domain_mappingArray

Get current factory standard domains settings

Returns:

  • (Array)

    an array of factory standard domains with their associated settings.



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

def factory_standard_domain_mapping
  @conn.get('/api/v1/factory-standard-domains')
end