Class: Samsara::Types::IftaJurisdictionReportDataObjectResponseBody
- Inherits:
-
Object
- Object
- Samsara::Types::IftaJurisdictionReportDataObjectResponseBody
- Defined in:
- lib/samsara_api/types/ifta_jurisdiction_report_data_object_response_body.rb
Overview
Dictionary containing summarized jurisdiction report data.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#jurisdiction_reports ⇒ Array<Samsara::Types::IftaJurisdictionSummaryObjectResponseBody>
readonly
List of summarized jurisdiction reports.
-
#month ⇒ String
readonly
The specified month duration for this IFTA report.
-
#quarter ⇒ String
readonly
The specified quarter duration for this IFTA report.
- #troubleshooting ⇒ Samsara::Types::IftaReportTroubleshootingObjectResponseBody readonly
-
#year ⇒ Long
readonly
The specified year for this IFTA report.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Samsara::Types::IftaJurisdictionReportDataObjectResponseBody
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(jurisdiction_reports:, month: OMIT, quarter: OMIT, troubleshooting: OMIT, year:, additional_properties: nil) ⇒ Samsara::Types::IftaJurisdictionReportDataObjectResponseBody constructor
- #to_json ⇒ String
Constructor Details
#initialize(jurisdiction_reports:, month: OMIT, quarter: OMIT, troubleshooting: OMIT, year:, additional_properties: nil) ⇒ Samsara::Types::IftaJurisdictionReportDataObjectResponseBody
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/samsara_api/types/ifta_jurisdiction_report_data_object_response_body.rb', line 36 def initialize(jurisdiction_reports:, month: OMIT, quarter: OMIT, troubleshooting: OMIT, year:, additional_properties: nil) @jurisdiction_reports = jurisdiction_reports @month = month if month != OMIT @quarter = quarter if quarter != OMIT @troubleshooting = troubleshooting if troubleshooting != OMIT @year = year @additional_properties = additional_properties @_field_set = { "jurisdictionReports": jurisdiction_reports, "month": month, "quarter": quarter, "troubleshooting": troubleshooting, "year": year }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
22 23 24 |
# File 'lib/samsara_api/types/ifta_jurisdiction_report_data_object_response_body.rb', line 22 def additional_properties @additional_properties end |
#jurisdiction_reports ⇒ Array<Samsara::Types::IftaJurisdictionSummaryObjectResponseBody> (readonly)
Returns List of summarized jurisdiction reports.
12 13 14 |
# File 'lib/samsara_api/types/ifta_jurisdiction_report_data_object_response_body.rb', line 12 def jurisdiction_reports @jurisdiction_reports end |
#month ⇒ String (readonly)
Returns The specified month duration for this IFTA report.
14 15 16 |
# File 'lib/samsara_api/types/ifta_jurisdiction_report_data_object_response_body.rb', line 14 def month @month end |
#quarter ⇒ String (readonly)
Returns The specified quarter duration for this IFTA report.
16 17 18 |
# File 'lib/samsara_api/types/ifta_jurisdiction_report_data_object_response_body.rb', line 16 def quarter @quarter end |
#troubleshooting ⇒ Samsara::Types::IftaReportTroubleshootingObjectResponseBody (readonly)
18 19 20 |
# File 'lib/samsara_api/types/ifta_jurisdiction_report_data_object_response_body.rb', line 18 def troubleshooting @troubleshooting end |
#year ⇒ Long (readonly)
Returns The specified year for this IFTA report.
20 21 22 |
# File 'lib/samsara_api/types/ifta_jurisdiction_report_data_object_response_body.rb', line 20 def year @year end |
Class Method Details
.from_json(json_object:) ⇒ Samsara::Types::IftaJurisdictionReportDataObjectResponseBody
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/samsara_api/types/ifta_jurisdiction_report_data_object_response_body.rb', line 52 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) jurisdiction_reports = parsed_json["jurisdictionReports"]&.map do | item | item = item.to_json Samsara::Types::IftaJurisdictionSummaryObjectResponseBody.from_json(json_object: item) end month = parsed_json["month"] quarter = parsed_json["quarter"] unless parsed_json["troubleshooting"].nil? troubleshooting = parsed_json["troubleshooting"].to_json troubleshooting = Samsara::Types::IftaReportTroubleshootingObjectResponseBody.from_json(json_object: troubleshooting) else troubleshooting = nil end year = parsed_json["year"] new( jurisdiction_reports: jurisdiction_reports, month: month, quarter: quarter, troubleshooting: troubleshooting, year: year, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
90 91 92 93 94 95 96 |
# File 'lib/samsara_api/types/ifta_jurisdiction_report_data_object_response_body.rb', line 90 def self.validate_raw(obj:) obj.jurisdiction_reports.is_a?(Array) != false || raise("Passed value for field obj.jurisdiction_reports is not the expected type, validation failed.") obj.month&.is_a?(String) != false || raise("Passed value for field obj.month is not the expected type, validation failed.") obj.quarter&.is_a?(String) != false || raise("Passed value for field obj.quarter is not the expected type, validation failed.") obj.troubleshooting.nil? || Samsara::Types::IftaReportTroubleshootingObjectResponseBody.validate_raw(obj: obj.troubleshooting) obj.year.is_a?(Long) != false || raise("Passed value for field obj.year is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
81 82 83 |
# File 'lib/samsara_api/types/ifta_jurisdiction_report_data_object_response_body.rb', line 81 def to_json @_field_set&.to_json end |