class Pinnacle::InboundMessage

def self.from_json(json_object:)

Returns:
  • (Pinnacle::InboundMessage) -

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

def self.validate_raw(obj:)

Returns:
  • (Void) -

Parameters:
  • obj (Object) --
def self.validate_raw(obj:)
  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.message_type.is_a?(Pinnacle::InboundMessageMessageType) != false || raise("Passed value for field obj.message_type is not the expected type, validation failed.")
  obj.metadata.nil? || Pinnacle::InboundMessageMetadata.validate_raw(obj: obj.metadata)
end

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

Returns:
  • (Pinnacle::InboundMessage) -

Parameters:
  • additional_properties (OpenStruct) -- Additional properties unmapped to the current class definition
  • metadata (Pinnacle::InboundMessageMetadata) --
  • message_type (Pinnacle::InboundMessageMessageType) --
  • to (String) --
  • from (String) --
def initialize(from:, to:, message_type:, metadata: OMIT, additional_properties: nil)
  @from = from
  @to = to
  @message_type = message_type
  @metadata = metadata if metadata != OMIT
  @additional_properties = additional_properties
  @_field_set = { "from": from, "to": to, "messageType": message_type, "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