class Pinnacle::InboundActionMessage
def self.from_json(json_object:)
-
(Pinnacle::InboundActionMessage)
-
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"] action_title = parsed_json["actionTitle"] payload = parsed_json["payload"] action_metadata = parsed_json["actionMetadata"] 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, action_title: action_title, payload: payload, action_metadata: action_metadata, from: from, to: to, metadata: metadata, additional_properties: struct ) end
def self.validate_raw(obj:)
-
(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.") obj.action_title.is_a?(String) != false || raise("Passed value for field obj.action_title is not the expected type, validation failed.") obj.payload&.is_a?(String) != false || raise("Passed value for field obj.payload is not the expected type, validation failed.") obj.action_metadata&.is_a?(String) != false || raise("Passed value for field obj.action_metadata is not the expected type, validation failed.") 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(action_title:, from:, to:, message_type: OMIT, payload: OMIT, action_metadata: OMIT, metadata: OMIT,
-
(Pinnacle::InboundActionMessage)
-
Parameters:
-
additional_properties
(OpenStruct
) -- Additional properties unmapped to the current class definition -
metadata
(Pinnacle::InboundMessageMetadata
) -- -
to
(String
) -- -
from
(String
) -- -
action_metadata
(String
) -- -
payload
(String
) -- -
action_title
(String
) -- -
message_type
(String
) --
def initialize(action_title:, from:, to:, message_type: OMIT, payload: OMIT, action_metadata: OMIT, metadata: OMIT, additional_properties: nil) @message_type = message_type if message_type != OMIT @action_title = action_title @payload = payload if payload != OMIT @action_metadata = action_metadata if action_metadata != OMIT @from = from @to = to @metadata = metadata if metadata != OMIT @additional_properties = additional_properties @_field_set = { "messageType": message_type, "actionTitle": action_title, "payload": payload, "actionMetadata": action_metadata, "from": from, "to": to, "metadata": metadata }.reject do |_k, v| v == OMIT end end
def to_json(*_args)
-
(String)
-
def to_json(*_args) @_field_set&.to_json end