Class: Aptible::Auth::Organization

Inherits:
Resource
  • Object
show all
Defined in:
lib/aptible/auth/organization.rb

Instance Method Summary collapse

Methods inherited from Resource

#namespace, #root_url

Instance Method Details

#accountsObject



31
32
33
34
35
36
37
38
39
40
# File 'lib/aptible/auth/organization.rb', line 31

def accounts
  return @accounts if @accounts

  require 'aptible/api'

  accounts = Aptible::Api::Account.all(token: token, headers: headers)
  @accounts = accounts.select do ||
    (link = .links[:organization]) && link.href == href
  end
end

#create_saml_configuration!(params) ⇒ Object

SamlConfiguration is a dependent object that does not have a link until created. So, we create the link for it to allow HyperResource to successfully create the object. Afterwords, we can directly manage the SamlConfiguration



46
47
48
49
50
51
# File 'lib/aptible/auth/organization.rb', line 46

def create_saml_configuration!(params)
  HyperResource::Link.new(
    self,
    'href' => "#{href}/saml_configurations"
  ).post(self.class.normalize_params(params))
end

#privileged_rolesObject



27
28
29
# File 'lib/aptible/auth/organization.rb', line 27

def privileged_roles
  roles.select(&:privileged?)
end