Class: Samsara::Types::WalkaroundPhotoObjectResponseBody

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

Overview

Walkaround’s photo object

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(created_at_time:, name:, url:, additional_properties: nil) ⇒ Samsara::Types::WalkaroundPhotoObjectResponseBody

Parameters:

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



30
31
32
33
34
35
36
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 30

def initialize(created_at_time:, name:, url:, additional_properties: nil)
  @created_at_time = created_at_time
  @name = name
  @url = url
  @additional_properties = additional_properties
  @_field_set = { "createdAtTime": created_at_time, "name": name, "url": url }
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



17
18
19
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 17

def additional_properties
  @additional_properties
end

#created_at_timeString (readonly)

Returns Time when walkaround’s photo was created in RFC 3339 format.

Returns:

  • (String)

    Time when walkaround’s photo was created in RFC 3339 format.



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

def created_at_time
  @created_at_time
end

#nameString (readonly)

Returns The name of the walkaround’s photo.

Returns:

  • (String)

    The name of the walkaround’s photo



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

def name
  @name
end

#urlObject (readonly)

after it’s sent



15
16
17
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 15

def url
  @url
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 41

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"]
  name = parsed_json["name"]
  url = parsed_json["url"]
  new(
    created_at_time: created_at_time,
    name: name,
    url: url,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


66
67
68
69
70
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 66

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.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


57
58
59
# File 'lib/samsara_api/types/walkaround_photo_object_response_body.rb', line 57

def to_json
  @_field_set&.to_json
end