class Aptible::Auth::Organization

Public Instance Methods

accounts() click to toggle source
# 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 |account|
    (link = account.links[:organization]) && link.href == href
  end
end
create_saml_configuration!(params) click to toggle source

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

# 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_roles() click to toggle source
# File lib/aptible/auth/organization.rb, line 27
def privileged_roles
  roles.select(&:privileged?)
end