class Pinnacle::Send::RcsFallback
def self.from_json(json_object:)
-
(Pinnacle::Send::RcsFallback)
-
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"] text = parsed_json["text"] media_urls = parsed_json["mediaUrls"] new( from: from, text: text, media_urls: media_urls, additional_properties: struct ) end
def self.validate_raw(obj:)
-
(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.text&.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.") obj.media_urls&.is_a?(Array) != false || raise("Passed value for field obj.media_urls is not the expected type, validation failed.") end
def initialize(from: OMIT, text: OMIT, media_urls: OMIT, additional_properties: nil)
-
(Pinnacle::Send::RcsFallback)
-
Parameters:
-
additional_properties
(OpenStruct
) -- Additional properties unmapped to the current class definition -
media_urls
(Array
) -- The URLs of media to include. One of 'text' or 'mediaUrls' must be provided. -
text
(String
) -- The fallback message content (max 1600 characters). One of 'text' or 'mediaUrls' -
from
(String
) -- The sender's phone number in E.164 format. Must be owned by the user.
def initialize(from: OMIT, text: OMIT, media_urls: OMIT, additional_properties: nil) @from = from if from != OMIT @text = text if text != OMIT @media_urls = media_urls if media_urls != OMIT @additional_properties = additional_properties @_field_set = { "from": from, "text": text, "mediaUrls": media_urls }.reject do |_k, v| v == OMIT end end
def to_json(*_args)
-
(String)
-
def to_json(*_args) @_field_set&.to_json end