Class: FreightFinancialsWebhookIngestionApi::UploadRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FreightFinancialsWebhookIngestionApi::UploadRequest
- Defined in:
- lib/freight_financials_webhook_ingestion_api/models/upload_request.rb
Overview
UploadRequest Model.
Instance Attribute Summary collapse
-
#content ⇒ String
TODO: Write general description for this method.
-
#content_type ⇒ String
TODO: Write general description for this method.
-
#document_type ⇒ Integer
TODO: Write general description for this method.
-
#file_name ⇒ String
TODO: Write general description for this method.
-
#invoice_number ⇒ String
TODO: Write general description for this method.
-
#tags ⇒ Hash[String, 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(content: SKIP, content_type: SKIP, document_type: SKIP, file_name: SKIP, invoice_number: SKIP, tags: SKIP, additional_properties: nil) ⇒ UploadRequest
constructor
A new instance of UploadRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#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(content: SKIP, content_type: SKIP, document_type: SKIP, file_name: SKIP, invoice_number: SKIP, tags: SKIP, additional_properties: nil) ⇒ UploadRequest
Returns a new instance of UploadRequest.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/freight_financials_webhook_ingestion_api/models/upload_request.rb', line 67 def initialize(content: SKIP, content_type: SKIP, document_type: SKIP, file_name: SKIP, invoice_number: SKIP, tags: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @content = content unless content == SKIP @content_type = content_type unless content_type == SKIP @document_type = document_type unless document_type == SKIP @file_name = file_name unless file_name == SKIP @invoice_number = invoice_number unless invoice_number == SKIP @tags = unless == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#content ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/freight_financials_webhook_ingestion_api/models/upload_request.rb', line 14 def content @content end |
#content_type ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/freight_financials_webhook_ingestion_api/models/upload_request.rb', line 18 def content_type @content_type end |
#document_type ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/freight_financials_webhook_ingestion_api/models/upload_request.rb', line 22 def document_type @document_type end |
#file_name ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/freight_financials_webhook_ingestion_api/models/upload_request.rb', line 26 def file_name @file_name end |
#invoice_number ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/freight_financials_webhook_ingestion_api/models/upload_request.rb', line 30 def invoice_number @invoice_number end |
#tags ⇒ Hash[String, String]
TODO: Write general description for this method
34 35 36 |
# File 'lib/freight_financials_webhook_ingestion_api/models/upload_request.rb', line 34 def @tags end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
83 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 |
# File 'lib/freight_financials_webhook_ingestion_api/models/upload_request.rb', line 83 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. content = hash.key?('content') ? hash['content'] : SKIP content_type = hash.key?('contentType') ? hash['contentType'] : SKIP document_type = hash.key?('documentType') ? hash['documentType'] : SKIP file_name = hash.key?('fileName') ? hash['fileName'] : SKIP invoice_number = hash.key?('invoiceNumber') ? hash['invoiceNumber'] : SKIP = hash.key?('tags') ? hash['tags'] : 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. UploadRequest.new(content: content, content_type: content_type, document_type: document_type, file_name: file_name, invoice_number: invoice_number, tags: , additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/freight_financials_webhook_ingestion_api/models/upload_request.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['content'] = 'content' @_hash['content_type'] = 'contentType' @_hash['document_type'] = 'documentType' @_hash['file_name'] = 'fileName' @_hash['invoice_number'] = 'invoiceNumber' @_hash['tags'] = 'tags' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 64 65 |
# File 'lib/freight_financials_webhook_ingestion_api/models/upload_request.rb', line 61 def self.nullables %w[ tags ] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/freight_financials_webhook_ingestion_api/models/upload_request.rb', line 49 def self.optionals %w[ content content_type document_type file_name invoice_number tags ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
120 121 122 123 124 125 126 |
# File 'lib/freight_financials_webhook_ingestion_api/models/upload_request.rb', line 120 def inspect class_name = self.class.name.split('::').last "<#{class_name} content: #{@content.inspect}, content_type: #{@content_type.inspect},"\ " document_type: #{@document_type.inspect}, file_name: #{@file_name.inspect},"\ " invoice_number: #{@invoice_number.inspect}, tags: #{@tags.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
112 113 114 115 116 117 |
# File 'lib/freight_financials_webhook_ingestion_api/models/upload_request.rb', line 112 def to_s class_name = self.class.name.split('::').last "<#{class_name} content: #{@content}, content_type: #{@content_type}, document_type:"\ " #{@document_type}, file_name: #{@file_name}, invoice_number: #{@invoice_number}, tags:"\ " #{@tags}, additional_properties: #{@additional_properties}>" end |