forked from loafle/openapi-generator-original
		
	added contianer check to simplify models
This commit is contained in:
		
							parent
							
								
									58cfacc4cf
								
							
						
					
					
						commit
						ce1b4ec347
					
				@ -1,13 +1,19 @@
 | 
				
			|||||||
import com.wordnik.swagger.codegen.BasicRubyGenerator
 | 
					import com.wordnik.swagger.codegen.BasicRubyGenerator
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.wordnik.swagger.core._
 | 
					import com.wordnik.swagger.core._
 | 
				
			||||||
 | 
					import com.wordnik.swagger.codegen.util.ScalaJsonUtil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
object RubyPetstoreCodegen extends BasicRubyGenerator {
 | 
					object RubyPetstoreCodegen extends BasicRubyGenerator {
 | 
				
			||||||
  def main(args: Array[String]) = generateClient(args)
 | 
					  def main(args: Array[String]) = generateClient(args)
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
					  // to avoid recompiling ...
 | 
				
			||||||
 | 
					  override def templateDir = "src/main/resources/ruby"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // where to write generated code
 | 
					  // where to write generated code
 | 
				
			||||||
  override def destinationDir = "samples/client/petstore/ruby"
 | 
					  override def destinationDir = "samples/client/petstore/ruby"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // package for models
 | 
					  override def processModelMap(m: Map[String, AnyRef]): Map[String, AnyRef] = {
 | 
				
			||||||
  override def modelPackage = Some("models")
 | 
					  	println(json.writeValueAsString(m))
 | 
				
			||||||
 | 
					  	m
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -16,33 +16,15 @@ class Category
 | 
				
			|||||||
      if Category.attribute_map["id".to_sym] != nil
 | 
					      if Category.attribute_map["id".to_sym] != nil
 | 
				
			||||||
        name = "id".to_sym
 | 
					        name = "id".to_sym
 | 
				
			||||||
        value = attributes["id"]
 | 
					        value = attributes["id"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if Category.attribute_map["name".to_sym] != nil
 | 
					      if Category.attribute_map["name".to_sym] != nil
 | 
				
			||||||
        name = "name".to_sym
 | 
					        name = "name".to_sym
 | 
				
			||||||
        value = attributes["name"]
 | 
					        value = attributes["name"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def to_body
 | 
					  def to_body
 | 
				
			||||||
    body = {}
 | 
					    body = {}
 | 
				
			||||||
 | 
				
			|||||||
@ -16,75 +16,30 @@ class Order
 | 
				
			|||||||
      if Order.attribute_map["id".to_sym] != nil
 | 
					      if Order.attribute_map["id".to_sym] != nil
 | 
				
			||||||
        name = "id".to_sym
 | 
					        name = "id".to_sym
 | 
				
			||||||
        value = attributes["id"]
 | 
					        value = attributes["id"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if Order.attribute_map["pet_id".to_sym] != nil
 | 
					      if Order.attribute_map["pet_id".to_sym] != nil
 | 
				
			||||||
        name = "pet_id".to_sym
 | 
					        name = "pet_id".to_sym
 | 
				
			||||||
        value = attributes["petId"]
 | 
					        value = attributes["petId"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if Order.attribute_map["status".to_sym] != nil
 | 
					      if Order.attribute_map["status".to_sym] != nil
 | 
				
			||||||
        name = "status".to_sym
 | 
					        name = "status".to_sym
 | 
				
			||||||
        value = attributes["status"]
 | 
					        value = attributes["status"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if Order.attribute_map["quantity".to_sym] != nil
 | 
					      if Order.attribute_map["quantity".to_sym] != nil
 | 
				
			||||||
        name = "quantity".to_sym
 | 
					        name = "quantity".to_sym
 | 
				
			||||||
        value = attributes["quantity"]
 | 
					        value = attributes["quantity"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if Order.attribute_map["ship_date".to_sym] != nil
 | 
					      if Order.attribute_map["ship_date".to_sym] != nil
 | 
				
			||||||
        name = "ship_date".to_sym
 | 
					        name = "ship_date".to_sym
 | 
				
			||||||
        value = attributes["shipDate"]
 | 
					        value = attributes["shipDate"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push Date.new(arrayValue)
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def to_body
 | 
					  def to_body
 | 
				
			||||||
    body = {}
 | 
					    body = {}
 | 
				
			||||||
 | 
				
			|||||||
@ -16,85 +16,43 @@ class Pet
 | 
				
			|||||||
      if Pet.attribute_map["id".to_sym] != nil
 | 
					      if Pet.attribute_map["id".to_sym] != nil
 | 
				
			||||||
        name = "id".to_sym
 | 
					        name = "id".to_sym
 | 
				
			||||||
        value = attributes["id"]
 | 
					        value = attributes["id"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if Pet.attribute_map["tags".to_sym] != nil
 | 
					      if Pet.attribute_map["tags".to_sym] != nil
 | 
				
			||||||
        name = "tags".to_sym
 | 
					        name = "tags".to_sym
 | 
				
			||||||
        value = attributes["tags"]
 | 
					        value = attributes["tags"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
        if value.is_a?(Array)
 | 
					        if value.is_a?(Array)
 | 
				
			||||||
	        array = Array.new
 | 
						        array = Array.new
 | 
				
			||||||
	        value.each do |arrayValue|
 | 
						        value.each do |arrayValue|
 | 
				
			||||||
	          array.push Tag.new(arrayValue)
 | 
						          array.push Tag.new(arrayValue)
 | 
				
			||||||
	        end
 | 
						        end
 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
						        send("#{name}=", array) if self.respond_to?(name)
 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
	        send("#{name}=", value) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
      if Pet.attribute_map["category".to_sym] != nil
 | 
					      if Pet.attribute_map["category".to_sym] != nil
 | 
				
			||||||
        name = "category".to_sym
 | 
					        name = "category".to_sym
 | 
				
			||||||
        value = attributes["category"]
 | 
					        value = attributes["category"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push Category.new(arrayValue)
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if Pet.attribute_map["status".to_sym] != nil
 | 
					      if Pet.attribute_map["status".to_sym] != nil
 | 
				
			||||||
        name = "status".to_sym
 | 
					        name = "status".to_sym
 | 
				
			||||||
        value = attributes["status"]
 | 
					        value = attributes["status"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if Pet.attribute_map["name".to_sym] != nil
 | 
					      if Pet.attribute_map["name".to_sym] != nil
 | 
				
			||||||
        name = "name".to_sym
 | 
					        name = "name".to_sym
 | 
				
			||||||
        value = attributes["name"]
 | 
					        value = attributes["name"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if Pet.attribute_map["photo_urls".to_sym] != nil
 | 
					      if Pet.attribute_map["photo_urls".to_sym] != nil
 | 
				
			||||||
        name = "photo_urls".to_sym
 | 
					        name = "photo_urls".to_sym
 | 
				
			||||||
        value = attributes["photoUrls"]
 | 
					        value = attributes["photoUrls"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
        if value.is_a?(Array)
 | 
					        if value.is_a?(Array)
 | 
				
			||||||
	        array = Array.new
 | 
						        array = Array.new
 | 
				
			||||||
	        value.each do |arrayValue|
 | 
						        value.each do |arrayValue|
 | 
				
			||||||
	          array.push arrayValue
 | 
						          array.push arrayValue
 | 
				
			||||||
	        end
 | 
						        end
 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
						        send("#{name}=", array) if self.respond_to?(name)
 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
	        send("#{name}=", value) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
        end
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
				
			|||||||
@ -16,33 +16,15 @@ class Tag
 | 
				
			|||||||
      if Tag.attribute_map["id".to_sym] != nil
 | 
					      if Tag.attribute_map["id".to_sym] != nil
 | 
				
			||||||
        name = "id".to_sym
 | 
					        name = "id".to_sym
 | 
				
			||||||
        value = attributes["id"]
 | 
					        value = attributes["id"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if Tag.attribute_map["name".to_sym] != nil
 | 
					      if Tag.attribute_map["name".to_sym] != nil
 | 
				
			||||||
        name = "name".to_sym
 | 
					        name = "name".to_sym
 | 
				
			||||||
        value = attributes["name"]
 | 
					        value = attributes["name"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def to_body
 | 
					  def to_body
 | 
				
			||||||
    body = {}
 | 
					    body = {}
 | 
				
			||||||
 | 
				
			|||||||
@ -16,117 +16,45 @@ class User
 | 
				
			|||||||
      if User.attribute_map["id".to_sym] != nil
 | 
					      if User.attribute_map["id".to_sym] != nil
 | 
				
			||||||
        name = "id".to_sym
 | 
					        name = "id".to_sym
 | 
				
			||||||
        value = attributes["id"]
 | 
					        value = attributes["id"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if User.attribute_map["last_name".to_sym] != nil
 | 
					      if User.attribute_map["last_name".to_sym] != nil
 | 
				
			||||||
        name = "last_name".to_sym
 | 
					        name = "last_name".to_sym
 | 
				
			||||||
        value = attributes["lastName"]
 | 
					        value = attributes["lastName"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if User.attribute_map["username".to_sym] != nil
 | 
					      if User.attribute_map["username".to_sym] != nil
 | 
				
			||||||
        name = "username".to_sym
 | 
					        name = "username".to_sym
 | 
				
			||||||
        value = attributes["username"]
 | 
					        value = attributes["username"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if User.attribute_map["phone".to_sym] != nil
 | 
					      if User.attribute_map["phone".to_sym] != nil
 | 
				
			||||||
        name = "phone".to_sym
 | 
					        name = "phone".to_sym
 | 
				
			||||||
        value = attributes["phone"]
 | 
					        value = attributes["phone"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if User.attribute_map["email".to_sym] != nil
 | 
					      if User.attribute_map["email".to_sym] != nil
 | 
				
			||||||
        name = "email".to_sym
 | 
					        name = "email".to_sym
 | 
				
			||||||
        value = attributes["email"]
 | 
					        value = attributes["email"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if User.attribute_map["user_status".to_sym] != nil
 | 
					      if User.attribute_map["user_status".to_sym] != nil
 | 
				
			||||||
        name = "user_status".to_sym
 | 
					        name = "user_status".to_sym
 | 
				
			||||||
        value = attributes["userStatus"]
 | 
					        value = attributes["userStatus"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if User.attribute_map["first_name".to_sym] != nil
 | 
					      if User.attribute_map["first_name".to_sym] != nil
 | 
				
			||||||
        name = "first_name".to_sym
 | 
					        name = "first_name".to_sym
 | 
				
			||||||
        value = attributes["firstName"]
 | 
					        value = attributes["firstName"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
	    end
 | 
					 | 
				
			||||||
      if User.attribute_map["password".to_sym] != nil
 | 
					      if User.attribute_map["password".to_sym] != nil
 | 
				
			||||||
        name = "password".to_sym
 | 
					        name = "password".to_sym
 | 
				
			||||||
        value = attributes["password"]
 | 
					        value = attributes["password"]
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      if value.is_a?(Array)
 | 
					 | 
				
			||||||
	        array = Array.new
 | 
					 | 
				
			||||||
	        value.each do |arrayValue|
 | 
					 | 
				
			||||||
	          array.push arrayValue
 | 
					 | 
				
			||||||
	        end
 | 
					 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
        send("#{name}=", value) if self.respond_to?(name)
 | 
					        send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
  end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def to_body
 | 
					  def to_body
 | 
				
			||||||
    body = {}
 | 
					    body = {}
 | 
				
			||||||
 | 
				
			|||||||
@ -20,7 +20,7 @@ class {{classname}}
 | 
				
			|||||||
      if {{classname}}.attribute_map["{{{name}}}".to_sym] != nil
 | 
					      if {{classname}}.attribute_map["{{{name}}}".to_sym] != nil
 | 
				
			||||||
        name = "{{{name}}}".to_sym
 | 
					        name = "{{{name}}}".to_sym
 | 
				
			||||||
        value = attributes["{{{baseName}}}"]
 | 
					        value = attributes["{{{baseName}}}"]
 | 
				
			||||||
 | 
					        {{#isContainer}}
 | 
				
			||||||
	      if value.is_a?(Array)
 | 
						      if value.is_a?(Array)
 | 
				
			||||||
	        array = Array.new
 | 
						        array = Array.new
 | 
				
			||||||
	        value.each do |arrayValue|
 | 
						        value.each do |arrayValue|
 | 
				
			||||||
@ -30,9 +30,11 @@ class {{classname}}
 | 
				
			|||||||
	        {{/complexType}}
 | 
						        {{/complexType}}
 | 
				
			||||||
	        end
 | 
						        end
 | 
				
			||||||
	        send("#{name}=", array) if self.respond_to?(name)
 | 
						        send("#{name}=", array) if self.respond_to?(name)
 | 
				
			||||||
	      else
 | 
					 | 
				
			||||||
	        send("#{name}=", value) if self.respond_to?(name)
 | 
					 | 
				
			||||||
	      end
 | 
						      end
 | 
				
			||||||
 | 
					        {{/isContainer}}
 | 
				
			||||||
 | 
					        {{^isContainer}}
 | 
				
			||||||
 | 
						      send("#{name}=", value) if self.respond_to?(name)
 | 
				
			||||||
 | 
						      {{/isContainer}}
 | 
				
			||||||
	    end
 | 
						    end
 | 
				
			||||||
      {{/vars}}
 | 
					      {{/vars}}
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user