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
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 |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
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_roles ⇒ Object
27 28 29 |
# File 'lib/aptible/auth/organization.rb', line 27 def privileged_roles roles.select(&:privileged?) end |