// Autogenerated by Thrift Compiler (0.9.3)
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING

package aurora

import (
	"bytes"
	"fmt"
	"git.apache.org/thrift.git/lib/go/thrift"
)

// (needed to ensure safety because of naive import list construction.)
var _ = thrift.ZERO
var _ = fmt.Printf
var _ = bytes.Equal

var GoUnusedProtection__ int

type ResponseCode int64

const (
	ResponseCode_INVALID_REQUEST    ResponseCode = 0
	ResponseCode_OK                 ResponseCode = 1
	ResponseCode_ERROR              ResponseCode = 2
	ResponseCode_WARNING            ResponseCode = 3
	ResponseCode_AUTH_FAILED        ResponseCode = 4
	ResponseCode_JOB_UPDATING_ERROR ResponseCode = 5
	ResponseCode_ERROR_TRANSIENT    ResponseCode = 6
)

func (p ResponseCode) String() string {
	switch p {
	case ResponseCode_INVALID_REQUEST:
		return "INVALID_REQUEST"
	case ResponseCode_OK:
		return "OK"
	case ResponseCode_ERROR:
		return "ERROR"
	case ResponseCode_WARNING:
		return "WARNING"
	case ResponseCode_AUTH_FAILED:
		return "AUTH_FAILED"
	case ResponseCode_JOB_UPDATING_ERROR:
		return "JOB_UPDATING_ERROR"
	case ResponseCode_ERROR_TRANSIENT:
		return "ERROR_TRANSIENT"
	}
	return "<UNSET>"
}

func ResponseCodeFromString(s string) (ResponseCode, error) {
	switch s {
	case "INVALID_REQUEST":
		return ResponseCode_INVALID_REQUEST, nil
	case "OK":
		return ResponseCode_OK, nil
	case "ERROR":
		return ResponseCode_ERROR, nil
	case "WARNING":
		return ResponseCode_WARNING, nil
	case "AUTH_FAILED":
		return ResponseCode_AUTH_FAILED, nil
	case "JOB_UPDATING_ERROR":
		return ResponseCode_JOB_UPDATING_ERROR, nil
	case "ERROR_TRANSIENT":
		return ResponseCode_ERROR_TRANSIENT, nil
	}
	return ResponseCode(0), fmt.Errorf("not a valid ResponseCode string")
}

func ResponseCodePtr(v ResponseCode) *ResponseCode { return &v }

func (p ResponseCode) MarshalText() ([]byte, error) {
	return []byte(p.String()), nil
}

func (p *ResponseCode) UnmarshalText(text []byte) error {
	q, err := ResponseCodeFromString(string(text))
	if err != nil {
		return err
	}
	*p = q
	return nil
}

type MaintenanceMode int64

const (
	MaintenanceMode_NONE      MaintenanceMode = 1
	MaintenanceMode_SCHEDULED MaintenanceMode = 2
	MaintenanceMode_DRAINING  MaintenanceMode = 3
	MaintenanceMode_DRAINED   MaintenanceMode = 4
)

func (p MaintenanceMode) String() string {
	switch p {
	case MaintenanceMode_NONE:
		return "NONE"
	case MaintenanceMode_SCHEDULED:
		return "SCHEDULED"
	case MaintenanceMode_DRAINING:
		return "DRAINING"
	case MaintenanceMode_DRAINED:
		return "DRAINED"
	}
	return "<UNSET>"
}

func MaintenanceModeFromString(s string) (MaintenanceMode, error) {
	switch s {
	case "NONE":
		return MaintenanceMode_NONE, nil
	case "SCHEDULED":
		return MaintenanceMode_SCHEDULED, nil
	case "DRAINING":
		return MaintenanceMode_DRAINING, nil
	case "DRAINED":
		return MaintenanceMode_DRAINED, nil
	}
	return MaintenanceMode(0), fmt.Errorf("not a valid MaintenanceMode string")
}

func MaintenanceModePtr(v MaintenanceMode) *MaintenanceMode { return &v }

func (p MaintenanceMode) MarshalText() ([]byte, error) {
	return []byte(p.String()), nil
}

func (p *MaintenanceMode) UnmarshalText(text []byte) error {
	q, err := MaintenanceModeFromString(string(text))
	if err != nil {
		return err
	}
	*p = q
	return nil
}

//The mode for a volume mount
type Mode int64

const (
	Mode_RW Mode = 1
	Mode_RO Mode = 2
)

func (p Mode) String() string {
	switch p {
	case Mode_RW:
		return "RW"
	case Mode_RO:
		return "RO"
	}
	return "<UNSET>"
}

func ModeFromString(s string) (Mode, error) {
	switch s {
	case "RW":
		return Mode_RW, nil
	case "RO":
		return Mode_RO, nil
	}
	return Mode(0), fmt.Errorf("not a valid Mode string")
}

func ModePtr(v Mode) *Mode { return &v }

func (p Mode) MarshalText() ([]byte, error) {
	return []byte(p.String()), nil
}

func (p *Mode) UnmarshalText(text []byte) error {
	q, err := ModeFromString(string(text))
	if err != nil {
		return err
	}
	*p = q
	return nil
}

//Defines the policy for launching a new cron job when one is already running.
type CronCollisionPolicy int64

const (
	CronCollisionPolicy_KILL_EXISTING CronCollisionPolicy = 0
	CronCollisionPolicy_CANCEL_NEW    CronCollisionPolicy = 1
	CronCollisionPolicy_RUN_OVERLAP   CronCollisionPolicy = 2
)

func (p CronCollisionPolicy) String() string {
	switch p {
	case CronCollisionPolicy_KILL_EXISTING:
		return "KILL_EXISTING"
	case CronCollisionPolicy_CANCEL_NEW:
		return "CANCEL_NEW"
	case CronCollisionPolicy_RUN_OVERLAP:
		return "RUN_OVERLAP"
	}
	return "<UNSET>"
}

func CronCollisionPolicyFromString(s string) (CronCollisionPolicy, error) {
	switch s {
	case "KILL_EXISTING":
		return CronCollisionPolicy_KILL_EXISTING, nil
	case "CANCEL_NEW":
		return CronCollisionPolicy_CANCEL_NEW, nil
	case "RUN_OVERLAP":
		return CronCollisionPolicy_RUN_OVERLAP, nil
	}
	return CronCollisionPolicy(0), fmt.Errorf("not a valid CronCollisionPolicy string")
}

func CronCollisionPolicyPtr(v CronCollisionPolicy) *CronCollisionPolicy { return &v }

func (p CronCollisionPolicy) MarshalText() ([]byte, error) {
	return []byte(p.String()), nil
}

func (p *CronCollisionPolicy) UnmarshalText(text []byte) error {
	q, err := CronCollisionPolicyFromString(string(text))
	if err != nil {
		return err
	}
	*p = q
	return nil
}

//States that a task may be in.
type ScheduleStatus int64

const (
	ScheduleStatus_INIT       ScheduleStatus = 11
	ScheduleStatus_THROTTLED  ScheduleStatus = 16
	ScheduleStatus_PENDING    ScheduleStatus = 0
	ScheduleStatus_ASSIGNED   ScheduleStatus = 9
	ScheduleStatus_STARTING   ScheduleStatus = 1
	ScheduleStatus_RUNNING    ScheduleStatus = 2
	ScheduleStatus_FINISHED   ScheduleStatus = 3
	ScheduleStatus_PREEMPTING ScheduleStatus = 13
	ScheduleStatus_RESTARTING ScheduleStatus = 12
	ScheduleStatus_DRAINING   ScheduleStatus = 17
	ScheduleStatus_FAILED     ScheduleStatus = 4
	ScheduleStatus_KILLED     ScheduleStatus = 5
	ScheduleStatus_KILLING    ScheduleStatus = 6
	ScheduleStatus_LOST       ScheduleStatus = 7
)

func (p ScheduleStatus) String() string {
	switch p {
	case ScheduleStatus_INIT:
		return "INIT"
	case ScheduleStatus_THROTTLED:
		return "THROTTLED"
	case ScheduleStatus_PENDING:
		return "PENDING"
	case ScheduleStatus_ASSIGNED:
		return "ASSIGNED"
	case ScheduleStatus_STARTING:
		return "STARTING"
	case ScheduleStatus_RUNNING:
		return "RUNNING"
	case ScheduleStatus_FINISHED:
		return "FINISHED"
	case ScheduleStatus_PREEMPTING:
		return "PREEMPTING"
	case ScheduleStatus_RESTARTING:
		return "RESTARTING"
	case ScheduleStatus_DRAINING:
		return "DRAINING"
	case ScheduleStatus_FAILED:
		return "FAILED"
	case ScheduleStatus_KILLED:
		return "KILLED"
	case ScheduleStatus_KILLING:
		return "KILLING"
	case ScheduleStatus_LOST:
		return "LOST"
	}
	return "<UNSET>"
}

func ScheduleStatusFromString(s string) (ScheduleStatus, error) {
	switch s {
	case "INIT":
		return ScheduleStatus_INIT, nil
	case "THROTTLED":
		return ScheduleStatus_THROTTLED, nil
	case "PENDING":
		return ScheduleStatus_PENDING, nil
	case "ASSIGNED":
		return ScheduleStatus_ASSIGNED, nil
	case "STARTING":
		return ScheduleStatus_STARTING, nil
	case "RUNNING":
		return ScheduleStatus_RUNNING, nil
	case "FINISHED":
		return ScheduleStatus_FINISHED, nil
	case "PREEMPTING":
		return ScheduleStatus_PREEMPTING, nil
	case "RESTARTING":
		return ScheduleStatus_RESTARTING, nil
	case "DRAINING":
		return ScheduleStatus_DRAINING, nil
	case "FAILED":
		return ScheduleStatus_FAILED, nil
	case "KILLED":
		return ScheduleStatus_KILLED, nil
	case "KILLING":
		return ScheduleStatus_KILLING, nil
	case "LOST":
		return ScheduleStatus_LOST, nil
	}
	return ScheduleStatus(0), fmt.Errorf("not a valid ScheduleStatus string")
}

func ScheduleStatusPtr(v ScheduleStatus) *ScheduleStatus { return &v }

func (p ScheduleStatus) MarshalText() ([]byte, error) {
	return []byte(p.String()), nil
}

func (p *ScheduleStatus) UnmarshalText(text []byte) error {
	q, err := ScheduleStatusFromString(string(text))
	if err != nil {
		return err
	}
	*p = q
	return nil
}

//States that a job update may be in.
type JobUpdateStatus int64

const (
	JobUpdateStatus_ROLLING_FORWARD             JobUpdateStatus = 0
	JobUpdateStatus_ROLLING_BACK                JobUpdateStatus = 1
	JobUpdateStatus_ROLL_FORWARD_PAUSED         JobUpdateStatus = 2
	JobUpdateStatus_ROLL_BACK_PAUSED            JobUpdateStatus = 3
	JobUpdateStatus_ROLLED_FORWARD              JobUpdateStatus = 4
	JobUpdateStatus_ROLLED_BACK                 JobUpdateStatus = 5
	JobUpdateStatus_ABORTED                     JobUpdateStatus = 6
	JobUpdateStatus_ERROR                       JobUpdateStatus = 7
	JobUpdateStatus_FAILED                      JobUpdateStatus = 8
	JobUpdateStatus_ROLL_FORWARD_AWAITING_PULSE JobUpdateStatus = 9
	JobUpdateStatus_ROLL_BACK_AWAITING_PULSE    JobUpdateStatus = 10
)

func (p JobUpdateStatus) String() string {
	switch p {
	case JobUpdateStatus_ROLLING_FORWARD:
		return "ROLLING_FORWARD"
	case JobUpdateStatus_ROLLING_BACK:
		return "ROLLING_BACK"
	case JobUpdateStatus_ROLL_FORWARD_PAUSED:
		return "ROLL_FORWARD_PAUSED"
	case JobUpdateStatus_ROLL_BACK_PAUSED:
		return "ROLL_BACK_PAUSED"
	case JobUpdateStatus_ROLLED_FORWARD:
		return "ROLLED_FORWARD"
	case JobUpdateStatus_ROLLED_BACK:
		return "ROLLED_BACK"
	case JobUpdateStatus_ABORTED:
		return "ABORTED"
	case JobUpdateStatus_ERROR:
		return "ERROR"
	case JobUpdateStatus_FAILED:
		return "FAILED"
	case JobUpdateStatus_ROLL_FORWARD_AWAITING_PULSE:
		return "ROLL_FORWARD_AWAITING_PULSE"
	case JobUpdateStatus_ROLL_BACK_AWAITING_PULSE:
		return "ROLL_BACK_AWAITING_PULSE"
	}
	return "<UNSET>"
}

func JobUpdateStatusFromString(s string) (JobUpdateStatus, error) {
	switch s {
	case "ROLLING_FORWARD":
		return JobUpdateStatus_ROLLING_FORWARD, nil
	case "ROLLING_BACK":
		return JobUpdateStatus_ROLLING_BACK, nil
	case "ROLL_FORWARD_PAUSED":
		return JobUpdateStatus_ROLL_FORWARD_PAUSED, nil
	case "ROLL_BACK_PAUSED":
		return JobUpdateStatus_ROLL_BACK_PAUSED, nil
	case "ROLLED_FORWARD":
		return JobUpdateStatus_ROLLED_FORWARD, nil
	case "ROLLED_BACK":
		return JobUpdateStatus_ROLLED_BACK, nil
	case "ABORTED":
		return JobUpdateStatus_ABORTED, nil
	case "ERROR":
		return JobUpdateStatus_ERROR, nil
	case "FAILED":
		return JobUpdateStatus_FAILED, nil
	case "ROLL_FORWARD_AWAITING_PULSE":
		return JobUpdateStatus_ROLL_FORWARD_AWAITING_PULSE, nil
	case "ROLL_BACK_AWAITING_PULSE":
		return JobUpdateStatus_ROLL_BACK_AWAITING_PULSE, nil
	}
	return JobUpdateStatus(0), fmt.Errorf("not a valid JobUpdateStatus string")
}

func JobUpdateStatusPtr(v JobUpdateStatus) *JobUpdateStatus { return &v }

func (p JobUpdateStatus) MarshalText() ([]byte, error) {
	return []byte(p.String()), nil
}

func (p *JobUpdateStatus) UnmarshalText(text []byte) error {
	q, err := JobUpdateStatusFromString(string(text))
	if err != nil {
		return err
	}
	*p = q
	return nil
}

//Job update actions that can be applied to job instances.
type JobUpdateAction int64

const (
	JobUpdateAction_INSTANCE_UPDATED         JobUpdateAction = 1
	JobUpdateAction_INSTANCE_ROLLED_BACK     JobUpdateAction = 2
	JobUpdateAction_INSTANCE_UPDATING        JobUpdateAction = 3
	JobUpdateAction_INSTANCE_ROLLING_BACK    JobUpdateAction = 4
	JobUpdateAction_INSTANCE_UPDATE_FAILED   JobUpdateAction = 5
	JobUpdateAction_INSTANCE_ROLLBACK_FAILED JobUpdateAction = 6
)

func (p JobUpdateAction) String() string {
	switch p {
	case JobUpdateAction_INSTANCE_UPDATED:
		return "INSTANCE_UPDATED"
	case JobUpdateAction_INSTANCE_ROLLED_BACK:
		return "INSTANCE_ROLLED_BACK"
	case JobUpdateAction_INSTANCE_UPDATING:
		return "INSTANCE_UPDATING"
	case JobUpdateAction_INSTANCE_ROLLING_BACK:
		return "INSTANCE_ROLLING_BACK"
	case JobUpdateAction_INSTANCE_UPDATE_FAILED:
		return "INSTANCE_UPDATE_FAILED"
	case JobUpdateAction_INSTANCE_ROLLBACK_FAILED:
		return "INSTANCE_ROLLBACK_FAILED"
	}
	return "<UNSET>"
}

func JobUpdateActionFromString(s string) (JobUpdateAction, error) {
	switch s {
	case "INSTANCE_UPDATED":
		return JobUpdateAction_INSTANCE_UPDATED, nil
	case "INSTANCE_ROLLED_BACK":
		return JobUpdateAction_INSTANCE_ROLLED_BACK, nil
	case "INSTANCE_UPDATING":
		return JobUpdateAction_INSTANCE_UPDATING, nil
	case "INSTANCE_ROLLING_BACK":
		return JobUpdateAction_INSTANCE_ROLLING_BACK, nil
	case "INSTANCE_UPDATE_FAILED":
		return JobUpdateAction_INSTANCE_UPDATE_FAILED, nil
	case "INSTANCE_ROLLBACK_FAILED":
		return JobUpdateAction_INSTANCE_ROLLBACK_FAILED, nil
	}
	return JobUpdateAction(0), fmt.Errorf("not a valid JobUpdateAction string")
}

func JobUpdateActionPtr(v JobUpdateAction) *JobUpdateAction { return &v }

func (p JobUpdateAction) MarshalText() ([]byte, error) {
	return []byte(p.String()), nil
}

func (p *JobUpdateAction) UnmarshalText(text []byte) error {
	q, err := JobUpdateActionFromString(string(text))
	if err != nil {
		return err
	}
	*p = q
	return nil
}

//Status of the coordinated update. Intended as a response to pulseJobUpdate RPC.
type JobUpdatePulseStatus int64

const (
	JobUpdatePulseStatus_OK       JobUpdatePulseStatus = 1
	JobUpdatePulseStatus_FINISHED JobUpdatePulseStatus = 2
)

func (p JobUpdatePulseStatus) String() string {
	switch p {
	case JobUpdatePulseStatus_OK:
		return "OK"
	case JobUpdatePulseStatus_FINISHED:
		return "FINISHED"
	}
	return "<UNSET>"
}

func JobUpdatePulseStatusFromString(s string) (JobUpdatePulseStatus, error) {
	switch s {
	case "OK":
		return JobUpdatePulseStatus_OK, nil
	case "FINISHED":
		return JobUpdatePulseStatus_FINISHED, nil
	}
	return JobUpdatePulseStatus(0), fmt.Errorf("not a valid JobUpdatePulseStatus string")
}

func JobUpdatePulseStatusPtr(v JobUpdatePulseStatus) *JobUpdatePulseStatus { return &v }

func (p JobUpdatePulseStatus) MarshalText() ([]byte, error) {
	return []byte(p.String()), nil
}

func (p *JobUpdatePulseStatus) UnmarshalText(text []byte) error {
	q, err := JobUpdatePulseStatusFromString(string(text))
	if err != nil {
		return err
	}
	*p = q
	return nil
}

// Attributes:
//  - User
type Identity struct {
	// unused field # 1
	User string `thrift:"user,2" json:"user"`
}

func NewIdentity() *Identity {
	return &Identity{}
}

func (p *Identity) GetUser() string {
	return p.User
}
func (p *Identity) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Identity) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.User = v
	}
	return nil
}

func (p *Identity) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Identity"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Identity) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("user", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:user: ", p), err)
	}
	if err := oprot.WriteString(string(p.User)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.user (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:user: ", p), err)
	}
	return err
}

func (p *Identity) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Identity(%+v)", *p)
}

// A single host attribute.
//
// Attributes:
//  - Name
//  - Values
type Attribute struct {
	Name   string          `thrift:"name,1" json:"name"`
	Values map[string]bool `thrift:"values,2" json:"values"`
}

func NewAttribute() *Attribute {
	return &Attribute{}
}

func (p *Attribute) GetName() string {
	return p.Name
}

func (p *Attribute) GetValues() map[string]bool {
	return p.Values
}
func (p *Attribute) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Attribute) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Name = v
	}
	return nil
}

func (p *Attribute) readField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[string]bool, size)
	p.Values = tSet
	for i := 0; i < size; i++ {
		var _elem0 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem0 = v
		}
		p.Values[_elem0] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *Attribute) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Attribute"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Attribute) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err)
	}
	if err := oprot.WriteString(string(p.Name)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err)
	}
	return err
}

func (p *Attribute) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("values", thrift.SET, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:values: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRING, len(p.Values)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Values {
		if err := oprot.WriteString(string(v)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:values: ", p), err)
	}
	return err
}

func (p *Attribute) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Attribute(%+v)", *p)
}

// The attributes assigned to a host.
//
// Attributes:
//  - Host
//  - Attributes
//  - Mode
//  - SlaveId
type HostAttributes struct {
	Host       string              `thrift:"host,1" json:"host"`
	Attributes map[*Attribute]bool `thrift:"attributes,2" json:"attributes"`
	Mode       *MaintenanceMode    `thrift:"mode,3" json:"mode,omitempty"`
	SlaveId    *string             `thrift:"slaveId,4" json:"slaveId,omitempty"`
}

func NewHostAttributes() *HostAttributes {
	return &HostAttributes{}
}

func (p *HostAttributes) GetHost() string {
	return p.Host
}

func (p *HostAttributes) GetAttributes() map[*Attribute]bool {
	return p.Attributes
}

var HostAttributes_Mode_DEFAULT MaintenanceMode

func (p *HostAttributes) GetMode() MaintenanceMode {
	if !p.IsSetMode() {
		return HostAttributes_Mode_DEFAULT
	}
	return *p.Mode
}

var HostAttributes_SlaveId_DEFAULT string

func (p *HostAttributes) GetSlaveId() string {
	if !p.IsSetSlaveId() {
		return HostAttributes_SlaveId_DEFAULT
	}
	return *p.SlaveId
}
func (p *HostAttributes) IsSetMode() bool {
	return p.Mode != nil
}

func (p *HostAttributes) IsSetSlaveId() bool {
	return p.SlaveId != nil
}

func (p *HostAttributes) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *HostAttributes) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Host = v
	}
	return nil
}

func (p *HostAttributes) readField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*Attribute]bool, size)
	p.Attributes = tSet
	for i := 0; i < size; i++ {
		_elem1 := &Attribute{}
		if err := _elem1.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err)
		}
		p.Attributes[_elem1] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *HostAttributes) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		temp := MaintenanceMode(v)
		p.Mode = &temp
	}
	return nil
}

func (p *HostAttributes) readField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.SlaveId = &v
	}
	return nil
}

func (p *HostAttributes) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("HostAttributes"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *HostAttributes) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("host", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err)
	}
	if err := oprot.WriteString(string(p.Host)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.host (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err)
	}
	return err
}

func (p *HostAttributes) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("attributes", thrift.SET, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:attributes: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Attributes)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Attributes {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:attributes: ", p), err)
	}
	return err
}

func (p *HostAttributes) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetMode() {
		if err := oprot.WriteFieldBegin("mode", thrift.I32, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:mode: ", p), err)
		}
		if err := oprot.WriteI32(int32(*p.Mode)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.mode (3) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mode: ", p), err)
		}
	}
	return err
}

func (p *HostAttributes) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetSlaveId() {
		if err := oprot.WriteFieldBegin("slaveId", thrift.STRING, 4); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:slaveId: ", p), err)
		}
		if err := oprot.WriteString(string(*p.SlaveId)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.slaveId (4) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 4:slaveId: ", p), err)
		}
	}
	return err
}

func (p *HostAttributes) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("HostAttributes(%+v)", *p)
}

// A constraint that specifies an explicit set of values, at least one of which must be present
// on a host for a task to be scheduled there.
//
// Attributes:
//  - Negated: If true, treat this as a 'not' - to avoid specific values.
//  - Values
type ValueConstraint struct {
	Negated bool            `thrift:"negated,1" json:"negated"`
	Values  map[string]bool `thrift:"values,2" json:"values"`
}

func NewValueConstraint() *ValueConstraint {
	return &ValueConstraint{}
}

func (p *ValueConstraint) GetNegated() bool {
	return p.Negated
}

func (p *ValueConstraint) GetValues() map[string]bool {
	return p.Values
}
func (p *ValueConstraint) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ValueConstraint) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Negated = v
	}
	return nil
}

func (p *ValueConstraint) readField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[string]bool, size)
	p.Values = tSet
	for i := 0; i < size; i++ {
		var _elem2 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem2 = v
		}
		p.Values[_elem2] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *ValueConstraint) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ValueConstraint"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ValueConstraint) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("negated", thrift.BOOL, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:negated: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.Negated)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.negated (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:negated: ", p), err)
	}
	return err
}

func (p *ValueConstraint) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("values", thrift.SET, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:values: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRING, len(p.Values)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Values {
		if err := oprot.WriteString(string(v)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:values: ", p), err)
	}
	return err
}

func (p *ValueConstraint) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ValueConstraint(%+v)", *p)
}

// A constraint the specifies the maximum number of active tasks on a host with a matching
// attribute that may be scheduled simultaneously.
//
// Attributes:
//  - Limit
type LimitConstraint struct {
	Limit int32 `thrift:"limit,1" json:"limit"`
}

func NewLimitConstraint() *LimitConstraint {
	return &LimitConstraint{}
}

func (p *LimitConstraint) GetLimit() int32 {
	return p.Limit
}
func (p *LimitConstraint) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *LimitConstraint) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Limit = v
	}
	return nil
}

func (p *LimitConstraint) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("LimitConstraint"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *LimitConstraint) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("limit", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:limit: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Limit)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.limit (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:limit: ", p), err)
	}
	return err
}

func (p *LimitConstraint) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("LimitConstraint(%+v)", *p)
}

// Types of constraints that may be applied to a task.
//
// Attributes:
//  - Value
//  - Limit
type TaskConstraint struct {
	Value *ValueConstraint `thrift:"value,1" json:"value,omitempty"`
	Limit *LimitConstraint `thrift:"limit,2" json:"limit,omitempty"`
}

func NewTaskConstraint() *TaskConstraint {
	return &TaskConstraint{}
}

var TaskConstraint_Value_DEFAULT *ValueConstraint

func (p *TaskConstraint) GetValue() *ValueConstraint {
	if !p.IsSetValue() {
		return TaskConstraint_Value_DEFAULT
	}
	return p.Value
}

var TaskConstraint_Limit_DEFAULT *LimitConstraint

func (p *TaskConstraint) GetLimit() *LimitConstraint {
	if !p.IsSetLimit() {
		return TaskConstraint_Limit_DEFAULT
	}
	return p.Limit
}
func (p *TaskConstraint) CountSetFieldsTaskConstraint() int {
	count := 0
	if p.IsSetValue() {
		count++
	}
	if p.IsSetLimit() {
		count++
	}
	return count

}

func (p *TaskConstraint) IsSetValue() bool {
	return p.Value != nil
}

func (p *TaskConstraint) IsSetLimit() bool {
	return p.Limit != nil
}

func (p *TaskConstraint) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *TaskConstraint) readField1(iprot thrift.TProtocol) error {
	p.Value = &ValueConstraint{}
	if err := p.Value.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err)
	}
	return nil
}

func (p *TaskConstraint) readField2(iprot thrift.TProtocol) error {
	p.Limit = &LimitConstraint{}
	if err := p.Limit.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Limit), err)
	}
	return nil
}

func (p *TaskConstraint) Write(oprot thrift.TProtocol) error {
	if c := p.CountSetFieldsTaskConstraint(); c != 1 {
		return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c)
	}
	if err := oprot.WriteStructBegin("TaskConstraint"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *TaskConstraint) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetValue() {
		if err := oprot.WriteFieldBegin("value", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err)
		}
		if err := p.Value.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err)
		}
	}
	return err
}

func (p *TaskConstraint) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetLimit() {
		if err := oprot.WriteFieldBegin("limit", thrift.STRUCT, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:limit: ", p), err)
		}
		if err := p.Limit.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Limit), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:limit: ", p), err)
		}
	}
	return err
}

func (p *TaskConstraint) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TaskConstraint(%+v)", *p)
}

// A constraint that defines whether a task may be scheduled on a host.
//
// Attributes:
//  - Name: Mesos slave attribute that the constraint is matched against.
//  - Constraint
type Constraint struct {
	Name       string          `thrift:"name,1" json:"name"`
	Constraint *TaskConstraint `thrift:"constraint,2" json:"constraint"`
}

func NewConstraint() *Constraint {
	return &Constraint{}
}

func (p *Constraint) GetName() string {
	return p.Name
}

var Constraint_Constraint_DEFAULT *TaskConstraint

func (p *Constraint) GetConstraint() *TaskConstraint {
	if !p.IsSetConstraint() {
		return Constraint_Constraint_DEFAULT
	}
	return p.Constraint
}
func (p *Constraint) IsSetConstraint() bool {
	return p.Constraint != nil
}

func (p *Constraint) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Constraint) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Name = v
	}
	return nil
}

func (p *Constraint) readField2(iprot thrift.TProtocol) error {
	p.Constraint = &TaskConstraint{}
	if err := p.Constraint.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Constraint), err)
	}
	return nil
}

func (p *Constraint) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Constraint"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Constraint) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err)
	}
	if err := oprot.WriteString(string(p.Name)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err)
	}
	return err
}

func (p *Constraint) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("constraint", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:constraint: ", p), err)
	}
	if err := p.Constraint.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Constraint), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:constraint: ", p), err)
	}
	return err
}

func (p *Constraint) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Constraint(%+v)", *p)
}

// Attributes:
//  - Role
//  - Name
//  - Version
type Package struct {
	Role    string `thrift:"role,1" json:"role"`
	Name    string `thrift:"name,2" json:"name"`
	Version int32  `thrift:"version,3" json:"version"`
}

func NewPackage() *Package {
	return &Package{}
}

func (p *Package) GetRole() string {
	return p.Role
}

func (p *Package) GetName() string {
	return p.Name
}

