Class: Aptible::Auth::Organization
- Defined in:
- lib/aptible/auth/organization.rb
Instance Method Summary collapse
- #accounts ⇒ Object
-
#create_saml_configuration!(params) ⇒ Object
SamlConfiguration is a dependent object that does not have a link until created.
- #privileged_roles ⇒ Object
Methods inherited from Resource
Instance Method Details
#accounts ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/aptible/auth/organization.rb', line 32 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) ⇒ 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
47 48 49 50 51 52 |
# File 'lib/aptible/auth/organization.rb', line 47 def create_saml_configuration!(params) HyperResource::Link.new( self, 'href' => "#{href}/saml_configurations" ).post(self.class.normalize_params(params)) end |
#privileged_roles ⇒ Object
28 29 30 |
# File 'lib/aptible/auth/organization.rb', line 28 def privileged_roles roles.select(&:privileged?) end |