Class: NewStoreApi::ImportSchemaGet
- Defined in:
- lib/new_store_api/models/import_schema_get.rb
Overview
ImportSchemaGet Model.
Instance Attribute Summary collapse
-
#entity ⇒ String
readonly
TODO: Write general description for this method.
-
#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) ⇒ ImportSchemaGet
constructor
A new instance of ImportSchemaGet.
-
#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) ⇒ ImportSchemaGet
Returns a new instance of ImportSchemaGet.
45 46 47 48 49 |
# File 'lib/new_store_api/models/import_schema_get.rb', line 45 def initialize(id = nil, last_updated_at = nil) @entity = 'PRODUCTS' @id = id @last_updated_at = last_updated_at end |
Instance Attribute Details
#entity ⇒ String (readonly)
TODO: Write general description for this method
15 16 17 |
# File 'lib/new_store_api/models/import_schema_get.rb', line 15 def entity @entity end |
#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
20 21 22 |
# File 'lib/new_store_api/models/import_schema_get.rb', line 20 def id @id end |
#last_updated_at ⇒ DateTime
Timestamp in RFC3339 format.
24 25 26 |
# File 'lib/new_store_api/models/import_schema_get.rb', line 24 def last_updated_at @last_updated_at 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 63 64 |
# File 'lib/new_store_api/models/import_schema_get.rb', line 52 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. ImportSchemaGet.new(id, last_updated_at) end |
.names ⇒ Object
A mapping from model property names to API property names.
27 28 29 30 31 32 33 |
# File 'lib/new_store_api/models/import_schema_get.rb', line 27 def self.names @_hash = {} if @_hash.nil? @_hash['entity'] = 'entity' @_hash['id'] = 'id' @_hash['last_updated_at'] = 'last_updated_at' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 |
# File 'lib/new_store_api/models/import_schema_get.rb', line 41 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
36 37 38 |
# File 'lib/new_store_api/models/import_schema_get.rb', line 36 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
77 78 79 80 81 |
# File 'lib/new_store_api/models/import_schema_get.rb', line 77 def inspect class_name = self.class.name.split('::').last "<#{class_name} entity: #{@entity.inspect}, id: #{@id.inspect}, last_updated_at:"\ " #{@last_updated_at.inspect}>" end |
#to_custom_last_updated_at ⇒ Object
66 67 68 |
# File 'lib/new_store_api/models/import_schema_get.rb', line 66 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.
71 72 73 74 |
# File 'lib/new_store_api/models/import_schema_get.rb', line 71 def to_s class_name = self.class.name.split('::').last "<#{class_name} entity: #{@entity}, id: #{@id}, last_updated_at: #{@last_updated_at}>" end |