func (p *Package) GetVersion() int32 {
	return p.Version
}
func (p *Package) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Package) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Role = v
	}
	return nil
}

func (p *Package) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Name = v
	}
	return nil
}

func (p *Package) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.Version = v
	}
	return nil
}

func (p *Package) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Package"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Package) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("role", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role: ", p), err)
	}
	if err := oprot.WriteString(string(p.Role)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.role (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role: ", p), err)
	}
	return err
}

func (p *Package) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err)
	}
	if err := oprot.WriteString(string(p.Name)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err)
	}
	return err
}

func (p *Package) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("version", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Version)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err)
	}
	return err
}

func (p *Package) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Package(%+v)", *p)
}

// Arbitrary key-value metadata to be included into TaskConfig.
//
// Attributes:
//  - Key
//  - Value
type Metadata struct {
	Key   string `thrift:"key,1" json:"key"`
	Value string `thrift:"value,2" json:"value"`
}

func NewMetadata() *Metadata {
	return &Metadata{}
}

func (p *Metadata) GetKey() string {
	return p.Key
}

func (p *Metadata) GetValue() string {
	return p.Value
}
func (p *Metadata) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Metadata) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Key = v
	}
	return nil
}

func (p *Metadata) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Value = v
	}
	return nil
}

func (p *Metadata) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Metadata"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Metadata) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err)
	}
	if err := oprot.WriteString(string(p.Key)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err)
	}
	return err
}

func (p *Metadata) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err)
	}
	if err := oprot.WriteString(string(p.Value)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err)
	}
	return err
}

func (p *Metadata) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Metadata(%+v)", *p)
}

// A unique identifier for a Job.
//
// Attributes:
//  - Role: User role (Unix service account), for example "mesos"
//  - Environment: Environment, for example "devel"
//  - Name: Name, for example "labrat"
type JobKey struct {
	Role        string `thrift:"role,1" json:"role"`
	Environment string `thrift:"environment,2" json:"environment"`
	Name        string `thrift:"name,3" json:"name"`
}

func NewJobKey() *JobKey {
	return &JobKey{}
}

func (p *JobKey) GetRole() string {
	return p.Role
}

func (p *JobKey) GetEnvironment() string {
	return p.Environment
}

func (p *JobKey) GetName() string {
	return p.Name
}
func (p *JobKey) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobKey) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Role = v
	}
	return nil
}

func (p *JobKey) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Environment = v
	}
	return nil
}

func (p *JobKey) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.Name = v
	}
	return nil
}

func (p *JobKey) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobKey"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobKey) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("role", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role: ", p), err)
	}
	if err := oprot.WriteString(string(p.Role)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.role (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role: ", p), err)
	}
	return err
}

func (p *JobKey) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("environment", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:environment: ", p), err)
	}
	if err := oprot.WriteString(string(p.Environment)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.environment (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:environment: ", p), err)
	}
	return err
}

func (p *JobKey) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("name", thrift.STRING, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err)
	}
	if err := oprot.WriteString(string(p.Name)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err)
	}
	return err
}

func (p *JobKey) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobKey(%+v)", *p)
}

// A unique lock key.
//
// Attributes:
//  - Job
type LockKey struct {
	Job *JobKey `thrift:"job,1" json:"job,omitempty"`
}

func NewLockKey() *LockKey {
	return &LockKey{}
}

var LockKey_Job_DEFAULT *JobKey

func (p *LockKey) GetJob() *JobKey {
	if !p.IsSetJob() {
		return LockKey_Job_DEFAULT
	}
	return p.Job
}
func (p *LockKey) CountSetFieldsLockKey() int {
	count := 0
	if p.IsSetJob() {
		count++
	}
	return count

}

func (p *LockKey) IsSetJob() bool {
	return p.Job != nil
}

func (p *LockKey) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *LockKey) readField1(iprot thrift.TProtocol) error {
	p.Job = &JobKey{}
	if err := p.Job.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Job), err)
	}
	return nil
}

func (p *LockKey) Write(oprot thrift.TProtocol) error {
	if c := p.CountSetFieldsLockKey(); c != 1 {
		return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c)
	}
	if err := oprot.WriteStructBegin("LockKey"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *LockKey) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetJob() {
		if err := oprot.WriteFieldBegin("job", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:job: ", p), err)
		}
		if err := p.Job.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Job), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job: ", p), err)
		}
	}
	return err
}

func (p *LockKey) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("LockKey(%+v)", *p)
}

// A generic lock struct to facilitate context specific resource/operation serialization.
//
// Attributes:
//  - Key: ID of the lock - unique per storage
//  - Token: UUID - facilitating soft lock authorization
//  - User: Lock creator
//  - TimestampMs: Lock creation timestamp in milliseconds
//  - Message: Optional message to record with the lock
type Lock struct {
	Key         *LockKey `thrift:"key,1" json:"key"`
	Token       string   `thrift:"token,2" json:"token"`
	User        string   `thrift:"user,3" json:"user"`
	TimestampMs int64    `thrift:"timestampMs,4" json:"timestampMs"`
	Message     *string  `thrift:"message,5" json:"message,omitempty"`
}

func NewLock() *Lock {
	return &Lock{}
}

var Lock_Key_DEFAULT *LockKey

func (p *Lock) GetKey() *LockKey {
	if !p.IsSetKey() {
		return Lock_Key_DEFAULT
	}
	return p.Key
}

func (p *Lock) GetToken() string {
	return p.Token
}

func (p *Lock) GetUser() string {
	return p.User
}

func (p *Lock) GetTimestampMs() int64 {
	return p.TimestampMs
}

var Lock_Message_DEFAULT string

func (p *Lock) GetMessage() string {
	if !p.IsSetMessage() {
		return Lock_Message_DEFAULT
	}
	return *p.Message
}
func (p *Lock) IsSetKey() bool {
	return p.Key != nil
}

func (p *Lock) IsSetMessage() bool {
	return p.Message != nil
}

func (p *Lock) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.readField5(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Lock) readField1(iprot thrift.TProtocol) error {
	p.Key = &LockKey{}
	if err := p.Key.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err)
	}
	return nil
}

func (p *Lock) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Token = v
	}
	return nil
}

func (p *Lock) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.User = v
	}
	return nil
}

func (p *Lock) readField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.TimestampMs = v
	}
	return nil
}

func (p *Lock) readField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.Message = &v
	}
	return nil
}

func (p *Lock) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Lock"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Lock) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err)
	}
	if err := p.Key.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err)
	}
	return err
}

func (p *Lock) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("token", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:token: ", p), err)
	}
	if err := oprot.WriteString(string(p.Token)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.token (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:token: ", p), err)
	}
	return err
}

func (p *Lock) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("user", thrift.STRING, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:user: ", p), err)
	}
	if err := oprot.WriteString(string(p.User)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.user (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:user: ", p), err)
	}
	return err
}

func (p *Lock) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("timestampMs", thrift.I64, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:timestampMs: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.TimestampMs)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.timestampMs (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:timestampMs: ", p), err)
	}
	return err
}

func (p *Lock) writeField5(oprot thrift.TProtocol) (err error) {
	if p.IsSetMessage() {
		if err := oprot.WriteFieldBegin("message", thrift.STRING, 5); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:message: ", p), err)
		}
		if err := oprot.WriteString(string(*p.Message)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.message (5) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 5:message: ", p), err)
		}
	}
	return err
}

func (p *Lock) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Lock(%+v)", *p)
}

// A unique identifier for the active task within a job.
//
// Attributes:
//  - JobKey: Key identifying the job.
//  - InstanceId: Unique instance ID for the active task in a job.
type InstanceKey struct {
	JobKey     *JobKey `thrift:"jobKey,1" json:"jobKey"`
	InstanceId int32   `thrift:"instanceId,2" json:"instanceId"`
}

func NewInstanceKey() *InstanceKey {
	return &InstanceKey{}
}

var InstanceKey_JobKey_DEFAULT *JobKey

func (p *InstanceKey) GetJobKey() *JobKey {
	if !p.IsSetJobKey() {
		return InstanceKey_JobKey_DEFAULT
	}
	return p.JobKey
}

func (p *InstanceKey) GetInstanceId() int32 {
	return p.InstanceId
}
func (p *InstanceKey) IsSetJobKey() bool {
	return p.JobKey != nil
}

func (p *InstanceKey) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *InstanceKey) readField1(iprot thrift.TProtocol) error {
	p.JobKey = &JobKey{}
	if err := p.JobKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JobKey), err)
	}
	return nil
}

func (p *InstanceKey) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.InstanceId = v
	}
	return nil
}

func (p *InstanceKey) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("InstanceKey"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *InstanceKey) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("jobKey", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:jobKey: ", p), err)
	}
	if err := p.JobKey.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JobKey), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:jobKey: ", p), err)
	}
	return err
}

func (p *InstanceKey) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("instanceId", thrift.I32, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:instanceId: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.InstanceId)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.instanceId (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:instanceId: ", p), err)
	}
	return err
}

func (p *InstanceKey) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("InstanceKey(%+v)", *p)
}

// URI which mirrors CommandInfo.URI in the Mesos Protobuf
//
// Attributes:
//  - Value: Where to get the resource from
//  - Extract: Extract compressed archive after downloading
//  - Cache: Cache value using Mesos Fetcher caching mechanism *
type MesosFetcherURI struct {
	Value   string `thrift:"value,1" json:"value"`
	Extract *bool  `thrift:"extract,2" json:"extract,omitempty"`
	Cache   *bool  `thrift:"cache,3" json:"cache,omitempty"`
}

func NewMesosFetcherURI() *MesosFetcherURI {
	return &MesosFetcherURI{}
}

func (p *MesosFetcherURI) GetValue() string {
	return p.Value
}

var MesosFetcherURI_Extract_DEFAULT bool

func (p *MesosFetcherURI) GetExtract() bool {
	if !p.IsSetExtract() {
		return MesosFetcherURI_Extract_DEFAULT
	}
	return *p.Extract
}

var MesosFetcherURI_Cache_DEFAULT bool

func (p *MesosFetcherURI) GetCache() bool {
	if !p.IsSetCache() {
		return MesosFetcherURI_Cache_DEFAULT
	}
	return *p.Cache
}
func (p *MesosFetcherURI) IsSetExtract() bool {
	return p.Extract != nil
}

func (p *MesosFetcherURI) IsSetCache() bool {
	return p.Cache != nil
}

func (p *MesosFetcherURI) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *MesosFetcherURI) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Value = v
	}
	return nil
}

func (p *MesosFetcherURI) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Extract = &v
	}
	return nil
}

func (p *MesosFetcherURI) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.Cache = &v
	}
	return nil
}

func (p *MesosFetcherURI) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("MesosFetcherURI"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *MesosFetcherURI) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("value", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err)
	}
	if err := oprot.WriteString(string(p.Value)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err)
	}
	return err
}

func (p *MesosFetcherURI) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetExtract() {
		if err := oprot.WriteFieldBegin("extract", thrift.BOOL, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:extract: ", p), err)
		}
		if err := oprot.WriteBool(bool(*p.Extract)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.extract (2) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:extract: ", p), err)
		}
	}
	return err
}

func (p *MesosFetcherURI) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetCache() {
		if err := oprot.WriteFieldBegin("cache", thrift.BOOL, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cache: ", p), err)
		}
		if err := oprot.WriteBool(bool(*p.Cache)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.cache (3) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cache: ", p), err)
		}
	}
	return err
}

func (p *MesosFetcherURI) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MesosFetcherURI(%+v)", *p)
}

// Attributes:
//  - Name: Name identifying the Executor.
//  - Data: Executor configuration data.
type ExecutorConfig struct {
	Name string `thrift:"name,1" json:"name"`
	Data string `thrift:"data,2" json:"data"`
}

func NewExecutorConfig() *ExecutorConfig {
	return &ExecutorConfig{}
}

func (p *ExecutorConfig) GetName() string {
	return p.Name
}

func (p *ExecutorConfig) GetData() string {
	return p.Data
}
func (p *ExecutorConfig) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ExecutorConfig) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Name = v
	}
	return nil
}

func (p *ExecutorConfig) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Data = v
	}
	return nil
}

func (p *ExecutorConfig) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ExecutorConfig"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ExecutorConfig) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err)
	}
	if err := oprot.WriteString(string(p.Name)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err)
	}
	return err
}

func (p *ExecutorConfig) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("data", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:data: ", p), err)
	}
	if err := oprot.WriteString(string(p.Data)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.data (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:data: ", p), err)
	}
	return err
}

func (p *ExecutorConfig) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ExecutorConfig(%+v)", *p)
}

// A volume mount point within a container
//
// Attributes:
//  - ContainerPath: The path inside the container where the mount will be created.
//  - HostPath: The path on the host that will serve as the source for the mount.
//  - Mode: The access mode
type Volume struct {
	ContainerPath string `thrift:"containerPath,1" json:"containerPath"`
	HostPath      string `thrift:"hostPath,2" json:"hostPath"`
	Mode          Mode   `thrift:"mode,3" json:"mode"`
}

func NewVolume() *Volume {
	return &Volume{}
}

func (p *Volume) GetContainerPath() string {
	return p.ContainerPath
}

func (p *Volume) GetHostPath() string {
	return p.HostPath
}

func (p *Volume) GetMode() Mode {
	return p.Mode
}
func (p *Volume) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Volume) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.ContainerPath = v
	}
	return nil
}

func (p *Volume) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.HostPath = v
	}
	return nil
}

func (p *Volume) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		temp := Mode(v)
		p.Mode = temp
	}
	return nil
}

func (p *Volume) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Volume"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Volume) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("containerPath", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:containerPath: ", p), err)
	}
	if err := oprot.WriteString(string(p.ContainerPath)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.containerPath (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:containerPath: ", p), err)
	}
	return err
}

func (p *Volume) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("hostPath", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hostPath: ", p), err)
	}
	if err := oprot.WriteString(string(p.HostPath)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.hostPath (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hostPath: ", p), err)
	}
	return err
}

func (p *Volume) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("mode", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:mode: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Mode)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.mode (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mode: ", p), err)
	}
	return err
}

func (p *Volume) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Volume(%+v)", *p)
}

// Describes an image for use with the Mesos unified containerizer in the Docker format
//
// Attributes:
//  - Name: The name of the image to run
//  - Tag: The Docker tag identifying the image
type DockerImage struct {
	Name string `thrift:"name,1" json:"name"`
	Tag  string `thrift:"tag,2" json:"tag"`
}

func NewDockerImage() *DockerImage {
	return &DockerImage{}
}

func (p *DockerImage) GetName() string {
	return p.Name
}

func (p *DockerImage) GetTag() string {
	return p.Tag
}
func (p *DockerImage) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *DockerImage) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Name = v
	}
	return nil
}

func (p *DockerImage) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Tag = v
	}
	return nil
}

func (p *DockerImage) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("DockerImage"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *DockerImage) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err)
	}
	if err := oprot.WriteString(string(p.Name)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err)
	}
	return err
}

func (p *DockerImage) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("tag", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tag: ", p), err)
	}
	if err := oprot.WriteString(string(p.Tag)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.tag (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag: ", p), err)
	}
	return err
}

func (p *DockerImage) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("DockerImage(%+v)", *p)
}

// Describes an image for use with the Mesos unified containerizer in the AppC format
//
// Attributes:
//  - Name: The name of the image to run
//  - ImageId: The appc image id identifying the image
type AppcImage struct {
	Name    string `thrift:"name,1" json:"name"`
	ImageId string `thrift:"imageId,2" json:"imageId"`
}

func NewAppcImage() *AppcImage {
	return &AppcImage{}
}

func (p *AppcImage) GetName() string {
	return p.Name
}

func (p *AppcImage) GetImageId() string {
	return p.ImageId
}
func (p *AppcImage) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *AppcImage) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Name = v
	}
	return nil
}

func (p *AppcImage) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.ImageId = v
	}
	return nil
}

func (p *AppcImage) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("AppcImage"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *AppcImage) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err)
	}
	if err := oprot.WriteString(string(p.Name)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err)
	}
	return err
}

func (p *AppcImage) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("imageId", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:imageId: ", p), err)
	}
	if err := oprot.WriteString(string(p.ImageId)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.imageId (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:imageId: ", p), err)
	}
	return err
}

func (p *AppcImage) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("AppcImage(%+v)", *p)
}

// Describes an image to be used with the Mesos unified containerizer
//
// Attributes:
//  - Docker
//  - Appc
type Image struct {
	Docker *DockerImage `thrift:"docker,1" json:"docker,omitempty"`
	Appc   *AppcImage   `thrift:"appc,2" json:"appc,omitempty"`
}

func NewImage() *Image {
	return &Image{}
}

var Image_Docker_DEFAULT *DockerImage

func (p *Image) GetDocker() *DockerImage {
	if !p.IsSetDocker() {
		return Image_Docker_DEFAULT
	}
	return p.Docker
}

var Image_Appc_DEFAULT *AppcImage

func (p *Image) GetAppc() *AppcImage {
	if !p.IsSetAppc() {
		return Image_Appc_DEFAULT
	}
	return p.Appc
}
func (p *Image) CountSetFieldsImage() int {
	count := 0
	if p.IsSetDocker() {
		count++
	}
	if p.IsSetAppc() {
		count++
	}
	return count

}

func (p *Image) IsSetDocker() bool {
	return p.Docker != nil
}

func (p *Image) IsSetAppc() bool {
	return p.Appc != nil
}

func (p *Image) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Image) readField1(iprot thrift.TProtocol) error {
	p.Docker = &DockerImage{}
	if err := p.Docker.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Docker), err)
	}
	return nil
}

func (p *Image) readField2(iprot thrift.TProtocol) error {
	p.Appc = &AppcImage{}
	if err := p.Appc.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Appc), err)
	}
	return nil
}

func (p *Image) Write(oprot thrift.TProtocol) error {
	if c := p.CountSetFieldsImage(); c != 1 {
		return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c)
	}
	if err := oprot.WriteStructBegin("Image"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Image) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetDocker() {
		if err := oprot.WriteFieldBegin("docker", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:docker: ", p), err)
		}
		if err := p.Docker.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Docker), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:docker: ", p), err)
		}
	}
	return err
}

func (p *Image) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetAppc() {
		if err := oprot.WriteFieldBegin("appc", thrift.STRUCT, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:appc: ", p), err)
		}
		if err := p.Appc.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Appc), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:appc: ", p), err)
		}
	}
	return err
}

func (p *Image) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Image(%+v)", *p)
}

// Describes a mesos container, this is the default
//
// Attributes:
//  - Image: the optional filesystem image to use when launching this task.
//  - Volumes: the optional list of volumes to mount into the task.
type MesosContainer struct {
	Image   *Image    `thrift:"image,1" json:"image,omitempty"`
	Volumes []*Volume `thrift:"volumes,2" json:"volumes,omitempty"`
}

func NewMesosContainer() *MesosContainer {
	return &MesosContainer{}
}

var MesosContainer_Image_DEFAULT *Image

func (p *MesosContainer) GetImage() *Image {
	if !p.IsSetImage() {
		return MesosContainer_Image_DEFAULT
	}
	return p.Image
}

var MesosContainer_Volumes_DEFAULT []*Volume

func (p *MesosContainer) GetVolumes() []*Volume {
	return p.Volumes
}
func (p *MesosContainer) IsSetImage() bool {
	return p.Image != nil
}

func (p *MesosContainer) IsSetVolumes() bool {
	return p.Volumes != nil
}

func (p *MesosContainer) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *MesosContainer) readField1(iprot thrift.TProtocol) error {
	p.Image = &Image{}
	if err := p.Image.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Image), err)
	}
	return nil
}

func (p *MesosContainer) readField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*Volume, 0, size)
	p.Volumes = tSlice
	for i := 0; i < size; i++ {
		_elem3 := &Volume{}
		if err := _elem3.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err)
		}
		p.Volumes = append(p.Volumes, _elem3)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *MesosContainer) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("MesosContainer"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *MesosContainer) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetImage() {
		if err := oprot.WriteFieldBegin("image", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:image: ", p), err)
		}
		if err := p.Image.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Image), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:image: ", p), err)
		}
	}
	return err
}

func (p *MesosContainer) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetVolumes() {
		if err := oprot.WriteFieldBegin("volumes", thrift.LIST, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:volumes: ", p), err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Volumes)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Volumes {
			if err := v.Write(oprot); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
			}
		}
		if err := oprot.WriteListEnd(); err != nil {
			return thrift.PrependError("error writing list end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:volumes: ", p), err)
		}
	}
	return err
}

func (p *MesosContainer) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MesosContainer(%+v)", *p)
}

// Describes a parameter passed to docker cli
//
// Attributes:
//  - Name: a parameter to pass to docker. (e.g. volume)
//  - Value: the value to pass to a parameter (e.g. /src/webapp:/opt/webapp)
type DockerParameter struct {
	Name  string `thrift:"name,1" json:"name"`
	Value string `thrift:"value,2" json:"value"`
}

func NewDockerParameter() *DockerParameter {
	return &DockerParameter{}
}

func (p *DockerParameter) GetName() string {
	return p.Name
}

func (p *DockerParameter) GetValue() string {
	return p.Value
}
func (p *DockerParameter) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *DockerParameter) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Name = v
	}
	return nil
}

func (p *DockerParameter) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Value = v
	}
	return nil
}

func (p *DockerParameter) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("DockerParameter"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *DockerParameter) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err)
	}
	if err := oprot.WriteString(string(p.Name)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err)
	}
	return err
}

func (p *DockerParameter) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err)
	}
	if err := oprot.WriteString(string(p.Value)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err)
	}
	return err
}

func (p *DockerParameter) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("DockerParameter(%+v)", *p)
}

// Describes a docker container
//
// Attributes:
//  - Image: The container image to be run
//  - Parameters: The arbitrary parameters to pass to container
type DockerContainer struct {
	Image      string             `thrift:"image,1" json:"image"`
	Parameters []*DockerParameter `thrift:"parameters,2" json:"parameters,omitempty"`
}

func NewDockerContainer() *DockerContainer {
	return &DockerContainer{}
}

func (p *DockerContainer) GetImage() string {
	return p.Image
}

var DockerContainer_Parameters_DEFAULT []*DockerParameter

func (p *DockerContainer) GetParameters() []*DockerParameter {
	return p.Parameters
}
func (p *DockerContainer) IsSetParameters() bool {
	return p.Parameters != nil
}

func (p *DockerContainer) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *DockerContainer) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Image = v
	}
	return nil
}

func (p *DockerContainer) readField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*DockerParameter, 0, size)
	p.Parameters = tSlice
	for i := 0; i < size; i++ {
		_elem4 := &DockerParameter{}
		if err := _elem4.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err)
		}
		p.Parameters = append(p.Parameters, _elem4)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *DockerContainer) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("DockerContainer"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *DockerContainer) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("image", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:image: ", p), err)
	}
	if err := oprot.WriteString(string(p.Image)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.image (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:image: ", p), err)
	}
	return err
}

func (p *DockerContainer) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetParameters() {
		if err := oprot.WriteFieldBegin("parameters", thrift.LIST, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parameters: ", p), err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Parameters)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Parameters {
			if err := v.Write(oprot); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
			}
		}
		if err := oprot.WriteListEnd(); err != nil {
			return thrift.PrependError("error writing list end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parameters: ", p), err)
		}
	}
	return err
}

func (p *DockerContainer) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("DockerContainer(%+v)", *p)
}

// Describes a container to be used in a task
//
// Attributes:
//  - Mesos
//  - Docker
type Container struct {
	Mesos  *MesosContainer  `thrift:"mesos,1" json:"mesos,omitempty"`
	Docker *DockerContainer `thrift:"docker,2" json:"docker,omitempty"`
}

func NewContainer() *Container {
	return &Container{}
}

var Container_Mesos_DEFAULT *MesosContainer

func (p *Container) GetMesos() *MesosContainer {
	if !p.IsSetMesos() {
		return Container_Mesos_DEFAULT
	}
	return p.Mesos
}

var Container_Docker_DEFAULT *DockerContainer

func (p *Container) GetDocker() *DockerContainer {
	if !p.IsSetDocker() {
		return Container_Docker_DEFAULT
	}
	return p.Docker
}
func (p *Container) CountSetFieldsContainer() int {
	count := 0
	if p.IsSetMesos() {
		count++
	}
	if p.IsSetDocker() {
		count++
	}
	return count

}

func (p *Container) IsSetMesos() bool {
	return p.Mesos != nil
}

func (p *Container) IsSetDocker() bool {
	return p.Docker != nil
}

func (p *Container) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Container) readField1(iprot thrift.TProtocol) error {
	p.Mesos = &MesosContainer{}
	if err := p.Mesos.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Mesos), err)
	}
	return nil
}

func (p *Container) readField2(iprot thrift.TProtocol) error {
	p.Docker = &DockerContainer{}
	if err := p.Docker.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Docker), err)
	}
	return nil
}

func (p *Container) Write(oprot thrift.TProtocol) error {
	if c := p.CountSetFieldsContainer(); c != 1 {
		return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c)
	}
	if err := oprot.WriteStructBegin("Container"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Container) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetMesos() {
		if err := oprot.WriteFieldBegin("mesos", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:mesos: ", p), err)
		}
		if err := p.Mesos.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Mesos), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:mesos: ", p), err)
		}
	}
	return err
}

func (p *Container) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetDocker() {
		if err := oprot.WriteFieldBegin("docker", thrift.STRUCT, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:docker: ", p), err)
		}
		if err := p.Docker.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Docker), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:docker: ", p), err)
		}
	}
	return err
}

func (p *Container) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Container(%+v)", *p)
}

// Describes resource value required to run a task.
//
// Attributes:
//  - NumCpus
//  - RamMb
//  - DiskMb
//  - NamedPort
//  - NumGpus
type Resource struct {
	NumCpus   *float64 `thrift:"numCpus,1" json:"numCpus,omitempty"`
	RamMb     *int64   `thrift:"ramMb,2" json:"ramMb,omitempty"`
	DiskMb    *int64   `thrift:"diskMb,3" json:"diskMb,omitempty"`
	NamedPort *string  `thrift:"namedPort,4" json:"namedPort,omitempty"`
	NumGpus   *int64   `thrift:"numGpus,5" json:"numGpus,omitempty"`
}

func NewResource() *Resource {
	return &Resource{}
}

var Resource_NumCpus_DEFAULT float64

func (p *Resource) GetNumCpus() float64 {
	if !p.IsSetNumCpus() {
		return Resource_NumCpus_DEFAULT
	}
	return *p.NumCpus
}

var Resource_RamMb_DEFAULT int64

func (p *Resource) GetRamMb() int64 {
	if !p.IsSetRamMb() {
		return Resource_RamMb_DEFAULT
	}
	return *p.RamMb
}

var Resource_DiskMb_DEFAULT int64

func (p *Resource) GetDiskMb() int64 {
	if !p.IsSetDiskMb() {
		return Resource_DiskMb_DEFAULT
	}
	return *p.DiskMb
}

var Resource_NamedPort_DEFAULT string

func (p *Resource) GetNamedPort() string {
	if !p.IsSetNamedPort() {
		return Resource_NamedPort_DEFAULT
	}
	return *p.NamedPort
}

var Resource_NumGpus_DEFAULT int64

func (p *Resource) GetNumGpus() int64 {
	if !p.IsSetNumGpus() {
		return Resource_NumGpus_DEFAULT
	}
	return *p.NumGpus
}
func (p *Resource) CountSetFieldsResource() int {
	count := 0
	if p.IsSetNumCpus() {
		count++
	}
	if p.IsSetRamMb() {
		count++
	}
	if p.IsSetDiskMb() {
		count++
	}
	if p.IsSetNamedPort() {
		count++
	}
	if p.IsSetNumGpus() {
		count++
	}
	return count

}

func (p *Resource) IsSetNumCpus() bool {
	return p.NumCpus != nil
}

func (p *Resource) IsSetRamMb() bool {
	return p.RamMb != nil
}

func (p *Resource) IsSetDiskMb() bool {
	return p.DiskMb != nil
}

func (p *Resource) IsSetNamedPort() bool {
	return p.NamedPort != nil
}

func (p *Resource) IsSetNumGpus() bool {
	return p.NumGpus != nil
}

func (p *Resource) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.readField5(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Resource) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadDouble(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.NumCpus = &v
	}
	return nil
}

func (p *Resource) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.RamMb = &v
	}
	return nil
}

func (p *Resource) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.DiskMb = &v
	}
	return nil
}

func (p *Resource) readField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.NamedPort = &v
	}
	return nil
}

func (p *Resource) readField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.NumGpus = &v
	}
	return nil
}

func (p *Resource) Write(oprot thrift.TProtocol) error {
	if c := p.CountSetFieldsResource(); c != 1 {
		return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c)
	}
	if err := oprot.WriteStructBegin("Resource"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Resource) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetNumCpus() {
		if err := oprot.WriteFieldBegin("numCpus", thrift.DOUBLE, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:numCpus: ", p), err)
		}
		if err := oprot.WriteDouble(float64(*p.NumCpus)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.numCpus (1) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:numCpus: ", p), err)
		}
	}
	return err
}

func (p *Resource) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetRamMb() {
		if err := oprot.WriteFieldBegin("ramMb", thrift.I64, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:ramMb: ", p), err)
		}
		if err := oprot.WriteI64(int64(*p.RamMb)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.ramMb (2) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:ramMb: ", p), err)
		}
	}
	return err
}

