Class: NewStoreApi::ImportResponse
- Defined in:
- lib/new_store_api/models/import_response.rb
Overview
ImportResponse Model.
Instance Attribute Summary collapse
-
#created_at ⇒ DateTime
Timestamp of the import creation.
-
#display_name ⇒ String
The human readable import identifier.
-
#id ⇒ String
The import identifier.
-
#s3_uri ⇒ String
The s3 URI of the CSV used in the import.
-
#status ⇒ StatusEnum
The current status of the import.
-
#status_notes ⇒ Array[String]
The notes relating to the status of the import, if it is FAILED or PARTIALLY_COMPLETED.
-
#type ⇒ String
The type of the import.
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, created_at = SKIP, display_name = SKIP, s3_uri = SKIP, status = SKIP, status_notes = SKIP, type = SKIP) ⇒ ImportResponse
constructor
A new instance of ImportResponse.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_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, created_at = SKIP, display_name = SKIP, s3_uri = SKIP, status = SKIP, status_notes = SKIP, type = SKIP) ⇒ ImportResponse
Returns a new instance of ImportResponse.
72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/new_store_api/models/import_response.rb', line 72 def initialize(id = nil, created_at = SKIP, display_name = SKIP, s3_uri = SKIP, status = SKIP, status_notes = SKIP, type = SKIP) @created_at = created_at unless created_at == SKIP @display_name = display_name unless display_name == SKIP @id = id @s3_uri = s3_uri unless s3_uri == SKIP @status = status unless status == SKIP @status_notes = status_notes unless status_notes == SKIP @type = type unless type == SKIP end |
Instance Attribute Details
#created_at ⇒ DateTime
Timestamp of the import creation.
15 16 17 |
# File 'lib/new_store_api/models/import_response.rb', line 15 def created_at @created_at end |
#display_name ⇒ String
The human readable import identifier.
19 20 21 |
# File 'lib/new_store_api/models/import_response.rb', line 19 def display_name @display_name end |
#id ⇒ String
The import identifier.
23 24 25 |
# File 'lib/new_store_api/models/import_response.rb', line 23 def id @id end |
#s3_uri ⇒ String
The s3 URI of the CSV used in the import.
27 28 29 |
# File 'lib/new_store_api/models/import_response.rb', line 27 def s3_uri @s3_uri end |
#status ⇒ StatusEnum
The current status of the import.
31 32 33 |
# File 'lib/new_store_api/models/import_response.rb', line 31 def status @status end |
#status_notes ⇒ Array[String]
The notes relating to the status of the import, if it is FAILED or PARTIALLY_COMPLETED
36 37 38 |
# File 'lib/new_store_api/models/import_response.rb', line 36 def status_notes @status_notes end |
#type ⇒ String
The type of the import.
40 41 42 |
# File 'lib/new_store_api/models/import_response.rb', line 40 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/new_store_api/models/import_response.rb', line 85 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) else SKIP end display_name = hash.key?('display_name') ? hash['display_name'] : SKIP s3_uri = hash.key?('s3_uri') ? hash['s3_uri'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP status_notes = hash.key?('status_notes') ? hash['status_notes'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP # Create object from extracted values. ImportResponse.new(id, created_at, display_name, s3_uri, status, status_notes, type) end |
.names ⇒ Object
A mapping from model property names to API property names.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/new_store_api/models/import_response.rb', line 43 def self.names @_hash = {} if @_hash.nil? @_hash['created_at'] = 'created_at' @_hash['display_name'] = 'display_name' @_hash['id'] = 'id' @_hash['s3_uri'] = 's3_uri' @_hash['status'] = 'status' @_hash['status_notes'] = 'status_notes' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
68 69 70 |
# File 'lib/new_store_api/models/import_response.rb', line 68 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/new_store_api/models/import_response.rb', line 56 def self.optionals %w[ created_at display_name s3_uri status status_notes type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
123 124 125 126 127 128 |
# File 'lib/new_store_api/models/import_response.rb', line 123 def inspect class_name = self.class.name.split('::').last "<#{class_name} created_at: #{@created_at.inspect}, display_name: #{@display_name.inspect},"\ " id: #{@id.inspect}, s3_uri: #{@s3_uri.inspect}, status: #{@status.inspect}, status_notes:"\ " #{@status_notes.inspect}, type: #{@type.inspect}>" end |
#to_custom_created_at ⇒ Object
111 112 113 |
# File 'lib/new_store_api/models/import_response.rb', line 111 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
116 117 118 119 120 |
# File 'lib/new_store_api/models/import_response.rb', line 116 def to_s class_name = self.class.name.split('::').last "<#{class_name} created_at: #{@created_at}, display_name: #{@display_name}, id: #{@id},"\ " s3_uri: #{@s3_uri}, status: #{@status}, status_notes: #{@status_notes}, type: #{@type}>" end |