Class: WalmartApIs::Report
- Defined in:
- lib/walmart_ap_is/models/report.rb
Overview
Report Model.
Instance Attribute Summary collapse
-
#created_time ⇒ DateTime
TODO: Write general description for this method.
-
#data_end_time ⇒ DateTime
TODO: Write general description for this method.
-
#data_start_time ⇒ DateTime
TODO: Write general description for this method.
-
#processing_end_time ⇒ DateTime
TODO: Write general description for this method.
-
#processing_start_time ⇒ DateTime
TODO: Write general description for this method.
-
#processing_status ⇒ ProcessingStatus
TODO: Write general description for this method.
-
#report_document_id ⇒ String
Present only when processingStatus is DONE.
-
#report_id ⇒ String
TODO: Write general description for this method.
-
#report_schedule_id ⇒ String
TODO: Write general description for this method.
-
#report_type ⇒ 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(report_id:, report_type:, processing_status:, data_start_time: SKIP, data_end_time: SKIP, report_schedule_id: SKIP, created_time: SKIP, processing_start_time: SKIP, processing_end_time: SKIP, report_document_id: SKIP, additional_properties: nil) ⇒ Report
constructor
A new instance of Report.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created_time ⇒ Object
- #to_custom_data_end_time ⇒ Object
- #to_custom_data_start_time ⇒ Object
- #to_custom_processing_end_time ⇒ Object
- #to_custom_processing_start_time ⇒ 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(report_id:, report_type:, processing_status:, data_start_time: SKIP, data_end_time: SKIP, report_schedule_id: SKIP, created_time: SKIP, processing_start_time: SKIP, processing_end_time: SKIP, report_document_id: SKIP, additional_properties: nil) ⇒ Report
Returns a new instance of Report.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/walmart_ap_is/models/report.rb', line 87 def initialize(report_id:, report_type:, processing_status:, data_start_time: SKIP, data_end_time: SKIP, report_schedule_id: SKIP, created_time: SKIP, processing_start_time: SKIP, processing_end_time: SKIP, report_document_id: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @report_id = report_id @report_type = report_type @data_start_time = data_start_time unless data_start_time == SKIP @data_end_time = data_end_time unless data_end_time == SKIP @report_schedule_id = report_schedule_id unless report_schedule_id == SKIP @created_time = created_time unless created_time == SKIP @processing_status = processing_status @processing_start_time = processing_start_time unless processing_start_time == SKIP @processing_end_time = processing_end_time unless processing_end_time == SKIP @report_document_id = report_document_id unless report_document_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#created_time ⇒ DateTime
TODO: Write general description for this method
35 36 37 |
# File 'lib/walmart_ap_is/models/report.rb', line 35 def created_time @created_time end |
#data_end_time ⇒ DateTime
TODO: Write general description for this method
27 28 29 |
# File 'lib/walmart_ap_is/models/report.rb', line 27 def data_end_time @data_end_time end |
#data_start_time ⇒ DateTime
TODO: Write general description for this method
23 24 25 |
# File 'lib/walmart_ap_is/models/report.rb', line 23 def data_start_time @data_start_time end |
#processing_end_time ⇒ DateTime
TODO: Write general description for this method
47 48 49 |
# File 'lib/walmart_ap_is/models/report.rb', line 47 def processing_end_time @processing_end_time end |
#processing_start_time ⇒ DateTime
TODO: Write general description for this method
43 44 45 |
# File 'lib/walmart_ap_is/models/report.rb', line 43 def processing_start_time @processing_start_time end |
#processing_status ⇒ ProcessingStatus
TODO: Write general description for this method
39 40 41 |
# File 'lib/walmart_ap_is/models/report.rb', line 39 def processing_status @processing_status end |
#report_document_id ⇒ String
Present only when processingStatus is DONE
51 52 53 |
# File 'lib/walmart_ap_is/models/report.rb', line 51 def report_document_id @report_document_id end |
#report_id ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/walmart_ap_is/models/report.rb', line 15 def report_id @report_id end |
#report_schedule_id ⇒ String
TODO: Write general description for this method
31 32 33 |
# File 'lib/walmart_ap_is/models/report.rb', line 31 def report_schedule_id @report_schedule_id end |
#report_type ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/walmart_ap_is/models/report.rb', line 19 def report_type @report_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/walmart_ap_is/models/report.rb', line 109 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. report_id = hash.key?('reportId') ? hash['reportId'] : nil report_type = hash.key?('reportType') ? hash['reportType'] : nil processing_status = hash.key?('processingStatus') ? hash['processingStatus'] : nil data_start_time = if hash.key?('dataStartTime') (DateTimeHelper.from_rfc3339(hash['dataStartTime']) if hash['dataStartTime']) else SKIP end data_end_time = if hash.key?('dataEndTime') (DateTimeHelper.from_rfc3339(hash['dataEndTime']) if hash['dataEndTime']) else SKIP end report_schedule_id = hash.key?('reportScheduleId') ? hash['reportScheduleId'] : SKIP created_time = if hash.key?('createdTime') (DateTimeHelper.from_rfc3339(hash['createdTime']) if hash['createdTime']) else SKIP end processing_start_time = if hash.key?('processingStartTime') (DateTimeHelper.from_rfc3339(hash['processingStartTime']) if hash['processingStartTime']) else SKIP end processing_end_time = if hash.key?('processingEndTime') (DateTimeHelper.from_rfc3339(hash['processingEndTime']) if hash['processingEndTime']) else SKIP end report_document_id = hash.key?('reportDocumentId') ? hash['reportDocumentId'] : SKIP # 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. Report.new(report_id: report_id, report_type: report_type, processing_status: processing_status, data_start_time: data_start_time, data_end_time: data_end_time, report_schedule_id: report_schedule_id, created_time: created_time, processing_start_time: processing_start_time, processing_end_time: processing_end_time, report_document_id: report_document_id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/walmart_ap_is/models/report.rb', line 54 def self.names @_hash = {} if @_hash.nil? @_hash['report_id'] = 'reportId' @_hash['report_type'] = 'reportType' @_hash['data_start_time'] = 'dataStartTime' @_hash['data_end_time'] = 'dataEndTime' @_hash['report_schedule_id'] = 'reportScheduleId' @_hash['created_time'] = 'createdTime' @_hash['processing_status'] = 'processingStatus' @_hash['processing_start_time'] = 'processingStartTime' @_hash['processing_end_time'] = 'processingEndTime' @_hash['report_document_id'] = 'reportDocumentId' @_hash end |
.nullables ⇒ Object
An array for nullable fields
83 84 85 |
# File 'lib/walmart_ap_is/models/report.rb', line 83 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/walmart_ap_is/models/report.rb', line 70 def self.optionals %w[ data_start_time data_end_time report_schedule_id created_time processing_start_time processing_end_time report_document_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
200 201 202 203 204 205 206 207 208 209 |
# File 'lib/walmart_ap_is/models/report.rb', line 200 def inspect class_name = self.class.name.split('::').last "<#{class_name} report_id: #{@report_id.inspect}, report_type: #{@report_type.inspect},"\ " data_start_time: #{@data_start_time.inspect}, data_end_time: #{@data_end_time.inspect},"\ " report_schedule_id: #{@report_schedule_id.inspect}, created_time:"\ " #{@created_time.inspect}, processing_status: #{@processing_status.inspect},"\ " processing_start_time: #{@processing_start_time.inspect}, processing_end_time:"\ " #{@processing_end_time.inspect}, report_document_id: #{@report_document_id.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_custom_created_time ⇒ Object
176 177 178 |
# File 'lib/walmart_ap_is/models/report.rb', line 176 def to_custom_created_time DateTimeHelper.to_rfc3339(created_time) end |
#to_custom_data_end_time ⇒ Object
172 173 174 |
# File 'lib/walmart_ap_is/models/report.rb', line 172 def to_custom_data_end_time DateTimeHelper.to_rfc3339(data_end_time) end |
#to_custom_data_start_time ⇒ Object
168 169 170 |
# File 'lib/walmart_ap_is/models/report.rb', line 168 def to_custom_data_start_time DateTimeHelper.to_rfc3339(data_start_time) end |
#to_custom_processing_end_time ⇒ Object
184 185 186 |
# File 'lib/walmart_ap_is/models/report.rb', line 184 def to_custom_processing_end_time DateTimeHelper.to_rfc3339(processing_end_time) end |
#to_custom_processing_start_time ⇒ Object
180 181 182 |
# File 'lib/walmart_ap_is/models/report.rb', line 180 def to_custom_processing_start_time DateTimeHelper.to_rfc3339(processing_start_time) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
189 190 191 192 193 194 195 196 197 |
# File 'lib/walmart_ap_is/models/report.rb', line 189 def to_s class_name = self.class.name.split('::').last "<#{class_name} report_id: #{@report_id}, report_type: #{@report_type}, data_start_time:"\ " #{@data_start_time}, data_end_time: #{@data_end_time}, report_schedule_id:"\ " #{@report_schedule_id}, created_time: #{@created_time}, processing_status:"\ " #{@processing_status}, processing_start_time: #{@processing_start_time},"\ " processing_end_time: #{@processing_end_time}, report_document_id: #{@report_document_id},"\ " additional_properties: #{@additional_properties}>" end |