func (j *AuroraJob) Container(container Container) Job {
	j.jobConfig.TaskConfig.Container = container.Build()
	return j
}
Container sets a container to run for the job configuration to run.
package realis
import (
	"strconv"
	"github.com/paypal/gorealis/gen-go/apache/aurora"
)
type Job interface {
	Environment(env string) Job
	Role(role string) Job
	Name(name string) Job
	CronSchedule(cron string) Job
	CronCollisionPolicy(policy aurora.CronCollisionPolicy) Job
	CPU(cpus float64) Job
	Disk(disk int64) Job
	RAM(ram int64) Job
	GPU(gpu int64) Job
	ExecutorName(name string) Job
	ExecutorData(data string) Job
	AddPorts(num int) Job
	AddLabel(key string, value string) Job
	AddNamedPorts(names ...string) Job
	AddLimitConstraint(name string, limit int32) Job
	AddValueConstraint(name string, negated bool, values ...string) Job
	AddDedicatedConstraint(role, name string) Job
	AddURIs(extract bool, cache bool, values ...string) Job
	JobKey() *aurora.JobKey
	JobConfig() *aurora.JobConfiguration
	TaskConfig() *aurora.TaskConfig
	IsService(isService bool) Job
	InstanceCount(instCount int32) Job
	GetInstanceCount() int32
	MaxFailure(maxFail int32) Job
	Container(container Container) Job
	PartitionPolicy(policy *aurora.PartitionPolicy) Job
	Tier(tier string) Job
	SlaPolicy(policy *aurora.SlaPolicy) Job
}
type resourceType int
const (
	CPU resourceType = iota
	RAM
	DISK
	GPU
)
const portNamePrefix = "org.apache.aurora.port."
type AuroraJob struct {
	jobConfig   *aurora.JobConfiguration
	resources   map[resourceType]*aurora.Resource
	metadata    map[string]*aurora.Metadata
	constraints map[string]*aurora.Constraint
	portCount   int
}
func NewJob() Job {
	jobConfig := aurora.NewJobConfiguration()
	taskConfig := aurora.NewTaskConfig()
	jobKey := aurora.NewJobKey()
	jobConfig.Key = jobKey
	jobConfig.TaskConfig = taskConfig
	taskConfig.Job = jobKey
	taskConfig.Container = aurora.NewContainer()
	taskConfig.Container.Mesos = aurora.NewMesosContainer()
	numCpus := aurora.NewResource()
	ramMb := aurora.NewResource()
	diskMb := aurora.NewResource()
	resources := map[resourceType]*aurora.Resource{CPU: numCpus, RAM: ramMb, DISK: diskMb}
	taskConfig.Resources = []*aurora.Resource{numCpus, ramMb, diskMb}
	numCpus.NumCpus = new(float64)
	ramMb.RamMb = new(int64)
	diskMb.DiskMb = new(int64)
	return &AuroraJob{
		jobConfig:   jobConfig,
		resources:   resources,
		metadata:    make(map[string]*aurora.Metadata),
		constraints: make(map[string]*aurora.Constraint),
		portCount:   0,
	}
}
func (j *AuroraJob) Environment(env string) Job {
	j.jobConfig.Key.Environment = env
	return j
}
func (j *AuroraJob) Role(role string) Job {
	j.jobConfig.Key.Role = role
	identity := &aurora.Identity{User: role}
	j.jobConfig.Owner = identity
	j.jobConfig.TaskConfig.Owner = identity
	return j
}
func (j *AuroraJob) Name(name string) Job {
	j.jobConfig.Key.Name = name
	return j
}
func (j *AuroraJob) ExecutorName(name string) Job {
	if j.jobConfig.TaskConfig.ExecutorConfig == nil {
		j.jobConfig.TaskConfig.ExecutorConfig = aurora.NewExecutorConfig()
	}
	j.jobConfig.TaskConfig.ExecutorConfig.Name = name
	return j
}
func (j *AuroraJob) ExecutorData(data string) Job {
	if j.jobConfig.TaskConfig.ExecutorConfig == nil {
		j.jobConfig.TaskConfig.ExecutorConfig = aurora.NewExecutorConfig()
	}
	j.jobConfig.TaskConfig.ExecutorConfig.Data = data
	return j
}
func (j *AuroraJob) CPU(cpus float64) Job {
	*j.resources[CPU].NumCpus = cpus
	return j
}
func (j *AuroraJob) RAM(ram int64) Job {
	*j.resources[RAM].RamMb = ram
	return j
}
func (j *AuroraJob) Disk(disk int64) Job {
	*j.resources[DISK].DiskMb = disk
	return j
}
func (j *AuroraJob) GPU(gpu int64) Job {
	if _, ok := j.resources[GPU]; !ok {
		j.resources[GPU] = &aurora.Resource{}
		j.JobConfig().GetTaskConfig().Resources = append(
			j.JobConfig().GetTaskConfig().Resources,
			j.resources[GPU])
	}
	j.resources[GPU].NumGpus = &gpu
	return j
}
func (j *AuroraJob) MaxFailure(maxFail int32) Job {
	j.jobConfig.TaskConfig.MaxTaskFailures = maxFail
	return j
}
func (j *AuroraJob) InstanceCount(instCount int32) Job {
	j.jobConfig.InstanceCount = instCount
	return j
}
func (j *AuroraJob) CronSchedule(cron string) Job {
	j.jobConfig.CronSchedule = &cron
	return j
}
func (j *AuroraJob) CronCollisionPolicy(policy aurora.CronCollisionPolicy) Job {
	j.jobConfig.CronCollisionPolicy = policy
	return j
}
func (j *AuroraJob) GetInstanceCount() int32 {
	return j.jobConfig.InstanceCount
}
func (j *AuroraJob) IsService(isService bool) Job {
	j.jobConfig.TaskConfig.IsService = isService
	return j
}
func (j *AuroraJob) JobKey() *aurora.JobKey {
	return j.jobConfig.Key
}
func (j *AuroraJob) JobConfig() *aurora.JobConfiguration {
	return j.jobConfig
}
func (j *AuroraJob) TaskConfig() *aurora.TaskConfig {
	return j.jobConfig.TaskConfig
}
func (j *AuroraJob) AddURIs(extract bool, cache bool, values ...string) Job {
	for _, value := range values {
		j.jobConfig.TaskConfig.MesosFetcherUris = append(j.jobConfig.TaskConfig.MesosFetcherUris,
			&aurora.MesosFetcherURI{Value: value, Extract: &extract, Cache: &cache})
	}
	return j
}
func (j *AuroraJob) AddLabel(key string, value string) Job {
	if _, ok := j.metadata[key]; !ok {
		j.metadata[key] = &aurora.Metadata{Key: key}
		j.jobConfig.TaskConfig.Metadata = append(j.jobConfig.TaskConfig.Metadata, j.metadata[key])
	}
	j.metadata[key].Value = value
	return j
}
func (j *AuroraJob) AddNamedPorts(names ...string) Job {
	j.portCount += len(names)
	for _, name := range names {
		j.jobConfig.TaskConfig.Resources = append(
			j.jobConfig.TaskConfig.Resources,
			&aurora.Resource{NamedPort: &name})
	}
	return j
}
func (j *AuroraJob) AddPorts(num int) Job {
	start := j.portCount
	j.portCount += num
	for i := start; i < j.portCount; i++ {
		portName := portNamePrefix + strconv.Itoa(i)
		j.jobConfig.TaskConfig.Resources = append(
			j.jobConfig.TaskConfig.Resources,
			&aurora.Resource{NamedPort: &portName})
	}
	return j
}
func (j *AuroraJob) AddValueConstraint(name string, negated bool, values ...string) Job {
	if _, ok := j.constraints[name]; !ok {
		j.constraints[name] = &aurora.Constraint{Name: name}
		j.jobConfig.TaskConfig.Constraints = append(j.jobConfig.TaskConfig.Constraints, j.constraints[name])
	}
	j.constraints[name].Constraint = &aurora.TaskConstraint{
		Value: &aurora.ValueConstraint{
			Negated: negated,
			Values:  values,
		},
		Limit: nil,
	}
	return j
}
func (j *AuroraJob) AddLimitConstraint(name string, limit int32) Job {
	if _, ok := j.constraints[name]; !ok {
		j.constraints[name] = &aurora.Constraint{Name: name}
		j.jobConfig.TaskConfig.Constraints = append(j.jobConfig.TaskConfig.Constraints, j.constraints[name])
	}
	j.constraints[name].Constraint = &aurora.TaskConstraint{
		Value: nil,
		Limit: &aurora.LimitConstraint{Limit: limit},
	}
	return j
}
func (j *AuroraJob) AddDedicatedConstraint(role, name string) Job {
	j.AddValueConstraint("dedicated", false, role+"/"+name)
	return j
}