Class: TqlOtrFactoringDataExchange::DocumentUploadResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- TqlOtrFactoringDataExchange::DocumentUploadResponse
- Defined in:
- lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb
Overview
Acknowledgement that the document was accepted for processing.
Instance Attribute Summary collapse
-
#document_id ⇒ UUID | String
System-generated unique identifier for this document.
-
#document_type ⇒ DocumentType
Document type classification used for categorizing uploaded documents.
-
#invoice_number ⇒ String
The invoice this document was linked to.
-
#received_at ⇒ DateTime
UTC timestamp when the document was received.
-
#status ⇒ Status
Processing status of this document.
-
#tags ⇒ Hash[String, String]
The tags that were submitted with this document (echoed back).
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(document_id: SKIP, invoice_number: SKIP, document_type: SKIP, status: SKIP, tags: SKIP, received_at: SKIP, additional_properties: nil) ⇒ DocumentUploadResponse
constructor
A new instance of DocumentUploadResponse.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_received_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(document_id: SKIP, invoice_number: SKIP, document_type: SKIP, status: SKIP, tags: SKIP, received_at: SKIP, additional_properties: nil) ⇒ DocumentUploadResponse
Returns a new instance of DocumentUploadResponse.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 68 def initialize(document_id: SKIP, invoice_number: SKIP, document_type: SKIP, status: SKIP, tags: SKIP, received_at: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @document_id = document_id unless document_id == SKIP @invoice_number = invoice_number unless invoice_number == SKIP @document_type = document_type unless document_type == SKIP @status = status unless status == SKIP @tags = unless == SKIP @received_at = received_at unless received_at == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#document_id ⇒ UUID | String
System-generated unique identifier for this document.
15 16 17 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 15 def document_id @document_id end |
#document_type ⇒ DocumentType
Document type classification used for categorizing uploaded documents.
23 24 25 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 23 def document_type @document_type end |
#invoice_number ⇒ String
The invoice this document was linked to.
19 20 21 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 19 def invoice_number @invoice_number end |
#received_at ⇒ DateTime
UTC timestamp when the document was received.
35 36 37 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 35 def received_at @received_at end |
#status ⇒ Status
Processing status of this document.
27 28 29 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 27 def status @status end |
#tags ⇒ Hash[String, String]
The tags that were submitted with this document (echoed back).
31 32 33 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 31 def @tags end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
84 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 110 111 112 113 114 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 84 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. document_id = hash.key?('documentId') ? hash['documentId'] : SKIP invoice_number = hash.key?('invoiceNumber') ? hash['invoiceNumber'] : SKIP document_type = hash.key?('documentType') ? hash['documentType'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP = hash.key?('tags') ? hash['tags'] : SKIP received_at = if hash.key?('receivedAt') (DateTimeHelper.from_rfc3339(hash['receivedAt']) if hash['receivedAt']) else SKIP end # 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. DocumentUploadResponse.new(document_id: document_id, invoice_number: invoice_number, document_type: document_type, status: status, tags: , received_at: received_at, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['document_id'] = 'documentId' @_hash['invoice_number'] = 'invoiceNumber' @_hash['document_type'] = 'documentType' @_hash['status'] = 'status' @_hash['tags'] = 'tags' @_hash['received_at'] = 'receivedAt' @_hash end |
.nullables ⇒ Object
An array for nullable fields
62 63 64 65 66 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 62 def self.nullables %w[ tags ] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 50 def self.optionals %w[ document_id invoice_number document_type status tags received_at ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
129 130 131 132 133 134 135 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 129 def inspect class_name = self.class.name.split('::').last "<#{class_name} document_id: #{@document_id.inspect}, invoice_number:"\ " #{@invoice_number.inspect}, document_type: #{@document_type.inspect}, status:"\ " #{@status.inspect}, tags: #{@tags.inspect}, received_at: #{@received_at.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_custom_received_at ⇒ Object
116 117 118 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 116 def to_custom_received_at DateTimeHelper.to_rfc3339(received_at) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
121 122 123 124 125 126 |
# File 'lib/tql_otr_factoring_data_exchange/models/document_upload_response.rb', line 121 def to_s class_name = self.class.name.split('::').last "<#{class_name} document_id: #{@document_id}, invoice_number: #{@invoice_number},"\ " document_type: #{@document_type}, status: #{@status}, tags: #{@tags}, received_at:"\ " #{@received_at}, additional_properties: #{@additional_properties}>" end |