Class: Samsara::Types::IftaDetailJobOutputResponseBody

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

Overview

The file outputs produced by a successfully completed job.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(created_at_time:, download_url:, download_url_expiration_time:, name:, record_count:, additional_properties: nil) ⇒ Samsara::Types::IftaDetailJobOutputResponseBody

Parameters:

  • name (String)

    The name of this file.

  • record_count (Long)

    The number of records in this file.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



38
39
40
41
42
43
44
45
46
# File 'lib/samsara_api/types/ifta_detail_job_output_response_body.rb', line 38

def initialize(created_at_time:, download_url:, download_url_expiration_time:, name:, record_count:, additional_properties: nil)
  @created_at_time = created_at_time
  @download_url = download_url
  @download_url_expiration_time = download_url_expiration_time
  @name = name
  @record_count = record_count
  @additional_properties = additional_properties
  @_field_set = { "createdAtTime": created_at_time, "downloadUrl": download_url, "downloadUrlExpirationTime": download_url_expiration_time, "name": name, "recordCount": record_count }
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



22
23
24
# File 'lib/samsara_api/types/ifta_detail_job_output_response_body.rb', line 22

def additional_properties
  @additional_properties
end

#created_at_timeString (readonly)

Returns When this file was created.

Returns:

  • (String)

    When this file was created.



10
11
12
# File 'lib/samsara_api/types/ifta_detail_job_output_response_body.rb', line 10

def created_at_time
  @created_at_time
end

#download_urlObject (readonly)

an expiration and will no longer be valid after expiration.



13
14
15
# File 'lib/samsara_api/types/ifta_detail_job_output_response_body.rb', line 13

def download_url
  @download_url
end

#download_url_expiration_timeObject (readonly)

ID will refresh the download urls, if expired.



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

def download_url_expiration_time
  @download_url_expiration_time
end

#nameString (readonly)

Returns The name of this file.

Returns:

  • (String)

    The name of this file.



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

def name
  @name
end

#record_countLong (readonly)

Returns The number of records in this file.

Returns:

  • (Long)

    The number of records in this file.



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

def record_count
  @record_count
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/samsara_api/types/ifta_detail_job_output_response_body.rb', line 51

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  created_at_time = parsed_json["createdAtTime"]
  download_url = parsed_json["downloadUrl"]
  download_url_expiration_time = parsed_json["downloadUrlExpirationTime"]
  name = parsed_json["name"]
  record_count = parsed_json["recordCount"]
  new(
    created_at_time: created_at_time,
    download_url: download_url,
    download_url_expiration_time: download_url_expiration_time,
    name: name,
    record_count: record_count,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


80
81
82
83
84
85
86
# File 'lib/samsara_api/types/ifta_detail_job_output_response_body.rb', line 80

def self.validate_raw(obj:)
  obj.created_at_time.is_a?(String) != false || raise("Passed value for field obj.created_at_time is not the expected type, validation failed.")
  obj.download_url.is_a?(String) != false || raise("Passed value for field obj.download_url is not the expected type, validation failed.")
  obj.download_url_expiration_time.is_a?(String) != false || raise("Passed value for field obj.download_url_expiration_time is not the expected type, validation failed.")
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.record_count.is_a?(Long) != false || raise("Passed value for field obj.record_count is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


71
72
73
# File 'lib/samsara_api/types/ifta_detail_job_output_response_body.rb', line 71

def to_json
  @_field_set&.to_json
end