Class: FreightFinancialsWebhookIngestionApi::NavixWebhookRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FreightFinancialsWebhookIngestionApi::NavixWebhookRequest
- Defined in:
- lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb
Overview
NavixWebhookRequest Model.
Instance Attribute Summary collapse
-
#data ⇒ String
TODO: Write general description for this method.
-
#id ⇒ UUID | String
TODO: Write general description for this method.
-
#time ⇒ DateTime
TODO: Write general description for this method.
-
#type ⇒ NavixWebhookEventType
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(id: SKIP, type: SKIP, time: SKIP, data: SKIP) ⇒ NavixWebhookRequest
constructor
A new instance of NavixWebhookRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_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(id: SKIP, type: SKIP, time: SKIP, data: SKIP) ⇒ NavixWebhookRequest
Returns a new instance of NavixWebhookRequest.
54 55 56 57 58 59 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb', line 54 def initialize(id: SKIP, type: SKIP, time: SKIP, data: SKIP) @id = id unless id == SKIP @type = type unless type == SKIP @time = time unless time == SKIP @data = data unless data == SKIP end |
Instance Attribute Details
#data ⇒ String
TODO: Write general description for this method
27 28 29 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb', line 27 def data @data end |
#id ⇒ UUID | String
TODO: Write general description for this method
15 16 17 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb', line 15 def id @id end |
#time ⇒ DateTime
TODO: Write general description for this method
23 24 25 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb', line 23 def time @time end |
#type ⇒ NavixWebhookEventType
TODO: Write general description for this method
19 20 21 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb', line 19 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP time = if hash.key?('time') (DateTimeHelper.from_rfc3339(hash['time']) if hash['time']) else SKIP end data = hash.key?('data') ? hash['data'] : SKIP # Create object from extracted values. NavixWebhookRequest.new(id: id, type: type, time: time, data: data) end |
.names ⇒ Object
A mapping from model property names to API property names.
30 31 32 33 34 35 36 37 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb', line 30 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['type'] = 'type' @_hash['time'] = 'time' @_hash['data'] = 'data' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 47 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb', line 40 def self.optionals %w[ id type time data ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
93 94 95 96 97 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb', line 93 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, type: #{@type.inspect}, time: #{@time.inspect}, data:"\ " #{@data.inspect}>" end |
#to_custom_time ⇒ Object
82 83 84 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb', line 82 def to_custom_time DateTimeHelper.to_rfc3339(time) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
87 88 89 90 |
# File 'lib/freight_financials_webhook_ingestion_api/models/navix_webhook_request.rb', line 87 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, type: #{@type}, time: #{@time}, data: #{@data}>" end |