class Pinnacle::InboundLocationMessage

def self.from_json(json_object:)

Returns:
  • (Pinnacle::InboundLocationMessage) -

Parameters:
  • json_object (String) --
def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  message_type = parsed_json["messageType"]
  if parsed_json["coordinates"].nil?
    coordinates = nil
  else
    coordinates = parsed_json["coordinates"].to_json
    coordinates = Pinnacle::InboundLocationMessageCoordinates.from_json(json_object: coordinates)
  end
  from = parsed_json["from"]
  to = parsed_json["to"]
  if parsed_json["metadata"].nil?
    metadata = nil
  else
    metadata = parsed_json["metadata"].to_json
    metadata = Pinnacle::InboundMessageMetadata.from_json(json_object: metadata)
  end
  new(
    message_type: message_type,
    coordinates: coordinates,
    from: from,
    to: to,
    metadata: metadata,
    additional_properties: struct
  )
end

def self.validate_raw(obj:)

Returns:
  • (Void) -

Parameters:
  • obj (Object) --
def self.validate_raw(obj:)
  obj.message_type&.is_a?(String) != false || raise("Passed value for field obj.message_type is not the expected type, validation failed.")
  Pinnacle::InboundLocationMessageCoordinates.validate_raw(obj: obj.coordinates)
  obj.from.is_a?(String) != false || raise("Passed value for field obj.from is not the expected type, validation failed.")
  obj.to.is_a?(String) != false || raise("Passed value for field obj.to is not the expected type, validation failed.")
  obj.metadata.nil? || Pinnacle::InboundMessageMetadata.validate_raw(obj: obj.metadata)
end

def initialize(coordinates:, from:, to:, message_type: OMIT, metadata: OMIT, additional_properties: nil)

Returns:
  • (Pinnacle::InboundLocationMessage) -

Parameters:
  • additional_properties (OpenStruct) -- Additional properties unmapped to the current class definition
  • metadata (Pinnacle::InboundMessageMetadata) --
  • to (String) --
  • from (String) --
  • coordinates (Pinnacle::InboundLocationMessageCoordinates) --
  • message_type (String) --
def initialize(coordinates:, from:, to:, message_type: OMIT, metadata: OMIT, additional_properties: nil)
  @message_type = message_type if message_type != OMIT
  @coordinates = coordinates
  @from = from
  @to = to
  @metadata = metadata if metadata != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "messageType": message_type,
    "coordinates": coordinates,
    "from": from,
    "to": to,
    "metadata": metadata
  }.reject do |_k, v|
    v == OMIT
  end
end

def to_json(*_args)

Returns:
  • (String) -
def to_json(*_args)
  @_field_set&.to_json
end