Class: NewStoreApi::SupportAccessDetails
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::SupportAccessDetails
- Defined in:
- lib/new_store_api/models/support_access_details.rb
Overview
Support Access Details.
Instance Attribute Summary collapse
-
#created_at ⇒ DateTime
Creation date of the support access.
-
#expires_at ⇒ DateTime
Expiry date of the support access.
-
#id ⇒ UUID | String
Support access id.
-
#reason ⇒ String
Reason for the support access.
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(created_at = nil, expires_at = nil, id = nil, reason = nil) ⇒ SupportAccessDetails
constructor
A new instance of SupportAccessDetails.
-
#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(created_at = nil, expires_at = nil, id = nil, reason = nil) ⇒ SupportAccessDetails
Returns a new instance of SupportAccessDetails.
49 50 51 52 53 54 |
# File 'lib/new_store_api/models/support_access_details.rb', line 49 def initialize(created_at = nil, expires_at = nil, id = nil, reason = nil) @created_at = created_at @expires_at = expires_at @id = id @reason = reason end |
Instance Attribute Details
#created_at ⇒ DateTime
Creation date of the support access.
15 16 17 |
# File 'lib/new_store_api/models/support_access_details.rb', line 15 def created_at @created_at end |
#expires_at ⇒ DateTime
Expiry date of the support access.
19 20 21 |
# File 'lib/new_store_api/models/support_access_details.rb', line 19 def expires_at @expires_at end |
#id ⇒ UUID | String
Support access id.
23 24 25 |
# File 'lib/new_store_api/models/support_access_details.rb', line 23 def id @id end |
#reason ⇒ String
Reason for the support access.
27 28 29 |
# File 'lib/new_store_api/models/support_access_details.rb', line 27 def reason @reason end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/new_store_api/models/support_access_details.rb', line 57 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. 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 id = hash.key?('id') ? hash['id'] : nil reason = hash.key?('reason') ? hash['reason'] : nil # Create object from extracted values. SupportAccessDetails.new(created_at, expires_at, id, reason) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/new_store_api/models/support_access_details.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['created_at'] = 'created_at' @_hash['expires_at'] = 'expires_at' @_hash['id'] = 'id' @_hash['reason'] = 'reason' @_hash end |
.nullables ⇒ Object
An array for nullable fields
45 46 47 |
# File 'lib/new_store_api/models/support_access_details.rb', line 45 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 |
# File 'lib/new_store_api/models/support_access_details.rb', line 40 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
93 94 95 96 97 |
# File 'lib/new_store_api/models/support_access_details.rb', line 93 def inspect class_name = self.class.name.split('::').last "<#{class_name} created_at: #{@created_at.inspect}, expires_at: #{@expires_at.inspect}, id:"\ " #{@id.inspect}, reason: #{@reason.inspect}>" end |
#to_custom_created_at ⇒ Object
77 78 79 |
# File 'lib/new_store_api/models/support_access_details.rb', line 77 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_custom_expires_at ⇒ Object
81 82 83 |
# File 'lib/new_store_api/models/support_access_details.rb', line 81 def to_custom_expires_at DateTimeHelper.to_rfc3339(expires_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
86 87 88 89 90 |
# File 'lib/new_store_api/models/support_access_details.rb', line 86 def to_s class_name = self.class.name.split('::').last "<#{class_name} created_at: #{@created_at}, expires_at: #{@expires_at}, id: #{@id}, reason:"\ " #{@reason}>" end |