Class: NewStoreApi::ImportSchemaCreated
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::ImportSchemaCreated
- Defined in:
- lib/new_store_api/models/import_schema_created.rb
Overview
ImportSchemaCreated Model.
Instance Attribute Summary collapse
-
#id ⇒ String
ID of the import schema.
-
#last_updated_at ⇒ DateTime
Timestamp in RFC3339 format.
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 = nil, last_updated_at = nil) ⇒ ImportSchemaCreated
constructor
A new instance of ImportSchemaCreated.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_last_updated_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 = nil, last_updated_at = nil) ⇒ ImportSchemaCreated
Returns a new instance of ImportSchemaCreated.
40 41 42 43 |
# File 'lib/new_store_api/models/import_schema_created.rb', line 40 def initialize(id = nil, last_updated_at = nil) @id = id @last_updated_at = last_updated_at end |
Instance Attribute Details
#id ⇒ String
ID of the import schema. It must be unique per tenant and contain only ASCII characters. F.e UUID4, human readable name without spaces
16 17 18 |
# File 'lib/new_store_api/models/import_schema_created.rb', line 16 def id @id end |
#last_updated_at ⇒ DateTime
Timestamp in RFC3339 format.
20 21 22 |
# File 'lib/new_store_api/models/import_schema_created.rb', line 20 def last_updated_at @last_updated_at end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/new_store_api/models/import_schema_created.rb', line 46 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil last_updated_at = if hash.key?('last_updated_at') (DateTimeHelper.from_rfc3339(hash['last_updated_at']) if hash['last_updated_at']) end # Create object from extracted values. ImportSchemaCreated.new(id, last_updated_at) end |
.names ⇒ Object
A mapping from model property names to API property names.
23 24 25 26 27 28 |
# File 'lib/new_store_api/models/import_schema_created.rb', line 23 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['last_updated_at'] = 'last_updated_at' @_hash end |
.nullables ⇒ Object
An array for nullable fields
36 37 38 |
# File 'lib/new_store_api/models/import_schema_created.rb', line 36 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
31 32 33 |
# File 'lib/new_store_api/models/import_schema_created.rb', line 31 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
71 72 73 74 |
# File 'lib/new_store_api/models/import_schema_created.rb', line 71 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, last_updated_at: #{@last_updated_at.inspect}>" end |
#to_custom_last_updated_at ⇒ Object
60 61 62 |
# File 'lib/new_store_api/models/import_schema_created.rb', line 60 def to_custom_last_updated_at DateTimeHelper.to_rfc3339(last_updated_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
65 66 67 68 |
# File 'lib/new_store_api/models/import_schema_created.rb', line 65 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, last_updated_at: #{@last_updated_at}>" end |