Class: FreightFinancialsWebhookIngestionApi::AssignmentResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/freight_financials_webhook_ingestion_api/models/assignment_response.rb

Overview

AssignmentResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(data: SKIP, errors: SKIP, is_success: SKIP) ⇒ AssignmentResponse

Returns a new instance of AssignmentResponse.



49
50
51
52
53
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response.rb', line 49

def initialize(data: SKIP, errors: SKIP, is_success: SKIP)
  @data = data unless data == SKIP
  @errors = errors unless errors == SKIP
  @is_success = is_success unless is_success == SKIP
end

Instance Attribute Details

#dataAssignmentResponseData

TODO: Write general description for this method



14
15
16
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response.rb', line 14

def data
  @data
end

#errorsArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


18
19
20
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response.rb', line 18

def errors
  @errors
end

#is_successTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


22
23
24
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response.rb', line 22

def is_success
  @is_success
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response.rb', line 56

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  data = AssignmentResponseData.from_hash(hash['data']) if hash['data']
  errors = hash.key?('errors') ? hash['errors'] : SKIP
  is_success = hash.key?('isSuccess') ? hash['isSuccess'] : SKIP

  # Create object from extracted values.
  AssignmentResponse.new(data: data,
                         errors: errors,
                         is_success: is_success)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
31
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['data'] = 'data'
  @_hash['errors'] = 'errors'
  @_hash['is_success'] = 'isSuccess'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
46
47
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response.rb', line 43

def self.nullables
  %w[
    data
  ]
end

.optionalsObject

An array for optional fields



34
35
36
37
38
39
40
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response.rb', line 34

def self.optionals
  %w[
    data
    errors
    is_success
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



77
78
79
80
81
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response.rb', line 77

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} data: #{@data.inspect}, errors: #{@errors.inspect}, is_success:"\
  " #{@is_success.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



71
72
73
74
# File 'lib/freight_financials_webhook_ingestion_api/models/assignment_response.rb', line 71

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} data: #{@data}, errors: #{@errors}, is_success: #{@is_success}>"
end