Module: Simpleokta::Client::Apps
- Included in:
- Simpleokta::Client
- Defined in:
- lib/simpleokta/apps.rb
Instance Method Summary collapse
-
#activate_app(app_id) ⇒ Object
Activate an application by id.
-
#app(app_id) ⇒ Hash<Application Object>
Return a specific application in the okta instance.
-
#apps ⇒ Array<Application Object>
Returns a list of all applications in the okta instance.
-
#create_app(app_data) ⇒ Hash<Application Object>
Creates an application in Okta.
-
#deactivate_app(app_id) ⇒ Object
Deactivate an application by id.
-
#delete_app(app_id) ⇒ Object
Delete an application by id.
-
#update_app(app_id, app_data) ⇒ Hash<Application Object>
Update an application.
-
#users_assigned_to_application(app_id) ⇒ Array<User Object>
Returns all users currently assigned to the application.
Instance Method Details
#activate_app(app_id) ⇒ Object
Activate an application by id
81 82 83 84 |
# File 'lib/simpleokta/apps.rb', line 81 def activate_app(app_id) response = call_with_token('post', "#{Constants::APP_API_BASE_PATH}/#{app_id}/lifecycle/activate") "Application with id: #{app_id} activated" end |
#app(app_id) ⇒ Hash<Application Object>
Return a specific application in the okta instance.
20 21 22 23 |
# File 'lib/simpleokta/apps.rb', line 20 def app(app_id) response = call_with_token('get', "#{Constants::APP_API_BASE_PATH}/#{app_id}") JSON.parse(response.body) end |
#apps ⇒ Array<Application Object>
Returns a list of all applications in the okta instance.
11 12 13 14 |
# File 'lib/simpleokta/apps.rb', line 11 def apps response = call_with_token('get', Constants::APP_API_BASE_PATH) JSON.parse(response.body) end |
#create_app(app_data) ⇒ Hash<Application Object>
Creates an application in Okta.
52 53 54 55 |
# File 'lib/simpleokta/apps.rb', line 52 def create_app(app_data) response = call_with_token('post', Constants::APP_API_BASE_PATH, app_data) JSON.parse(response.body) end |
#deactivate_app(app_id) ⇒ Object
Deactivate an application by id
90 91 92 93 |
# File 'lib/simpleokta/apps.rb', line 90 def deactivate_app(app_id) response = call_with_token('post', "#{Constants::APP_API_BASE_PATH}/#{app_id}/lifecycle/deactivate") "Application with id: #{app_id} deactivated" end |
#delete_app(app_id) ⇒ Object
Delete an application by id
72 73 74 75 |
# File 'lib/simpleokta/apps.rb', line 72 def delete_app(app_id) response = call_with_token('delete', "#{Constants::APP_API_BASE_PATH}/#{app_id}") response end |
#update_app(app_id, app_data) ⇒ Hash<Application Object>
Update an application
64 65 66 67 |
# File 'lib/simpleokta/apps.rb', line 64 def update_app(app_id, app_data) response = call_with_token('put', "#{Constants::APP_API_BASE_PATH}/#{app_id}", app_data) JSON.parse(response.body) end |
#users_assigned_to_application(app_id) ⇒ Array<User Object>
Returns all users currently assigned to the application
29 30 31 32 |
# File 'lib/simpleokta/apps.rb', line 29 def users_assigned_to_application(app_id) response = call_with_token('get', "#{Constants::APP_API_BASE_PATH}/#{app_id}/users") JSON.parse(response.body) end |