func (p *Resource) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetDiskMb() {
		if err := oprot.WriteFieldBegin("diskMb", thrift.I64, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:diskMb: ", p), err)
		}
		if err := oprot.WriteI64(int64(*p.DiskMb)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.diskMb (3) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:diskMb: ", p), err)
		}
	}
	return err
}

func (p *Resource) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetNamedPort() {
		if err := oprot.WriteFieldBegin("namedPort", thrift.STRING, 4); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:namedPort: ", p), err)
		}
		if err := oprot.WriteString(string(*p.NamedPort)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.namedPort (4) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 4:namedPort: ", p), err)
		}
	}
	return err
}

func (p *Resource) writeField5(oprot thrift.TProtocol) (err error) {
	if p.IsSetNumGpus() {
		if err := oprot.WriteFieldBegin("numGpus", thrift.I64, 5); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:numGpus: ", p), err)
		}
		if err := oprot.WriteI64(int64(*p.NumGpus)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.numGpus (5) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 5:numGpus: ", p), err)
		}
	}
	return err
}

func (p *Resource) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Resource(%+v)", *p)
}

// Description of the tasks contained within a job.
//
// Attributes:
//  - Job: Job task belongs to.
//  - Owner: contains the role component of JobKey
//  - IsService
//  - NumCpus
//  - RamMb
//  - DiskMb
//  - Priority
//  - MaxTaskFailures
//  - Production: Whether this is a production task, which can preempt.
//  - Tier: Task tier type.
//  - Resources: All resources required to run a task.
//  - Constraints
//  - RequestedPorts: a list of named ports this task requests
//  - MesosFetcherUris: Resources to retrieve with Mesos Fetcher
//  - TaskLinks: Custom links to include when displaying this task on the scheduler dashboard. Keys are anchor
// text, values are URLs. Wildcards are supported for dynamic link crafting based on host, ports,
// instance, etc.
//  - ContactEmail
//  - ExecutorConfig: Executor configuration
//  - Metadata: Used to display additional details in the UI.
//  - Container: the container the task should use to execute
type TaskConfig struct {
	// unused fields # 1 to 6
	IsService bool    `thrift:"isService,7" json:"isService"`
	NumCpus   float64 `thrift:"numCpus,8" json:"numCpus"`
	RamMb     int64   `thrift:"ramMb,9" json:"ramMb"`
	DiskMb    int64   `thrift:"diskMb,10" json:"diskMb"`
	Priority  int32   `thrift:"priority,11" json:"priority"`
	// unused field # 12
	MaxTaskFailures int32 `thrift:"maxTaskFailures,13" json:"maxTaskFailures"`
	// unused fields # 14 to 16
	Owner      *Identity `thrift:"owner,17" json:"owner"`
	Production *bool     `thrift:"production,18" json:"production,omitempty"`
	// unused field # 19
	Constraints    map[*Constraint]bool `thrift:"constraints,20" json:"constraints"`
	RequestedPorts map[string]bool      `thrift:"requestedPorts,21" json:"requestedPorts"`
	TaskLinks      map[string]string    `thrift:"taskLinks,22" json:"taskLinks,omitempty"`
	ContactEmail   *string              `thrift:"contactEmail,23" json:"contactEmail,omitempty"`
	// unused field # 24
	ExecutorConfig *ExecutorConfig `thrift:"executorConfig,25" json:"executorConfig,omitempty"`
	// unused field # 26
	Metadata  map[*Metadata]bool `thrift:"metadata,27" json:"metadata,omitempty"`
	Job       *JobKey            `thrift:"job,28" json:"job"`
	Container *Container         `thrift:"container,29" json:"container"`
	Tier      *string            `thrift:"tier,30" json:"tier,omitempty"`
	// unused field # 31
	Resources        map[*Resource]bool        `thrift:"resources,32" json:"resources"`
	MesosFetcherUris map[*MesosFetcherURI]bool `thrift:"mesosFetcherUris,33" json:"mesosFetcherUris,omitempty"`
}

func NewTaskConfig() *TaskConfig {
	return &TaskConfig{}
}

var TaskConfig_Job_DEFAULT *JobKey

func (p *TaskConfig) GetJob() *JobKey {
	if !p.IsSetJob() {
		return TaskConfig_Job_DEFAULT
	}
	return p.Job
}

var TaskConfig_Owner_DEFAULT *Identity

func (p *TaskConfig) GetOwner() *Identity {
	if !p.IsSetOwner() {
		return TaskConfig_Owner_DEFAULT
	}
	return p.Owner
}

func (p *TaskConfig) GetIsService() bool {
	return p.IsService
}

func (p *TaskConfig) GetNumCpus() float64 {
	return p.NumCpus
}

func (p *TaskConfig) GetRamMb() int64 {
	return p.RamMb
}

func (p *TaskConfig) GetDiskMb() int64 {
	return p.DiskMb
}

func (p *TaskConfig) GetPriority() int32 {
	return p.Priority
}

func (p *TaskConfig) GetMaxTaskFailures() int32 {
	return p.MaxTaskFailures
}

var TaskConfig_Production_DEFAULT bool

func (p *TaskConfig) GetProduction() bool {
	if !p.IsSetProduction() {
		return TaskConfig_Production_DEFAULT
	}
	return *p.Production
}

var TaskConfig_Tier_DEFAULT string

func (p *TaskConfig) GetTier() string {
	if !p.IsSetTier() {
		return TaskConfig_Tier_DEFAULT
	}
	return *p.Tier
}

func (p *TaskConfig) GetResources() map[*Resource]bool {
	return p.Resources
}

func (p *TaskConfig) GetConstraints() map[*Constraint]bool {
	return p.Constraints
}

func (p *TaskConfig) GetRequestedPorts() map[string]bool {
	return p.RequestedPorts
}

var TaskConfig_MesosFetcherUris_DEFAULT map[*MesosFetcherURI]bool

func (p *TaskConfig) GetMesosFetcherUris() map[*MesosFetcherURI]bool {
	return p.MesosFetcherUris
}

var TaskConfig_TaskLinks_DEFAULT map[string]string

func (p *TaskConfig) GetTaskLinks() map[string]string {
	return p.TaskLinks
}

var TaskConfig_ContactEmail_DEFAULT string

func (p *TaskConfig) GetContactEmail() string {
	if !p.IsSetContactEmail() {
		return TaskConfig_ContactEmail_DEFAULT
	}
	return *p.ContactEmail
}

var TaskConfig_ExecutorConfig_DEFAULT *ExecutorConfig

func (p *TaskConfig) GetExecutorConfig() *ExecutorConfig {
	if !p.IsSetExecutorConfig() {
		return TaskConfig_ExecutorConfig_DEFAULT
	}
	return p.ExecutorConfig
}

var TaskConfig_Metadata_DEFAULT map[*Metadata]bool

func (p *TaskConfig) GetMetadata() map[*Metadata]bool {
	return p.Metadata
}

var TaskConfig_Container_DEFAULT *Container = &Container{
	Mesos: &MesosContainer{},
}

func (p *TaskConfig) GetContainer() *Container {
	if !p.IsSetContainer() {
		return TaskConfig_Container_DEFAULT
	}
	return p.Container
}
func (p *TaskConfig) IsSetJob() bool {
	return p.Job != nil
}

func (p *TaskConfig) IsSetOwner() bool {
	return p.Owner != nil
}

func (p *TaskConfig) IsSetProduction() bool {
	return p.Production != nil
}

func (p *TaskConfig) IsSetTier() bool {
	return p.Tier != nil
}

func (p *TaskConfig) IsSetMesosFetcherUris() bool {
	return p.MesosFetcherUris != nil
}

func (p *TaskConfig) IsSetTaskLinks() bool {
	return p.TaskLinks != nil
}

func (p *TaskConfig) IsSetContactEmail() bool {
	return p.ContactEmail != nil
}

func (p *TaskConfig) IsSetExecutorConfig() bool {
	return p.ExecutorConfig != nil
}

func (p *TaskConfig) IsSetMetadata() bool {
	return p.Metadata != nil
}

func (p *TaskConfig) IsSetContainer() bool {
	return p.Container != nil
}

func (p *TaskConfig) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 28:
			if err := p.readField28(iprot); err != nil {
				return err
			}
		case 17:
			if err := p.readField17(iprot); err != nil {
				return err
			}
		case 7:
			if err := p.readField7(iprot); err != nil {
				return err
			}
		case 8:
			if err := p.readField8(iprot); err != nil {
				return err
			}
		case 9:
			if err := p.readField9(iprot); err != nil {
				return err
			}
		case 10:
			if err := p.readField10(iprot); err != nil {
				return err
			}
		case 11:
			if err := p.readField11(iprot); err != nil {
				return err
			}
		case 13:
			if err := p.readField13(iprot); err != nil {
				return err
			}
		case 18:
			if err := p.readField18(iprot); err != nil {
				return err
			}
		case 30:
			if err := p.readField30(iprot); err != nil {
				return err
			}
		case 32:
			if err := p.readField32(iprot); err != nil {
				return err
			}
		case 20:
			if err := p.readField20(iprot); err != nil {
				return err
			}
		case 21:
			if err := p.readField21(iprot); err != nil {
				return err
			}
		case 33:
			if err := p.readField33(iprot); err != nil {
				return err
			}
		case 22:
			if err := p.readField22(iprot); err != nil {
				return err
			}
		case 23:
			if err := p.readField23(iprot); err != nil {
				return err
			}
		case 25:
			if err := p.readField25(iprot); err != nil {
				return err
			}
		case 27:
			if err := p.readField27(iprot); err != nil {
				return err
			}
		case 29:
			if err := p.readField29(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *TaskConfig) readField28(iprot thrift.TProtocol) error {
	p.Job = &JobKey{}
	if err := p.Job.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Job), err)
	}
	return nil
}

func (p *TaskConfig) readField17(iprot thrift.TProtocol) error {
	p.Owner = &Identity{}
	if err := p.Owner.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Owner), err)
	}
	return nil
}

func (p *TaskConfig) readField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 7: ", err)
	} else {
		p.IsService = v
	}
	return nil
}

func (p *TaskConfig) readField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadDouble(); err != nil {
		return thrift.PrependError("error reading field 8: ", err)
	} else {
		p.NumCpus = v
	}
	return nil
}

func (p *TaskConfig) readField9(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 9: ", err)
	} else {
		p.RamMb = v
	}
	return nil
}

func (p *TaskConfig) readField10(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 10: ", err)
	} else {
		p.DiskMb = v
	}
	return nil
}

func (p *TaskConfig) readField11(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 11: ", err)
	} else {
		p.Priority = v
	}
	return nil
}

func (p *TaskConfig) readField13(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 13: ", err)
	} else {
		p.MaxTaskFailures = v
	}
	return nil
}

func (p *TaskConfig) readField18(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 18: ", err)
	} else {
		p.Production = &v
	}
	return nil
}

func (p *TaskConfig) readField30(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 30: ", err)
	} else {
		p.Tier = &v
	}
	return nil
}

func (p *TaskConfig) readField32(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*Resource]bool, size)
	p.Resources = tSet
	for i := 0; i < size; i++ {
		_elem5 := &Resource{}
		if err := _elem5.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err)
		}
		p.Resources[_elem5] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *TaskConfig) readField20(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*Constraint]bool, size)
	p.Constraints = tSet
	for i := 0; i < size; i++ {
		_elem6 := &Constraint{}
		if err := _elem6.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err)
		}
		p.Constraints[_elem6] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *TaskConfig) readField21(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[string]bool, size)
	p.RequestedPorts = tSet
	for i := 0; i < size; i++ {
		var _elem7 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem7 = v
		}
		p.RequestedPorts[_elem7] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *TaskConfig) readField33(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*MesosFetcherURI]bool, size)
	p.MesosFetcherUris = tSet
	for i := 0; i < size; i++ {
		_elem8 := &MesosFetcherURI{}
		if err := _elem8.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err)
		}
		p.MesosFetcherUris[_elem8] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *TaskConfig) readField22(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return thrift.PrependError("error reading map begin: ", err)
	}
	tMap := make(map[string]string, size)
	p.TaskLinks = tMap
	for i := 0; i < size; i++ {
		var _key9 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_key9 = v
		}
		var _val10 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_val10 = v
		}
		p.TaskLinks[_key9] = _val10
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return thrift.PrependError("error reading map end: ", err)
	}
	return nil
}

func (p *TaskConfig) readField23(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 23: ", err)
	} else {
		p.ContactEmail = &v
	}
	return nil
}

func (p *TaskConfig) readField25(iprot thrift.TProtocol) error {
	p.ExecutorConfig = &ExecutorConfig{}
	if err := p.ExecutorConfig.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ExecutorConfig), err)
	}
	return nil
}

func (p *TaskConfig) readField27(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*Metadata]bool, size)
	p.Metadata = tSet
	for i := 0; i < size; i++ {
		_elem11 := &Metadata{}
		if err := _elem11.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err)
		}
		p.Metadata[_elem11] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *TaskConfig) readField29(iprot thrift.TProtocol) error {
	p.Container = &Container{}
	if err := p.Container.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Container), err)
	}
	return nil
}

func (p *TaskConfig) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("TaskConfig"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField7(oprot); err != nil {
		return err
	}
	if err := p.writeField8(oprot); err != nil {
		return err
	}
	if err := p.writeField9(oprot); err != nil {
		return err
	}
	if err := p.writeField10(oprot); err != nil {
		return err
	}
	if err := p.writeField11(oprot); err != nil {
		return err
	}
	if err := p.writeField13(oprot); err != nil {
		return err
	}
	if err := p.writeField17(oprot); err != nil {
		return err
	}
	if err := p.writeField18(oprot); err != nil {
		return err
	}
	if err := p.writeField20(oprot); err != nil {
		return err
	}
	if err := p.writeField21(oprot); err != nil {
		return err
	}
	if err := p.writeField22(oprot); err != nil {
		return err
	}
	if err := p.writeField23(oprot); err != nil {
		return err
	}
	if err := p.writeField25(oprot); err != nil {
		return err
	}
	if err := p.writeField27(oprot); err != nil {
		return err
	}
	if err := p.writeField28(oprot); err != nil {
		return err
	}
	if err := p.writeField29(oprot); err != nil {
		return err
	}
	if err := p.writeField30(oprot); err != nil {
		return err
	}
	if err := p.writeField32(oprot); err != nil {
		return err
	}
	if err := p.writeField33(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *TaskConfig) writeField7(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("isService", thrift.BOOL, 7); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:isService: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.IsService)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.isService (7) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 7:isService: ", p), err)
	}
	return err
}

func (p *TaskConfig) writeField8(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("numCpus", thrift.DOUBLE, 8); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:numCpus: ", p), err)
	}
	if err := oprot.WriteDouble(float64(p.NumCpus)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.numCpus (8) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 8:numCpus: ", p), err)
	}
	return err
}

func (p *TaskConfig) writeField9(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("ramMb", thrift.I64, 9); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:ramMb: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.RamMb)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.ramMb (9) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 9:ramMb: ", p), err)
	}
	return err
}

func (p *TaskConfig) writeField10(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("diskMb", thrift.I64, 10); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:diskMb: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.DiskMb)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.diskMb (10) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 10:diskMb: ", p), err)
	}
	return err
}

func (p *TaskConfig) writeField11(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("priority", thrift.I32, 11); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:priority: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Priority)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.priority (11) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 11:priority: ", p), err)
	}
	return err
}

func (p *TaskConfig) writeField13(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("maxTaskFailures", thrift.I32, 13); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:maxTaskFailures: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.MaxTaskFailures)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.maxTaskFailures (13) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 13:maxTaskFailures: ", p), err)
	}
	return err
}

func (p *TaskConfig) writeField17(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("owner", thrift.STRUCT, 17); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 17:owner: ", p), err)
	}
	if err := p.Owner.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Owner), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 17:owner: ", p), err)
	}
	return err
}

func (p *TaskConfig) writeField18(oprot thrift.TProtocol) (err error) {
	if p.IsSetProduction() {
		if err := oprot.WriteFieldBegin("production", thrift.BOOL, 18); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 18:production: ", p), err)
		}
		if err := oprot.WriteBool(bool(*p.Production)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.production (18) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 18:production: ", p), err)
		}
	}
	return err
}

func (p *TaskConfig) writeField20(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("constraints", thrift.SET, 20); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 20:constraints: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Constraints)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Constraints {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 20:constraints: ", p), err)
	}
	return err
}

func (p *TaskConfig) writeField21(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("requestedPorts", thrift.SET, 21); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 21:requestedPorts: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRING, len(p.RequestedPorts)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.RequestedPorts {
		if err := oprot.WriteString(string(v)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 21:requestedPorts: ", p), err)
	}
	return err
}

func (p *TaskConfig) writeField22(oprot thrift.TProtocol) (err error) {
	if p.IsSetTaskLinks() {
		if err := oprot.WriteFieldBegin("taskLinks", thrift.MAP, 22); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 22:taskLinks: ", p), err)
		}
		if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.TaskLinks)); err != nil {
			return thrift.PrependError("error writing map begin: ", err)
		}
		for k, v := range p.TaskLinks {
			if err := oprot.WriteString(string(k)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
			if err := oprot.WriteString(string(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteMapEnd(); err != nil {
			return thrift.PrependError("error writing map end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 22:taskLinks: ", p), err)
		}
	}
	return err
}

func (p *TaskConfig) writeField23(oprot thrift.TProtocol) (err error) {
	if p.IsSetContactEmail() {
		if err := oprot.WriteFieldBegin("contactEmail", thrift.STRING, 23); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 23:contactEmail: ", p), err)
		}
		if err := oprot.WriteString(string(*p.ContactEmail)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.contactEmail (23) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 23:contactEmail: ", p), err)
		}
	}
	return err
}

func (p *TaskConfig) writeField25(oprot thrift.TProtocol) (err error) {
	if p.IsSetExecutorConfig() {
		if err := oprot.WriteFieldBegin("executorConfig", thrift.STRUCT, 25); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 25:executorConfig: ", p), err)
		}
		if err := p.ExecutorConfig.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ExecutorConfig), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 25:executorConfig: ", p), err)
		}
	}
	return err
}

func (p *TaskConfig) writeField27(oprot thrift.TProtocol) (err error) {
	if p.IsSetMetadata() {
		if err := oprot.WriteFieldBegin("metadata", thrift.SET, 27); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 27:metadata: ", p), err)
		}
		if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Metadata)); err != nil {
			return thrift.PrependError("error writing set begin: ", err)
		}
		for v, _ := range p.Metadata {
			if err := v.Write(oprot); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
			}
		}
		if err := oprot.WriteSetEnd(); err != nil {
			return thrift.PrependError("error writing set end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 27:metadata: ", p), err)
		}
	}
	return err
}

func (p *TaskConfig) writeField28(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("job", thrift.STRUCT, 28); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 28:job: ", p), err)
	}
	if err := p.Job.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Job), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 28:job: ", p), err)
	}
	return err
}

func (p *TaskConfig) writeField29(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("container", thrift.STRUCT, 29); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 29:container: ", p), err)
	}
	if err := p.Container.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Container), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 29:container: ", p), err)
	}
	return err
}

func (p *TaskConfig) writeField30(oprot thrift.TProtocol) (err error) {
	if p.IsSetTier() {
		if err := oprot.WriteFieldBegin("tier", thrift.STRING, 30); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 30:tier: ", p), err)
		}
		if err := oprot.WriteString(string(*p.Tier)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.tier (30) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 30:tier: ", p), err)
		}
	}
	return err
}

func (p *TaskConfig) writeField32(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("resources", thrift.SET, 32); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 32:resources: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Resources)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Resources {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 32:resources: ", p), err)
	}
	return err
}

func (p *TaskConfig) writeField33(oprot thrift.TProtocol) (err error) {
	if p.IsSetMesosFetcherUris() {
		if err := oprot.WriteFieldBegin("mesosFetcherUris", thrift.SET, 33); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 33:mesosFetcherUris: ", p), err)
		}
		if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.MesosFetcherUris)); err != nil {
			return thrift.PrependError("error writing set begin: ", err)
		}
		for v, _ := range p.MesosFetcherUris {
			if err := v.Write(oprot); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
			}
		}
		if err := oprot.WriteSetEnd(); err != nil {
			return thrift.PrependError("error writing set end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 33:mesosFetcherUris: ", p), err)
		}
	}
	return err
}

func (p *TaskConfig) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TaskConfig(%+v)", *p)
}

// Attributes:
//  - NumCpus: Number of CPU cores allotted.
//  - RamMb: Megabytes of RAM allotted.
//  - DiskMb: Megabytes of disk space allotted.
//  - Resources: Aggregated resource values.
type ResourceAggregate struct {
	NumCpus   float64            `thrift:"numCpus,1" json:"numCpus"`
	RamMb     int64              `thrift:"ramMb,2" json:"ramMb"`
	DiskMb    int64              `thrift:"diskMb,3" json:"diskMb"`
	Resources map[*Resource]bool `thrift:"resources,4" json:"resources"`
}

func NewResourceAggregate() *ResourceAggregate {
	return &ResourceAggregate{}
}

func (p *ResourceAggregate) GetNumCpus() float64 {
	return p.NumCpus
}

func (p *ResourceAggregate) GetRamMb() int64 {
	return p.RamMb
}

func (p *ResourceAggregate) GetDiskMb() int64 {
	return p.DiskMb
}

func (p *ResourceAggregate) GetResources() map[*Resource]bool {
	return p.Resources
}
func (p *ResourceAggregate) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ResourceAggregate) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadDouble(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.NumCpus = v
	}
	return nil
}

func (p *ResourceAggregate) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.RamMb = v
	}
	return nil
}

func (p *ResourceAggregate) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.DiskMb = v
	}
	return nil
}

func (p *ResourceAggregate) readField4(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*Resource]bool, size)
	p.Resources = tSet
	for i := 0; i < size; i++ {
		_elem12 := &Resource{}
		if err := _elem12.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err)
		}
		p.Resources[_elem12] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *ResourceAggregate) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ResourceAggregate"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ResourceAggregate) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("numCpus", thrift.DOUBLE, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:numCpus: ", p), err)
	}
	if err := oprot.WriteDouble(float64(p.NumCpus)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.numCpus (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:numCpus: ", p), err)
	}
	return err
}

func (p *ResourceAggregate) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("ramMb", thrift.I64, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:ramMb: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.RamMb)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.ramMb (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:ramMb: ", p), err)
	}
	return err
}

func (p *ResourceAggregate) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("diskMb", thrift.I64, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:diskMb: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.DiskMb)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.diskMb (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:diskMb: ", p), err)
	}
	return err
}

func (p *ResourceAggregate) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("resources", thrift.SET, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:resources: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Resources)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Resources {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:resources: ", p), err)
	}
	return err
}

func (p *ResourceAggregate) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ResourceAggregate(%+v)", *p)
}

// Description of an Aurora job. One task will be scheduled for each instance within the job.
//
// Attributes:
//  - Key: Key for this job. If not specified name, owner.role, and a reasonable default environment are
// used to construct it server-side.
//  - Owner: Owner of this job.
//  - CronSchedule: If present, the job will be handled as a cron job with this crontab-syntax schedule.
//  - CronCollisionPolicy: Collision policy to use when handling overlapping cron runs.  Default is KILL_EXISTING.
//  - TaskConfig: Task configuration for this job.
//  - InstanceCount: The number of instances in the job. Generated instance IDs for tasks will be in the range
// [0, instances).
type JobConfiguration struct {
	// unused fields # 1 to 3
	CronSchedule        *string             `thrift:"cronSchedule,4" json:"cronSchedule,omitempty"`
	CronCollisionPolicy CronCollisionPolicy `thrift:"cronCollisionPolicy,5" json:"cronCollisionPolicy"`
	TaskConfig          *TaskConfig         `thrift:"taskConfig,6" json:"taskConfig"`
	Owner               *Identity           `thrift:"owner,7" json:"owner"`
	InstanceCount       int32               `thrift:"instanceCount,8" json:"instanceCount"`
	Key                 *JobKey             `thrift:"key,9" json:"key"`
}

func NewJobConfiguration() *JobConfiguration {
	return &JobConfiguration{}
}

var JobConfiguration_Key_DEFAULT *JobKey

func (p *JobConfiguration) GetKey() *JobKey {
	if !p.IsSetKey() {
		return JobConfiguration_Key_DEFAULT
	}
	return p.Key
}

var JobConfiguration_Owner_DEFAULT *Identity

func (p *JobConfiguration) GetOwner() *Identity {
	if !p.IsSetOwner() {
		return JobConfiguration_Owner_DEFAULT
	}
	return p.Owner
}

var JobConfiguration_CronSchedule_DEFAULT string

func (p *JobConfiguration) GetCronSchedule() string {
	if !p.IsSetCronSchedule() {
		return JobConfiguration_CronSchedule_DEFAULT
	}
	return *p.CronSchedule
}

func (p *JobConfiguration) GetCronCollisionPolicy() CronCollisionPolicy {
	return p.CronCollisionPolicy
}

var JobConfiguration_TaskConfig_DEFAULT *TaskConfig

func (p *JobConfiguration) GetTaskConfig() *TaskConfig {
	if !p.IsSetTaskConfig() {
		return JobConfiguration_TaskConfig_DEFAULT
	}
	return p.TaskConfig
}

func (p *JobConfiguration) GetInstanceCount() int32 {
	return p.InstanceCount
}
func (p *JobConfiguration) IsSetKey() bool {
	return p.Key != nil
}

func (p *JobConfiguration) IsSetOwner() bool {
	return p.Owner != nil
}

func (p *JobConfiguration) IsSetCronSchedule() bool {
	return p.CronSchedule != nil
}

func (p *JobConfiguration) IsSetTaskConfig() bool {
	return p.TaskConfig != nil
}

func (p *JobConfiguration) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 9:
			if err := p.readField9(iprot); err != nil {
				return err
			}
		case 7:
			if err := p.readField7(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.readField5(iprot); err != nil {
				return err
			}
		case 6:
			if err := p.readField6(iprot); err != nil {
				return err
			}
		case 8:
			if err := p.readField8(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobConfiguration) readField9(iprot thrift.TProtocol) error {
	p.Key = &JobKey{}
	if err := p.Key.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err)
	}
	return nil
}

func (p *JobConfiguration) readField7(iprot thrift.TProtocol) error {
	p.Owner = &Identity{}
	if err := p.Owner.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Owner), err)
	}
	return nil
}

func (p *JobConfiguration) readField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.CronSchedule = &v
	}
	return nil
}

func (p *JobConfiguration) readField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		temp := CronCollisionPolicy(v)
		p.CronCollisionPolicy = temp
	}
	return nil
}

func (p *JobConfiguration) readField6(iprot thrift.TProtocol) error {
	p.TaskConfig = &TaskConfig{}
	if err := p.TaskConfig.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TaskConfig), err)
	}
	return nil
}

func (p *JobConfiguration) readField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 8: ", err)
	} else {
		p.InstanceCount = v
	}
	return nil
}

func (p *JobConfiguration) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobConfiguration"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := p.writeField6(oprot); err != nil {
		return err
	}
	if err := p.writeField7(oprot); err != nil {
		return err
	}
	if err := p.writeField8(oprot); err != nil {
		return err
	}
	if err := p.writeField9(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobConfiguration) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetCronSchedule() {
		if err := oprot.WriteFieldBegin("cronSchedule", thrift.STRING, 4); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:cronSchedule: ", p), err)
		}
		if err := oprot.WriteString(string(*p.CronSchedule)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.cronSchedule (4) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 4:cronSchedule: ", p), err)
		}
	}
	return err
}

func (p *JobConfiguration) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("cronCollisionPolicy", thrift.I32, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:cronCollisionPolicy: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.CronCollisionPolicy)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.cronCollisionPolicy (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:cronCollisionPolicy: ", p), err)
	}
	return err
}

func (p *JobConfiguration) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("taskConfig", thrift.STRUCT, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:taskConfig: ", p), err)
	}
	if err := p.TaskConfig.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TaskConfig), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:taskConfig: ", p), err)
	}
	return err
}

func (p *JobConfiguration) writeField7(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("owner", thrift.STRUCT, 7); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:owner: ", p), err)
	}
	if err := p.Owner.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Owner), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 7:owner: ", p), err)
	}
	return err
}

func (p *JobConfiguration) writeField8(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("instanceCount", thrift.I32, 8); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:instanceCount: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.InstanceCount)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.instanceCount (8) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 8:instanceCount: ", p), err)
	}
	return err
}

func (p *JobConfiguration) writeField9(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 9); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:key: ", p), err)
	}
	if err := p.Key.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 9:key: ", p), err)
	}
	return err
}

func (p *JobConfiguration) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobConfiguration(%+v)", *p)
}

// Attributes:
//  - ActiveTaskCount: Number of tasks in active state for this job.
//  - FinishedTaskCount: Number of tasks in finished state for this job.
//  - FailedTaskCount: Number of failed tasks for this job.
//  - PendingTaskCount: Number of tasks in pending state for this job.
type JobStats struct {
	ActiveTaskCount   int32 `thrift:"activeTaskCount,1" json:"activeTaskCount"`
	FinishedTaskCount int32 `thrift:"finishedTaskCount,2" json:"finishedTaskCount"`
	FailedTaskCount   int32 `thrift:"failedTaskCount,3" json:"failedTaskCount"`
	PendingTaskCount  int32 `thrift:"pendingTaskCount,4" json:"pendingTaskCount"`
}

