module EasyTalk::Model::InstanceMethods

def as_json(_options = {})

Override as_json to include both defined and additional properties
def as_json(_options = {})
  to_hash.merge(@additional_properties)
end

def initialize(attributes = {})

def initialize(attributes = {})
  @additional_properties = {}
  super
end

def method_missing(method_name, *args)

def method_missing(method_name, *args)
  method_string = method_name.to_s
  if method_string.end_with?('=')
    property_name = method_string.chomp('=')
    if self.class.additional_properties_allowed?
      @additional_properties[property_name] = args.first
    else
      super
    end
  elsif self.class.additional_properties_allowed? && @additional_properties.key?(method_string)
    @additional_properties[method_string]
  else
    super
  end
end

def respond_to_missing?(method_name, include_private = false)

def respond_to_missing?(method_name, include_private = false)
  method_string = method_name.to_s
  method_string.end_with?('=') ? method_string.chomp('=') : method_string
  self.class.additional_properties_allowed? || super
end

def to_hash

Add to_hash method to convert defined properties to hash
def to_hash
  return {} unless self.class.properties
  self.class.properties.each_with_object({}) do |prop, hash|
    hash[prop.to_s] = send(prop)
  end
end