Class: Samsara::Types::RouteChangesResponseBody

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

Overview

A diff of the changes for a route update.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(after:, before:, additional_properties: nil) ⇒ Samsara::Types::RouteChangesResponseBody

Parameters:



26
27
28
29
30
31
# File 'lib/samsara_api/types/route_changes_response_body.rb', line 26

def initialize(after:, before:, additional_properties: nil)
  @after = after
  @before = before
  @additional_properties = additional_properties
  @_field_set = { "after": after, "before": before }
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



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

def additional_properties
  @additional_properties
end

#after ⇒ Samsara::Types::MinimalRouteAuditLogsResponseBody (readonly)



11
12
13
# File 'lib/samsara_api/types/route_changes_response_body.rb', line 11

def after
  @after
end

#before ⇒ Samsara::Types::MinimalRouteAuditLogsResponseBody (readonly)



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

def before
  @before
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/samsara_api/types/route_changes_response_body.rb', line 36

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  unless parsed_json["after"].nil?
    after = parsed_json["after"].to_json
    after = Samsara::Types::MinimalRouteAuditLogsResponseBody.from_json(json_object: after)
  else
    after = nil
  end
  unless parsed_json["before"].nil?
    before = parsed_json["before"].to_json
    before = Samsara::Types::MinimalRouteAuditLogsResponseBody.from_json(json_object: before)
  else
    before = nil
  end
  new(
    after: after,
    before: before,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


69
70
71
72
# File 'lib/samsara_api/types/route_changes_response_body.rb', line 69

def self.validate_raw(obj:)
  Samsara::Types::MinimalRouteAuditLogsResponseBody.validate_raw(obj: obj.after)
  Samsara::Types::MinimalRouteAuditLogsResponseBody.validate_raw(obj: obj.before)
end

Instance Method Details

#to_json ⇒ String

Returns:

  • (String)


60
61
62
# File 'lib/samsara_api/types/route_changes_response_body.rb', line 60

def to_json
  @_field_set&.to_json
end