func NewJobStats() *JobStats {
	return &JobStats{}
}

func (p *JobStats) GetActiveTaskCount() int32 {
	return p.ActiveTaskCount
}

func (p *JobStats) GetFinishedTaskCount() int32 {
	return p.FinishedTaskCount
}

func (p *JobStats) GetFailedTaskCount() int32 {
	return p.FailedTaskCount
}

func (p *JobStats) GetPendingTaskCount() int32 {
	return p.PendingTaskCount
}
func (p *JobStats) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobStats) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.ActiveTaskCount = v
	}
	return nil
}

func (p *JobStats) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.FinishedTaskCount = v
	}
	return nil
}

func (p *JobStats) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.FailedTaskCount = v
	}
	return nil
}

func (p *JobStats) readField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.PendingTaskCount = v
	}
	return nil
}

func (p *JobStats) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobStats"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobStats) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("activeTaskCount", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:activeTaskCount: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.ActiveTaskCount)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.activeTaskCount (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:activeTaskCount: ", p), err)
	}
	return err
}

func (p *JobStats) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("finishedTaskCount", thrift.I32, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:finishedTaskCount: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.FinishedTaskCount)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.finishedTaskCount (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:finishedTaskCount: ", p), err)
	}
	return err
}

func (p *JobStats) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("failedTaskCount", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:failedTaskCount: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.FailedTaskCount)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.failedTaskCount (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:failedTaskCount: ", p), err)
	}
	return err
}

func (p *JobStats) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("pendingTaskCount", thrift.I32, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:pendingTaskCount: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.PendingTaskCount)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.pendingTaskCount (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:pendingTaskCount: ", p), err)
	}
	return err
}

func (p *JobStats) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobStats(%+v)", *p)
}

// Attributes:
//  - Job
//  - Stats
//  - NextCronRunMs: Timestamp of next cron run in ms since epoch, for a cron job
type JobSummary struct {
	Job           *JobConfiguration `thrift:"job,1" json:"job"`
	Stats         *JobStats         `thrift:"stats,2" json:"stats"`
	NextCronRunMs *int64            `thrift:"nextCronRunMs,3" json:"nextCronRunMs,omitempty"`
}

func NewJobSummary() *JobSummary {
	return &JobSummary{}
}

var JobSummary_Job_DEFAULT *JobConfiguration

func (p *JobSummary) GetJob() *JobConfiguration {
	if !p.IsSetJob() {
		return JobSummary_Job_DEFAULT
	}
	return p.Job
}

var JobSummary_Stats_DEFAULT *JobStats

func (p *JobSummary) GetStats() *JobStats {
	if !p.IsSetStats() {
		return JobSummary_Stats_DEFAULT
	}
	return p.Stats
}

var JobSummary_NextCronRunMs_DEFAULT int64

func (p *JobSummary) GetNextCronRunMs() int64 {
	if !p.IsSetNextCronRunMs() {
		return JobSummary_NextCronRunMs_DEFAULT
	}
	return *p.NextCronRunMs
}
func (p *JobSummary) IsSetJob() bool {
	return p.Job != nil
}

func (p *JobSummary) IsSetStats() bool {
	return p.Stats != nil
}

func (p *JobSummary) IsSetNextCronRunMs() bool {
	return p.NextCronRunMs != nil
}

func (p *JobSummary) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobSummary) readField1(iprot thrift.TProtocol) error {
	p.Job = &JobConfiguration{}
	if err := p.Job.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Job), err)
	}
	return nil
}

func (p *JobSummary) readField2(iprot thrift.TProtocol) error {
	p.Stats = &JobStats{}
	if err := p.Stats.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Stats), err)
	}
	return nil
}

func (p *JobSummary) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.NextCronRunMs = &v
	}
	return nil
}

func (p *JobSummary) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobSummary"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobSummary) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("job", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:job: ", p), err)
	}
	if err := p.Job.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Job), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job: ", p), err)
	}
	return err
}

func (p *JobSummary) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("stats", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stats: ", p), err)
	}
	if err := p.Stats.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Stats), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stats: ", p), err)
	}
	return err
}

func (p *JobSummary) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetNextCronRunMs() {
		if err := oprot.WriteFieldBegin("nextCronRunMs", thrift.I64, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:nextCronRunMs: ", p), err)
		}
		if err := oprot.WriteI64(int64(*p.NextCronRunMs)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.nextCronRunMs (3) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:nextCronRunMs: ", p), err)
		}
	}
	return err
}

func (p *JobSummary) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobSummary(%+v)", *p)
}

// Closed range of integers.
//
// Attributes:
//  - First
//  - Last
type Range struct {
	First int32 `thrift:"first,1" json:"first"`
	Last  int32 `thrift:"last,2" json:"last"`
}

func NewRange() *Range {
	return &Range{}
}

func (p *Range) GetFirst() int32 {
	return p.First
}

func (p *Range) GetLast() int32 {
	return p.Last
}
func (p *Range) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Range) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.First = v
	}
	return nil
}

func (p *Range) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Last = v
	}
	return nil
}

func (p *Range) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Range"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Range) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("first", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:first: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.First)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.first (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:first: ", p), err)
	}
	return err
}

func (p *Range) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("last", thrift.I32, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:last: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Last)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.last (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:last: ", p), err)
	}
	return err
}

func (p *Range) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Range(%+v)", *p)
}

// Attributes:
//  - Config
//  - Instances
type ConfigGroup struct {
	Config *TaskConfig `thrift:"config,1" json:"config"`
	// unused field # 2
	Instances map[*Range]bool `thrift:"instances,3" json:"instances"`
}

func NewConfigGroup() *ConfigGroup {
	return &ConfigGroup{}
}

var ConfigGroup_Config_DEFAULT *TaskConfig

func (p *ConfigGroup) GetConfig() *TaskConfig {
	if !p.IsSetConfig() {
		return ConfigGroup_Config_DEFAULT
	}
	return p.Config
}

func (p *ConfigGroup) GetInstances() map[*Range]bool {
	return p.Instances
}
func (p *ConfigGroup) IsSetConfig() bool {
	return p.Config != nil
}

func (p *ConfigGroup) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ConfigGroup) readField1(iprot thrift.TProtocol) error {
	p.Config = &TaskConfig{}
	if err := p.Config.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Config), err)
	}
	return nil
}

func (p *ConfigGroup) readField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*Range]bool, size)
	p.Instances = tSet
	for i := 0; i < size; i++ {
		_elem13 := &Range{}
		if err := _elem13.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err)
		}
		p.Instances[_elem13] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *ConfigGroup) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ConfigGroup"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ConfigGroup) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("config", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:config: ", p), err)
	}
	if err := p.Config.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Config), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:config: ", p), err)
	}
	return err
}

func (p *ConfigGroup) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("instances", thrift.SET, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:instances: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Instances)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Instances {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:instances: ", p), err)
	}
	return err
}

func (p *ConfigGroup) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ConfigGroup(%+v)", *p)
}

// Attributes:
//  - Key
//  - Groups
type ConfigSummary struct {
	Key    *JobKey               `thrift:"key,1" json:"key"`
	Groups map[*ConfigGroup]bool `thrift:"groups,2" json:"groups"`
}

func NewConfigSummary() *ConfigSummary {
	return &ConfigSummary{}
}

var ConfigSummary_Key_DEFAULT *JobKey

func (p *ConfigSummary) GetKey() *JobKey {
	if !p.IsSetKey() {
		return ConfigSummary_Key_DEFAULT
	}
	return p.Key
}

func (p *ConfigSummary) GetGroups() map[*ConfigGroup]bool {
	return p.Groups
}
func (p *ConfigSummary) IsSetKey() bool {
	return p.Key != nil
}

func (p *ConfigSummary) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ConfigSummary) readField1(iprot thrift.TProtocol) error {
	p.Key = &JobKey{}
	if err := p.Key.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err)
	}
	return nil
}

func (p *ConfigSummary) readField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*ConfigGroup]bool, size)
	p.Groups = tSet
	for i := 0; i < size; i++ {
		_elem14 := &ConfigGroup{}
		if err := _elem14.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err)
		}
		p.Groups[_elem14] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *ConfigSummary) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ConfigSummary"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ConfigSummary) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err)
	}
	if err := p.Key.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err)
	}
	return err
}

func (p *ConfigSummary) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("groups", thrift.SET, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:groups: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Groups)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Groups {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:groups: ", p), err)
	}
	return err
}

func (p *ConfigSummary) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ConfigSummary(%+v)", *p)
}

// Attributes:
//  - TaskConfig
type PopulateJobResult_ struct {
	// unused field # 1
	TaskConfig *TaskConfig `thrift:"taskConfig,2" json:"taskConfig"`
}

func NewPopulateJobResult_() *PopulateJobResult_ {
	return &PopulateJobResult_{}
}

var PopulateJobResult__TaskConfig_DEFAULT *TaskConfig

func (p *PopulateJobResult_) GetTaskConfig() *TaskConfig {
	if !p.IsSetTaskConfig() {
		return PopulateJobResult__TaskConfig_DEFAULT
	}
	return p.TaskConfig
}
func (p *PopulateJobResult_) IsSetTaskConfig() bool {
	return p.TaskConfig != nil
}

func (p *PopulateJobResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *PopulateJobResult_) readField2(iprot thrift.TProtocol) error {
	p.TaskConfig = &TaskConfig{}
	if err := p.TaskConfig.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TaskConfig), err)
	}
	return nil
}

func (p *PopulateJobResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("PopulateJobResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *PopulateJobResult_) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("taskConfig", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:taskConfig: ", p), err)
	}
	if err := p.TaskConfig.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TaskConfig), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:taskConfig: ", p), err)
	}
	return err
}

func (p *PopulateJobResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PopulateJobResult_(%+v)", *p)
}

// Attributes:
//  - Quota: Total allocated resource quota.
//  - ProdSharedConsumption: Resources consumed by production jobs from a shared resource pool.
//  - NonProdSharedConsumption: Resources consumed by non-production jobs from a shared resource pool.
//  - ProdDedicatedConsumption: Resources consumed by production jobs from a dedicated resource pool.
//  - NonProdDedicatedConsumption: Resources consumed by non-production jobs from a dedicated resource pool.
type GetQuotaResult_ struct {
	Quota                       *ResourceAggregate `thrift:"quota,1" json:"quota"`
	ProdSharedConsumption       *ResourceAggregate `thrift:"prodSharedConsumption,2" json:"prodSharedConsumption,omitempty"`
	NonProdSharedConsumption    *ResourceAggregate `thrift:"nonProdSharedConsumption,3" json:"nonProdSharedConsumption,omitempty"`
	ProdDedicatedConsumption    *ResourceAggregate `thrift:"prodDedicatedConsumption,4" json:"prodDedicatedConsumption,omitempty"`
	NonProdDedicatedConsumption *ResourceAggregate `thrift:"nonProdDedicatedConsumption,5" json:"nonProdDedicatedConsumption,omitempty"`
}

func NewGetQuotaResult_() *GetQuotaResult_ {
	return &GetQuotaResult_{}
}

var GetQuotaResult__Quota_DEFAULT *ResourceAggregate

func (p *GetQuotaResult_) GetQuota() *ResourceAggregate {
	if !p.IsSetQuota() {
		return GetQuotaResult__Quota_DEFAULT
	}
	return p.Quota
}

var GetQuotaResult__ProdSharedConsumption_DEFAULT *ResourceAggregate

func (p *GetQuotaResult_) GetProdSharedConsumption() *ResourceAggregate {
	if !p.IsSetProdSharedConsumption() {
		return GetQuotaResult__ProdSharedConsumption_DEFAULT
	}
	return p.ProdSharedConsumption
}

var GetQuotaResult__NonProdSharedConsumption_DEFAULT *ResourceAggregate

func (p *GetQuotaResult_) GetNonProdSharedConsumption() *ResourceAggregate {
	if !p.IsSetNonProdSharedConsumption() {
		return GetQuotaResult__NonProdSharedConsumption_DEFAULT
	}
	return p.NonProdSharedConsumption
}

var GetQuotaResult__ProdDedicatedConsumption_DEFAULT *ResourceAggregate

func (p *GetQuotaResult_) GetProdDedicatedConsumption() *ResourceAggregate {
	if !p.IsSetProdDedicatedConsumption() {
		return GetQuotaResult__ProdDedicatedConsumption_DEFAULT
	}
	return p.ProdDedicatedConsumption
}

var GetQuotaResult__NonProdDedicatedConsumption_DEFAULT *ResourceAggregate

func (p *GetQuotaResult_) GetNonProdDedicatedConsumption() *ResourceAggregate {
	if !p.IsSetNonProdDedicatedConsumption() {
		return GetQuotaResult__NonProdDedicatedConsumption_DEFAULT
	}
	return p.NonProdDedicatedConsumption
}
func (p *GetQuotaResult_) IsSetQuota() bool {
	return p.Quota != nil
}

func (p *GetQuotaResult_) IsSetProdSharedConsumption() bool {
	return p.ProdSharedConsumption != nil
}

func (p *GetQuotaResult_) IsSetNonProdSharedConsumption() bool {
	return p.NonProdSharedConsumption != nil
}

func (p *GetQuotaResult_) IsSetProdDedicatedConsumption() bool {
	return p.ProdDedicatedConsumption != nil
}

func (p *GetQuotaResult_) IsSetNonProdDedicatedConsumption() bool {
	return p.NonProdDedicatedConsumption != nil
}

func (p *GetQuotaResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.readField5(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *GetQuotaResult_) readField1(iprot thrift.TProtocol) error {
	p.Quota = &ResourceAggregate{}
	if err := p.Quota.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Quota), err)
	}
	return nil
}

func (p *GetQuotaResult_) readField2(iprot thrift.TProtocol) error {
	p.ProdSharedConsumption = &ResourceAggregate{}
	if err := p.ProdSharedConsumption.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProdSharedConsumption), err)
	}
	return nil
}

func (p *GetQuotaResult_) readField3(iprot thrift.TProtocol) error {
	p.NonProdSharedConsumption = &ResourceAggregate{}
	if err := p.NonProdSharedConsumption.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NonProdSharedConsumption), err)
	}
	return nil
}

func (p *GetQuotaResult_) readField4(iprot thrift.TProtocol) error {
	p.ProdDedicatedConsumption = &ResourceAggregate{}
	if err := p.ProdDedicatedConsumption.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProdDedicatedConsumption), err)
	}
	return nil
}

func (p *GetQuotaResult_) readField5(iprot thrift.TProtocol) error {
	p.NonProdDedicatedConsumption = &ResourceAggregate{}
	if err := p.NonProdDedicatedConsumption.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NonProdDedicatedConsumption), err)
	}
	return nil
}

func (p *GetQuotaResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("GetQuotaResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *GetQuotaResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("quota", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:quota: ", p), err)
	}
	if err := p.Quota.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Quota), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:quota: ", p), err)
	}
	return err
}

func (p *GetQuotaResult_) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetProdSharedConsumption() {
		if err := oprot.WriteFieldBegin("prodSharedConsumption", thrift.STRUCT, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:prodSharedConsumption: ", p), err)
		}
		if err := p.ProdSharedConsumption.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProdSharedConsumption), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:prodSharedConsumption: ", p), err)
		}
	}
	return err
}

func (p *GetQuotaResult_) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetNonProdSharedConsumption() {
		if err := oprot.WriteFieldBegin("nonProdSharedConsumption", thrift.STRUCT, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:nonProdSharedConsumption: ", p), err)
		}
		if err := p.NonProdSharedConsumption.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NonProdSharedConsumption), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:nonProdSharedConsumption: ", p), err)
		}
	}
	return err
}

func (p *GetQuotaResult_) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetProdDedicatedConsumption() {
		if err := oprot.WriteFieldBegin("prodDedicatedConsumption", thrift.STRUCT, 4); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:prodDedicatedConsumption: ", p), err)
		}
		if err := p.ProdDedicatedConsumption.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProdDedicatedConsumption), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 4:prodDedicatedConsumption: ", p), err)
		}
	}
	return err
}

func (p *GetQuotaResult_) writeField5(oprot thrift.TProtocol) (err error) {
	if p.IsSetNonProdDedicatedConsumption() {
		if err := oprot.WriteFieldBegin("nonProdDedicatedConsumption", thrift.STRUCT, 5); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:nonProdDedicatedConsumption: ", p), err)
		}
		if err := p.NonProdDedicatedConsumption.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NonProdDedicatedConsumption), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 5:nonProdDedicatedConsumption: ", p), err)
		}
	}
	return err
}

func (p *GetQuotaResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("GetQuotaResult_(%+v)", *p)
}

// Event marking a state transition within a task's lifecycle.
//
// Attributes:
//  - Timestamp: Epoch timestamp in milliseconds.
//  - Status: New status of the task.
//  - Message: Audit message that explains why a transition occurred.
//  - Scheduler: Hostname of the scheduler machine that performed the event.
type TaskEvent struct {
	Timestamp int64          `thrift:"timestamp,1" json:"timestamp"`
	Status    ScheduleStatus `thrift:"status,2" json:"status"`
	Message   *string        `thrift:"message,3" json:"message,omitempty"`
	Scheduler *string        `thrift:"scheduler,4" json:"scheduler,omitempty"`
}

func NewTaskEvent() *TaskEvent {
	return &TaskEvent{}
}

func (p *TaskEvent) GetTimestamp() int64 {
	return p.Timestamp
}

func (p *TaskEvent) GetStatus() ScheduleStatus {
	return p.Status
}

var TaskEvent_Message_DEFAULT string

func (p *TaskEvent) GetMessage() string {
	if !p.IsSetMessage() {
		return TaskEvent_Message_DEFAULT
	}
	return *p.Message
}

var TaskEvent_Scheduler_DEFAULT string

func (p *TaskEvent) GetScheduler() string {
	if !p.IsSetScheduler() {
		return TaskEvent_Scheduler_DEFAULT
	}
	return *p.Scheduler
}
func (p *TaskEvent) IsSetMessage() bool {
	return p.Message != nil
}

func (p *TaskEvent) IsSetScheduler() bool {
	return p.Scheduler != nil
}

func (p *TaskEvent) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *TaskEvent) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Timestamp = v
	}
	return nil
}

func (p *TaskEvent) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		temp := ScheduleStatus(v)
		p.Status = temp
	}
	return nil
}

func (p *TaskEvent) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.Message = &v
	}
	return nil
}

func (p *TaskEvent) readField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.Scheduler = &v
	}
	return nil
}

func (p *TaskEvent) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("TaskEvent"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *TaskEvent) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("timestamp", thrift.I64, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:timestamp: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.Timestamp)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.timestamp (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:timestamp: ", p), err)
	}
	return err
}

func (p *TaskEvent) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Status)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err)
	}
	return err
}

func (p *TaskEvent) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetMessage() {
		if err := oprot.WriteFieldBegin("message", thrift.STRING, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:message: ", p), err)
		}
		if err := oprot.WriteString(string(*p.Message)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.message (3) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:message: ", p), err)
		}
	}
	return err
}

func (p *TaskEvent) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetScheduler() {
		if err := oprot.WriteFieldBegin("scheduler", thrift.STRING, 4); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:scheduler: ", p), err)
		}
		if err := oprot.WriteString(string(*p.Scheduler)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.scheduler (4) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 4:scheduler: ", p), err)
		}
	}
	return err
}

func (p *TaskEvent) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TaskEvent(%+v)", *p)
}

// A task assignment that is provided to an executor.
//
// Attributes:
//  - TaskId: The mesos task ID for this task.  Guaranteed to be globally unique
//  - SlaveId: The mesos slave ID that this task has been assigned to.
// This will not be populated for a PENDING task.
//  - SlaveHost: The name of the machine that this task has been assigned to.
// This will not be populated for a PENDING task.
//  - Task: Information about how to run this task.
//  - AssignedPorts: Ports reserved on the machine while this task is running.
//  - InstanceId: The instance ID assigned to this task. Instance IDs must be unique and contiguous within a
// job, and will be in the range [0, N-1] (inclusive) for a job that has N instances.
type AssignedTask struct {
	TaskId        string           `thrift:"taskId,1" json:"taskId"`
	SlaveId       string           `thrift:"slaveId,2" json:"slaveId"`
	SlaveHost     string           `thrift:"slaveHost,3" json:"slaveHost"`
	Task          *TaskConfig      `thrift:"task,4" json:"task"`
	AssignedPorts map[string]int32 `thrift:"assignedPorts,5" json:"assignedPorts"`
	InstanceId    int32            `thrift:"instanceId,6" json:"instanceId"`
}

func NewAssignedTask() *AssignedTask {
	return &AssignedTask{}
}

func (p *AssignedTask) GetTaskId() string {
	return p.TaskId
}

func (p *AssignedTask) GetSlaveId() string {
	return p.SlaveId
}

func (p *AssignedTask) GetSlaveHost() string {
	return p.SlaveHost
}

var AssignedTask_Task_DEFAULT *TaskConfig

func (p *AssignedTask) GetTask() *TaskConfig {
	if !p.IsSetTask() {
		return AssignedTask_Task_DEFAULT
	}
	return p.Task
}

func (p *AssignedTask) GetAssignedPorts() map[string]int32 {
	return p.AssignedPorts
}

func (p *AssignedTask) GetInstanceId() int32 {
	return p.InstanceId
}
func (p *AssignedTask) IsSetTask() bool {
	return p.Task != nil
}

func (p *AssignedTask) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.readField5(iprot); err != nil {
				return err
			}
		case 6:
			if err := p.readField6(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *AssignedTask) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.TaskId = v
	}
	return nil
}

func (p *AssignedTask) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.SlaveId = v
	}
	return nil
}

func (p *AssignedTask) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.SlaveHost = v
	}
	return nil
}

func (p *AssignedTask) readField4(iprot thrift.TProtocol) error {
	p.Task = &TaskConfig{}
	if err := p.Task.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Task), err)
	}
	return nil
}

func (p *AssignedTask) readField5(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return thrift.PrependError("error reading map begin: ", err)
	}
	tMap := make(map[string]int32, size)
	p.AssignedPorts = tMap
	for i := 0; i < size; i++ {
		var _key15 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_key15 = v
		}
		var _val16 int32
		if v, err := iprot.ReadI32(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_val16 = v
		}
		p.AssignedPorts[_key15] = _val16
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return thrift.PrependError("error reading map end: ", err)
	}
	return nil
}

func (p *AssignedTask) readField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.InstanceId = v
	}
	return nil
}

func (p *AssignedTask) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("AssignedTask"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := p.writeField6(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *AssignedTask) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("taskId", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:taskId: ", p), err)
	}
	if err := oprot.WriteString(string(p.TaskId)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.taskId (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:taskId: ", p), err)
	}
	return err
}

func (p *AssignedTask) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("slaveId", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:slaveId: ", p), err)
	}
	if err := oprot.WriteString(string(p.SlaveId)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.slaveId (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:slaveId: ", p), err)
	}
	return err
}

func (p *AssignedTask) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("slaveHost", thrift.STRING, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:slaveHost: ", p), err)
	}
	if err := oprot.WriteString(string(p.SlaveHost)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.slaveHost (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:slaveHost: ", p), err)
	}
	return err
}

func (p *AssignedTask) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("task", thrift.STRUCT, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:task: ", p), err)
	}
	if err := p.Task.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Task), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:task: ", p), err)
	}
	return err
}

func (p *AssignedTask) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("assignedPorts", thrift.MAP, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:assignedPorts: ", p), err)
	}
	if err := oprot.WriteMapBegin(thrift.STRING, thrift.I32, len(p.AssignedPorts)); err != nil {
		return thrift.PrependError("error writing map begin: ", err)
	}
	for k, v := range p.AssignedPorts {
		if err := oprot.WriteString(string(k)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
		}
		if err := oprot.WriteI32(int32(v)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
		}
	}
	if err := oprot.WriteMapEnd(); err != nil {
		return thrift.PrependError("error writing map end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:assignedPorts: ", p), err)
	}
	return err
}

func (p *AssignedTask) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("instanceId", thrift.I32, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:instanceId: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.InstanceId)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.instanceId (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:instanceId: ", p), err)
	}
	return err
}

func (p *AssignedTask) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("AssignedTask(%+v)", *p)
}

// A task that has been scheduled.
//
// Attributes:
//  - AssignedTask: The task that was scheduled.
//  - Status: The current status of this task.
//  - FailureCount: The number of failures that this task has accumulated over the multi-generational history of
// this task.
//  - TaskEvents: State change history for this task.
//  - AncestorId: The task ID of the previous generation of this task.  When a task is automatically rescheduled,
// a copy of the task is created and ancestor ID of the previous task's task ID.
type ScheduledTask struct {
	AssignedTask *AssignedTask  `thrift:"assignedTask,1" json:"assignedTask"`
	Status       ScheduleStatus `thrift:"status,2" json:"status"`
	FailureCount int32          `thrift:"failureCount,3" json:"failureCount"`
	TaskEvents   []*TaskEvent   `thrift:"taskEvents,4" json:"taskEvents"`
	AncestorId   string         `thrift:"ancestorId,5" json:"ancestorId"`
}

func NewScheduledTask() *ScheduledTask {
	return &ScheduledTask{}
}

var ScheduledTask_AssignedTask_DEFAULT *AssignedTask

func (p *ScheduledTask) GetAssignedTask() *AssignedTask {
	if !p.IsSetAssignedTask() {
		return ScheduledTask_AssignedTask_DEFAULT
	}
	return p.AssignedTask
}

func (p *ScheduledTask) GetStatus() ScheduleStatus {
	return p.Status
}

func (p *ScheduledTask) GetFailureCount() int32 {
	return p.FailureCount
}

func (p *ScheduledTask) GetTaskEvents() []*TaskEvent {
	return p.TaskEvents
}

func (p *ScheduledTask) GetAncestorId() string {
	return p.AncestorId
}
func (p *ScheduledTask) IsSetAssignedTask() bool {
	return p.AssignedTask != nil
}

func (p *ScheduledTask) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.readField5(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ScheduledTask) readField1(iprot thrift.TProtocol) error {
	p.AssignedTask = &AssignedTask{}
	if err := p.AssignedTask.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.AssignedTask), err)
	}
	return nil
}

func (p *ScheduledTask) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		temp := ScheduleStatus(v)
		p.Status = temp
	}
	return nil
}

func (p *ScheduledTask) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.FailureCount = v
	}
	return nil
}

func (p *ScheduledTask) readField4(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*TaskEvent, 0, size)
	p.TaskEvents = tSlice
	for i := 0; i < size; i++ {
		_elem17 := &TaskEvent{}
		if err := _elem17.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err)
		}
		p.TaskEvents = append(p.TaskEvents, _elem17)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *ScheduledTask) readField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.AncestorId = v
	}
	return nil
}

func (p *ScheduledTask) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ScheduledTask"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ScheduledTask) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("assignedTask", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:assignedTask: ", p), err)
	}
	if err := p.AssignedTask.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.AssignedTask), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:assignedTask: ", p), err)
	}
	return err
}

func (p *ScheduledTask) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("status", thrift.I32, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Status)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err)
	}
	return err
}

func (p *ScheduledTask) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("failureCount", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:failureCount: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.FailureCount)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.failureCount (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:failureCount: ", p), err)
	}
	return err
}

func (p *ScheduledTask) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("taskEvents", thrift.LIST, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:taskEvents: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TaskEvents)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.TaskEvents {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:taskEvents: ", p), err)
	}
	return err
}

func (p *ScheduledTask) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("ancestorId", thrift.STRING, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ancestorId: ", p), err)
	}
	if err := oprot.WriteString(string(p.AncestorId)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.ancestorId (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ancestorId: ", p), err)
	}
	return err
}

func (p *ScheduledTask) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ScheduledTask(%+v)", *p)
}

// Attributes:
//  - Tasks
type ScheduleStatusResult_ struct {
	Tasks []*ScheduledTask `thrift:"tasks,1" json:"tasks"`
}

func NewScheduleStatusResult_() *ScheduleStatusResult_ {
	return &ScheduleStatusResult_{}
}

func (p *ScheduleStatusResult_) GetTasks() []*ScheduledTask {
	return p.Tasks
}
func (p *ScheduleStatusResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ScheduleStatusResult_) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*ScheduledTask, 0, size)
	p.Tasks = tSlice
	for i := 0; i < size; i++ {
		_elem18 := &ScheduledTask{}
		if err := _elem18.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err)
		}
		p.Tasks = append(p.Tasks, _elem18)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *ScheduleStatusResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ScheduleStatusResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ScheduleStatusResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("tasks", thrift.LIST, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tasks: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tasks)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Tasks {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tasks: ", p), err)
	}
	return err
}

func (p *ScheduleStatusResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ScheduleStatusResult_(%+v)", *p)
}

// Attributes:
//  - Configs
type GetJobsResult_ struct {
	Configs map[*JobConfiguration]bool `thrift:"configs,1" json:"configs"`
}

func NewGetJobsResult_() *GetJobsResult_ {
	return &GetJobsResult_{}
}

func (p *GetJobsResult_) GetConfigs() map[*JobConfiguration]bool {
	return p.Configs
}
func (p *GetJobsResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *GetJobsResult_) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*JobConfiguration]bool, size)
	p.Configs = tSet
	for i := 0; i < size; i++ {
		_elem19 := &JobConfiguration{}
		if err := _elem19.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem19), err)
		}
		p.Configs[_elem19] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *GetJobsResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("GetJobsResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *GetJobsResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("configs", thrift.SET, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:configs: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Configs)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Configs {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:configs: ", p), err)
	}
	return err
}

