Class: Nahook::Resources::PortalSessions
- Inherits:
-
Object
- Object
- Nahook::Resources::PortalSessions
- Defined in:
- lib/nahook/resources/portal_sessions.rb
Overview
Resource for creating developer portal sessions via the Management API.
Portal sessions generate short-lived URLs that grant your customers access to a self-service endpoint management portal.
Instance Method Summary collapse
-
#create(workspace_id, app_id, metadata: nil) ⇒ Hash
Create a portal session for an application.
-
#initialize(http) ⇒ PortalSessions
constructor
private
A new instance of PortalSessions.
Constructor Details
#initialize(http) ⇒ PortalSessions
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of PortalSessions.
19 20 21 |
# File 'lib/nahook/resources/portal_sessions.rb', line 19 def initialize(http) @http = http end |
Instance Method Details
#create(workspace_id, app_id, metadata: nil) ⇒ Hash
Create a portal session for an application.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/nahook/resources/portal_sessions.rb', line 29 def create(workspace_id, app_id, metadata: nil) body = {} body["metadata"] = if @http.request( method: :post, path: "/management/v1/workspaces/#{e(workspace_id)}/applications/#{e(app_id)}/portal", body: body ) end |