Class: WalmartApIs::ReportAvailabilityResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/walmart_ap_is/models/report_availability_response.rb

Overview

ReportAvailabilityResponse 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(available_dates: SKIP, is_wfs_report_present: SKIP, is_legacy_report_present: SKIP, is_mt_report_present: SKIP, additional_properties: nil) ⇒ ReportAvailabilityResponse

Returns a new instance of ReportAvailabilityResponse.



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/walmart_ap_is/models/report_availability_response.rb', line 53

def initialize(available_dates: SKIP, is_wfs_report_present: SKIP,
               is_legacy_report_present: SKIP, is_mt_report_present: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @available_dates = available_dates unless available_dates == SKIP
  @is_wfs_report_present = is_wfs_report_present unless is_wfs_report_present == SKIP
  @is_legacy_report_present = is_legacy_report_present unless is_legacy_report_present == SKIP
  @is_mt_report_present = is_mt_report_present unless is_mt_report_present == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#available_datesArray[String]

TODO: Write general description for this method

Returns:

  • (Array[String])


14
15
16
# File 'lib/walmart_ap_is/models/report_availability_response.rb', line 14

def available_dates
  @available_dates
end

#is_legacy_report_presentTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


22
23
24
# File 'lib/walmart_ap_is/models/report_availability_response.rb', line 22

def is_legacy_report_present
  @is_legacy_report_present
end

#is_mt_report_presentTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


26
27
28
# File 'lib/walmart_ap_is/models/report_availability_response.rb', line 26

def is_mt_report_present
  @is_mt_report_present
end

#is_wfs_report_presentTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


18
19
20
# File 'lib/walmart_ap_is/models/report_availability_response.rb', line 18

def is_wfs_report_present
  @is_wfs_report_present
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/walmart_ap_is/models/report_availability_response.rb', line 67

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  available_dates =
    hash.key?('availableDates') ? hash['availableDates'] : SKIP
  is_wfs_report_present =
    hash.key?('isWfsReportPresent') ? hash['isWfsReportPresent'] : SKIP
  is_legacy_report_present =
    hash.key?('isLegacyReportPresent') ? hash['isLegacyReportPresent'] : SKIP
  is_mt_report_present =
    hash.key?('isMtReportPresent') ? hash['isMtReportPresent'] : 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.
  ReportAvailabilityResponse.new(available_dates: available_dates,
                                 is_wfs_report_present: is_wfs_report_present,
                                 is_legacy_report_present: is_legacy_report_present,
                                 is_mt_report_present: is_mt_report_present,
                                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/walmart_ap_is/models/report_availability_response.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['available_dates'] = 'availableDates'
  @_hash['is_wfs_report_present'] = 'isWfsReportPresent'
  @_hash['is_legacy_report_present'] = 'isLegacyReportPresent'
  @_hash['is_mt_report_present'] = 'isMtReportPresent'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/walmart_ap_is/models/report_availability_response.rb', line 49

def self.nullables
  []
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
45
46
# File 'lib/walmart_ap_is/models/report_availability_response.rb', line 39

def self.optionals
  %w[
    available_dates
    is_wfs_report_present
    is_legacy_report_present
    is_mt_report_present
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



105
106
107
108
109
110
111
# File 'lib/walmart_ap_is/models/report_availability_response.rb', line 105

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} available_dates: #{@available_dates.inspect}, is_wfs_report_present:"\
  " #{@is_wfs_report_present.inspect}, is_legacy_report_present:"\
  " #{@is_legacy_report_present.inspect}, is_mt_report_present:"\
  " #{@is_mt_report_present.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



96
97
98
99
100
101
102
# File 'lib/walmart_ap_is/models/report_availability_response.rb', line 96

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} available_dates: #{@available_dates}, is_wfs_report_present:"\
  " #{@is_wfs_report_present}, is_legacy_report_present: #{@is_legacy_report_present},"\
  " is_mt_report_present: #{@is_mt_report_present}, additional_properties:"\
  " #{@additional_properties}>"
end