func (p *GetJobsResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("GetJobsResult_(%+v)", *p)
}

// Contains a set of restrictions on matching tasks where all restrictions must be met
// (terms are AND'ed together).
//
// Attributes:
//  - Role
//  - Environment
//  - JobName
//  - TaskIds
//  - Statuses
//  - InstanceIds
//  - SlaveHosts
//  - JobKeys
//  - Offset
//  - Limit
type TaskQuery struct {
	// unused field # 1
	JobName *string `thrift:"jobName,2" json:"jobName,omitempty"`
	// unused field # 3
	TaskIds  map[string]bool         `thrift:"taskIds,4" json:"taskIds,omitempty"`
	Statuses map[ScheduleStatus]bool `thrift:"statuses,5" json:"statuses,omitempty"`
	// unused field # 6
	InstanceIds map[int32]bool `thrift:"instanceIds,7" json:"instanceIds,omitempty"`
	// unused field # 8
	Environment *string          `thrift:"environment,9" json:"environment,omitempty"`
	SlaveHosts  map[string]bool  `thrift:"slaveHosts,10" json:"slaveHosts,omitempty"`
	JobKeys     map[*JobKey]bool `thrift:"jobKeys,11" json:"jobKeys,omitempty"`
	Offset      *int32           `thrift:"offset,12" json:"offset,omitempty"`
	Limit       *int32           `thrift:"limit,13" json:"limit,omitempty"`
	Role        *string          `thrift:"role,14" json:"role,omitempty"`
}

func NewTaskQuery() *TaskQuery {
	return &TaskQuery{}
}

var TaskQuery_Role_DEFAULT string

func (p *TaskQuery) GetRole() string {
	if !p.IsSetRole() {
		return TaskQuery_Role_DEFAULT
	}
	return *p.Role
}

var TaskQuery_Environment_DEFAULT string

func (p *TaskQuery) GetEnvironment() string {
	if !p.IsSetEnvironment() {
		return TaskQuery_Environment_DEFAULT
	}
	return *p.Environment
}

var TaskQuery_JobName_DEFAULT string

func (p *TaskQuery) GetJobName() string {
	if !p.IsSetJobName() {
		return TaskQuery_JobName_DEFAULT
	}
	return *p.JobName
}

var TaskQuery_TaskIds_DEFAULT map[string]bool

func (p *TaskQuery) GetTaskIds() map[string]bool {
	return p.TaskIds
}

var TaskQuery_Statuses_DEFAULT map[ScheduleStatus]bool

func (p *TaskQuery) GetStatuses() map[ScheduleStatus]bool {
	return p.Statuses
}

var TaskQuery_InstanceIds_DEFAULT map[int32]bool

func (p *TaskQuery) GetInstanceIds() map[int32]bool {
	return p.InstanceIds
}

var TaskQuery_SlaveHosts_DEFAULT map[string]bool

func (p *TaskQuery) GetSlaveHosts() map[string]bool {
	return p.SlaveHosts
}

var TaskQuery_JobKeys_DEFAULT map[*JobKey]bool

func (p *TaskQuery) GetJobKeys() map[*JobKey]bool {
	return p.JobKeys
}

var TaskQuery_Offset_DEFAULT int32

func (p *TaskQuery) GetOffset() int32 {
	if !p.IsSetOffset() {
		return TaskQuery_Offset_DEFAULT
	}
	return *p.Offset
}

var TaskQuery_Limit_DEFAULT int32

func (p *TaskQuery) GetLimit() int32 {
	if !p.IsSetLimit() {
		return TaskQuery_Limit_DEFAULT
	}
	return *p.Limit
}
func (p *TaskQuery) IsSetRole() bool {
	return p.Role != nil
}

func (p *TaskQuery) IsSetEnvironment() bool {
	return p.Environment != nil
}

func (p *TaskQuery) IsSetJobName() bool {
	return p.JobName != nil
}

func (p *TaskQuery) IsSetTaskIds() bool {
	return p.TaskIds != nil
}

func (p *TaskQuery) IsSetStatuses() bool {
	return p.Statuses != nil
}

func (p *TaskQuery) IsSetInstanceIds() bool {
	return p.InstanceIds != nil
}

func (p *TaskQuery) IsSetSlaveHosts() bool {
	return p.SlaveHosts != nil
}

func (p *TaskQuery) IsSetJobKeys() bool {
	return p.JobKeys != nil
}

func (p *TaskQuery) IsSetOffset() bool {
	return p.Offset != nil
}

func (p *TaskQuery) IsSetLimit() bool {
	return p.Limit != nil
}

func (p *TaskQuery) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 14:
			if err := p.readField14(iprot); err != nil {
				return err
			}
		case 9:
			if err := p.readField9(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.readField5(iprot); err != nil {
				return err
			}
		case 7:
			if err := p.readField7(iprot); err != nil {
				return err
			}
		case 10:
			if err := p.readField10(iprot); err != nil {
				return err
			}
		case 11:
			if err := p.readField11(iprot); err != nil {
				return err
			}
		case 12:
			if err := p.readField12(iprot); err != nil {
				return err
			}
		case 13:
			if err := p.readField13(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *TaskQuery) readField14(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 14: ", err)
	} else {
		p.Role = &v
	}
	return nil
}

func (p *TaskQuery) readField9(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 9: ", err)
	} else {
		p.Environment = &v
	}
	return nil
}

func (p *TaskQuery) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.JobName = &v
	}
	return nil
}

func (p *TaskQuery) readField4(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[string]bool, size)
	p.TaskIds = tSet
	for i := 0; i < size; i++ {
		var _elem20 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem20 = v
		}
		p.TaskIds[_elem20] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *TaskQuery) readField5(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[ScheduleStatus]bool, size)
	p.Statuses = tSet
	for i := 0; i < size; i++ {
		var _elem21 ScheduleStatus
		if v, err := iprot.ReadI32(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			temp := ScheduleStatus(v)
			_elem21 = temp
		}
		p.Statuses[_elem21] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *TaskQuery) readField7(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[int32]bool, size)
	p.InstanceIds = tSet
	for i := 0; i < size; i++ {
		var _elem22 int32
		if v, err := iprot.ReadI32(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem22 = v
		}
		p.InstanceIds[_elem22] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *TaskQuery) readField10(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[string]bool, size)
	p.SlaveHosts = tSet
	for i := 0; i < size; i++ {
		var _elem23 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem23 = v
		}
		p.SlaveHosts[_elem23] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *TaskQuery) readField11(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*JobKey]bool, size)
	p.JobKeys = tSet
	for i := 0; i < size; i++ {
		_elem24 := &JobKey{}
		if err := _elem24.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err)
		}
		p.JobKeys[_elem24] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *TaskQuery) readField12(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 12: ", err)
	} else {
		p.Offset = &v
	}
	return nil
}

func (p *TaskQuery) readField13(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 13: ", err)
	} else {
		p.Limit = &v
	}
	return nil
}

func (p *TaskQuery) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("TaskQuery"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := p.writeField7(oprot); err != nil {
		return err
	}
	if err := p.writeField9(oprot); err != nil {
		return err
	}
	if err := p.writeField10(oprot); err != nil {
		return err
	}
	if err := p.writeField11(oprot); err != nil {
		return err
	}
	if err := p.writeField12(oprot); err != nil {
		return err
	}
	if err := p.writeField13(oprot); err != nil {
		return err
	}
	if err := p.writeField14(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *TaskQuery) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetJobName() {
		if err := oprot.WriteFieldBegin("jobName", thrift.STRING, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:jobName: ", p), err)
		}
		if err := oprot.WriteString(string(*p.JobName)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.jobName (2) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:jobName: ", p), err)
		}
	}
	return err
}

func (p *TaskQuery) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetTaskIds() {
		if err := oprot.WriteFieldBegin("taskIds", thrift.SET, 4); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:taskIds: ", p), err)
		}
		if err := oprot.WriteSetBegin(thrift.STRING, len(p.TaskIds)); err != nil {
			return thrift.PrependError("error writing set begin: ", err)
		}
		for v, _ := range p.TaskIds {
			if err := oprot.WriteString(string(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteSetEnd(); err != nil {
			return thrift.PrependError("error writing set end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 4:taskIds: ", p), err)
		}
	}
	return err
}

func (p *TaskQuery) writeField5(oprot thrift.TProtocol) (err error) {
	if p.IsSetStatuses() {
		if err := oprot.WriteFieldBegin("statuses", thrift.SET, 5); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:statuses: ", p), err)
		}
		if err := oprot.WriteSetBegin(thrift.I32, len(p.Statuses)); err != nil {
			return thrift.PrependError("error writing set begin: ", err)
		}
		for v, _ := range p.Statuses {
			if err := oprot.WriteI32(int32(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteSetEnd(); err != nil {
			return thrift.PrependError("error writing set end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 5:statuses: ", p), err)
		}
	}
	return err
}

func (p *TaskQuery) writeField7(oprot thrift.TProtocol) (err error) {
	if p.IsSetInstanceIds() {
		if err := oprot.WriteFieldBegin("instanceIds", thrift.SET, 7); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:instanceIds: ", p), err)
		}
		if err := oprot.WriteSetBegin(thrift.I32, len(p.InstanceIds)); err != nil {
			return thrift.PrependError("error writing set begin: ", err)
		}
		for v, _ := range p.InstanceIds {
			if err := oprot.WriteI32(int32(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteSetEnd(); err != nil {
			return thrift.PrependError("error writing set end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 7:instanceIds: ", p), err)
		}
	}
	return err
}

func (p *TaskQuery) writeField9(oprot thrift.TProtocol) (err error) {
	if p.IsSetEnvironment() {
		if err := oprot.WriteFieldBegin("environment", thrift.STRING, 9); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:environment: ", p), err)
		}
		if err := oprot.WriteString(string(*p.Environment)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.environment (9) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 9:environment: ", p), err)
		}
	}
	return err
}

func (p *TaskQuery) writeField10(oprot thrift.TProtocol) (err error) {
	if p.IsSetSlaveHosts() {
		if err := oprot.WriteFieldBegin("slaveHosts", thrift.SET, 10); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:slaveHosts: ", p), err)
		}
		if err := oprot.WriteSetBegin(thrift.STRING, len(p.SlaveHosts)); err != nil {
			return thrift.PrependError("error writing set begin: ", err)
		}
		for v, _ := range p.SlaveHosts {
			if err := oprot.WriteString(string(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteSetEnd(); err != nil {
			return thrift.PrependError("error writing set end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 10:slaveHosts: ", p), err)
		}
	}
	return err
}

func (p *TaskQuery) writeField11(oprot thrift.TProtocol) (err error) {
	if p.IsSetJobKeys() {
		if err := oprot.WriteFieldBegin("jobKeys", thrift.SET, 11); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:jobKeys: ", p), err)
		}
		if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.JobKeys)); err != nil {
			return thrift.PrependError("error writing set begin: ", err)
		}
		for v, _ := range p.JobKeys {
			if err := v.Write(oprot); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
			}
		}
		if err := oprot.WriteSetEnd(); err != nil {
			return thrift.PrependError("error writing set end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 11:jobKeys: ", p), err)
		}
	}
	return err
}

func (p *TaskQuery) writeField12(oprot thrift.TProtocol) (err error) {
	if p.IsSetOffset() {
		if err := oprot.WriteFieldBegin("offset", thrift.I32, 12); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:offset: ", p), err)
		}
		if err := oprot.WriteI32(int32(*p.Offset)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.offset (12) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 12:offset: ", p), err)
		}
	}
	return err
}

func (p *TaskQuery) writeField13(oprot thrift.TProtocol) (err error) {
	if p.IsSetLimit() {
		if err := oprot.WriteFieldBegin("limit", thrift.I32, 13); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:limit: ", p), err)
		}
		if err := oprot.WriteI32(int32(*p.Limit)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.limit (13) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 13:limit: ", p), err)
		}
	}
	return err
}

func (p *TaskQuery) writeField14(oprot thrift.TProtocol) (err error) {
	if p.IsSetRole() {
		if err := oprot.WriteFieldBegin("role", thrift.STRING, 14); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 14:role: ", p), err)
		}
		if err := oprot.WriteString(string(*p.Role)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.role (14) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 14:role: ", p), err)
		}
	}
	return err
}

func (p *TaskQuery) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TaskQuery(%+v)", *p)
}

// Attributes:
//  - Host
//  - Mode
type HostStatus struct {
	Host string          `thrift:"host,1" json:"host"`
	Mode MaintenanceMode `thrift:"mode,2" json:"mode"`
}

func NewHostStatus() *HostStatus {
	return &HostStatus{}
}

func (p *HostStatus) GetHost() string {
	return p.Host
}

func (p *HostStatus) GetMode() MaintenanceMode {
	return p.Mode
}
func (p *HostStatus) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *HostStatus) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Host = v
	}
	return nil
}

func (p *HostStatus) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		temp := MaintenanceMode(v)
		p.Mode = temp
	}
	return nil
}

func (p *HostStatus) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("HostStatus"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *HostStatus) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("host", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err)
	}
	if err := oprot.WriteString(string(p.Host)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.host (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err)
	}
	return err
}

func (p *HostStatus) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("mode", thrift.I32, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:mode: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Mode)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.mode (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:mode: ", p), err)
	}
	return err
}

func (p *HostStatus) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("HostStatus(%+v)", *p)
}

// Attributes:
//  - Role
//  - JobCount
//  - CronJobCount
type RoleSummary struct {
	Role         string `thrift:"role,1" json:"role"`
	JobCount     int32  `thrift:"jobCount,2" json:"jobCount"`
	CronJobCount int32  `thrift:"cronJobCount,3" json:"cronJobCount"`
}

func NewRoleSummary() *RoleSummary {
	return &RoleSummary{}
}

func (p *RoleSummary) GetRole() string {
	return p.Role
}

func (p *RoleSummary) GetJobCount() int32 {
	return p.JobCount
}

func (p *RoleSummary) GetCronJobCount() int32 {
	return p.CronJobCount
}
func (p *RoleSummary) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RoleSummary) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Role = v
	}
	return nil
}

func (p *RoleSummary) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.JobCount = v
	}
	return nil
}

func (p *RoleSummary) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.CronJobCount = v
	}
	return nil
}

func (p *RoleSummary) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("RoleSummary"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RoleSummary) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("role", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role: ", p), err)
	}
	if err := oprot.WriteString(string(p.Role)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.role (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role: ", p), err)
	}
	return err
}

func (p *RoleSummary) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("jobCount", thrift.I32, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:jobCount: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.JobCount)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.jobCount (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:jobCount: ", p), err)
	}
	return err
}

func (p *RoleSummary) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("cronJobCount", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cronJobCount: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.CronJobCount)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.cronJobCount (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cronJobCount: ", p), err)
	}
	return err
}

func (p *RoleSummary) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RoleSummary(%+v)", *p)
}

// Attributes:
//  - HostNames
type Hosts struct {
	HostNames map[string]bool `thrift:"hostNames,1" json:"hostNames"`
}

func NewHosts() *Hosts {
	return &Hosts{}
}

func (p *Hosts) GetHostNames() map[string]bool {
	return p.HostNames
}
func (p *Hosts) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Hosts) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[string]bool, size)
	p.HostNames = tSet
	for i := 0; i < size; i++ {
		var _elem25 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem25 = v
		}
		p.HostNames[_elem25] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *Hosts) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Hosts"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Hosts) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("hostNames", thrift.SET, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hostNames: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRING, len(p.HostNames)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.HostNames {
		if err := oprot.WriteString(string(v)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hostNames: ", p), err)
	}
	return err
}

func (p *Hosts) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Hosts(%+v)", *p)
}

// Attributes:
//  - TaskId
//  - Reason
type PendingReason struct {
	TaskId string `thrift:"taskId,1" json:"taskId"`
	Reason string `thrift:"reason,2" json:"reason"`
}

func NewPendingReason() *PendingReason {
	return &PendingReason{}
}

func (p *PendingReason) GetTaskId() string {
	return p.TaskId
}

func (p *PendingReason) GetReason() string {
	return p.Reason
}
func (p *PendingReason) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *PendingReason) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.TaskId = v
	}
	return nil
}

func (p *PendingReason) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Reason = v
	}
	return nil
}

func (p *PendingReason) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("PendingReason"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *PendingReason) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("taskId", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:taskId: ", p), err)
	}
	if err := oprot.WriteString(string(p.TaskId)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.taskId (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:taskId: ", p), err)
	}
	return err
}

func (p *PendingReason) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("reason", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:reason: ", p), err)
	}
	if err := oprot.WriteString(string(p.Reason)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.reason (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:reason: ", p), err)
	}
	return err
}

func (p *PendingReason) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PendingReason(%+v)", *p)
}

// Job update key.
//
// Attributes:
//  - Job: Job being updated
//  - ID: Update ID.
type JobUpdateKey struct {
	Job *JobKey `thrift:"job,1" json:"job"`
	ID  string  `thrift:"id,2" json:"id"`
}

func NewJobUpdateKey() *JobUpdateKey {
	return &JobUpdateKey{}
}

var JobUpdateKey_Job_DEFAULT *JobKey

func (p *JobUpdateKey) GetJob() *JobKey {
	if !p.IsSetJob() {
		return JobUpdateKey_Job_DEFAULT
	}
	return p.Job
}

func (p *JobUpdateKey) GetID() string {
	return p.ID
}
func (p *JobUpdateKey) IsSetJob() bool {
	return p.Job != nil
}

func (p *JobUpdateKey) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobUpdateKey) readField1(iprot thrift.TProtocol) error {
	p.Job = &JobKey{}
	if err := p.Job.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Job), err)
	}
	return nil
}

func (p *JobUpdateKey) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.ID = v
	}
	return nil
}

func (p *JobUpdateKey) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobUpdateKey"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobUpdateKey) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("job", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:job: ", p), err)
	}
	if err := p.Job.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Job), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job: ", p), err)
	}
	return err
}

func (p *JobUpdateKey) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("id", thrift.STRING, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err)
	}
	if err := oprot.WriteString(string(p.ID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err)
	}
	return err
}

func (p *JobUpdateKey) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobUpdateKey(%+v)", *p)
}

// Job update thresholds and limits.
//
// Attributes:
//  - UpdateGroupSize: Max number of instances being updated at any given moment.
//  - MaxPerInstanceFailures: Max number of instance failures to tolerate before marking instance as FAILED.
//  - MaxFailedInstances: Max number of FAILED instances to tolerate before terminating the update.
//  - MinWaitInInstanceRunningMs: Min time to watch a RUNNING instance.
//  - RollbackOnFailure: If true, enables failed update rollback.
//  - UpdateOnlyTheseInstances: Instance IDs to act on. All instances will be affected if this is not set.
//  - WaitForBatchCompletion: If true, use updateGroupSize as strict batching boundaries, and avoid proceeding to another
// batch until the preceding batch finishes updating.
//  - BlockIfNoPulsesAfterMs: If set, requires external calls to pulseJobUpdate RPC within the specified rate for the
// update to make progress. If no pulses received within specified interval the update will
// block. A blocked update is unable to continue but retains its current status. It may only get
// unblocked by a fresh pulseJobUpdate call.
type JobUpdateSettings struct {
	UpdateGroupSize        int32 `thrift:"updateGroupSize,1" json:"updateGroupSize"`
	MaxPerInstanceFailures int32 `thrift:"maxPerInstanceFailures,2" json:"maxPerInstanceFailures"`
	MaxFailedInstances     int32 `thrift:"maxFailedInstances,3" json:"maxFailedInstances"`
	// unused field # 4
	MinWaitInInstanceRunningMs int32           `thrift:"minWaitInInstanceRunningMs,5" json:"minWaitInInstanceRunningMs"`
	RollbackOnFailure          bool            `thrift:"rollbackOnFailure,6" json:"rollbackOnFailure"`
	UpdateOnlyTheseInstances   map[*Range]bool `thrift:"updateOnlyTheseInstances,7" json:"updateOnlyTheseInstances"`
	WaitForBatchCompletion     bool            `thrift:"waitForBatchCompletion,8" json:"waitForBatchCompletion"`
	BlockIfNoPulsesAfterMs     *int32          `thrift:"blockIfNoPulsesAfterMs,9" json:"blockIfNoPulsesAfterMs,omitempty"`
}

func NewJobUpdateSettings() *JobUpdateSettings {
	return &JobUpdateSettings{}
}

func (p *JobUpdateSettings) GetUpdateGroupSize() int32 {
	return p.UpdateGroupSize
}

func (p *JobUpdateSettings) GetMaxPerInstanceFailures() int32 {
	return p.MaxPerInstanceFailures
}

func (p *JobUpdateSettings) GetMaxFailedInstances() int32 {
	return p.MaxFailedInstances
}

func (p *JobUpdateSettings) GetMinWaitInInstanceRunningMs() int32 {
	return p.MinWaitInInstanceRunningMs
}

func (p *JobUpdateSettings) GetRollbackOnFailure() bool {
	return p.RollbackOnFailure
}

func (p *JobUpdateSettings) GetUpdateOnlyTheseInstances() map[*Range]bool {
	return p.UpdateOnlyTheseInstances
}

func (p *JobUpdateSettings) GetWaitForBatchCompletion() bool {
	return p.WaitForBatchCompletion
}

var JobUpdateSettings_BlockIfNoPulsesAfterMs_DEFAULT int32

func (p *JobUpdateSettings) GetBlockIfNoPulsesAfterMs() int32 {
	if !p.IsSetBlockIfNoPulsesAfterMs() {
		return JobUpdateSettings_BlockIfNoPulsesAfterMs_DEFAULT
	}
	return *p.BlockIfNoPulsesAfterMs
}
func (p *JobUpdateSettings) IsSetBlockIfNoPulsesAfterMs() bool {
	return p.BlockIfNoPulsesAfterMs != nil
}

func (p *JobUpdateSettings) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.readField5(iprot); err != nil {
				return err
			}
		case 6:
			if err := p.readField6(iprot); err != nil {
				return err
			}
		case 7:
			if err := p.readField7(iprot); err != nil {
				return err
			}
		case 8:
			if err := p.readField8(iprot); err != nil {
				return err
			}
		case 9:
			if err := p.readField9(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobUpdateSettings) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.UpdateGroupSize = v
	}
	return nil
}

func (p *JobUpdateSettings) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.MaxPerInstanceFailures = v
	}
	return nil
}

func (p *JobUpdateSettings) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.MaxFailedInstances = v
	}
	return nil
}

func (p *JobUpdateSettings) readField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 5: ", err)
	} else {
		p.MinWaitInInstanceRunningMs = v
	}
	return nil
}

func (p *JobUpdateSettings) readField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.RollbackOnFailure = v
	}
	return nil
}

func (p *JobUpdateSettings) readField7(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*Range]bool, size)
	p.UpdateOnlyTheseInstances = tSet
	for i := 0; i < size; i++ {
		_elem26 := &Range{}
		if err := _elem26.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err)
		}
		p.UpdateOnlyTheseInstances[_elem26] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *JobUpdateSettings) readField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(); err != nil {
		return thrift.PrependError("error reading field 8: ", err)
	} else {
		p.WaitForBatchCompletion = v
	}
	return nil
}

func (p *JobUpdateSettings) readField9(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 9: ", err)
	} else {
		p.BlockIfNoPulsesAfterMs = &v
	}
	return nil
}

func (p *JobUpdateSettings) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobUpdateSettings"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := p.writeField6(oprot); err != nil {
		return err
	}
	if err := p.writeField7(oprot); err != nil {
		return err
	}
	if err := p.writeField8(oprot); err != nil {
		return err
	}
	if err := p.writeField9(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobUpdateSettings) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("updateGroupSize", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:updateGroupSize: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.UpdateGroupSize)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.updateGroupSize (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:updateGroupSize: ", p), err)
	}
	return err
}

func (p *JobUpdateSettings) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("maxPerInstanceFailures", thrift.I32, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:maxPerInstanceFailures: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.MaxPerInstanceFailures)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.maxPerInstanceFailures (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:maxPerInstanceFailures: ", p), err)
	}
	return err
}

func (p *JobUpdateSettings) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("maxFailedInstances", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:maxFailedInstances: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.MaxFailedInstances)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.maxFailedInstances (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:maxFailedInstances: ", p), err)
	}
	return err
}

func (p *JobUpdateSettings) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("minWaitInInstanceRunningMs", thrift.I32, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:minWaitInInstanceRunningMs: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.MinWaitInInstanceRunningMs)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.minWaitInInstanceRunningMs (5) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:minWaitInInstanceRunningMs: ", p), err)
	}
	return err
}

func (p *JobUpdateSettings) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("rollbackOnFailure", thrift.BOOL, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:rollbackOnFailure: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.RollbackOnFailure)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.rollbackOnFailure (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:rollbackOnFailure: ", p), err)
	}
	return err
}

func (p *JobUpdateSettings) writeField7(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("updateOnlyTheseInstances", thrift.SET, 7); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:updateOnlyTheseInstances: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.UpdateOnlyTheseInstances)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.UpdateOnlyTheseInstances {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 7:updateOnlyTheseInstances: ", p), err)
	}
	return err
}

func (p *JobUpdateSettings) writeField8(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("waitForBatchCompletion", thrift.BOOL, 8); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:waitForBatchCompletion: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.WaitForBatchCompletion)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.waitForBatchCompletion (8) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 8:waitForBatchCompletion: ", p), err)
	}
	return err
}

func (p *JobUpdateSettings) writeField9(oprot thrift.TProtocol) (err error) {
	if p.IsSetBlockIfNoPulsesAfterMs() {
		if err := oprot.WriteFieldBegin("blockIfNoPulsesAfterMs", thrift.I32, 9); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:blockIfNoPulsesAfterMs: ", p), err)
		}
		if err := oprot.WriteI32(int32(*p.BlockIfNoPulsesAfterMs)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.blockIfNoPulsesAfterMs (9) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 9:blockIfNoPulsesAfterMs: ", p), err)
		}
	}
	return err
}

func (p *JobUpdateSettings) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobUpdateSettings(%+v)", *p)
}

// Event marking a state transition in job update lifecycle.
//
// Attributes:
//  - Status: Update status.
//  - TimestampMs: Epoch timestamp in milliseconds.
//  - User: User who performed this event (if user-initiated).
//  - Message: Message from the user (for user-initiated transitions) or the scheduler about why the state was
// changed.
type JobUpdateEvent struct {
	Status      JobUpdateStatus `thrift:"status,1" json:"status"`
	TimestampMs int64           `thrift:"timestampMs,2" json:"timestampMs"`
	User        *string         `thrift:"user,3" json:"user,omitempty"`
	Message     *string         `thrift:"message,4" json:"message,omitempty"`
}

func NewJobUpdateEvent() *JobUpdateEvent {
	return &JobUpdateEvent{}
}

func (p *JobUpdateEvent) GetStatus() JobUpdateStatus {
	return p.Status
}

func (p *JobUpdateEvent) GetTimestampMs() int64 {
	return p.TimestampMs
}

var JobUpdateEvent_User_DEFAULT string

func (p *JobUpdateEvent) GetUser() string {
	if !p.IsSetUser() {
		return JobUpdateEvent_User_DEFAULT
	}
	return *p.User
}

var JobUpdateEvent_Message_DEFAULT string

func (p *JobUpdateEvent) GetMessage() string {
	if !p.IsSetMessage() {
		return JobUpdateEvent_Message_DEFAULT
	}
	return *p.Message
}
func (p *JobUpdateEvent) IsSetUser() bool {
	return p.User != nil
}

func (p *JobUpdateEvent) IsSetMessage() bool {
	return p.Message != nil
}

func (p *JobUpdateEvent) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobUpdateEvent) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		temp := JobUpdateStatus(v)
		p.Status = temp
	}
	return nil
}

func (p *JobUpdateEvent) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.TimestampMs = v
	}
	return nil
}

func (p *JobUpdateEvent) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.User = &v
	}
	return nil
}

func (p *JobUpdateEvent) readField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.Message = &v
	}
	return nil
}

func (p *JobUpdateEvent) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobUpdateEvent"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobUpdateEvent) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("status", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Status)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.status (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err)
	}
	return err
}

func (p *JobUpdateEvent) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("timestampMs", thrift.I64, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:timestampMs: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.TimestampMs)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.timestampMs (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:timestampMs: ", p), err)
	}
	return err
}

func (p *JobUpdateEvent) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetUser() {
		if err := oprot.WriteFieldBegin("user", thrift.STRING, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:user: ", p), err)
		}
		if err := oprot.WriteString(string(*p.User)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.user (3) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:user: ", p), err)
		}
	}
	return err
}

func (p *JobUpdateEvent) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetMessage() {
		if err := oprot.WriteFieldBegin("message", thrift.STRING, 4); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:message: ", p), err)
		}
		if err := oprot.WriteString(string(*p.Message)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.message (4) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 4:message: ", p), err)
		}
	}
	return err
}

func (p *JobUpdateEvent) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobUpdateEvent(%+v)", *p)
}

