module WorkOS::Portal
The Portal
module provides resource methods for working with the Admin Portal
product
Constants
- GENERATE_LINK_INTENTS
Public Class Methods
generate_link(intent:, organization:, return_url: nil)
click to toggle source
# File lib/workos/portal.rb, line 34 def generate_link(intent:, organization:, return_url: nil) validate_intent(intent) request = post_request( auth: true, body: { intent: intent, organization: organization, return_url: return_url, }, path: '/portal/generate_link', ) response = execute_request(request: request) JSON.parse(response.body)['link'] end
Private Class Methods
validate_intent(intent)
click to toggle source
# File lib/workos/portal.rb, line 55 def validate_intent(intent) return if GENERATE_LINK_INTENTS.include?(intent) raise ArgumentError, "#{intent} is not a valid value." \ " `intent` must be in #{GENERATE_LINK_INTENTS}" end