package org.openstack.nova.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonRootName;

@JsonRootName("server")
public class ServerForCreate implements Serializable {
	
	public static final class SecurityGroup implements Serializable {
		
		private String name;

		public SecurityGroup() {
		}
		
		public SecurityGroup(String name) {
			this.name = name;
		}

		/**
		 * @return the name
		 */
		public String getName() {
			return name;
		}

		/**
		 * @param name the name to set
		 */
		public void setName(String name) {
			this.name = name;
		}
		
	}
	
	private String name;
	
	private String adminPass;
	
	private String imageRef;
	
	private String flavorRef;
	
	private String accessIPv4;
	
	private String accessIPv6;
	
	private Integer min;
	
	private Integer max;
	
	private String diskConfig;
	
	@JsonProperty("key_name")
	private String keyName;
	
	private List<PersonalityFile> personality = new ArrayList<PersonalityFile>();
	
	private Map<String, String> metadata = new HashMap<String, String>();
	
	@JsonProperty("security_groups")
	private List<SecurityGroup> securityGroups;

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the adminPass
	 */
	public String getAdminPass() {
		return adminPass;
	}

	/**
	 * @param adminPass the adminPass to set
	 */
	public void setAdminPass(String adminPass) {
		this.adminPass = adminPass;
	}

	/**
	 * @return the imageRef
	 */
	public String getImageRef() {
		return imageRef;
	}

	/**
	 * @param imageRef the imageRef to set
	 */
	public void setImageRef(String imageRef) {
		this.imageRef = imageRef;
	}

	/**
	 * @return the flavorRef
	 */
	public String getFlavorRef() {
		return flavorRef;
	}

	/**
	 * @param flavorRef the flavorRef to set
	 */
	public void setFlavorRef(String flavorRef) {
		this.flavorRef = flavorRef;
	}

	/**
	 * @return the accessIPv4
	 */
	public String getAccessIPv4() {
		return accessIPv4;
	}

	/**
	 * @param accessIPv4 the accessIPv4 to set
	 */
	public void setAccessIPv4(String accessIPv4) {
		this.accessIPv4 = accessIPv4;
	}

	/**
	 * @return the accessIPv6
	 */
	public String getAccessIPv6() {
		return accessIPv6;
	}

	/**
	 * @param accessIPv6 the accessIPv6 to set
	 */
	public void setAccessIPv6(String accessIPv6) {
		this.accessIPv6 = accessIPv6;
	}

	/**
	 * @return the min
	 */
	public Integer getMin() {
		return min;
	}

	/**
	 * @param min the min to set
	 */
	public void setMin(Integer min) {
		this.min = min;
	}

	/**
	 * @return the max
	 */
	public Integer getMax() {
		return max;
	}

	/**
	 * @param max the max to set
	 */
	public void setMax(Integer max) {
		this.max = max;
	}

	/**
	 * @return the diskConfig
	 */
	public String getDiskConfig() {
		return diskConfig;
	}

	/**
	 * @param diskConfig the diskConfig to set
	 */
	public void setDiskConfig(String diskConfig) {
		this.diskConfig = diskConfig;
	}

	/**
	 * @return the keyName
	 */
	public String getKeyName() {
		return keyName;
	}

	/**
	 * @param keyName the keyName to set
	 */
	public void setKeyName(String keyName) {
		this.keyName = keyName;
	}

	/**
	 * @return the personality
	 */
	public List<PersonalityFile> getPersonality() {
		return personality;
	}

	/**
	 * @param personality the personality to set
	 */
	public void setPersonality(List<PersonalityFile> personality) {
		this.personality = personality;
	}

	/**
	 * @return the metadata
	 */
	public Map<String, String> getMetadata() {
		return metadata;
	}

	/**
	 * @param metadata the metadata to set
	 */
	public void setMetadata(Map<String, String> metadata) {
		this.metadata = metadata;
	}

	/**
	 * @return the securityGroups
	 */
	public List<SecurityGroup> getSecurityGroups() {
		if(securityGroups == null) {
			securityGroups = new ArrayList<SecurityGroup>();
		}
		return securityGroups;
	}
	
}

@@ -1269,16 +1269,144 @@
 yGroups;
+%0A%09%0A%09@JsonProperty(%22user_data%22)%0A%09private String userData;%0A%09%0A%09@JsonProperty(%22availability_zone%22)%0A%09private String availabilityZone;
 %0A%0A%09/**%0A%09
@@ -4211,10 +4211,513 @@
 s;%0A%09%7D%0A%09%0A
+%09/**%0A%09 * @return the userData%0A%09 */%0A%09public String getUserData() %7B%0A%09%09return userData;%0A%09%7D%0A%0A%09/**%0A%09 * @param userData the userData to set%0A%09 */%0A%09public void setUserData(String userData) %7B%0A%09%09this.userData = userData;%0A%09%7D%0A%0A%09/**%0A%09 * @return the availabilityZone%0A%09 */%0A%09public String getAvailabilityZone() %7B%0A%09%09return availabilityZone;%0A%09%7D%0A%0A%09/**%0A%09 * @param availabilityZone the availabilityZone to set%0A%09 */%0A%09public void setAvailabilityZone(String availabilityZone) %7B%0A%09%09this.availabilityZone = availabilityZone;%0A%09%7D%0A%09%0A
 %7D%0A

Update ServerForCreate.java