// Event marking a state transition in job instance update lifecycle.
//
// Attributes:
//  - InstanceId: Job instance ID.
//  - TimestampMs: Epoch timestamp in milliseconds.
//  - Action: Job update action taken on the instance.
type JobInstanceUpdateEvent struct {
	InstanceId  int32           `thrift:"instanceId,1" json:"instanceId"`
	TimestampMs int64           `thrift:"timestampMs,2" json:"timestampMs"`
	Action      JobUpdateAction `thrift:"action,3" json:"action"`
}

func NewJobInstanceUpdateEvent() *JobInstanceUpdateEvent {
	return &JobInstanceUpdateEvent{}
}

func (p *JobInstanceUpdateEvent) GetInstanceId() int32 {
	return p.InstanceId
}

func (p *JobInstanceUpdateEvent) GetTimestampMs() int64 {
	return p.TimestampMs
}

func (p *JobInstanceUpdateEvent) GetAction() JobUpdateAction {
	return p.Action
}
func (p *JobInstanceUpdateEvent) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobInstanceUpdateEvent) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.InstanceId = v
	}
	return nil
}

func (p *JobInstanceUpdateEvent) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.TimestampMs = v
	}
	return nil
}

func (p *JobInstanceUpdateEvent) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		temp := JobUpdateAction(v)
		p.Action = temp
	}
	return nil
}

func (p *JobInstanceUpdateEvent) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobInstanceUpdateEvent"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobInstanceUpdateEvent) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("instanceId", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:instanceId: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.InstanceId)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.instanceId (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:instanceId: ", p), err)
	}
	return err
}

func (p *JobInstanceUpdateEvent) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("timestampMs", thrift.I64, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:timestampMs: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.TimestampMs)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.timestampMs (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:timestampMs: ", p), err)
	}
	return err
}

func (p *JobInstanceUpdateEvent) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("action", thrift.I32, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:action: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Action)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.action (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:action: ", p), err)
	}
	return err
}

func (p *JobInstanceUpdateEvent) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobInstanceUpdateEvent(%+v)", *p)
}

// Maps instance IDs to TaskConfigs it.
//
// Attributes:
//  - Task: A TaskConfig associated with instances.
//  - Instances: Instances associated with the TaskConfig.
type InstanceTaskConfig struct {
	Task      *TaskConfig     `thrift:"task,1" json:"task"`
	Instances map[*Range]bool `thrift:"instances,2" json:"instances"`
}

func NewInstanceTaskConfig() *InstanceTaskConfig {
	return &InstanceTaskConfig{}
}

var InstanceTaskConfig_Task_DEFAULT *TaskConfig

func (p *InstanceTaskConfig) GetTask() *TaskConfig {
	if !p.IsSetTask() {
		return InstanceTaskConfig_Task_DEFAULT
	}
	return p.Task
}

func (p *InstanceTaskConfig) GetInstances() map[*Range]bool {
	return p.Instances
}
func (p *InstanceTaskConfig) IsSetTask() bool {
	return p.Task != nil
}

func (p *InstanceTaskConfig) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *InstanceTaskConfig) readField1(iprot thrift.TProtocol) error {
	p.Task = &TaskConfig{}
	if err := p.Task.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Task), err)
	}
	return nil
}

func (p *InstanceTaskConfig) readField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*Range]bool, size)
	p.Instances = tSet
	for i := 0; i < size; i++ {
		_elem27 := &Range{}
		if err := _elem27.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err)
		}
		p.Instances[_elem27] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *InstanceTaskConfig) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("InstanceTaskConfig"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *InstanceTaskConfig) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("task", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:task: ", p), err)
	}
	if err := p.Task.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Task), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:task: ", p), err)
	}
	return err
}

func (p *InstanceTaskConfig) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("instances", thrift.SET, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:instances: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Instances)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Instances {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:instances: ", p), err)
	}
	return err
}

func (p *InstanceTaskConfig) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("InstanceTaskConfig(%+v)", *p)
}

// Current job update state including status and created/modified timestamps.
//
// Attributes:
//  - Status: Current status of the update.
//  - CreatedTimestampMs: Created timestamp in milliseconds.
//  - LastModifiedTimestampMs: Last modified timestamp in milliseconds.
type JobUpdateState struct {
	Status                  JobUpdateStatus `thrift:"status,1" json:"status"`
	CreatedTimestampMs      int64           `thrift:"createdTimestampMs,2" json:"createdTimestampMs"`
	LastModifiedTimestampMs int64           `thrift:"lastModifiedTimestampMs,3" json:"lastModifiedTimestampMs"`
}

func NewJobUpdateState() *JobUpdateState {
	return &JobUpdateState{}
}

func (p *JobUpdateState) GetStatus() JobUpdateStatus {
	return p.Status
}

func (p *JobUpdateState) GetCreatedTimestampMs() int64 {
	return p.CreatedTimestampMs
}

func (p *JobUpdateState) GetLastModifiedTimestampMs() int64 {
	return p.LastModifiedTimestampMs
}
func (p *JobUpdateState) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobUpdateState) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		temp := JobUpdateStatus(v)
		p.Status = temp
	}
	return nil
}

func (p *JobUpdateState) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.CreatedTimestampMs = v
	}
	return nil
}

func (p *JobUpdateState) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.LastModifiedTimestampMs = v
	}
	return nil
}

func (p *JobUpdateState) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobUpdateState"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobUpdateState) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("status", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Status)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.status (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err)
	}
	return err
}

func (p *JobUpdateState) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("createdTimestampMs", thrift.I64, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:createdTimestampMs: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.CreatedTimestampMs)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.createdTimestampMs (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:createdTimestampMs: ", p), err)
	}
	return err
}

func (p *JobUpdateState) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("lastModifiedTimestampMs", thrift.I64, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:lastModifiedTimestampMs: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.LastModifiedTimestampMs)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.lastModifiedTimestampMs (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:lastModifiedTimestampMs: ", p), err)
	}
	return err
}

func (p *JobUpdateState) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobUpdateState(%+v)", *p)
}

// Summary of the job update including job key, user and current state.
//
// Attributes:
//  - Key: Unique identifier for the update.
//  - User: User initiated an update.
//  - State: Current job update state.
//  - Metadata: Update metadata supplied by the client.
type JobUpdateSummary struct {
	// unused fields # 1 to 2
	User     string             `thrift:"user,3" json:"user"`
	State    *JobUpdateState    `thrift:"state,4" json:"state"`
	Key      *JobUpdateKey      `thrift:"key,5" json:"key"`
	Metadata map[*Metadata]bool `thrift:"metadata,6" json:"metadata,omitempty"`
}

func NewJobUpdateSummary() *JobUpdateSummary {
	return &JobUpdateSummary{}
}

var JobUpdateSummary_Key_DEFAULT *JobUpdateKey

func (p *JobUpdateSummary) GetKey() *JobUpdateKey {
	if !p.IsSetKey() {
		return JobUpdateSummary_Key_DEFAULT
	}
	return p.Key
}

func (p *JobUpdateSummary) GetUser() string {
	return p.User
}

var JobUpdateSummary_State_DEFAULT *JobUpdateState

func (p *JobUpdateSummary) GetState() *JobUpdateState {
	if !p.IsSetState() {
		return JobUpdateSummary_State_DEFAULT
	}
	return p.State
}

var JobUpdateSummary_Metadata_DEFAULT map[*Metadata]bool

func (p *JobUpdateSummary) GetMetadata() map[*Metadata]bool {
	return p.Metadata
}
func (p *JobUpdateSummary) IsSetKey() bool {
	return p.Key != nil
}

func (p *JobUpdateSummary) IsSetState() bool {
	return p.State != nil
}

func (p *JobUpdateSummary) IsSetMetadata() bool {
	return p.Metadata != nil
}

func (p *JobUpdateSummary) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 5:
			if err := p.readField5(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		case 6:
			if err := p.readField6(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobUpdateSummary) readField5(iprot thrift.TProtocol) error {
	p.Key = &JobUpdateKey{}
	if err := p.Key.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err)
	}
	return nil
}

func (p *JobUpdateSummary) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.User = v
	}
	return nil
}

func (p *JobUpdateSummary) readField4(iprot thrift.TProtocol) error {
	p.State = &JobUpdateState{}
	if err := p.State.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.State), err)
	}
	return nil
}

func (p *JobUpdateSummary) readField6(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*Metadata]bool, size)
	p.Metadata = tSet
	for i := 0; i < size; i++ {
		_elem28 := &Metadata{}
		if err := _elem28.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem28), err)
		}
		p.Metadata[_elem28] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *JobUpdateSummary) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobUpdateSummary"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := p.writeField6(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobUpdateSummary) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("user", thrift.STRING, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:user: ", p), err)
	}
	if err := oprot.WriteString(string(p.User)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.user (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:user: ", p), err)
	}
	return err
}

func (p *JobUpdateSummary) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("state", thrift.STRUCT, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:state: ", p), err)
	}
	if err := p.State.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.State), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:state: ", p), err)
	}
	return err
}

func (p *JobUpdateSummary) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:key: ", p), err)
	}
	if err := p.Key.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:key: ", p), err)
	}
	return err
}

func (p *JobUpdateSummary) writeField6(oprot thrift.TProtocol) (err error) {
	if p.IsSetMetadata() {
		if err := oprot.WriteFieldBegin("metadata", thrift.SET, 6); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:metadata: ", p), err)
		}
		if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Metadata)); err != nil {
			return thrift.PrependError("error writing set begin: ", err)
		}
		for v, _ := range p.Metadata {
			if err := v.Write(oprot); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
			}
		}
		if err := oprot.WriteSetEnd(); err != nil {
			return thrift.PrependError("error writing set end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 6:metadata: ", p), err)
		}
	}
	return err
}

func (p *JobUpdateSummary) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobUpdateSummary(%+v)", *p)
}

// Update configuration and setting details.
//
// Attributes:
//  - InitialState: Actual InstanceId -> TaskConfig mapping when the update was requested.
//  - DesiredState: Desired configuration when the update completes.
//  - Settings: Update specific settings.
type JobUpdateInstructions struct {
	InitialState map[*InstanceTaskConfig]bool `thrift:"initialState,1" json:"initialState"`
	DesiredState *InstanceTaskConfig          `thrift:"desiredState,2" json:"desiredState"`
	Settings     *JobUpdateSettings           `thrift:"settings,3" json:"settings"`
}

func NewJobUpdateInstructions() *JobUpdateInstructions {
	return &JobUpdateInstructions{}
}

func (p *JobUpdateInstructions) GetInitialState() map[*InstanceTaskConfig]bool {
	return p.InitialState
}

var JobUpdateInstructions_DesiredState_DEFAULT *InstanceTaskConfig

func (p *JobUpdateInstructions) GetDesiredState() *InstanceTaskConfig {
	if !p.IsSetDesiredState() {
		return JobUpdateInstructions_DesiredState_DEFAULT
	}
	return p.DesiredState
}

var JobUpdateInstructions_Settings_DEFAULT *JobUpdateSettings

func (p *JobUpdateInstructions) GetSettings() *JobUpdateSettings {
	if !p.IsSetSettings() {
		return JobUpdateInstructions_Settings_DEFAULT
	}
	return p.Settings
}
func (p *JobUpdateInstructions) IsSetDesiredState() bool {
	return p.DesiredState != nil
}

func (p *JobUpdateInstructions) IsSetSettings() bool {
	return p.Settings != nil
}

func (p *JobUpdateInstructions) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobUpdateInstructions) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*InstanceTaskConfig]bool, size)
	p.InitialState = tSet
	for i := 0; i < size; i++ {
		_elem29 := &InstanceTaskConfig{}
		if err := _elem29.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err)
		}
		p.InitialState[_elem29] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *JobUpdateInstructions) readField2(iprot thrift.TProtocol) error {
	p.DesiredState = &InstanceTaskConfig{}
	if err := p.DesiredState.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DesiredState), err)
	}
	return nil
}

func (p *JobUpdateInstructions) readField3(iprot thrift.TProtocol) error {
	p.Settings = &JobUpdateSettings{}
	if err := p.Settings.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Settings), err)
	}
	return nil
}

func (p *JobUpdateInstructions) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobUpdateInstructions"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobUpdateInstructions) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("initialState", thrift.SET, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:initialState: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.InitialState)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.InitialState {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:initialState: ", p), err)
	}
	return err
}

func (p *JobUpdateInstructions) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("desiredState", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:desiredState: ", p), err)
	}
	if err := p.DesiredState.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DesiredState), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:desiredState: ", p), err)
	}
	return err
}

func (p *JobUpdateInstructions) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("settings", thrift.STRUCT, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:settings: ", p), err)
	}
	if err := p.Settings.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Settings), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:settings: ", p), err)
	}
	return err
}

func (p *JobUpdateInstructions) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobUpdateInstructions(%+v)", *p)
}

// Full definition of the job update.
//
// Attributes:
//  - Summary: Update summary.
//  - Instructions: Update configuration.
type JobUpdate struct {
	Summary      *JobUpdateSummary      `thrift:"summary,1" json:"summary"`
	Instructions *JobUpdateInstructions `thrift:"instructions,2" json:"instructions"`
}

func NewJobUpdate() *JobUpdate {
	return &JobUpdate{}
}

var JobUpdate_Summary_DEFAULT *JobUpdateSummary

func (p *JobUpdate) GetSummary() *JobUpdateSummary {
	if !p.IsSetSummary() {
		return JobUpdate_Summary_DEFAULT
	}
	return p.Summary
}

var JobUpdate_Instructions_DEFAULT *JobUpdateInstructions

func (p *JobUpdate) GetInstructions() *JobUpdateInstructions {
	if !p.IsSetInstructions() {
		return JobUpdate_Instructions_DEFAULT
	}
	return p.Instructions
}
func (p *JobUpdate) IsSetSummary() bool {
	return p.Summary != nil
}

func (p *JobUpdate) IsSetInstructions() bool {
	return p.Instructions != nil
}

func (p *JobUpdate) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobUpdate) readField1(iprot thrift.TProtocol) error {
	p.Summary = &JobUpdateSummary{}
	if err := p.Summary.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Summary), err)
	}
	return nil
}

func (p *JobUpdate) readField2(iprot thrift.TProtocol) error {
	p.Instructions = &JobUpdateInstructions{}
	if err := p.Instructions.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Instructions), err)
	}
	return nil
}

func (p *JobUpdate) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobUpdate"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobUpdate) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("summary", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:summary: ", p), err)
	}
	if err := p.Summary.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Summary), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:summary: ", p), err)
	}
	return err
}

func (p *JobUpdate) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("instructions", thrift.STRUCT, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:instructions: ", p), err)
	}
	if err := p.Instructions.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Instructions), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:instructions: ", p), err)
	}
	return err
}

func (p *JobUpdate) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobUpdate(%+v)", *p)
}

// Attributes:
//  - Update: Update definition.
//  - UpdateEvents: History for this update.
//  - InstanceEvents: History for the individual instances updated.
type JobUpdateDetails struct {
	Update         *JobUpdate                `thrift:"update,1" json:"update"`
	UpdateEvents   []*JobUpdateEvent         `thrift:"updateEvents,2" json:"updateEvents"`
	InstanceEvents []*JobInstanceUpdateEvent `thrift:"instanceEvents,3" json:"instanceEvents"`
}

func NewJobUpdateDetails() *JobUpdateDetails {
	return &JobUpdateDetails{}
}

var JobUpdateDetails_Update_DEFAULT *JobUpdate

func (p *JobUpdateDetails) GetUpdate() *JobUpdate {
	if !p.IsSetUpdate() {
		return JobUpdateDetails_Update_DEFAULT
	}
	return p.Update
}

func (p *JobUpdateDetails) GetUpdateEvents() []*JobUpdateEvent {
	return p.UpdateEvents
}

func (p *JobUpdateDetails) GetInstanceEvents() []*JobInstanceUpdateEvent {
	return p.InstanceEvents
}
func (p *JobUpdateDetails) IsSetUpdate() bool {
	return p.Update != nil
}

func (p *JobUpdateDetails) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobUpdateDetails) readField1(iprot thrift.TProtocol) error {
	p.Update = &JobUpdate{}
	if err := p.Update.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Update), err)
	}
	return nil
}

func (p *JobUpdateDetails) readField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*JobUpdateEvent, 0, size)
	p.UpdateEvents = tSlice
	for i := 0; i < size; i++ {
		_elem30 := &JobUpdateEvent{}
		if err := _elem30.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err)
		}
		p.UpdateEvents = append(p.UpdateEvents, _elem30)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *JobUpdateDetails) readField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*JobInstanceUpdateEvent, 0, size)
	p.InstanceEvents = tSlice
	for i := 0; i < size; i++ {
		_elem31 := &JobInstanceUpdateEvent{}
		if err := _elem31.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem31), err)
		}
		p.InstanceEvents = append(p.InstanceEvents, _elem31)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *JobUpdateDetails) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobUpdateDetails"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobUpdateDetails) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("update", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:update: ", p), err)
	}
	if err := p.Update.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Update), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:update: ", p), err)
	}
	return err
}

func (p *JobUpdateDetails) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("updateEvents", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:updateEvents: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.UpdateEvents)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.UpdateEvents {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:updateEvents: ", p), err)
	}
	return err
}

func (p *JobUpdateDetails) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("instanceEvents", thrift.LIST, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:instanceEvents: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.InstanceEvents)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.InstanceEvents {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:instanceEvents: ", p), err)
	}
	return err
}

func (p *JobUpdateDetails) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobUpdateDetails(%+v)", *p)
}

// A request to update the following instances of an existing job. Used by startUpdate.
//
// Attributes:
//  - TaskConfig: Desired TaskConfig to apply.
//  - InstanceCount: Desired number of instances of the task config.
//  - Settings: Update settings and limits.
//  - Metadata: Update metadata supplied by the client issuing the JobUpdateRequest.
type JobUpdateRequest struct {
	TaskConfig    *TaskConfig        `thrift:"taskConfig,1" json:"taskConfig"`
	InstanceCount int32              `thrift:"instanceCount,2" json:"instanceCount"`
	Settings      *JobUpdateSettings `thrift:"settings,3" json:"settings"`
	Metadata      map[*Metadata]bool `thrift:"metadata,4" json:"metadata,omitempty"`
}

func NewJobUpdateRequest() *JobUpdateRequest {
	return &JobUpdateRequest{}
}

var JobUpdateRequest_TaskConfig_DEFAULT *TaskConfig

func (p *JobUpdateRequest) GetTaskConfig() *TaskConfig {
	if !p.IsSetTaskConfig() {
		return JobUpdateRequest_TaskConfig_DEFAULT
	}
	return p.TaskConfig
}

func (p *JobUpdateRequest) GetInstanceCount() int32 {
	return p.InstanceCount
}

var JobUpdateRequest_Settings_DEFAULT *JobUpdateSettings

func (p *JobUpdateRequest) GetSettings() *JobUpdateSettings {
	if !p.IsSetSettings() {
		return JobUpdateRequest_Settings_DEFAULT
	}
	return p.Settings
}

var JobUpdateRequest_Metadata_DEFAULT map[*Metadata]bool

func (p *JobUpdateRequest) GetMetadata() map[*Metadata]bool {
	return p.Metadata
}
func (p *JobUpdateRequest) IsSetTaskConfig() bool {
	return p.TaskConfig != nil
}

func (p *JobUpdateRequest) IsSetSettings() bool {
	return p.Settings != nil
}

func (p *JobUpdateRequest) IsSetMetadata() bool {
	return p.Metadata != nil
}

func (p *JobUpdateRequest) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobUpdateRequest) readField1(iprot thrift.TProtocol) error {
	p.TaskConfig = &TaskConfig{}
	if err := p.TaskConfig.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TaskConfig), err)
	}
	return nil
}

func (p *JobUpdateRequest) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.InstanceCount = v
	}
	return nil
}

func (p *JobUpdateRequest) readField3(iprot thrift.TProtocol) error {
	p.Settings = &JobUpdateSettings{}
	if err := p.Settings.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Settings), err)
	}
	return nil
}

func (p *JobUpdateRequest) readField4(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*Metadata]bool, size)
	p.Metadata = tSet
	for i := 0; i < size; i++ {
		_elem32 := &Metadata{}
		if err := _elem32.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err)
		}
		p.Metadata[_elem32] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *JobUpdateRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobUpdateRequest"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobUpdateRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("taskConfig", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:taskConfig: ", p), err)
	}
	if err := p.TaskConfig.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TaskConfig), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:taskConfig: ", p), err)
	}
	return err
}

func (p *JobUpdateRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("instanceCount", thrift.I32, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:instanceCount: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.InstanceCount)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.instanceCount (2) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:instanceCount: ", p), err)
	}
	return err
}

func (p *JobUpdateRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("settings", thrift.STRUCT, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:settings: ", p), err)
	}
	if err := p.Settings.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Settings), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:settings: ", p), err)
	}
	return err
}

func (p *JobUpdateRequest) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetMetadata() {
		if err := oprot.WriteFieldBegin("metadata", thrift.SET, 4); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:metadata: ", p), err)
		}
		if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Metadata)); err != nil {
			return thrift.PrependError("error writing set begin: ", err)
		}
		for v, _ := range p.Metadata {
			if err := v.Write(oprot); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
			}
		}
		if err := oprot.WriteSetEnd(); err != nil {
			return thrift.PrependError("error writing set end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 4:metadata: ", p), err)
		}
	}
	return err
}

func (p *JobUpdateRequest) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobUpdateRequest(%+v)", *p)
}

// Contains a set of restrictions on matching job updates where all restrictions must be met
// (terms are AND'ed together).
//
// Attributes:
//  - Role: Job role.
//  - Key: Unique identifier for a job update.
//  - JobKey: Job key.
//  - User: User who created the update.
//  - UpdateStatuses: Set of update statuses.
//  - Offset: Offset to serve data from. Used by pagination.
//  - Limit: Number or records to serve. Used by pagination.
type JobUpdateQuery struct {
	// unused field # 1
	Role           *string                  `thrift:"role,2" json:"role,omitempty"`
	JobKey         *JobKey                  `thrift:"jobKey,3" json:"jobKey,omitempty"`
	User           *string                  `thrift:"user,4" json:"user,omitempty"`
	UpdateStatuses map[JobUpdateStatus]bool `thrift:"updateStatuses,5" json:"updateStatuses,omitempty"`
	Offset         int32                    `thrift:"offset,6" json:"offset"`
	Limit          int32                    `thrift:"limit,7" json:"limit"`
	Key            *JobUpdateKey            `thrift:"key,8" json:"key,omitempty"`
}

func NewJobUpdateQuery() *JobUpdateQuery {
	return &JobUpdateQuery{}
}

var JobUpdateQuery_Role_DEFAULT string

func (p *JobUpdateQuery) GetRole() string {
	if !p.IsSetRole() {
		return JobUpdateQuery_Role_DEFAULT
	}
	return *p.Role
}

var JobUpdateQuery_Key_DEFAULT *JobUpdateKey

func (p *JobUpdateQuery) GetKey() *JobUpdateKey {
	if !p.IsSetKey() {
		return JobUpdateQuery_Key_DEFAULT
	}
	return p.Key
}

var JobUpdateQuery_JobKey_DEFAULT *JobKey

func (p *JobUpdateQuery) GetJobKey() *JobKey {
	if !p.IsSetJobKey() {
		return JobUpdateQuery_JobKey_DEFAULT
	}
	return p.JobKey
}

var JobUpdateQuery_User_DEFAULT string

func (p *JobUpdateQuery) GetUser() string {
	if !p.IsSetUser() {
		return JobUpdateQuery_User_DEFAULT
	}
	return *p.User
}

var JobUpdateQuery_UpdateStatuses_DEFAULT map[JobUpdateStatus]bool

func (p *JobUpdateQuery) GetUpdateStatuses() map[JobUpdateStatus]bool {
	return p.UpdateStatuses
}

func (p *JobUpdateQuery) GetOffset() int32 {
	return p.Offset
}

func (p *JobUpdateQuery) GetLimit() int32 {
	return p.Limit
}
func (p *JobUpdateQuery) IsSetRole() bool {
	return p.Role != nil
}

func (p *JobUpdateQuery) IsSetKey() bool {
	return p.Key != nil
}

func (p *JobUpdateQuery) IsSetJobKey() bool {
	return p.JobKey != nil
}

func (p *JobUpdateQuery) IsSetUser() bool {
	return p.User != nil
}

func (p *JobUpdateQuery) IsSetUpdateStatuses() bool {
	return p.UpdateStatuses != nil
}

func (p *JobUpdateQuery) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 8:
			if err := p.readField8(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.readField5(iprot); err != nil {
				return err
			}
		case 6:
			if err := p.readField6(iprot); err != nil {
				return err
			}
		case 7:
			if err := p.readField7(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobUpdateQuery) readField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.Role = &v
	}
	return nil
}

func (p *JobUpdateQuery) readField8(iprot thrift.TProtocol) error {
	p.Key = &JobUpdateKey{}
	if err := p.Key.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err)
	}
	return nil
}

func (p *JobUpdateQuery) readField3(iprot thrift.TProtocol) error {
	p.JobKey = &JobKey{}
	if err := p.JobKey.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JobKey), err)
	}
	return nil
}

func (p *JobUpdateQuery) readField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.User = &v
	}
	return nil
}

func (p *JobUpdateQuery) readField5(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[JobUpdateStatus]bool, size)
	p.UpdateStatuses = tSet
	for i := 0; i < size; i++ {
		var _elem33 JobUpdateStatus
		if v, err := iprot.ReadI32(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			temp := JobUpdateStatus(v)
			_elem33 = temp
		}
		p.UpdateStatuses[_elem33] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *JobUpdateQuery) readField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.Offset = v
	}
	return nil
}

func (p *JobUpdateQuery) readField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 7: ", err)
	} else {
		p.Limit = v
	}
	return nil
}

func (p *JobUpdateQuery) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobUpdateQuery"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := p.writeField6(oprot); err != nil {
		return err
	}
	if err := p.writeField7(oprot); err != nil {
		return err
	}
	if err := p.writeField8(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobUpdateQuery) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetRole() {
		if err := oprot.WriteFieldBegin("role", thrift.STRING, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:role: ", p), err)
		}
		if err := oprot.WriteString(string(*p.Role)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.role (2) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:role: ", p), err)
		}
	}
	return err
}

func (p *JobUpdateQuery) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetJobKey() {
		if err := oprot.WriteFieldBegin("jobKey", thrift.STRUCT, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:jobKey: ", p), err)
		}
		if err := p.JobKey.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JobKey), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:jobKey: ", p), err)
		}
	}
	return err
}

func (p *JobUpdateQuery) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetUser() {
		if err := oprot.WriteFieldBegin("user", thrift.STRING, 4); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:user: ", p), err)
		}
		if err := oprot.WriteString(string(*p.User)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.user (4) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 4:user: ", p), err)
		}
	}
	return err
}

func (p *JobUpdateQuery) writeField5(oprot thrift.TProtocol) (err error) {
	if p.IsSetUpdateStatuses() {
		if err := oprot.WriteFieldBegin("updateStatuses", thrift.SET, 5); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:updateStatuses: ", p), err)
		}
		if err := oprot.WriteSetBegin(thrift.I32, len(p.UpdateStatuses)); err != nil {
			return thrift.PrependError("error writing set begin: ", err)
		}
		for v, _ := range p.UpdateStatuses {
			if err := oprot.WriteI32(int32(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
		}
		if err := oprot.WriteSetEnd(); err != nil {
			return thrift.PrependError("error writing set end: ", err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 5:updateStatuses: ", p), err)
		}
	}
	return err
}

func (p *JobUpdateQuery) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("offset", thrift.I32, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:offset: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Offset)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.offset (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:offset: ", p), err)
	}
	return err
}

func (p *JobUpdateQuery) writeField7(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("limit", thrift.I32, 7); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:limit: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Limit)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.limit (7) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 7:limit: ", p), err)
	}
	return err
}

func (p *JobUpdateQuery) writeField8(oprot thrift.TProtocol) (err error) {
	if p.IsSetKey() {
		if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 8); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:key: ", p), err)
		}
		if err := p.Key.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 8:key: ", p), err)
		}
	}
	return err
}

func (p *JobUpdateQuery) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobUpdateQuery(%+v)", *p)
}

// Attributes:
//  - Backups
type ListBackupsResult_ struct {
	Backups map[string]bool `thrift:"backups,1" json:"backups"`
}

func NewListBackupsResult_() *ListBackupsResult_ {
	return &ListBackupsResult_{}
}

func (p *ListBackupsResult_) GetBackups() map[string]bool {
	return p.Backups
}
func (p *ListBackupsResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ListBackupsResult_) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[string]bool, size)
	p.Backups = tSet
	for i := 0; i < size; i++ {
		var _elem34 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem34 = v
		}
		p.Backups[_elem34] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *ListBackupsResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ListBackupsResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ListBackupsResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("backups", thrift.SET, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backups: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRING, len(p.Backups)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Backups {
		if err := oprot.WriteString(string(v)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backups: ", p), err)
	}
	return err
}

func (p *ListBackupsResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ListBackupsResult_(%+v)", *p)
}

// Attributes:
//  - Statuses
type StartMaintenanceResult_ struct {
	Statuses map[*HostStatus]bool `thrift:"statuses,1" json:"statuses"`
}

func NewStartMaintenanceResult_() *StartMaintenanceResult_ {
	return &StartMaintenanceResult_{}
}

func (p *StartMaintenanceResult_) GetStatuses() map[*HostStatus]bool {
	return p.Statuses
}
func (p *StartMaintenanceResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *StartMaintenanceResult_) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*HostStatus]bool, size)
	p.Statuses = tSet
	for i := 0; i < size; i++ {
		_elem35 := &HostStatus{}
		if err := _elem35.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err)
		}
		p.Statuses[_elem35] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *StartMaintenanceResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("StartMaintenanceResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *StartMaintenanceResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("statuses", thrift.SET, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:statuses: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Statuses)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Statuses {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:statuses: ", p), err)
	}
	return err
}

