Class: ApiReference::PortalSession
- Defined in:
- lib/api_reference/models/portal_session.rb
Overview
PortalSession Model.
Instance Attribute Summary collapse
-
#created_at ⇒ DateTime
TODO: Write general description for this method.
-
#customer_id ⇒ String
TODO: Write general description for this method.
-
#expires_at ⇒ DateTime
TODO: Write general description for this method.
-
#id ⇒ String
TODO: Write general description for this method.
-
#url ⇒ String
TODO: Write general description for this method.
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(id:, customer_id:, created_at:, expires_at:, url:, additional_properties: nil) ⇒ PortalSession
constructor
A new instance of PortalSession.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_at ⇒ Object
- #to_custom_expires_at ⇒ Object
-
#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(id:, customer_id:, created_at:, expires_at:, url:, additional_properties: nil) ⇒ PortalSession
Returns a new instance of PortalSession.
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/api_reference/models/portal_session.rb', line 56 def initialize(id:, customer_id:, created_at:, expires_at:, url:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id @customer_id = customer_id @created_at = created_at @expires_at = expires_at @url = url @additional_properties = additional_properties end |
Instance Attribute Details
#created_at ⇒ DateTime
TODO: Write general description for this method
23 24 25 |
# File 'lib/api_reference/models/portal_session.rb', line 23 def created_at @created_at end |
#customer_id ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/api_reference/models/portal_session.rb', line 19 def customer_id @customer_id end |
#expires_at ⇒ DateTime
TODO: Write general description for this method
27 28 29 |
# File 'lib/api_reference/models/portal_session.rb', line 27 def expires_at @expires_at end |
#id ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/api_reference/models/portal_session.rb', line 15 def id @id end |
#url ⇒ String
TODO: Write general description for this method
31 32 33 |
# File 'lib/api_reference/models/portal_session.rb', line 31 def url @url end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/api_reference/models/portal_session.rb', line 70 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil customer_id = hash.key?('customer_id') ? hash['customer_id'] : nil created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) end expires_at = if hash.key?('expires_at') (DateTimeHelper.from_rfc3339(hash['expires_at']) if hash['expires_at']) end url = hash.key?('url') ? hash['url'] : nil # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. PortalSession.new(id: id, customer_id: customer_id, created_at: created_at, expires_at: expires_at, url: url, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 42 |
# File 'lib/api_reference/models/portal_session.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['customer_id'] = 'customer_id' @_hash['created_at'] = 'created_at' @_hash['expires_at'] = 'expires_at' @_hash['url'] = 'url' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 53 54 |
# File 'lib/api_reference/models/portal_session.rb', line 50 def self.nullables %w[ expires_at ] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 |
# File 'lib/api_reference/models/portal_session.rb', line 45 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
117 118 119 120 121 122 |
# File 'lib/api_reference/models/portal_session.rb', line 117 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, customer_id: #{@customer_id.inspect}, created_at:"\ " #{@created_at.inspect}, expires_at: #{@expires_at.inspect}, url: #{@url.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_custom_created_at ⇒ Object
100 101 102 |
# File 'lib/api_reference/models/portal_session.rb', line 100 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_custom_expires_at ⇒ Object
104 105 106 |
# File 'lib/api_reference/models/portal_session.rb', line 104 def to_custom_expires_at DateTimeHelper.to_rfc3339(expires_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
109 110 111 112 113 114 |
# File 'lib/api_reference/models/portal_session.rb', line 109 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, customer_id: #{@customer_id}, created_at: #{@created_at},"\ " expires_at: #{@expires_at}, url: #{@url}, additional_properties:"\ " #{@additional_properties}>" end |