class Pinnacle::SenderMetadata
def self.from_json(json_object:)
-
(Pinnacle::SenderMetadata)
-
Parameters:
-
json_object
(String
) --
def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) city = parsed_json["city"] state = parsed_json["state"] country = parsed_json["country"] new( city: city, state: state, country: country, additional_properties: struct ) end
def self.validate_raw(obj:)
-
(Void)
-
Parameters:
-
obj
(Object
) --
def self.validate_raw(obj:) obj.city&.is_a?(String) != false || raise("Passed value for field obj.city is not the expected type, validation failed.") obj.state&.is_a?(String) != false || raise("Passed value for field obj.state is not the expected type, validation failed.") obj.country&.is_a?(String) != false || raise("Passed value for field obj.country is not the expected type, validation failed.") end
def initialize(city: OMIT, state: OMIT, country: OMIT, additional_properties: nil)
-
(Pinnacle::SenderMetadata)
-
Parameters:
-
additional_properties
(OpenStruct
) -- Additional properties unmapped to the current class definition -
country
(String
) -- -
state
(String
) -- -
city
(String
) --
def initialize(city: OMIT, state: OMIT, country: OMIT, additional_properties: nil) @city = city if city != OMIT @state = state if state != OMIT @country = country if country != OMIT @additional_properties = additional_properties @_field_set = { "city": city, "state": state, "country": country }.reject do |_k, v| v == OMIT end end
def to_json(*_args)
-
(String)
-
def to_json(*_args) @_field_set&.to_json end