func (p *StartMaintenanceResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("StartMaintenanceResult_(%+v)", *p)
}

// Attributes:
//  - Statuses
type DrainHostsResult_ struct {
	Statuses map[*HostStatus]bool `thrift:"statuses,1" json:"statuses"`
}

func NewDrainHostsResult_() *DrainHostsResult_ {
	return &DrainHostsResult_{}
}

func (p *DrainHostsResult_) GetStatuses() map[*HostStatus]bool {
	return p.Statuses
}
func (p *DrainHostsResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *DrainHostsResult_) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*HostStatus]bool, size)
	p.Statuses = tSet
	for i := 0; i < size; i++ {
		_elem36 := &HostStatus{}
		if err := _elem36.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem36), err)
		}
		p.Statuses[_elem36] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *DrainHostsResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("DrainHostsResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *DrainHostsResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("statuses", thrift.SET, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:statuses: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Statuses)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Statuses {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:statuses: ", p), err)
	}
	return err
}

func (p *DrainHostsResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("DrainHostsResult_(%+v)", *p)
}

// Attributes:
//  - Tasks
type QueryRecoveryResult_ struct {
	Tasks map[*ScheduledTask]bool `thrift:"tasks,1" json:"tasks"`
}

func NewQueryRecoveryResult_() *QueryRecoveryResult_ {
	return &QueryRecoveryResult_{}
}

func (p *QueryRecoveryResult_) GetTasks() map[*ScheduledTask]bool {
	return p.Tasks
}
func (p *QueryRecoveryResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *QueryRecoveryResult_) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*ScheduledTask]bool, size)
	p.Tasks = tSet
	for i := 0; i < size; i++ {
		_elem37 := &ScheduledTask{}
		if err := _elem37.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem37), err)
		}
		p.Tasks[_elem37] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *QueryRecoveryResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("QueryRecoveryResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *QueryRecoveryResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("tasks", thrift.SET, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tasks: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Tasks)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Tasks {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tasks: ", p), err)
	}
	return err
}

func (p *QueryRecoveryResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("QueryRecoveryResult_(%+v)", *p)
}

// Attributes:
//  - Statuses
type MaintenanceStatusResult_ struct {
	Statuses map[*HostStatus]bool `thrift:"statuses,1" json:"statuses"`
}

func NewMaintenanceStatusResult_() *MaintenanceStatusResult_ {
	return &MaintenanceStatusResult_{}
}

func (p *MaintenanceStatusResult_) GetStatuses() map[*HostStatus]bool {
	return p.Statuses
}
func (p *MaintenanceStatusResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *MaintenanceStatusResult_) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*HostStatus]bool, size)
	p.Statuses = tSet
	for i := 0; i < size; i++ {
		_elem38 := &HostStatus{}
		if err := _elem38.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem38), err)
		}
		p.Statuses[_elem38] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *MaintenanceStatusResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("MaintenanceStatusResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *MaintenanceStatusResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("statuses", thrift.SET, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:statuses: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Statuses)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Statuses {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:statuses: ", p), err)
	}
	return err
}

func (p *MaintenanceStatusResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("MaintenanceStatusResult_(%+v)", *p)
}

// Attributes:
//  - Statuses
type EndMaintenanceResult_ struct {
	Statuses map[*HostStatus]bool `thrift:"statuses,1" json:"statuses"`
}

func NewEndMaintenanceResult_() *EndMaintenanceResult_ {
	return &EndMaintenanceResult_{}
}

func (p *EndMaintenanceResult_) GetStatuses() map[*HostStatus]bool {
	return p.Statuses
}
func (p *EndMaintenanceResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *EndMaintenanceResult_) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*HostStatus]bool, size)
	p.Statuses = tSet
	for i := 0; i < size; i++ {
		_elem39 := &HostStatus{}
		if err := _elem39.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem39), err)
		}
		p.Statuses[_elem39] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *EndMaintenanceResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("EndMaintenanceResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *EndMaintenanceResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("statuses", thrift.SET, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:statuses: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Statuses)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Statuses {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:statuses: ", p), err)
	}
	return err
}

func (p *EndMaintenanceResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("EndMaintenanceResult_(%+v)", *p)
}

// Attributes:
//  - Summaries
type RoleSummaryResult_ struct {
	Summaries map[*RoleSummary]bool `thrift:"summaries,1" json:"summaries"`
}

func NewRoleSummaryResult_() *RoleSummaryResult_ {
	return &RoleSummaryResult_{}
}

func (p *RoleSummaryResult_) GetSummaries() map[*RoleSummary]bool {
	return p.Summaries
}
func (p *RoleSummaryResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *RoleSummaryResult_) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*RoleSummary]bool, size)
	p.Summaries = tSet
	for i := 0; i < size; i++ {
		_elem40 := &RoleSummary{}
		if err := _elem40.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem40), err)
		}
		p.Summaries[_elem40] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *RoleSummaryResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("RoleSummaryResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *RoleSummaryResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("summaries", thrift.SET, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:summaries: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Summaries)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Summaries {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:summaries: ", p), err)
	}
	return err
}

func (p *RoleSummaryResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("RoleSummaryResult_(%+v)", *p)
}

// Attributes:
//  - Summaries
type JobSummaryResult_ struct {
	Summaries map[*JobSummary]bool `thrift:"summaries,1" json:"summaries"`
}

func NewJobSummaryResult_() *JobSummaryResult_ {
	return &JobSummaryResult_{}
}

func (p *JobSummaryResult_) GetSummaries() map[*JobSummary]bool {
	return p.Summaries
}
func (p *JobSummaryResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *JobSummaryResult_) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*JobSummary]bool, size)
	p.Summaries = tSet
	for i := 0; i < size; i++ {
		_elem41 := &JobSummary{}
		if err := _elem41.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem41), err)
		}
		p.Summaries[_elem41] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *JobSummaryResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("JobSummaryResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *JobSummaryResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("summaries", thrift.SET, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:summaries: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Summaries)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Summaries {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:summaries: ", p), err)
	}
	return err
}

func (p *JobSummaryResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("JobSummaryResult_(%+v)", *p)
}

// Attributes:
//  - Summary
type ConfigSummaryResult_ struct {
	Summary *ConfigSummary `thrift:"summary,1" json:"summary"`
}

func NewConfigSummaryResult_() *ConfigSummaryResult_ {
	return &ConfigSummaryResult_{}
}

var ConfigSummaryResult__Summary_DEFAULT *ConfigSummary

func (p *ConfigSummaryResult_) GetSummary() *ConfigSummary {
	if !p.IsSetSummary() {
		return ConfigSummaryResult__Summary_DEFAULT
	}
	return p.Summary
}
func (p *ConfigSummaryResult_) IsSetSummary() bool {
	return p.Summary != nil
}

func (p *ConfigSummaryResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ConfigSummaryResult_) readField1(iprot thrift.TProtocol) error {
	p.Summary = &ConfigSummary{}
	if err := p.Summary.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Summary), err)
	}
	return nil
}

func (p *ConfigSummaryResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ConfigSummaryResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ConfigSummaryResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("summary", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:summary: ", p), err)
	}
	if err := p.Summary.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Summary), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:summary: ", p), err)
	}
	return err
}

func (p *ConfigSummaryResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ConfigSummaryResult_(%+v)", *p)
}

// Attributes:
//  - Reasons
type GetPendingReasonResult_ struct {
	Reasons map[*PendingReason]bool `thrift:"reasons,1" json:"reasons"`
}

func NewGetPendingReasonResult_() *GetPendingReasonResult_ {
	return &GetPendingReasonResult_{}
}

func (p *GetPendingReasonResult_) GetReasons() map[*PendingReason]bool {
	return p.Reasons
}
func (p *GetPendingReasonResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *GetPendingReasonResult_) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*PendingReason]bool, size)
	p.Reasons = tSet
	for i := 0; i < size; i++ {
		_elem42 := &PendingReason{}
		if err := _elem42.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem42), err)
		}
		p.Reasons[_elem42] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *GetPendingReasonResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("GetPendingReasonResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *GetPendingReasonResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("reasons", thrift.SET, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:reasons: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Reasons)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Reasons {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:reasons: ", p), err)
	}
	return err
}

func (p *GetPendingReasonResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("GetPendingReasonResult_(%+v)", *p)
}

// Result of the startUpdate call.
//
// Attributes:
//  - Key: Unique identifier for the job update.
//  - UpdateSummary: Summary of the update that is in progress for the given JobKey.
type StartJobUpdateResult_ struct {
	Key           *JobUpdateKey     `thrift:"key,1" json:"key"`
	UpdateSummary *JobUpdateSummary `thrift:"updateSummary,2" json:"updateSummary,omitempty"`
}

func NewStartJobUpdateResult_() *StartJobUpdateResult_ {
	return &StartJobUpdateResult_{}
}

var StartJobUpdateResult__Key_DEFAULT *JobUpdateKey

func (p *StartJobUpdateResult_) GetKey() *JobUpdateKey {
	if !p.IsSetKey() {
		return StartJobUpdateResult__Key_DEFAULT
	}
	return p.Key
}

var StartJobUpdateResult__UpdateSummary_DEFAULT *JobUpdateSummary

func (p *StartJobUpdateResult_) GetUpdateSummary() *JobUpdateSummary {
	if !p.IsSetUpdateSummary() {
		return StartJobUpdateResult__UpdateSummary_DEFAULT
	}
	return p.UpdateSummary
}
func (p *StartJobUpdateResult_) IsSetKey() bool {
	return p.Key != nil
}

func (p *StartJobUpdateResult_) IsSetUpdateSummary() bool {
	return p.UpdateSummary != nil
}

func (p *StartJobUpdateResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *StartJobUpdateResult_) readField1(iprot thrift.TProtocol) error {
	p.Key = &JobUpdateKey{}
	if err := p.Key.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err)
	}
	return nil
}

func (p *StartJobUpdateResult_) readField2(iprot thrift.TProtocol) error {
	p.UpdateSummary = &JobUpdateSummary{}
	if err := p.UpdateSummary.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UpdateSummary), err)
	}
	return nil
}

func (p *StartJobUpdateResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("StartJobUpdateResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *StartJobUpdateResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err)
	}
	if err := p.Key.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err)
	}
	return err
}

func (p *StartJobUpdateResult_) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetUpdateSummary() {
		if err := oprot.WriteFieldBegin("updateSummary", thrift.STRUCT, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:updateSummary: ", p), err)
		}
		if err := p.UpdateSummary.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UpdateSummary), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:updateSummary: ", p), err)
		}
	}
	return err
}

func (p *StartJobUpdateResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("StartJobUpdateResult_(%+v)", *p)
}

// Result of the getJobUpdateSummaries call.
//
// Attributes:
//  - UpdateSummaries
type GetJobUpdateSummariesResult_ struct {
	UpdateSummaries []*JobUpdateSummary `thrift:"updateSummaries,1" json:"updateSummaries"`
}

func NewGetJobUpdateSummariesResult_() *GetJobUpdateSummariesResult_ {
	return &GetJobUpdateSummariesResult_{}
}

func (p *GetJobUpdateSummariesResult_) GetUpdateSummaries() []*JobUpdateSummary {
	return p.UpdateSummaries
}
func (p *GetJobUpdateSummariesResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *GetJobUpdateSummariesResult_) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*JobUpdateSummary, 0, size)
	p.UpdateSummaries = tSlice
	for i := 0; i < size; i++ {
		_elem43 := &JobUpdateSummary{}
		if err := _elem43.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem43), err)
		}
		p.UpdateSummaries = append(p.UpdateSummaries, _elem43)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *GetJobUpdateSummariesResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("GetJobUpdateSummariesResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *GetJobUpdateSummariesResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("updateSummaries", thrift.LIST, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:updateSummaries: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.UpdateSummaries)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.UpdateSummaries {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:updateSummaries: ", p), err)
	}
	return err
}

func (p *GetJobUpdateSummariesResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("GetJobUpdateSummariesResult_(%+v)", *p)
}

// Result of the getJobUpdateDetails call.
//
// Attributes:
//  - Details
//  - DetailsList
type GetJobUpdateDetailsResult_ struct {
	Details     *JobUpdateDetails   `thrift:"details,1" json:"details"`
	DetailsList []*JobUpdateDetails `thrift:"detailsList,2" json:"detailsList"`
}

func NewGetJobUpdateDetailsResult_() *GetJobUpdateDetailsResult_ {
	return &GetJobUpdateDetailsResult_{}
}

var GetJobUpdateDetailsResult__Details_DEFAULT *JobUpdateDetails

func (p *GetJobUpdateDetailsResult_) GetDetails() *JobUpdateDetails {
	if !p.IsSetDetails() {
		return GetJobUpdateDetailsResult__Details_DEFAULT
	}
	return p.Details
}

func (p *GetJobUpdateDetailsResult_) GetDetailsList() []*JobUpdateDetails {
	return p.DetailsList
}
func (p *GetJobUpdateDetailsResult_) IsSetDetails() bool {
	return p.Details != nil
}

func (p *GetJobUpdateDetailsResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *GetJobUpdateDetailsResult_) readField1(iprot thrift.TProtocol) error {
	p.Details = &JobUpdateDetails{}
	if err := p.Details.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Details), err)
	}
	return nil
}

func (p *GetJobUpdateDetailsResult_) readField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*JobUpdateDetails, 0, size)
	p.DetailsList = tSlice
	for i := 0; i < size; i++ {
		_elem44 := &JobUpdateDetails{}
		if err := _elem44.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem44), err)
		}
		p.DetailsList = append(p.DetailsList, _elem44)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *GetJobUpdateDetailsResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("GetJobUpdateDetailsResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *GetJobUpdateDetailsResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("details", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:details: ", p), err)
	}
	if err := p.Details.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Details), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:details: ", p), err)
	}
	return err
}

func (p *GetJobUpdateDetailsResult_) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("detailsList", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:detailsList: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.DetailsList)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.DetailsList {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:detailsList: ", p), err)
	}
	return err
}

func (p *GetJobUpdateDetailsResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("GetJobUpdateDetailsResult_(%+v)", *p)
}

// Result of the pulseJobUpdate call.
//
// Attributes:
//  - Status
type PulseJobUpdateResult_ struct {
	Status JobUpdatePulseStatus `thrift:"status,1" json:"status"`
}

func NewPulseJobUpdateResult_() *PulseJobUpdateResult_ {
	return &PulseJobUpdateResult_{}
}

func (p *PulseJobUpdateResult_) GetStatus() JobUpdatePulseStatus {
	return p.Status
}
func (p *PulseJobUpdateResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *PulseJobUpdateResult_) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		temp := JobUpdatePulseStatus(v)
		p.Status = temp
	}
	return nil
}

func (p *PulseJobUpdateResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("PulseJobUpdateResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *PulseJobUpdateResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("status", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.Status)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.status (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err)
	}
	return err
}

func (p *PulseJobUpdateResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PulseJobUpdateResult_(%+v)", *p)
}

// Attributes:
//  - Add: Instance addition diff details.
//  - Remove: Instance removal diff details.
//  - Update: Instance update diff details.
//  - Unchanged: Instances unchanged by the update.
type GetJobUpdateDiffResult_ struct {
	Add       map[*ConfigGroup]bool `thrift:"add,1" json:"add"`
	Remove    map[*ConfigGroup]bool `thrift:"remove,2" json:"remove"`
	Update    map[*ConfigGroup]bool `thrift:"update,3" json:"update"`
	Unchanged map[*ConfigGroup]bool `thrift:"unchanged,4" json:"unchanged"`
}

func NewGetJobUpdateDiffResult_() *GetJobUpdateDiffResult_ {
	return &GetJobUpdateDiffResult_{}
}

func (p *GetJobUpdateDiffResult_) GetAdd() map[*ConfigGroup]bool {
	return p.Add
}

func (p *GetJobUpdateDiffResult_) GetRemove() map[*ConfigGroup]bool {
	return p.Remove
}

func (p *GetJobUpdateDiffResult_) GetUpdate() map[*ConfigGroup]bool {
	return p.Update
}

func (p *GetJobUpdateDiffResult_) GetUnchanged() map[*ConfigGroup]bool {
	return p.Unchanged
}
func (p *GetJobUpdateDiffResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *GetJobUpdateDiffResult_) readField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*ConfigGroup]bool, size)
	p.Add = tSet
	for i := 0; i < size; i++ {
		_elem45 := &ConfigGroup{}
		if err := _elem45.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem45), err)
		}
		p.Add[_elem45] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *GetJobUpdateDiffResult_) readField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*ConfigGroup]bool, size)
	p.Remove = tSet
	for i := 0; i < size; i++ {
		_elem46 := &ConfigGroup{}
		if err := _elem46.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err)
		}
		p.Remove[_elem46] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *GetJobUpdateDiffResult_) readField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*ConfigGroup]bool, size)
	p.Update = tSet
	for i := 0; i < size; i++ {
		_elem47 := &ConfigGroup{}
		if err := _elem47.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem47), err)
		}
		p.Update[_elem47] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *GetJobUpdateDiffResult_) readField4(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*ConfigGroup]bool, size)
	p.Unchanged = tSet
	for i := 0; i < size; i++ {
		_elem48 := &ConfigGroup{}
		if err := _elem48.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem48), err)
		}
		p.Unchanged[_elem48] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *GetJobUpdateDiffResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("GetJobUpdateDiffResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *GetJobUpdateDiffResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("add", thrift.SET, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:add: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Add)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Add {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:add: ", p), err)
	}
	return err
}

func (p *GetJobUpdateDiffResult_) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("remove", thrift.SET, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:remove: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Remove)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Remove {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:remove: ", p), err)
	}
	return err
}

func (p *GetJobUpdateDiffResult_) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("update", thrift.SET, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:update: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Update)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Update {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:update: ", p), err)
	}
	return err
}

func (p *GetJobUpdateDiffResult_) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("unchanged", thrift.SET, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:unchanged: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Unchanged)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Unchanged {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:unchanged: ", p), err)
	}
	return err
}

func (p *GetJobUpdateDiffResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("GetJobUpdateDiffResult_(%+v)", *p)
}

// Tier information.
//
// Attributes:
//  - Name: Name of tier.
//  - Settings: Tier attributes.
type TierConfig struct {
	Name     string            `thrift:"name,1" json:"name"`
	Settings map[string]string `thrift:"settings,2" json:"settings"`
}

func NewTierConfig() *TierConfig {
	return &TierConfig{}
}

func (p *TierConfig) GetName() string {
	return p.Name
}

func (p *TierConfig) GetSettings() map[string]string {
	return p.Settings
}
func (p *TierConfig) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *TierConfig) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Name = v
	}
	return nil
}

func (p *TierConfig) readField2(iprot thrift.TProtocol) error {
	_, _, size, err := iprot.ReadMapBegin()
	if err != nil {
		return thrift.PrependError("error reading map begin: ", err)
	}
	tMap := make(map[string]string, size)
	p.Settings = tMap
	for i := 0; i < size; i++ {
		var _key49 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_key49 = v
		}
		var _val50 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_val50 = v
		}
		p.Settings[_key49] = _val50
	}
	if err := iprot.ReadMapEnd(); err != nil {
		return thrift.PrependError("error reading map end: ", err)
	}
	return nil
}

func (p *TierConfig) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("TierConfig"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *TierConfig) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err)
	}
	if err := oprot.WriteString(string(p.Name)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err)
	}
	return err
}

func (p *TierConfig) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("settings", thrift.MAP, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:settings: ", p), err)
	}
	if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Settings)); err != nil {
		return thrift.PrependError("error writing map begin: ", err)
	}
	for k, v := range p.Settings {
		if err := oprot.WriteString(string(k)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
		}
		if err := oprot.WriteString(string(v)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
		}
	}
	if err := oprot.WriteMapEnd(); err != nil {
		return thrift.PrependError("error writing map end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:settings: ", p), err)
	}
	return err
}

func (p *TierConfig) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TierConfig(%+v)", *p)
}

// Result of the getTierConfigResult call.
//
// Attributes:
//  - DefaultTierName: Name of the default tier.
//  - Tiers: Set of tier configurations.
type GetTierConfigResult_ struct {
	DefaultTierName string               `thrift:"defaultTierName,1" json:"defaultTierName"`
	Tiers           map[*TierConfig]bool `thrift:"tiers,2" json:"tiers"`
}

func NewGetTierConfigResult_() *GetTierConfigResult_ {
	return &GetTierConfigResult_{}
}

func (p *GetTierConfigResult_) GetDefaultTierName() string {
	return p.DefaultTierName
}

func (p *GetTierConfigResult_) GetTiers() map[*TierConfig]bool {
	return p.Tiers
}
func (p *GetTierConfigResult_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 2:
			if err := p.readField2(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *GetTierConfigResult_) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.DefaultTierName = v
	}
	return nil
}

func (p *GetTierConfigResult_) readField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin()
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make(map[*TierConfig]bool, size)
	p.Tiers = tSet
	for i := 0; i < size; i++ {
		_elem51 := &TierConfig{}
		if err := _elem51.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err)
		}
		p.Tiers[_elem51] = true
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *GetTierConfigResult_) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("GetTierConfigResult"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField2(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *GetTierConfigResult_) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("defaultTierName", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:defaultTierName: ", p), err)
	}
	if err := oprot.WriteString(string(p.DefaultTierName)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.defaultTierName (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:defaultTierName: ", p), err)
	}
	return err
}

func (p *GetTierConfigResult_) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("tiers", thrift.SET, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tiers: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.STRUCT, len(p.Tiers)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for v, _ := range p.Tiers {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteSetEnd(); err != nil {
		return thrift.PrependError("error writing set end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tiers: ", p), err)
	}
	return err
}

func (p *GetTierConfigResult_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("GetTierConfigResult_(%+v)", *p)
}

// Information about the scheduler.
//
// Attributes:
//  - ClusterName
//  - StatsUrlPrefix: A url prefix for job container stats.
type ServerInfo struct {
	ClusterName string `thrift:"clusterName,1" json:"clusterName"`
	// unused field # 2
	StatsUrlPrefix string `thrift:"statsUrlPrefix,3" json:"statsUrlPrefix"`
}

func NewServerInfo() *ServerInfo {
	return &ServerInfo{}
}

func (p *ServerInfo) GetClusterName() string {
	return p.ClusterName
}

func (p *ServerInfo) GetStatsUrlPrefix() string {
	return p.StatsUrlPrefix
}
func (p *ServerInfo) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ServerInfo) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.ClusterName = v
	}
	return nil
}

func (p *ServerInfo) readField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.StatsUrlPrefix = v
	}
	return nil
}

func (p *ServerInfo) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ServerInfo"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ServerInfo) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("clusterName", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:clusterName: ", p), err)
	}
	if err := oprot.WriteString(string(p.ClusterName)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.clusterName (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:clusterName: ", p), err)
	}
	return err
}

func (p *ServerInfo) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("statsUrlPrefix", thrift.STRING, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statsUrlPrefix: ", p), err)
	}
	if err := oprot.WriteString(string(p.StatsUrlPrefix)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.statsUrlPrefix (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statsUrlPrefix: ", p), err)
	}
	return err
}

func (p *ServerInfo) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ServerInfo(%+v)", *p)
}

// Attributes:
//  - PopulateJobResult_
//  - ScheduleStatusResult_
//  - GetJobsResult_
//  - GetQuotaResult_
//  - ListBackupsResult_
//  - StartMaintenanceResult_
//  - DrainHostsResult_
//  - QueryRecoveryResult_
//  - MaintenanceStatusResult_
//  - EndMaintenanceResult_
//  - RoleSummaryResult_
//  - JobSummaryResult_
//  - ConfigSummaryResult_
//  - GetPendingReasonResult_
//  - StartJobUpdateResult_
//  - GetJobUpdateSummariesResult_
//  - GetJobUpdateDetailsResult_
//  - PulseJobUpdateResult_
//  - GetJobUpdateDiffResult_
//  - GetTierConfigResult_
type Result_ struct {
	PopulateJobResult_ *PopulateJobResult_ `thrift:"populateJobResult,1" json:"populateJobResult,omitempty"`
	// unused field # 2
	ScheduleStatusResult_    *ScheduleStatusResult_    `thrift:"scheduleStatusResult,3" json:"scheduleStatusResult,omitempty"`
	GetJobsResult_           *GetJobsResult_           `thrift:"getJobsResult,4" json:"getJobsResult,omitempty"`
	GetQuotaResult_          *GetQuotaResult_          `thrift:"getQuotaResult,5" json:"getQuotaResult,omitempty"`
	ListBackupsResult_       *ListBackupsResult_       `thrift:"listBackupsResult,6" json:"listBackupsResult,omitempty"`
	StartMaintenanceResult_  *StartMaintenanceResult_  `thrift:"startMaintenanceResult,7" json:"startMaintenanceResult,omitempty"`
	DrainHostsResult_        *DrainHostsResult_        `thrift:"drainHostsResult,8" json:"drainHostsResult,omitempty"`
	QueryRecoveryResult_     *QueryRecoveryResult_     `thrift:"queryRecoveryResult,9" json:"queryRecoveryResult,omitempty"`
	MaintenanceStatusResult_ *MaintenanceStatusResult_ `thrift:"maintenanceStatusResult,10" json:"maintenanceStatusResult,omitempty"`
	EndMaintenanceResult_    *EndMaintenanceResult_    `thrift:"endMaintenanceResult,11" json:"endMaintenanceResult,omitempty"`
	// unused fields # 12 to 16
	RoleSummaryResult_ *RoleSummaryResult_ `thrift:"roleSummaryResult,17" json:"roleSummaryResult,omitempty"`
	JobSummaryResult_  *JobSummaryResult_  `thrift:"jobSummaryResult,18" json:"jobSummaryResult,omitempty"`
	// unused field # 19
	ConfigSummaryResult_         *ConfigSummaryResult_         `thrift:"configSummaryResult,20" json:"configSummaryResult,omitempty"`
	GetPendingReasonResult_      *GetPendingReasonResult_      `thrift:"getPendingReasonResult,21" json:"getPendingReasonResult,omitempty"`
	StartJobUpdateResult_        *StartJobUpdateResult_        `thrift:"startJobUpdateResult,22" json:"startJobUpdateResult,omitempty"`
	GetJobUpdateSummariesResult_ *GetJobUpdateSummariesResult_ `thrift:"getJobUpdateSummariesResult,23" json:"getJobUpdateSummariesResult,omitempty"`
	GetJobUpdateDetailsResult_   *GetJobUpdateDetailsResult_   `thrift:"getJobUpdateDetailsResult,24" json:"getJobUpdateDetailsResult,omitempty"`
	PulseJobUpdateResult_        *PulseJobUpdateResult_        `thrift:"pulseJobUpdateResult,25" json:"pulseJobUpdateResult,omitempty"`
	GetJobUpdateDiffResult_      *GetJobUpdateDiffResult_      `thrift:"getJobUpdateDiffResult,26" json:"getJobUpdateDiffResult,omitempty"`
	GetTierConfigResult_         *GetTierConfigResult_         `thrift:"getTierConfigResult,27" json:"getTierConfigResult,omitempty"`
}

func NewResult_() *Result_ {
	return &Result_{}
}

var Result__PopulateJobResult__DEFAULT *PopulateJobResult_

func (p *Result_) GetPopulateJobResult_() *PopulateJobResult_ {
	if !p.IsSetPopulateJobResult_() {
		return Result__PopulateJobResult__DEFAULT
	}
	return p.PopulateJobResult_
}

var Result__ScheduleStatusResult__DEFAULT *ScheduleStatusResult_

func (p *Result_) GetScheduleStatusResult_() *ScheduleStatusResult_ {
	if !p.IsSetScheduleStatusResult_() {
		return Result__ScheduleStatusResult__DEFAULT
	}
	return p.ScheduleStatusResult_
}

var Result__GetJobsResult__DEFAULT *GetJobsResult_

func (p *Result_) GetGetJobsResult_() *GetJobsResult_ {
	if !p.IsSetGetJobsResult_() {
		return Result__GetJobsResult__DEFAULT
	}
	return p.GetJobsResult_
}

var Result__GetQuotaResult__DEFAULT *GetQuotaResult_

func (p *Result_) GetGetQuotaResult_() *GetQuotaResult_ {
	if !p.IsSetGetQuotaResult_() {
		return Result__GetQuotaResult__DEFAULT
	}
	return p.GetQuotaResult_
}

var Result__ListBackupsResult__DEFAULT *ListBackupsResult_

func (p *Result_) GetListBackupsResult_() *ListBackupsResult_ {
	if !p.IsSetListBackupsResult_() {
		return Result__ListBackupsResult__DEFAULT
	}
	return p.ListBackupsResult_
}

var Result__StartMaintenanceResult__DEFAULT *StartMaintenanceResult_

