Class: ApiReference::NewPortalSession
- Defined in:
- lib/api_reference/models/new_portal_session.rb
Overview
NewPortalSession Model.
Instance Attribute Summary collapse
-
#expires_in_minutes ⇒ Integer
Duration in minutes until the portal session expires.
-
#invalidate_existing ⇒ TrueClass | FalseClass
When true (default), creating this session soft-deletes any other active portal sessions for the customer.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(expires_in_minutes: 60, invalidate_existing: true) ⇒ NewPortalSession
constructor
A new instance of NewPortalSession.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(expires_in_minutes: 60, invalidate_existing: true) ⇒ NewPortalSession
Returns a new instance of NewPortalSession.
46 47 48 49 |
# File 'lib/api_reference/models/new_portal_session.rb', line 46 def initialize(expires_in_minutes: 60, invalidate_existing: true) @expires_in_minutes = expires_in_minutes unless expires_in_minutes == SKIP @invalidate_existing = invalidate_existing unless invalidate_existing == SKIP end |
Instance Attribute Details
#expires_in_minutes ⇒ Integer
Duration in minutes until the portal session expires. Defaults to 60. Maximum 180.
15 16 17 |
# File 'lib/api_reference/models/new_portal_session.rb', line 15 def expires_in_minutes @expires_in_minutes end |
#invalidate_existing ⇒ TrueClass | FalseClass
When true (default), creating this session soft-deletes any other active portal sessions for the customer. Set to false to allow concurrent sessions — useful when minting portal links for multiple authenticated end-users at once. The customer's permanent portal link (if any) is never invalidated by this.
23 24 25 |
# File 'lib/api_reference/models/new_portal_session.rb', line 23 def invalidate_existing @invalidate_existing end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/api_reference/models/new_portal_session.rb', line 52 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. expires_in_minutes = hash['expires_in_minutes'] ||= 60 invalidate_existing = hash['invalidate_existing'] ||= true # Create object from extracted values. NewPortalSession.new(expires_in_minutes: expires_in_minutes, invalidate_existing: invalidate_existing) end |
.names ⇒ Object
A mapping from model property names to API property names.
26 27 28 29 30 31 |
# File 'lib/api_reference/models/new_portal_session.rb', line 26 def self.names @_hash = {} if @_hash.nil? @_hash['expires_in_minutes'] = 'expires_in_minutes' @_hash['invalidate_existing'] = 'invalidate_existing' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 |
# File 'lib/api_reference/models/new_portal_session.rb', line 42 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 |
# File 'lib/api_reference/models/new_portal_session.rb', line 34 def self.optionals %w[ expires_in_minutes invalidate_existing ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
72 73 74 75 76 |
# File 'lib/api_reference/models/new_portal_session.rb', line 72 def inspect class_name = self.class.name.split('::').last "<#{class_name} expires_in_minutes: #{@expires_in_minutes.inspect}, invalidate_existing:"\ " #{@invalidate_existing.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
65 66 67 68 69 |
# File 'lib/api_reference/models/new_portal_session.rb', line 65 def to_s class_name = self.class.name.split('::').last "<#{class_name} expires_in_minutes: #{@expires_in_minutes}, invalidate_existing:"\ " #{@invalidate_existing}>" end |