Class: Samsara::Types::DocumentPdfQueryResponseData

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(completed_at_time: OMIT, document_id: OMIT, download_document_pdf_url: OMIT, id: OMIT, job_status: OMIT, requested_at_time: OMIT, additional_properties: nil) ⇒ Samsara::Types::DocumentPdfQueryResponseData

Parameters:

  • requested_at_time (String) (defaults to: OMIT) —

    Time that PDF generation was requested, in RFC 3339 format.

  • additional_properties (OpenStruct) (defaults to: nil) —

    Additional properties unmapped to the current class definition



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/samsara_api/types/document_pdf_query_response_data.rb', line 39

def initialize(completed_at_time: OMIT, document_id: OMIT, download_document_pdf_url: OMIT, id: OMIT, job_status: OMIT, requested_at_time: OMIT, additional_properties: nil)
  @completed_at_time = completed_at_time if completed_at_time != OMIT
  @document_id = document_id if document_id != OMIT
  @download_document_pdf_url = download_document_pdf_url if download_document_pdf_url != OMIT
  @id = id if id != OMIT
  @job_status = job_status if job_status != OMIT
  @requested_at_time = requested_at_time if requested_at_time != OMIT
  @additional_properties = additional_properties
  @_field_set = { "completedAtTime": completed_at_time, "documentId": document_id, "downloadDocumentPdfUrl": download_document_pdf_url, "id": id, "jobStatus": job_status, "requestedAtTime": requested_at_time }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_properties ⇒ OpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct) —

    Additional properties unmapped to the current class definition



23
24
25
# File 'lib/samsara_api/types/document_pdf_query_response_data.rb', line 23

def additional_properties
  @additional_properties
end

#completed_at_time ⇒ String (readonly)

Returns Time that PDF generation was completed, in RFC 3339 format.

Returns:

  • (String) —

    Time that PDF generation was completed, in RFC 3339 format.



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

def completed_at_time
  @completed_at_time
end

#document_id ⇒ String (readonly)

Returns ID of the document.

Returns:

  • (String) —

    ID of the document.



12
13
14
# File 'lib/samsara_api/types/document_pdf_query_response_data.rb', line 12

def document_id
  @document_id
end

#download_document_pdf_url ⇒ String (readonly)

Returns S3 pre-signed URL to download PDF file.

Returns:

  • (String) —

    S3 pre-signed URL to download PDF file.



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

def download_document_pdf_url
  @download_document_pdf_url
end

#id ⇒ String (readonly)

Returns ID of the PDF file generated or being generated for the document.

Returns:

  • (String) —

    ID of the PDF file generated or being generated for the document



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

def id
  @id
end

#job_status ⇒ Object (readonly)

processing, completed.



19
20
21
# File 'lib/samsara_api/types/document_pdf_query_response_data.rb', line 19

def job_status
  @job_status
end

#requested_at_time ⇒ String (readonly)

Returns Time that PDF generation was requested, in RFC 3339 format.

Returns:

  • (String) —

    Time that PDF generation was requested, in RFC 3339 format.



21
22
23
# File 'lib/samsara_api/types/document_pdf_query_response_data.rb', line 21

def requested_at_time
  @requested_at_time
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



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

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  completed_at_time = parsed_json["completedAtTime"]
  document_id = parsed_json["documentId"]
  download_document_pdf_url = parsed_json["downloadDocumentPdfUrl"]
  id = parsed_json["id"]
  job_status = parsed_json["jobStatus"]
  requested_at_time = parsed_json["requestedAtTime"]
  new(
    completed_at_time: completed_at_time,
    document_id: document_id,
    download_document_pdf_url: download_document_pdf_url,
    id: id,
    job_status: job_status,
    requested_at_time: requested_at_time,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


86
87
88
89
90
91
92
93
# File 'lib/samsara_api/types/document_pdf_query_response_data.rb', line 86

def self.validate_raw(obj:)
  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.document_id&.is_a?(String) != false || raise("Passed value for field obj.document_id is not the expected type, validation failed.")
  obj.download_document_pdf_url&.is_a?(String) != false || raise("Passed value for field obj.download_document_pdf_url is not the expected type, validation failed.")
  obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.job_status&.is_a?(Samsara::Types::DocumentPdfQueryResponseDataJobStatus) != 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.")
end

Instance Method Details

#to_json ⇒ String

Returns:

  • (String)


77
78
79
# File 'lib/samsara_api/types/document_pdf_query_response_data.rb', line 77

def to_json
  @_field_set&.to_json
end