func (p *Result_) GetStartMaintenanceResult_() *StartMaintenanceResult_ {
	if !p.IsSetStartMaintenanceResult_() {
		return Result__StartMaintenanceResult__DEFAULT
	}
	return p.StartMaintenanceResult_
}

var Result__DrainHostsResult__DEFAULT *DrainHostsResult_

func (p *Result_) GetDrainHostsResult_() *DrainHostsResult_ {
	if !p.IsSetDrainHostsResult_() {
		return Result__DrainHostsResult__DEFAULT
	}
	return p.DrainHostsResult_
}

var Result__QueryRecoveryResult__DEFAULT *QueryRecoveryResult_

func (p *Result_) GetQueryRecoveryResult_() *QueryRecoveryResult_ {
	if !p.IsSetQueryRecoveryResult_() {
		return Result__QueryRecoveryResult__DEFAULT
	}
	return p.QueryRecoveryResult_
}

var Result__MaintenanceStatusResult__DEFAULT *MaintenanceStatusResult_

func (p *Result_) GetMaintenanceStatusResult_() *MaintenanceStatusResult_ {
	if !p.IsSetMaintenanceStatusResult_() {
		return Result__MaintenanceStatusResult__DEFAULT
	}
	return p.MaintenanceStatusResult_
}

var Result__EndMaintenanceResult__DEFAULT *EndMaintenanceResult_

func (p *Result_) GetEndMaintenanceResult_() *EndMaintenanceResult_ {
	if !p.IsSetEndMaintenanceResult_() {
		return Result__EndMaintenanceResult__DEFAULT
	}
	return p.EndMaintenanceResult_
}

var Result__RoleSummaryResult__DEFAULT *RoleSummaryResult_

func (p *Result_) GetRoleSummaryResult_() *RoleSummaryResult_ {
	if !p.IsSetRoleSummaryResult_() {
		return Result__RoleSummaryResult__DEFAULT
	}
	return p.RoleSummaryResult_
}

var Result__JobSummaryResult__DEFAULT *JobSummaryResult_

func (p *Result_) GetJobSummaryResult_() *JobSummaryResult_ {
	if !p.IsSetJobSummaryResult_() {
		return Result__JobSummaryResult__DEFAULT
	}
	return p.JobSummaryResult_
}

var Result__ConfigSummaryResult__DEFAULT *ConfigSummaryResult_

func (p *Result_) GetConfigSummaryResult_() *ConfigSummaryResult_ {
	if !p.IsSetConfigSummaryResult_() {
		return Result__ConfigSummaryResult__DEFAULT
	}
	return p.ConfigSummaryResult_
}

var Result__GetPendingReasonResult__DEFAULT *GetPendingReasonResult_

func (p *Result_) GetGetPendingReasonResult_() *GetPendingReasonResult_ {
	if !p.IsSetGetPendingReasonResult_() {
		return Result__GetPendingReasonResult__DEFAULT
	}
	return p.GetPendingReasonResult_
}

var Result__StartJobUpdateResult__DEFAULT *StartJobUpdateResult_

func (p *Result_) GetStartJobUpdateResult_() *StartJobUpdateResult_ {
	if !p.IsSetStartJobUpdateResult_() {
		return Result__StartJobUpdateResult__DEFAULT
	}
	return p.StartJobUpdateResult_
}

var Result__GetJobUpdateSummariesResult__DEFAULT *GetJobUpdateSummariesResult_

func (p *Result_) GetGetJobUpdateSummariesResult_() *GetJobUpdateSummariesResult_ {
	if !p.IsSetGetJobUpdateSummariesResult_() {
		return Result__GetJobUpdateSummariesResult__DEFAULT
	}
	return p.GetJobUpdateSummariesResult_
}

var Result__GetJobUpdateDetailsResult__DEFAULT *GetJobUpdateDetailsResult_

func (p *Result_) GetGetJobUpdateDetailsResult_() *GetJobUpdateDetailsResult_ {
	if !p.IsSetGetJobUpdateDetailsResult_() {
		return Result__GetJobUpdateDetailsResult__DEFAULT
	}
	return p.GetJobUpdateDetailsResult_
}

var Result__PulseJobUpdateResult__DEFAULT *PulseJobUpdateResult_

func (p *Result_) GetPulseJobUpdateResult_() *PulseJobUpdateResult_ {
	if !p.IsSetPulseJobUpdateResult_() {
		return Result__PulseJobUpdateResult__DEFAULT
	}
	return p.PulseJobUpdateResult_
}

var Result__GetJobUpdateDiffResult__DEFAULT *GetJobUpdateDiffResult_

func (p *Result_) GetGetJobUpdateDiffResult_() *GetJobUpdateDiffResult_ {
	if !p.IsSetGetJobUpdateDiffResult_() {
		return Result__GetJobUpdateDiffResult__DEFAULT
	}
	return p.GetJobUpdateDiffResult_
}

var Result__GetTierConfigResult__DEFAULT *GetTierConfigResult_

func (p *Result_) GetGetTierConfigResult_() *GetTierConfigResult_ {
	if !p.IsSetGetTierConfigResult_() {
		return Result__GetTierConfigResult__DEFAULT
	}
	return p.GetTierConfigResult_
}
func (p *Result_) CountSetFieldsResult_() int {
	count := 0
	if p.IsSetPopulateJobResult_() {
		count++
	}
	if p.IsSetScheduleStatusResult_() {
		count++
	}
	if p.IsSetGetJobsResult_() {
		count++
	}
	if p.IsSetGetQuotaResult_() {
		count++
	}
	if p.IsSetListBackupsResult_() {
		count++
	}
	if p.IsSetStartMaintenanceResult_() {
		count++
	}
	if p.IsSetDrainHostsResult_() {
		count++
	}
	if p.IsSetQueryRecoveryResult_() {
		count++
	}
	if p.IsSetMaintenanceStatusResult_() {
		count++
	}
	if p.IsSetEndMaintenanceResult_() {
		count++
	}
	if p.IsSetRoleSummaryResult_() {
		count++
	}
	if p.IsSetJobSummaryResult_() {
		count++
	}
	if p.IsSetConfigSummaryResult_() {
		count++
	}
	if p.IsSetGetPendingReasonResult_() {
		count++
	}
	if p.IsSetStartJobUpdateResult_() {
		count++
	}
	if p.IsSetGetJobUpdateSummariesResult_() {
		count++
	}
	if p.IsSetGetJobUpdateDetailsResult_() {
		count++
	}
	if p.IsSetPulseJobUpdateResult_() {
		count++
	}
	if p.IsSetGetJobUpdateDiffResult_() {
		count++
	}
	if p.IsSetGetTierConfigResult_() {
		count++
	}
	return count

}

func (p *Result_) IsSetPopulateJobResult_() bool {
	return p.PopulateJobResult_ != nil
}

func (p *Result_) IsSetScheduleStatusResult_() bool {
	return p.ScheduleStatusResult_ != nil
}

func (p *Result_) IsSetGetJobsResult_() bool {
	return p.GetJobsResult_ != nil
}

func (p *Result_) IsSetGetQuotaResult_() bool {
	return p.GetQuotaResult_ != nil
}

func (p *Result_) IsSetListBackupsResult_() bool {
	return p.ListBackupsResult_ != nil
}

func (p *Result_) IsSetStartMaintenanceResult_() bool {
	return p.StartMaintenanceResult_ != nil
}

func (p *Result_) IsSetDrainHostsResult_() bool {
	return p.DrainHostsResult_ != nil
}

func (p *Result_) IsSetQueryRecoveryResult_() bool {
	return p.QueryRecoveryResult_ != nil
}

func (p *Result_) IsSetMaintenanceStatusResult_() bool {
	return p.MaintenanceStatusResult_ != nil
}

func (p *Result_) IsSetEndMaintenanceResult_() bool {
	return p.EndMaintenanceResult_ != nil
}

func (p *Result_) IsSetRoleSummaryResult_() bool {
	return p.RoleSummaryResult_ != nil
}

func (p *Result_) IsSetJobSummaryResult_() bool {
	return p.JobSummaryResult_ != nil
}

func (p *Result_) IsSetConfigSummaryResult_() bool {
	return p.ConfigSummaryResult_ != nil
}

func (p *Result_) IsSetGetPendingReasonResult_() bool {
	return p.GetPendingReasonResult_ != nil
}

func (p *Result_) IsSetStartJobUpdateResult_() bool {
	return p.StartJobUpdateResult_ != nil
}

func (p *Result_) IsSetGetJobUpdateSummariesResult_() bool {
	return p.GetJobUpdateSummariesResult_ != nil
}

func (p *Result_) IsSetGetJobUpdateDetailsResult_() bool {
	return p.GetJobUpdateDetailsResult_ != nil
}

func (p *Result_) IsSetPulseJobUpdateResult_() bool {
	return p.PulseJobUpdateResult_ != nil
}

func (p *Result_) IsSetGetJobUpdateDiffResult_() bool {
	return p.GetJobUpdateDiffResult_ != nil
}

func (p *Result_) IsSetGetTierConfigResult_() bool {
	return p.GetTierConfigResult_ != nil
}

func (p *Result_) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 4:
			if err := p.readField4(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.readField5(iprot); err != nil {
				return err
			}
		case 6:
			if err := p.readField6(iprot); err != nil {
				return err
			}
		case 7:
			if err := p.readField7(iprot); err != nil {
				return err
			}
		case 8:
			if err := p.readField8(iprot); err != nil {
				return err
			}
		case 9:
			if err := p.readField9(iprot); err != nil {
				return err
			}
		case 10:
			if err := p.readField10(iprot); err != nil {
				return err
			}
		case 11:
			if err := p.readField11(iprot); err != nil {
				return err
			}
		case 17:
			if err := p.readField17(iprot); err != nil {
				return err
			}
		case 18:
			if err := p.readField18(iprot); err != nil {
				return err
			}
		case 20:
			if err := p.readField20(iprot); err != nil {
				return err
			}
		case 21:
			if err := p.readField21(iprot); err != nil {
				return err
			}
		case 22:
			if err := p.readField22(iprot); err != nil {
				return err
			}
		case 23:
			if err := p.readField23(iprot); err != nil {
				return err
			}
		case 24:
			if err := p.readField24(iprot); err != nil {
				return err
			}
		case 25:
			if err := p.readField25(iprot); err != nil {
				return err
			}
		case 26:
			if err := p.readField26(iprot); err != nil {
				return err
			}
		case 27:
			if err := p.readField27(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Result_) readField1(iprot thrift.TProtocol) error {
	p.PopulateJobResult_ = &PopulateJobResult_{}
	if err := p.PopulateJobResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PopulateJobResult_), err)
	}
	return nil
}

func (p *Result_) readField3(iprot thrift.TProtocol) error {
	p.ScheduleStatusResult_ = &ScheduleStatusResult_{}
	if err := p.ScheduleStatusResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ScheduleStatusResult_), err)
	}
	return nil
}

func (p *Result_) readField4(iprot thrift.TProtocol) error {
	p.GetJobsResult_ = &GetJobsResult_{}
	if err := p.GetJobsResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetJobsResult_), err)
	}
	return nil
}

func (p *Result_) readField5(iprot thrift.TProtocol) error {
	p.GetQuotaResult_ = &GetQuotaResult_{}
	if err := p.GetQuotaResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetQuotaResult_), err)
	}
	return nil
}

func (p *Result_) readField6(iprot thrift.TProtocol) error {
	p.ListBackupsResult_ = &ListBackupsResult_{}
	if err := p.ListBackupsResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ListBackupsResult_), err)
	}
	return nil
}

func (p *Result_) readField7(iprot thrift.TProtocol) error {
	p.StartMaintenanceResult_ = &StartMaintenanceResult_{}
	if err := p.StartMaintenanceResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StartMaintenanceResult_), err)
	}
	return nil
}

func (p *Result_) readField8(iprot thrift.TProtocol) error {
	p.DrainHostsResult_ = &DrainHostsResult_{}
	if err := p.DrainHostsResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DrainHostsResult_), err)
	}
	return nil
}

func (p *Result_) readField9(iprot thrift.TProtocol) error {
	p.QueryRecoveryResult_ = &QueryRecoveryResult_{}
	if err := p.QueryRecoveryResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.QueryRecoveryResult_), err)
	}
	return nil
}

func (p *Result_) readField10(iprot thrift.TProtocol) error {
	p.MaintenanceStatusResult_ = &MaintenanceStatusResult_{}
	if err := p.MaintenanceStatusResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MaintenanceStatusResult_), err)
	}
	return nil
}

func (p *Result_) readField11(iprot thrift.TProtocol) error {
	p.EndMaintenanceResult_ = &EndMaintenanceResult_{}
	if err := p.EndMaintenanceResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EndMaintenanceResult_), err)
	}
	return nil
}

func (p *Result_) readField17(iprot thrift.TProtocol) error {
	p.RoleSummaryResult_ = &RoleSummaryResult_{}
	if err := p.RoleSummaryResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RoleSummaryResult_), err)
	}
	return nil
}

func (p *Result_) readField18(iprot thrift.TProtocol) error {
	p.JobSummaryResult_ = &JobSummaryResult_{}
	if err := p.JobSummaryResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JobSummaryResult_), err)
	}
	return nil
}

func (p *Result_) readField20(iprot thrift.TProtocol) error {
	p.ConfigSummaryResult_ = &ConfigSummaryResult_{}
	if err := p.ConfigSummaryResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ConfigSummaryResult_), err)
	}
	return nil
}

func (p *Result_) readField21(iprot thrift.TProtocol) error {
	p.GetPendingReasonResult_ = &GetPendingReasonResult_{}
	if err := p.GetPendingReasonResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetPendingReasonResult_), err)
	}
	return nil
}

func (p *Result_) readField22(iprot thrift.TProtocol) error {
	p.StartJobUpdateResult_ = &StartJobUpdateResult_{}
	if err := p.StartJobUpdateResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StartJobUpdateResult_), err)
	}
	return nil
}

func (p *Result_) readField23(iprot thrift.TProtocol) error {
	p.GetJobUpdateSummariesResult_ = &GetJobUpdateSummariesResult_{}
	if err := p.GetJobUpdateSummariesResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetJobUpdateSummariesResult_), err)
	}
	return nil
}

func (p *Result_) readField24(iprot thrift.TProtocol) error {
	p.GetJobUpdateDetailsResult_ = &GetJobUpdateDetailsResult_{}
	if err := p.GetJobUpdateDetailsResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetJobUpdateDetailsResult_), err)
	}
	return nil
}

func (p *Result_) readField25(iprot thrift.TProtocol) error {
	p.PulseJobUpdateResult_ = &PulseJobUpdateResult_{}
	if err := p.PulseJobUpdateResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PulseJobUpdateResult_), err)
	}
	return nil
}

func (p *Result_) readField26(iprot thrift.TProtocol) error {
	p.GetJobUpdateDiffResult_ = &GetJobUpdateDiffResult_{}
	if err := p.GetJobUpdateDiffResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetJobUpdateDiffResult_), err)
	}
	return nil
}

func (p *Result_) readField27(iprot thrift.TProtocol) error {
	p.GetTierConfigResult_ = &GetTierConfigResult_{}
	if err := p.GetTierConfigResult_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GetTierConfigResult_), err)
	}
	return nil
}

func (p *Result_) Write(oprot thrift.TProtocol) error {
	if c := p.CountSetFieldsResult_(); c != 1 {
		return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c)
	}
	if err := oprot.WriteStructBegin("Result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField4(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := p.writeField6(oprot); err != nil {
		return err
	}
	if err := p.writeField7(oprot); err != nil {
		return err
	}
	if err := p.writeField8(oprot); err != nil {
		return err
	}
	if err := p.writeField9(oprot); err != nil {
		return err
	}
	if err := p.writeField10(oprot); err != nil {
		return err
	}
	if err := p.writeField11(oprot); err != nil {
		return err
	}
	if err := p.writeField17(oprot); err != nil {
		return err
	}
	if err := p.writeField18(oprot); err != nil {
		return err
	}
	if err := p.writeField20(oprot); err != nil {
		return err
	}
	if err := p.writeField21(oprot); err != nil {
		return err
	}
	if err := p.writeField22(oprot); err != nil {
		return err
	}
	if err := p.writeField23(oprot); err != nil {
		return err
	}
	if err := p.writeField24(oprot); err != nil {
		return err
	}
	if err := p.writeField25(oprot); err != nil {
		return err
	}
	if err := p.writeField26(oprot); err != nil {
		return err
	}
	if err := p.writeField27(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Result_) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetPopulateJobResult_() {
		if err := oprot.WriteFieldBegin("populateJobResult", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:populateJobResult: ", p), err)
		}
		if err := p.PopulateJobResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PopulateJobResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:populateJobResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetScheduleStatusResult_() {
		if err := oprot.WriteFieldBegin("scheduleStatusResult", thrift.STRUCT, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:scheduleStatusResult: ", p), err)
		}
		if err := p.ScheduleStatusResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ScheduleStatusResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:scheduleStatusResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField4(oprot thrift.TProtocol) (err error) {
	if p.IsSetGetJobsResult_() {
		if err := oprot.WriteFieldBegin("getJobsResult", thrift.STRUCT, 4); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:getJobsResult: ", p), err)
		}
		if err := p.GetJobsResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetJobsResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 4:getJobsResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField5(oprot thrift.TProtocol) (err error) {
	if p.IsSetGetQuotaResult_() {
		if err := oprot.WriteFieldBegin("getQuotaResult", thrift.STRUCT, 5); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:getQuotaResult: ", p), err)
		}
		if err := p.GetQuotaResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetQuotaResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 5:getQuotaResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField6(oprot thrift.TProtocol) (err error) {
	if p.IsSetListBackupsResult_() {
		if err := oprot.WriteFieldBegin("listBackupsResult", thrift.STRUCT, 6); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:listBackupsResult: ", p), err)
		}
		if err := p.ListBackupsResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ListBackupsResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 6:listBackupsResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField7(oprot thrift.TProtocol) (err error) {
	if p.IsSetStartMaintenanceResult_() {
		if err := oprot.WriteFieldBegin("startMaintenanceResult", thrift.STRUCT, 7); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:startMaintenanceResult: ", p), err)
		}
		if err := p.StartMaintenanceResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StartMaintenanceResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 7:startMaintenanceResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField8(oprot thrift.TProtocol) (err error) {
	if p.IsSetDrainHostsResult_() {
		if err := oprot.WriteFieldBegin("drainHostsResult", thrift.STRUCT, 8); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:drainHostsResult: ", p), err)
		}
		if err := p.DrainHostsResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DrainHostsResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 8:drainHostsResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField9(oprot thrift.TProtocol) (err error) {
	if p.IsSetQueryRecoveryResult_() {
		if err := oprot.WriteFieldBegin("queryRecoveryResult", thrift.STRUCT, 9); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:queryRecoveryResult: ", p), err)
		}
		if err := p.QueryRecoveryResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.QueryRecoveryResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 9:queryRecoveryResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField10(oprot thrift.TProtocol) (err error) {
	if p.IsSetMaintenanceStatusResult_() {
		if err := oprot.WriteFieldBegin("maintenanceStatusResult", thrift.STRUCT, 10); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:maintenanceStatusResult: ", p), err)
		}
		if err := p.MaintenanceStatusResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MaintenanceStatusResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 10:maintenanceStatusResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField11(oprot thrift.TProtocol) (err error) {
	if p.IsSetEndMaintenanceResult_() {
		if err := oprot.WriteFieldBegin("endMaintenanceResult", thrift.STRUCT, 11); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:endMaintenanceResult: ", p), err)
		}
		if err := p.EndMaintenanceResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EndMaintenanceResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 11:endMaintenanceResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField17(oprot thrift.TProtocol) (err error) {
	if p.IsSetRoleSummaryResult_() {
		if err := oprot.WriteFieldBegin("roleSummaryResult", thrift.STRUCT, 17); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 17:roleSummaryResult: ", p), err)
		}
		if err := p.RoleSummaryResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RoleSummaryResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 17:roleSummaryResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField18(oprot thrift.TProtocol) (err error) {
	if p.IsSetJobSummaryResult_() {
		if err := oprot.WriteFieldBegin("jobSummaryResult", thrift.STRUCT, 18); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 18:jobSummaryResult: ", p), err)
		}
		if err := p.JobSummaryResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JobSummaryResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 18:jobSummaryResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField20(oprot thrift.TProtocol) (err error) {
	if p.IsSetConfigSummaryResult_() {
		if err := oprot.WriteFieldBegin("configSummaryResult", thrift.STRUCT, 20); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 20:configSummaryResult: ", p), err)
		}
		if err := p.ConfigSummaryResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ConfigSummaryResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 20:configSummaryResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField21(oprot thrift.TProtocol) (err error) {
	if p.IsSetGetPendingReasonResult_() {
		if err := oprot.WriteFieldBegin("getPendingReasonResult", thrift.STRUCT, 21); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 21:getPendingReasonResult: ", p), err)
		}
		if err := p.GetPendingReasonResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetPendingReasonResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 21:getPendingReasonResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField22(oprot thrift.TProtocol) (err error) {
	if p.IsSetStartJobUpdateResult_() {
		if err := oprot.WriteFieldBegin("startJobUpdateResult", thrift.STRUCT, 22); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 22:startJobUpdateResult: ", p), err)
		}
		if err := p.StartJobUpdateResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StartJobUpdateResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 22:startJobUpdateResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField23(oprot thrift.TProtocol) (err error) {
	if p.IsSetGetJobUpdateSummariesResult_() {
		if err := oprot.WriteFieldBegin("getJobUpdateSummariesResult", thrift.STRUCT, 23); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 23:getJobUpdateSummariesResult: ", p), err)
		}
		if err := p.GetJobUpdateSummariesResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetJobUpdateSummariesResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 23:getJobUpdateSummariesResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField24(oprot thrift.TProtocol) (err error) {
	if p.IsSetGetJobUpdateDetailsResult_() {
		if err := oprot.WriteFieldBegin("getJobUpdateDetailsResult", thrift.STRUCT, 24); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 24:getJobUpdateDetailsResult: ", p), err)
		}
		if err := p.GetJobUpdateDetailsResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetJobUpdateDetailsResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 24:getJobUpdateDetailsResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField25(oprot thrift.TProtocol) (err error) {
	if p.IsSetPulseJobUpdateResult_() {
		if err := oprot.WriteFieldBegin("pulseJobUpdateResult", thrift.STRUCT, 25); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 25:pulseJobUpdateResult: ", p), err)
		}
		if err := p.PulseJobUpdateResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PulseJobUpdateResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 25:pulseJobUpdateResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField26(oprot thrift.TProtocol) (err error) {
	if p.IsSetGetJobUpdateDiffResult_() {
		if err := oprot.WriteFieldBegin("getJobUpdateDiffResult", thrift.STRUCT, 26); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 26:getJobUpdateDiffResult: ", p), err)
		}
		if err := p.GetJobUpdateDiffResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetJobUpdateDiffResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 26:getJobUpdateDiffResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) writeField27(oprot thrift.TProtocol) (err error) {
	if p.IsSetGetTierConfigResult_() {
		if err := oprot.WriteFieldBegin("getTierConfigResult", thrift.STRUCT, 27); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 27:getTierConfigResult: ", p), err)
		}
		if err := p.GetTierConfigResult_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GetTierConfigResult_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 27:getTierConfigResult: ", p), err)
		}
	}
	return err
}

func (p *Result_) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Result_(%+v)", *p)
}

// Attributes:
//  - Message
type ResponseDetail struct {
	Message string `thrift:"message,1" json:"message"`
}

func NewResponseDetail() *ResponseDetail {
	return &ResponseDetail{}
}

func (p *ResponseDetail) GetMessage() string {
	return p.Message
}
func (p *ResponseDetail) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ResponseDetail) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Message = v
	}
	return nil
}

func (p *ResponseDetail) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ResponseDetail"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ResponseDetail) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("message", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:message: ", p), err)
	}
	if err := oprot.WriteString(string(p.Message)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.message (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:message: ", p), err)
	}
	return err
}

func (p *ResponseDetail) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ResponseDetail(%+v)", *p)
}

// Attributes:
//  - ResponseCode
//  - ServerInfo
//  - Result_: Payload from the invoked RPC.
//  - Details: Messages from the server relevant to the request, such as warnings or use of deprecated
// features.
type Response struct {
	ResponseCode ResponseCode `thrift:"responseCode,1" json:"responseCode"`
	// unused field # 2
	Result_ *Result_ `thrift:"result,3" json:"result,omitempty"`
	// unused field # 4
	ServerInfo *ServerInfo       `thrift:"serverInfo,5" json:"serverInfo"`
	Details    []*ResponseDetail `thrift:"details,6" json:"details"`
}

func NewResponse() *Response {
	return &Response{}
}

func (p *Response) GetResponseCode() ResponseCode {
	return p.ResponseCode
}

var Response_ServerInfo_DEFAULT *ServerInfo

func (p *Response) GetServerInfo() *ServerInfo {
	if !p.IsSetServerInfo() {
		return Response_ServerInfo_DEFAULT
	}
	return p.ServerInfo
}

var Response_Result__DEFAULT *Result_

func (p *Response) GetResult_() *Result_ {
	if !p.IsSetResult_() {
		return Response_Result__DEFAULT
	}
	return p.Result_
}

func (p *Response) GetDetails() []*ResponseDetail {
	return p.Details
}
func (p *Response) IsSetServerInfo() bool {
	return p.ServerInfo != nil
}

func (p *Response) IsSetResult_() bool {
	return p.Result_ != nil
}

func (p *Response) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		case 5:
			if err := p.readField5(iprot); err != nil {
				return err
			}
		case 3:
			if err := p.readField3(iprot); err != nil {
				return err
			}
		case 6:
			if err := p.readField6(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *Response) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		temp := ResponseCode(v)
		p.ResponseCode = temp
	}
	return nil
}

func (p *Response) readField5(iprot thrift.TProtocol) error {
	p.ServerInfo = &ServerInfo{}
	if err := p.ServerInfo.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ServerInfo), err)
	}
	return nil
}

func (p *Response) readField3(iprot thrift.TProtocol) error {
	p.Result_ = &Result_{}
	if err := p.Result_.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err)
	}
	return nil
}

func (p *Response) readField6(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]*ResponseDetail, 0, size)
	p.Details = tSlice
	for i := 0; i < size; i++ {
		_elem52 := &ResponseDetail{}
		if err := _elem52.Read(iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err)
		}
		p.Details = append(p.Details, _elem52)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *Response) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("Response"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := p.writeField3(oprot); err != nil {
		return err
	}
	if err := p.writeField5(oprot); err != nil {
		return err
	}
	if err := p.writeField6(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *Response) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("responseCode", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:responseCode: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.ResponseCode)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.responseCode (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:responseCode: ", p), err)
	}
	return err
}

func (p *Response) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetResult_() {
		if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:result: ", p), err)
		}
		if err := p.Result_.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:result: ", p), err)
		}
	}
	return err
}

func (p *Response) writeField5(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("serverInfo", thrift.STRUCT, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:serverInfo: ", p), err)
	}
	if err := p.ServerInfo.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ServerInfo), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:serverInfo: ", p), err)
	}
	return err
}

func (p *Response) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("details", thrift.LIST, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:details: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Details)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Details {
		if err := v.Write(oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
		}
	}
	if err := oprot.WriteListEnd(); err != nil {
		return thrift.PrependError("error writing list end: ", err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:details: ", p), err)
	}
	return err
}

func (p *Response) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Response(%+v)", *p)
}

// Attributes:
//  - BatchSize
type ExplicitReconciliationSettings struct {
	BatchSize *int32 `thrift:"batchSize,1" json:"batchSize,omitempty"`
}

func NewExplicitReconciliationSettings() *ExplicitReconciliationSettings {
	return &ExplicitReconciliationSettings{}
}

var ExplicitReconciliationSettings_BatchSize_DEFAULT int32

func (p *ExplicitReconciliationSettings) GetBatchSize() int32 {
	if !p.IsSetBatchSize() {
		return ExplicitReconciliationSettings_BatchSize_DEFAULT
	}
	return *p.BatchSize
}
func (p *ExplicitReconciliationSettings) IsSetBatchSize() bool {
	return p.BatchSize != nil
}

func (p *ExplicitReconciliationSettings) Read(iprot thrift.TProtocol) error {
	if _, err := iprot.ReadStructBegin(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
	}

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != nil {
			return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		switch fieldId {
		case 1:
			if err := p.readField1(iprot); err != nil {
				return err
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

func (p *ExplicitReconciliationSettings) readField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.BatchSize = &v
	}
	return nil
}

func (p *ExplicitReconciliationSettings) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("ExplicitReconciliationSettings"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if err := p.writeField1(oprot); err != nil {
		return err
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

func (p *ExplicitReconciliationSettings) writeField1(oprot thrift.TProtocol) (err error) {
	if p.IsSetBatchSize() {
		if err := oprot.WriteFieldBegin("batchSize", thrift.I32, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:batchSize: ", p), err)
		}
		if err := oprot.WriteI32(int32(*p.BatchSize)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.batchSize (1) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:batchSize: ", p), err)
		}
	}
	return err
}

func (p *ExplicitReconciliationSettings) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("ExplicitReconciliationSettings(%+v)", *p)
}
