Class: Samsara::Types::IftaDetailJobResponseBody

Inherits:
Object
  • Object
show all
Defined in:
lib/samsara_api/types/ifta_detail_job_response_body.rb

Overview

should be polled until the state is terminal.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args:, completed_at_time: OMIT, details: OMIT, failed_at_time: OMIT, files: OMIT, job_id:, job_status:, requested_at_time:, started_at_time: OMIT, additional_properties: nil) ⇒ Samsara::Types::IftaDetailJobResponseBody

Parameters:

  • requested_at_time (String)

    The time this job was requested for creation.

  • started_at_time (String) (defaults to: OMIT)

    The time this job started processing.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/samsara_api/types/ifta_detail_job_response_body.rb', line 58

def initialize(args:, completed_at_time: OMIT, details: OMIT, failed_at_time: OMIT, files: OMIT, job_id:, job_status:, requested_at_time:, started_at_time: OMIT, additional_properties: nil)
  @args = args
  @completed_at_time = completed_at_time if completed_at_time != OMIT
  @details = details if details != OMIT
  @failed_at_time = failed_at_time if failed_at_time != OMIT
  @files = files if files != OMIT
  @job_id = job_id
  @job_status = job_status
  @requested_at_time = requested_at_time
  @started_at_time = started_at_time if started_at_time != OMIT
  @additional_properties = additional_properties
  @_field_set = { "args": args, "completedAtTime": completed_at_time, "details": details, "failedAtTime": failed_at_time, "files": files, "jobId": job_id, "jobStatus": job_status, "requestedAtTime": requested_at_time, "startedAtTime": started_at_time }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



36
37
38
# File 'lib/samsara_api/types/ifta_detail_job_response_body.rb', line 36

def additional_properties
  @additional_properties
end

#argsSamsara::Types::IftaDetailJobArgsResponseBody (readonly)



14
15
16
# File 'lib/samsara_api/types/ifta_detail_job_response_body.rb', line 14

def args
  @args
end

#completed_at_timeString (readonly)

Returns The time this job completed successfully.

Returns:

  • (String)

    The time this job completed successfully.



16
17
18
# File 'lib/samsara_api/types/ifta_detail_job_response_body.rb', line 16

def completed_at_time
  @completed_at_time
end

#detailsString (readonly)

Returns A message containing additional details about the job, if available.

Returns:

  • (String)

    A message containing additional details about the job, if available.



18
19
20
# File 'lib/samsara_api/types/ifta_detail_job_response_body.rb', line 18

def details
  @details
end

#failed_at_timeString (readonly)

Returns The time this job failed.

Returns:

  • (String)

    The time this job failed.



20
21
22
# File 'lib/samsara_api/types/ifta_detail_job_response_body.rb', line 20

def failed_at_time
  @failed_at_time
end

#filesObject (readonly)

the file structure [here](developers.samsara.com/docs/ifta-detail-csv).



24
25
26
# File 'lib/samsara_api/types/ifta_detail_job_response_body.rb', line 24

def files
  @files
end

#job_idString (readonly)

Returns The ID used to retrieve this job.

Returns:

  • (String)

    The ID used to retrieve this job.



26
27
28
# File 'lib/samsara_api/types/ifta_detail_job_response_body.rb', line 26

def job_id
  @job_id
end

#job_statusObject (readonly)

‘Failed`



30
31
32
# File 'lib/samsara_api/types/ifta_detail_job_response_body.rb', line 30

def job_status
  @job_status
end

#requested_at_timeString (readonly)

Returns The time this job was requested for creation.

Returns:

  • (String)

    The time this job was requested for creation.



32
33
34
# File 'lib/samsara_api/types/ifta_detail_job_response_body.rb', line 32

def requested_at_time
  @requested_at_time
end

#started_at_timeString (readonly)

Returns The time this job started processing.

Returns:

  • (String)

    The time this job started processing.



34
35
36
# File 'lib/samsara_api/types/ifta_detail_job_response_body.rb', line 34

def started_at_time
  @started_at_time
end

Class Method Details

.from_json(json_object:) ⇒ Samsara::Types::IftaDetailJobResponseBody

Parameters:

  • json_object (String)

Returns:



77
78
79
80
81
82
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/samsara_api/types/ifta_detail_job_response_body.rb', line 77

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  unless parsed_json["args"].nil?
    args = parsed_json["args"].to_json
    args = Samsara::Types::IftaDetailJobArgsResponseBody.from_json(json_object: args)
  else
    args = nil
  end
  completed_at_time = parsed_json["completedAtTime"]
  details = parsed_json["details"]
  failed_at_time = parsed_json["failedAtTime"]
  files = parsed_json["files"]&.map do | item |
  item = item.to_json
  Samsara::Types::IftaDetailJobOutputResponseBody.from_json(json_object: item)
end
  job_id = parsed_json["jobId"]
  job_status = parsed_json["jobStatus"]
  requested_at_time = parsed_json["requestedAtTime"]
  started_at_time = parsed_json["startedAtTime"]
  new(
    args: args,
    completed_at_time: completed_at_time,
    details: details,
    failed_at_time: failed_at_time,
    files: files,
    job_id: job_id,
    job_status: job_status,
    requested_at_time: requested_at_time,
    started_at_time: started_at_time,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


122
123
124
125
126
127
128
129
130
131
132
# File 'lib/samsara_api/types/ifta_detail_job_response_body.rb', line 122

def self.validate_raw(obj:)
  Samsara::Types::IftaDetailJobArgsResponseBody.validate_raw(obj: obj.args)
  obj.completed_at_time&.is_a?(String) != false || raise("Passed value for field obj.completed_at_time is not the expected type, validation failed.")
  obj.details&.is_a?(String) != false || raise("Passed value for field obj.details is not the expected type, validation failed.")
  obj.failed_at_time&.is_a?(String) != false || raise("Passed value for field obj.failed_at_time is not the expected type, validation failed.")
  obj.files&.is_a?(Array) != false || raise("Passed value for field obj.files is not the expected type, validation failed.")
  obj.job_id.is_a?(String) != false || raise("Passed value for field obj.job_id is not the expected type, validation failed.")
  obj.job_status.is_a?(Samsara::Types::IftaDetailJobResponseBodyJobStatus) != false || raise("Passed value for field obj.job_status is not the expected type, validation failed.")
  obj.requested_at_time.is_a?(String) != false || raise("Passed value for field obj.requested_at_time is not the expected type, validation failed.")
  obj.started_at_time&.is_a?(String) != false || raise("Passed value for field obj.started_at_time is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


113
114
115
# File 'lib/samsara_api/types/ifta_detail_job_response_body.rb', line 113

def to_json
  @_field_set&.to_json
end