From 366599fb80b4b5f91702bd4db593aba4915bddd6 Mon Sep 17 00:00:00 2001 From: Renan DelValle Date: Tue, 27 Nov 2018 18:05:33 -0800 Subject: [PATCH] Regenerating Thrift bindings with Thrift 0.12.0 --- gen-go/apache/aurora/GoUnusedProtection__.go | 7 + gen-go/apache/aurora/auroraAPI-consts.go | 58 + gen-go/apache/aurora/auroraAPI.go | 31576 ++++++++++++++++ .../aurora_admin-remote.go | 201 +- .../aurora_scheduler_manager-remote.go | 143 +- gen-go/apache/aurora/auroraadmin.go | 5870 --- .../apache/aurora/auroraschedulermanager.go | 5115 --- gen-go/apache/aurora/constants.go | 89 - .../read_only_scheduler-remote.go | 83 +- gen-go/apache/aurora/readonlyscheduler.go | 4293 --- gen-go/apache/aurora/ttypes.go | 16424 -------- 11 files changed, 31898 insertions(+), 31961 deletions(-) create mode 100644 gen-go/apache/aurora/GoUnusedProtection__.go create mode 100644 gen-go/apache/aurora/auroraAPI-consts.go create mode 100644 gen-go/apache/aurora/auroraAPI.go delete mode 100644 gen-go/apache/aurora/auroraadmin.go delete mode 100644 gen-go/apache/aurora/auroraschedulermanager.go delete mode 100644 gen-go/apache/aurora/constants.go delete mode 100644 gen-go/apache/aurora/readonlyscheduler.go delete mode 100644 gen-go/apache/aurora/ttypes.go diff --git a/gen-go/apache/aurora/GoUnusedProtection__.go b/gen-go/apache/aurora/GoUnusedProtection__.go new file mode 100644 index 0000000..0854061 --- /dev/null +++ b/gen-go/apache/aurora/GoUnusedProtection__.go @@ -0,0 +1,7 @@ +// Autogenerated by Thrift Compiler (1.0.0-dev) +// Autogenerated by Thrift Compiler (0.12.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package aurora + +var GoUnusedProtection__ int diff --git a/gen-go/apache/aurora/auroraAPI-consts.go b/gen-go/apache/aurora/auroraAPI-consts.go new file mode 100644 index 0000000..da41b93 --- /dev/null +++ b/gen-go/apache/aurora/auroraAPI-consts.go @@ -0,0 +1,58 @@ +// Autogenerated by Thrift Compiler (0.12.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package aurora + +import ( + "bytes" + "context" + "fmt" + "reflect" + + "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 _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +const AURORA_EXECUTOR_NAME = "AuroraExecutor" + +var ACTIVE_STATES []ScheduleStatus +var SLAVE_ASSIGNED_STATES []ScheduleStatus +var LIVE_STATES []ScheduleStatus +var TERMINAL_STATES []ScheduleStatus + +const GOOD_IDENTIFIER_PATTERN = "^[\\w\\-\\.]+$" +const GOOD_IDENTIFIER_PATTERN_JVM = "^[\\w\\-\\.]+$" +const GOOD_IDENTIFIER_PATTERN_PYTHON = "^[\\w\\-\\.]+$" + +var ACTIVE_JOB_UPDATE_STATES []JobUpdateStatus +var AWAITNG_PULSE_JOB_UPDATE_STATES []JobUpdateStatus + +const BYPASS_LEADER_REDIRECT_HEADER_NAME = "Bypass-Leader-Redirect" +const TASK_FILESYSTEM_MOUNT_POINT = "taskfs" + +func init() { + ACTIVE_STATES = []ScheduleStatus{ + 9, 17, 6, 0, 13, 12, 2, 1, 18, 16} + + SLAVE_ASSIGNED_STATES = []ScheduleStatus{ + 9, 17, 6, 13, 12, 2, 18, 1} + + LIVE_STATES = []ScheduleStatus{ + 6, 13, 12, 17, 18, 2} + + TERMINAL_STATES = []ScheduleStatus{ + 4, 3, 5, 7} + + ACTIVE_JOB_UPDATE_STATES = []JobUpdateStatus{ + 0, 1, 2, 3, 9, 10} + + AWAITNG_PULSE_JOB_UPDATE_STATES = []JobUpdateStatus{ + 9, 10} + +} diff --git a/gen-go/apache/aurora/auroraAPI.go b/gen-go/apache/aurora/auroraAPI.go new file mode 100644 index 0000000..2c6bb79 --- /dev/null +++ b/gen-go/apache/aurora/auroraAPI.go @@ -0,0 +1,31576 @@ +// Autogenerated by Thrift Compiler (0.12.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package aurora + +import ( + "bytes" + "context" + "database/sql/driver" + "errors" + "fmt" + "reflect" + + "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 _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +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 "" +} + +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 +} + +func (p *ResponseCode) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = ResponseCode(v) + return nil +} + +func (p *ResponseCode) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), 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 "" +} + +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 +} + +func (p *MaintenanceMode) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = MaintenanceMode(v) + return nil +} + +func (p *MaintenanceMode) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), 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 "" +} + +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 +} + +func (p *Mode) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = Mode(v) + return nil +} + +func (p *Mode) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), 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 "" +} + +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 +} + +func (p *CronCollisionPolicy) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = CronCollisionPolicy(v) + return nil +} + +func (p *CronCollisionPolicy) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), 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 + ScheduleStatus_PARTITIONED ScheduleStatus = 18 +) + +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" + case ScheduleStatus_PARTITIONED: + return "PARTITIONED" + } + return "" +} + +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 + case "PARTITIONED": + return ScheduleStatus_PARTITIONED, 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 +} + +func (p *ScheduleStatus) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = ScheduleStatus(v) + return nil +} + +func (p *ScheduleStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), 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 "" +} + +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 +} + +func (p *JobUpdateStatus) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = JobUpdateStatus(v) + return nil +} + +func (p *JobUpdateStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), 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 "" +} + +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 +} + +func (p *JobUpdateAction) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = JobUpdateAction(v) + return nil +} + +func (p *JobUpdateAction) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), 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 "" +} + +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 +} + +func (p *JobUpdatePulseStatus) Scan(value interface{}) error { + v, ok := value.(int64) + if !ok { + return errors.New("Scan value is not int64") + } + *p = JobUpdatePulseStatus(v) + return nil +} + +func (p *JobUpdatePulseStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + +// Attributes: +// - User +type Identity struct { + // unused field # 1 + User string `thrift:"user,2" db:"user" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + return fmt.Sprintf("Identity(%+v)", *p) +} + +// A single host attribute. +// +// Attributes: +// - Name +// - Values +type Attribute struct { + Name string `thrift:"name,1" db:"name" json:"name"` + Values []string `thrift:"values,2" db:"values" json:"values"` +} + +func NewAttribute() *Attribute { + return &Attribute{} +} + +func (p *Attribute) GetName() string { + return p.Name +} + +func (p *Attribute) GetValues() []string { + 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.SET { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]string, 0, 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 = append(p.Values, _elem0) + } + 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 p != nil { + 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 i := 0; i < len(p.Values); i++ { + for j := i + 1; j < len(p.Values); j++ { + if reflect.DeepEqual(p.Values[i], p.Values[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Values[i])) + } + } + } + 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 "" + } + 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" db:"host" json:"host"` + Attributes []*Attribute `thrift:"attributes,2" db:"attributes" json:"attributes"` + Mode *MaintenanceMode `thrift:"mode,3" db:"mode" json:"mode,omitempty"` + SlaveId *string `thrift:"slaveId,4" db:"slaveId" json:"slaveId,omitempty"` +} + +func NewHostAttributes() *HostAttributes { + return &HostAttributes{} +} + +func (p *HostAttributes) GetHost() string { + return p.Host +} + +func (p *HostAttributes) GetAttributes() []*Attribute { + 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.SET { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*Attribute, 0, 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 = append(p.Attributes, _elem1) + } + 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 p != nil { + 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 i := 0; i < len(p.Attributes); i++ { + for j := i + 1; j < len(p.Attributes); j++ { + if reflect.DeepEqual(p.Attributes[i], p.Attributes[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Attributes[i])) + } + } + } + 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 "" + } + 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" db:"negated" json:"negated"` + Values []string `thrift:"values,2" db:"values" json:"values"` +} + +func NewValueConstraint() *ValueConstraint { + return &ValueConstraint{} +} + +func (p *ValueConstraint) GetNegated() bool { + return p.Negated +} + +func (p *ValueConstraint) GetValues() []string { + 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 fieldTypeId == thrift.BOOL { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.SET { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]string, 0, 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 = append(p.Values, _elem2) + } + 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 p != nil { + 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 i := 0; i < len(p.Values); i++ { + for j := i + 1; j < len(p.Values); j++ { + if reflect.DeepEqual(p.Values[i], p.Values[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Values[i])) + } + } + } + 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 "" + } + 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" db:"limit" 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"value" json:"value,omitempty"` + Limit *LimitConstraint `thrift:"limit,2" db:"limit" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"name" json:"name"` + Constraint *TaskConstraint `thrift:"constraint,2" db:"constraint" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + return fmt.Sprintf("Constraint(%+v)", *p) +} + +// Attributes: +// - Role +// - Name +// - Version +type Package struct { + Role string `thrift:"role,1" db:"role" json:"role"` + Name string `thrift:"name,2" db:"name" json:"name"` + Version int32 `thrift:"version,3" db:"version" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"key" json:"key"` + Value string `thrift:"value,2" db:"value" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"role" json:"role"` + Environment string `thrift:"environment,2" db:"environment" json:"environment"` + Name string `thrift:"name,3" db:"name" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + return fmt.Sprintf("JobKey(%+v)", *p) +} + +// A unique lock key. +// +// Attributes: +// - Job +type LockKey struct { + Job *JobKey `thrift:"job,1" db:"job" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"key" json:"key"` + Token string `thrift:"token,2" db:"token" json:"token"` + User string `thrift:"user,3" db:"user" json:"user"` + TimestampMs int64 `thrift:"timestampMs,4" db:"timestampMs" json:"timestampMs"` + Message *string `thrift:"message,5" db:"message" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"jobKey" json:"jobKey"` + InstanceId int32 `thrift:"instanceId,2" db:"instanceId" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"value" json:"value"` + Extract *bool `thrift:"extract,2" db:"extract" json:"extract,omitempty"` + Cache *bool `thrift:"cache,3" db:"cache" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + return fmt.Sprintf("MesosFetcherURI(%+v)", *p) +} + +// Attributes: +// - Name: Name identifying the Executor. +// - Data: Executor configuration data. +type ExecutorConfig struct { + Name string `thrift:"name,1" db:"name" json:"name"` + Data string `thrift:"data,2" db:"data" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"containerPath" json:"containerPath"` + HostPath string `thrift:"hostPath,2" db:"hostPath" json:"hostPath"` + Mode Mode `thrift:"mode,3" db:"mode" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"name" json:"name"` + Tag string `thrift:"tag,2" db:"tag" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"name" json:"name"` + ImageId string `thrift:"imageId,2" db:"imageId" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"docker" json:"docker,omitempty"` + Appc *AppcImage `thrift:"appc,2" db:"appc" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"image" json:"image,omitempty"` + Volumes []*Volume `thrift:"volumes,2" db:"volumes" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"name" json:"name"` + Value string `thrift:"value,2" db:"value" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"image" json:"image"` + Parameters []*DockerParameter `thrift:"parameters,2" db:"parameters" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"mesos" json:"mesos,omitempty"` + Docker *DockerContainer `thrift:"docker,2" db:"docker" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"numCpus" json:"numCpus,omitempty"` + RamMb *int64 `thrift:"ramMb,2" db:"ramMb" json:"ramMb,omitempty"` + DiskMb *int64 `thrift:"diskMb,3" db:"diskMb" json:"diskMb,omitempty"` + NamedPort *string `thrift:"namedPort,4" db:"namedPort" json:"namedPort,omitempty"` + NumGpus *int64 `thrift:"numGpus,5" db:"numGpus" 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 fieldTypeId == thrift.DOUBLE { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + return fmt.Sprintf("Resource(%+v)", *p) +} + +// Attributes: +// - Reschedule +// - DelaySecs +type PartitionPolicy struct { + Reschedule bool `thrift:"reschedule,1" db:"reschedule" json:"reschedule"` + DelaySecs *int64 `thrift:"delaySecs,2" db:"delaySecs" json:"delaySecs,omitempty"` +} + +func NewPartitionPolicy() *PartitionPolicy { + return &PartitionPolicy{} +} + +func (p *PartitionPolicy) GetReschedule() bool { + return p.Reschedule +} + +var PartitionPolicy_DelaySecs_DEFAULT int64 + +func (p *PartitionPolicy) GetDelaySecs() int64 { + if !p.IsSetDelaySecs() { + return PartitionPolicy_DelaySecs_DEFAULT + } + return *p.DelaySecs +} +func (p *PartitionPolicy) IsSetDelaySecs() bool { + return p.DelaySecs != nil +} + +func (p *PartitionPolicy) 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 fieldTypeId == thrift.BOOL { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *PartitionPolicy) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Reschedule = v + } + return nil +} + +func (p *PartitionPolicy) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.DelaySecs = &v + } + return nil +} + +func (p *PartitionPolicy) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("PartitionPolicy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *PartitionPolicy) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("reschedule", thrift.BOOL, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:reschedule: ", p), err) + } + if err := oprot.WriteBool(bool(p.Reschedule)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.reschedule (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:reschedule: ", p), err) + } + return err +} + +func (p *PartitionPolicy) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetDelaySecs() { + if err := oprot.WriteFieldBegin("delaySecs", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delaySecs: ", p), err) + } + if err := oprot.WriteI64(int64(*p.DelaySecs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.delaySecs (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delaySecs: ", p), err) + } + } + return err +} + +func (p *PartitionPolicy) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PartitionPolicy(%+v)", *p) +} + +// SLA requirements expressed as the percentage of instances to be RUNNING every durationSecs +// +// Attributes: +// - Percentage +// - DurationSecs: Minimum time duration a task needs to be `RUNNING` to be treated as active +type PercentageSlaPolicy struct { + Percentage float64 `thrift:"percentage,1" db:"percentage" json:"percentage"` + DurationSecs int64 `thrift:"durationSecs,2" db:"durationSecs" json:"durationSecs"` +} + +func NewPercentageSlaPolicy() *PercentageSlaPolicy { + return &PercentageSlaPolicy{} +} + +func (p *PercentageSlaPolicy) GetPercentage() float64 { + return p.Percentage +} + +func (p *PercentageSlaPolicy) GetDurationSecs() int64 { + return p.DurationSecs +} +func (p *PercentageSlaPolicy) 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 fieldTypeId == thrift.DOUBLE { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *PercentageSlaPolicy) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Percentage = v + } + return nil +} + +func (p *PercentageSlaPolicy) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.DurationSecs = v + } + return nil +} + +func (p *PercentageSlaPolicy) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("PercentageSlaPolicy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *PercentageSlaPolicy) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("percentage", thrift.DOUBLE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:percentage: ", p), err) + } + if err := oprot.WriteDouble(float64(p.Percentage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.percentage (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:percentage: ", p), err) + } + return err +} + +func (p *PercentageSlaPolicy) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("durationSecs", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:durationSecs: ", p), err) + } + if err := oprot.WriteI64(int64(p.DurationSecs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.durationSecs (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:durationSecs: ", p), err) + } + return err +} + +func (p *PercentageSlaPolicy) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PercentageSlaPolicy(%+v)", *p) +} + +// SLA requirements expressed as the number of instances to be RUNNING every durationSecs +// +// Attributes: +// - Count: The number of active instances required every `durationSecs` +// - DurationSecs: Minimum time duration a task needs to be `RUNNING` to be treated as active +type CountSlaPolicy struct { + Count int64 `thrift:"count,1" db:"count" json:"count"` + DurationSecs int64 `thrift:"durationSecs,2" db:"durationSecs" json:"durationSecs"` +} + +func NewCountSlaPolicy() *CountSlaPolicy { + return &CountSlaPolicy{} +} + +func (p *CountSlaPolicy) GetCount() int64 { + return p.Count +} + +func (p *CountSlaPolicy) GetDurationSecs() int64 { + return p.DurationSecs +} +func (p *CountSlaPolicy) 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 fieldTypeId == thrift.I64 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *CountSlaPolicy) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.Count = v + } + return nil +} + +func (p *CountSlaPolicy) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.DurationSecs = v + } + return nil +} + +func (p *CountSlaPolicy) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("CountSlaPolicy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *CountSlaPolicy) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("count", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:count: ", p), err) + } + if err := oprot.WriteI64(int64(p.Count)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.count (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:count: ", p), err) + } + return err +} + +func (p *CountSlaPolicy) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("durationSecs", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:durationSecs: ", p), err) + } + if err := oprot.WriteI64(int64(p.DurationSecs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.durationSecs (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:durationSecs: ", p), err) + } + return err +} + +func (p *CountSlaPolicy) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CountSlaPolicy(%+v)", *p) +} + +// SLA requirements to be delegated to an external coordinator +// +// Attributes: +// - CoordinatorUrl: URL for the coordinator service that needs to be contacted for SLA checks +// - StatusKey: Field in the Coordinator response json indicating if the action is allowed or not +type CoordinatorSlaPolicy struct { + CoordinatorUrl string `thrift:"coordinatorUrl,1" db:"coordinatorUrl" json:"coordinatorUrl"` + StatusKey string `thrift:"statusKey,2" db:"statusKey" json:"statusKey"` +} + +func NewCoordinatorSlaPolicy() *CoordinatorSlaPolicy { + return &CoordinatorSlaPolicy{} +} + +func (p *CoordinatorSlaPolicy) GetCoordinatorUrl() string { + return p.CoordinatorUrl +} + +func (p *CoordinatorSlaPolicy) GetStatusKey() string { + return p.StatusKey +} +func (p *CoordinatorSlaPolicy) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *CoordinatorSlaPolicy) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.CoordinatorUrl = v + } + return nil +} + +func (p *CoordinatorSlaPolicy) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.StatusKey = v + } + return nil +} + +func (p *CoordinatorSlaPolicy) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("CoordinatorSlaPolicy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *CoordinatorSlaPolicy) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("coordinatorUrl", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:coordinatorUrl: ", p), err) + } + if err := oprot.WriteString(string(p.CoordinatorUrl)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.coordinatorUrl (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:coordinatorUrl: ", p), err) + } + return err +} + +func (p *CoordinatorSlaPolicy) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("statusKey", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statusKey: ", p), err) + } + if err := oprot.WriteString(string(p.StatusKey)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.statusKey (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statusKey: ", p), err) + } + return err +} + +func (p *CoordinatorSlaPolicy) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CoordinatorSlaPolicy(%+v)", *p) +} + +// SLA requirements expressed in one of the many types +// +// Attributes: +// - PercentageSlaPolicy +// - CountSlaPolicy +// - CoordinatorSlaPolicy +type SlaPolicy struct { + PercentageSlaPolicy *PercentageSlaPolicy `thrift:"percentageSlaPolicy,1" db:"percentageSlaPolicy" json:"percentageSlaPolicy,omitempty"` + CountSlaPolicy *CountSlaPolicy `thrift:"countSlaPolicy,2" db:"countSlaPolicy" json:"countSlaPolicy,omitempty"` + CoordinatorSlaPolicy *CoordinatorSlaPolicy `thrift:"coordinatorSlaPolicy,3" db:"coordinatorSlaPolicy" json:"coordinatorSlaPolicy,omitempty"` +} + +func NewSlaPolicy() *SlaPolicy { + return &SlaPolicy{} +} + +var SlaPolicy_PercentageSlaPolicy_DEFAULT *PercentageSlaPolicy + +func (p *SlaPolicy) GetPercentageSlaPolicy() *PercentageSlaPolicy { + if !p.IsSetPercentageSlaPolicy() { + return SlaPolicy_PercentageSlaPolicy_DEFAULT + } + return p.PercentageSlaPolicy +} + +var SlaPolicy_CountSlaPolicy_DEFAULT *CountSlaPolicy + +func (p *SlaPolicy) GetCountSlaPolicy() *CountSlaPolicy { + if !p.IsSetCountSlaPolicy() { + return SlaPolicy_CountSlaPolicy_DEFAULT + } + return p.CountSlaPolicy +} + +var SlaPolicy_CoordinatorSlaPolicy_DEFAULT *CoordinatorSlaPolicy + +func (p *SlaPolicy) GetCoordinatorSlaPolicy() *CoordinatorSlaPolicy { + if !p.IsSetCoordinatorSlaPolicy() { + return SlaPolicy_CoordinatorSlaPolicy_DEFAULT + } + return p.CoordinatorSlaPolicy +} +func (p *SlaPolicy) CountSetFieldsSlaPolicy() int { + count := 0 + if p.IsSetPercentageSlaPolicy() { + count++ + } + if p.IsSetCountSlaPolicy() { + count++ + } + if p.IsSetCoordinatorSlaPolicy() { + count++ + } + return count + +} + +func (p *SlaPolicy) IsSetPercentageSlaPolicy() bool { + return p.PercentageSlaPolicy != nil +} + +func (p *SlaPolicy) IsSetCountSlaPolicy() bool { + return p.CountSlaPolicy != nil +} + +func (p *SlaPolicy) IsSetCoordinatorSlaPolicy() bool { + return p.CoordinatorSlaPolicy != nil +} + +func (p *SlaPolicy) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *SlaPolicy) ReadField1(iprot thrift.TProtocol) error { + p.PercentageSlaPolicy = &PercentageSlaPolicy{} + if err := p.PercentageSlaPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PercentageSlaPolicy), err) + } + return nil +} + +func (p *SlaPolicy) ReadField2(iprot thrift.TProtocol) error { + p.CountSlaPolicy = &CountSlaPolicy{} + if err := p.CountSlaPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CountSlaPolicy), err) + } + return nil +} + +func (p *SlaPolicy) ReadField3(iprot thrift.TProtocol) error { + p.CoordinatorSlaPolicy = &CoordinatorSlaPolicy{} + if err := p.CoordinatorSlaPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CoordinatorSlaPolicy), err) + } + return nil +} + +func (p *SlaPolicy) Write(oprot thrift.TProtocol) error { + if c := p.CountSetFieldsSlaPolicy(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("SlaPolicy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *SlaPolicy) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetPercentageSlaPolicy() { + if err := oprot.WriteFieldBegin("percentageSlaPolicy", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:percentageSlaPolicy: ", p), err) + } + if err := p.PercentageSlaPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PercentageSlaPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:percentageSlaPolicy: ", p), err) + } + } + return err +} + +func (p *SlaPolicy) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCountSlaPolicy() { + if err := oprot.WriteFieldBegin("countSlaPolicy", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:countSlaPolicy: ", p), err) + } + if err := p.CountSlaPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CountSlaPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:countSlaPolicy: ", p), err) + } + } + return err +} + +func (p *SlaPolicy) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetCoordinatorSlaPolicy() { + if err := oprot.WriteFieldBegin("coordinatorSlaPolicy", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:coordinatorSlaPolicy: ", p), err) + } + if err := p.CoordinatorSlaPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CoordinatorSlaPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:coordinatorSlaPolicy: ", p), err) + } + } + return err +} + +func (p *SlaPolicy) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SlaPolicy(%+v)", *p) +} + +// Description of the tasks contained within a job. +// +// Attributes: +// - Job: Job task belongs to. +// - Owner: contains the role component of JobKey +// - IsService +// - 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 +// - 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. +// - PartitionPolicy: Policy for how to deal with task partitions +// - SlaPolicy: SLA requirements to be met during maintenance +// - Container: the container the task should use to execute +type TaskConfig struct { + // unused fields # 1 to 6 + IsService bool `thrift:"isService,7" db:"isService" json:"isService"` + // unused fields # 8 to 10 + Priority int32 `thrift:"priority,11" db:"priority" json:"priority"` + // unused field # 12 + MaxTaskFailures int32 `thrift:"maxTaskFailures,13" db:"maxTaskFailures" json:"maxTaskFailures"` + // unused fields # 14 to 16 + Owner *Identity `thrift:"owner,17" db:"owner" json:"owner"` + Production *bool `thrift:"production,18" db:"production" json:"production,omitempty"` + // unused field # 19 + Constraints []*Constraint `thrift:"constraints,20" db:"constraints" json:"constraints"` + // unused field # 21 + TaskLinks map[string]string `thrift:"taskLinks,22" db:"taskLinks" json:"taskLinks,omitempty"` + ContactEmail *string `thrift:"contactEmail,23" db:"contactEmail" json:"contactEmail,omitempty"` + // unused field # 24 + ExecutorConfig *ExecutorConfig `thrift:"executorConfig,25" db:"executorConfig" json:"executorConfig,omitempty"` + // unused field # 26 + Metadata []*Metadata `thrift:"metadata,27" db:"metadata" json:"metadata,omitempty"` + Job *JobKey `thrift:"job,28" db:"job" json:"job"` + Container *Container `thrift:"container,29" db:"container" json:"container"` + Tier *string `thrift:"tier,30" db:"tier" json:"tier,omitempty"` + // unused field # 31 + Resources []*Resource `thrift:"resources,32" db:"resources" json:"resources"` + MesosFetcherUris []*MesosFetcherURI `thrift:"mesosFetcherUris,33" db:"mesosFetcherUris" json:"mesosFetcherUris,omitempty"` + PartitionPolicy *PartitionPolicy `thrift:"partitionPolicy,34" db:"partitionPolicy" json:"partitionPolicy,omitempty"` + SlaPolicy *SlaPolicy `thrift:"slaPolicy,35" db:"slaPolicy" json:"slaPolicy,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) 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() []*Resource { + return p.Resources +} + +func (p *TaskConfig) GetConstraints() []*Constraint { + return p.Constraints +} + +var TaskConfig_MesosFetcherUris_DEFAULT []*MesosFetcherURI + +func (p *TaskConfig) GetMesosFetcherUris() []*MesosFetcherURI { + 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 []*Metadata + +func (p *TaskConfig) GetMetadata() []*Metadata { + return p.Metadata +} + +var TaskConfig_PartitionPolicy_DEFAULT *PartitionPolicy + +func (p *TaskConfig) GetPartitionPolicy() *PartitionPolicy { + if !p.IsSetPartitionPolicy() { + return TaskConfig_PartitionPolicy_DEFAULT + } + return p.PartitionPolicy +} + +var TaskConfig_SlaPolicy_DEFAULT *SlaPolicy + +func (p *TaskConfig) GetSlaPolicy() *SlaPolicy { + if !p.IsSetSlaPolicy() { + return TaskConfig_SlaPolicy_DEFAULT + } + return p.SlaPolicy +} + +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) IsSetPartitionPolicy() bool { + return p.PartitionPolicy != nil +} + +func (p *TaskConfig) IsSetSlaPolicy() bool { + return p.SlaPolicy != 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField28(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 17: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField17(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.I32 { + if err := p.ReadField11(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 13: + if fieldTypeId == thrift.I32 { + if err := p.ReadField13(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 18: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField18(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 30: + if fieldTypeId == thrift.STRING { + if err := p.ReadField30(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 32: + if fieldTypeId == thrift.SET { + if err := p.ReadField32(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 20: + if fieldTypeId == thrift.SET { + if err := p.ReadField20(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 33: + if fieldTypeId == thrift.SET { + if err := p.ReadField33(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 22: + if fieldTypeId == thrift.MAP { + if err := p.ReadField22(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 23: + if fieldTypeId == thrift.STRING { + if err := p.ReadField23(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 25: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField25(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 27: + if fieldTypeId == thrift.SET { + if err := p.ReadField27(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 34: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField34(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 35: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField35(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 29: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField29(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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) 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([]*Resource, 0, 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 = append(p.Resources, _elem5) + } + 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([]*Constraint, 0, 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 = append(p.Constraints, _elem6) + } + 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([]*MesosFetcherURI, 0, size) + p.MesosFetcherUris = tSet + for i := 0; i < size; i++ { + _elem7 := &MesosFetcherURI{} + if err := _elem7.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) + } + p.MesosFetcherUris = append(p.MesosFetcherUris, _elem7) + } + 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 _key8 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key8 = v + } + var _val9 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val9 = v + } + p.TaskLinks[_key8] = _val9 + } + 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([]*Metadata, 0, size) + p.Metadata = tSet + for i := 0; i < size; i++ { + _elem10 := &Metadata{} + if err := _elem10.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) + } + p.Metadata = append(p.Metadata, _elem10) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + return nil +} + +func (p *TaskConfig) ReadField34(iprot thrift.TProtocol) error { + p.PartitionPolicy = &PartitionPolicy{} + if err := p.PartitionPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PartitionPolicy), err) + } + return nil +} + +func (p *TaskConfig) ReadField35(iprot thrift.TProtocol) error { + p.SlaPolicy = &SlaPolicy{} + if err := p.SlaPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SlaPolicy), 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 p != nil { + if err := p.writeField7(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.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 := p.writeField34(oprot); err != nil { + return err + } + if err := p.writeField35(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) 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 i := 0; i < len(p.Constraints); i++ { + for j := i + 1; j < len(p.Constraints); j++ { + if reflect.DeepEqual(p.Constraints[i], p.Constraints[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Constraints[i])) + } + } + } + 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) 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 i := 0; i < len(p.Metadata); i++ { + for j := i + 1; j < len(p.Metadata); j++ { + if reflect.DeepEqual(p.Metadata[i], p.Metadata[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Metadata[i])) + } + } + } + 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 i := 0; i < len(p.Resources); i++ { + for j := i + 1; j < len(p.Resources); j++ { + if reflect.DeepEqual(p.Resources[i], p.Resources[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Resources[i])) + } + } + } + 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 i := 0; i < len(p.MesosFetcherUris); i++ { + for j := i + 1; j < len(p.MesosFetcherUris); j++ { + if reflect.DeepEqual(p.MesosFetcherUris[i], p.MesosFetcherUris[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.MesosFetcherUris[i])) + } + } + } + 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) writeField34(oprot thrift.TProtocol) (err error) { + if p.IsSetPartitionPolicy() { + if err := oprot.WriteFieldBegin("partitionPolicy", thrift.STRUCT, 34); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 34:partitionPolicy: ", p), err) + } + if err := p.PartitionPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PartitionPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 34:partitionPolicy: ", p), err) + } + } + return err +} + +func (p *TaskConfig) writeField35(oprot thrift.TProtocol) (err error) { + if p.IsSetSlaPolicy() { + if err := oprot.WriteFieldBegin("slaPolicy", thrift.STRUCT, 35); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 35:slaPolicy: ", p), err) + } + if err := p.SlaPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SlaPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 35:slaPolicy: ", p), err) + } + } + return err +} + +func (p *TaskConfig) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TaskConfig(%+v)", *p) +} + +// Attributes: +// - Resources: Aggregated resource values. +type ResourceAggregate struct { + // unused fields # 1 to 3 + Resources []*Resource `thrift:"resources,4" db:"resources" json:"resources"` +} + +func NewResourceAggregate() *ResourceAggregate { + return &ResourceAggregate{} +} + +func (p *ResourceAggregate) GetResources() []*Resource { + 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 4: + if fieldTypeId == thrift.SET { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]*Resource, 0, size) + p.Resources = tSet + for i := 0; i < size; i++ { + _elem11 := &Resource{} + if err := _elem11.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + } + p.Resources = append(p.Resources, _elem11) + } + 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 p != nil { + 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) 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 i := 0; i < len(p.Resources); i++ { + for j := i + 1; j < len(p.Resources); j++ { + if reflect.DeepEqual(p.Resources[i], p.Resources[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Resources[i])) + } + } + } + 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 "" + } + 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" db:"cronSchedule" json:"cronSchedule,omitempty"` + CronCollisionPolicy CronCollisionPolicy `thrift:"cronCollisionPolicy,5" db:"cronCollisionPolicy" json:"cronCollisionPolicy"` + TaskConfig *TaskConfig `thrift:"taskConfig,6" db:"taskConfig" json:"taskConfig"` + Owner *Identity `thrift:"owner,7" db:"owner" json:"owner"` + InstanceCount int32 `thrift:"instanceCount,8" db:"instanceCount" json:"instanceCount"` + Key *JobKey `thrift:"key,9" db:"key" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.I32 { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"activeTaskCount" json:"activeTaskCount"` + FinishedTaskCount int32 `thrift:"finishedTaskCount,2" db:"finishedTaskCount" json:"finishedTaskCount"` + FailedTaskCount int32 `thrift:"failedTaskCount,3" db:"failedTaskCount" json:"failedTaskCount"` + PendingTaskCount int32 `thrift:"pendingTaskCount,4" db:"pendingTaskCount" 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"job" json:"job"` + Stats *JobStats `thrift:"stats,2" db:"stats" json:"stats"` + NextCronRunMs *int64 `thrift:"nextCronRunMs,3" db:"nextCronRunMs" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + return fmt.Sprintf("JobSummary(%+v)", *p) +} + +// Closed range of integers. +// +// Attributes: +// - First +// - Last +type Range struct { + First int32 `thrift:"first,1" db:"first" json:"first"` + Last int32 `thrift:"last,2" db:"last" 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + return fmt.Sprintf("Range(%+v)", *p) +} + +// Attributes: +// - Config +// - Instances +type ConfigGroup struct { + Config *TaskConfig `thrift:"config,1" db:"config" json:"config"` + // unused field # 2 + Instances []*Range `thrift:"instances,3" db:"instances" 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() []*Range { + 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.SET { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*Range, 0, size) + p.Instances = tSet + for i := 0; i < size; i++ { + _elem12 := &Range{} + if err := _elem12.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) + } + p.Instances = append(p.Instances, _elem12) + } + 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 p != nil { + 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 i := 0; i < len(p.Instances); i++ { + for j := i + 1; j < len(p.Instances); j++ { + if reflect.DeepEqual(p.Instances[i], p.Instances[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Instances[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("ConfigGroup(%+v)", *p) +} + +// Attributes: +// - Key +// - Groups +type ConfigSummary struct { + Key *JobKey `thrift:"key,1" db:"key" json:"key"` + Groups []*ConfigGroup `thrift:"groups,2" db:"groups" 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() []*ConfigGroup { + 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.SET { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*ConfigGroup, 0, size) + p.Groups = tSet + for i := 0; i < size; i++ { + _elem13 := &ConfigGroup{} + if err := _elem13.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) + } + p.Groups = append(p.Groups, _elem13) + } + 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 p != nil { + 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 i := 0; i < len(p.Groups); i++ { + for j := i + 1; j < len(p.Groups); j++ { + if reflect.DeepEqual(p.Groups[i], p.Groups[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Groups[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("ConfigSummary(%+v)", *p) +} + +// Attributes: +// - TaskConfig +type PopulateJobResult_ struct { + // unused field # 1 + TaskConfig *TaskConfig `thrift:"taskConfig,2" db:"taskConfig" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"quota" json:"quota"` + ProdSharedConsumption *ResourceAggregate `thrift:"prodSharedConsumption,2" db:"prodSharedConsumption" json:"prodSharedConsumption,omitempty"` + NonProdSharedConsumption *ResourceAggregate `thrift:"nonProdSharedConsumption,3" db:"nonProdSharedConsumption" json:"nonProdSharedConsumption,omitempty"` + ProdDedicatedConsumption *ResourceAggregate `thrift:"prodDedicatedConsumption,4" db:"prodDedicatedConsumption" json:"prodDedicatedConsumption,omitempty"` + NonProdDedicatedConsumption *ResourceAggregate `thrift:"nonProdDedicatedConsumption,5" db:"nonProdDedicatedConsumption" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"timestamp" json:"timestamp"` + Status ScheduleStatus `thrift:"status,2" db:"status" json:"status"` + Message *string `thrift:"message,3" db:"message" json:"message,omitempty"` + Scheduler *string `thrift:"scheduler,4" db:"scheduler" 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 fieldTypeId == thrift.I64 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"taskId" json:"taskId"` + SlaveId string `thrift:"slaveId,2" db:"slaveId" json:"slaveId"` + SlaveHost string `thrift:"slaveHost,3" db:"slaveHost" json:"slaveHost"` + Task *TaskConfig `thrift:"task,4" db:"task" json:"task"` + AssignedPorts map[string]int32 `thrift:"assignedPorts,5" db:"assignedPorts" json:"assignedPorts"` + InstanceId int32 `thrift:"instanceId,6" db:"instanceId" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.MAP { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I32 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 _key14 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key14 = v + } + var _val15 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val15 = v + } + p.AssignedPorts[_key14] = _val15 + } + 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 p != nil { + 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 "" + } + 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. +// - TimesPartitioned: The number of partitions this task has accumulated over its lifetime. +// - 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" db:"assignedTask" json:"assignedTask"` + Status ScheduleStatus `thrift:"status,2" db:"status" json:"status"` + FailureCount int32 `thrift:"failureCount,3" db:"failureCount" json:"failureCount"` + TaskEvents []*TaskEvent `thrift:"taskEvents,4" db:"taskEvents" json:"taskEvents"` + AncestorId string `thrift:"ancestorId,5" db:"ancestorId" json:"ancestorId"` + TimesPartitioned int32 `thrift:"timesPartitioned,6" db:"timesPartitioned" json:"timesPartitioned"` +} + +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) GetTimesPartitioned() int32 { + return p.TimesPartitioned +} + +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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I32 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.TimesPartitioned = 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++ { + _elem16 := &TaskEvent{} + if err := _elem16.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem16), err) + } + p.TaskEvents = append(p.TaskEvents, _elem16) + } + 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 p != nil { + 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 *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) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("timesPartitioned", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:timesPartitioned: ", p), err) + } + if err := oprot.WriteI32(int32(p.TimesPartitioned)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timesPartitioned (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:timesPartitioned: ", p), err) + } + return err +} + +func (p *ScheduledTask) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ScheduledTask(%+v)", *p) +} + +// Attributes: +// - Tasks +type ScheduleStatusResult_ struct { + Tasks []*ScheduledTask `thrift:"tasks,1" db:"tasks" 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 fieldTypeId == thrift.LIST { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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++ { + _elem17 := &ScheduledTask{} + if err := _elem17.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) + } + p.Tasks = append(p.Tasks, _elem17) + } + 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 p != nil { + 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 "" + } + return fmt.Sprintf("ScheduleStatusResult_(%+v)", *p) +} + +// Attributes: +// - Configs +type GetJobsResult_ struct { + Configs []*JobConfiguration `thrift:"configs,1" db:"configs" json:"configs"` +} + +func NewGetJobsResult_() *GetJobsResult_ { + return &GetJobsResult_{} +} + +func (p *GetJobsResult_) GetConfigs() []*JobConfiguration { + 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 fieldTypeId == thrift.SET { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*JobConfiguration, 0, size) + p.Configs = tSet + for i := 0; i < size; i++ { + _elem18 := &JobConfiguration{} + if err := _elem18.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) + } + p.Configs = append(p.Configs, _elem18) + } + 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 p != nil { + 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 i := 0; i < len(p.Configs); i++ { + for j := i + 1; j < len(p.Configs); j++ { + if reflect.DeepEqual(p.Configs[i], p.Configs[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Configs[i])) + } + } + } + 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 "" + } + 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" db:"jobName" json:"jobName,omitempty"` + // unused field # 3 + TaskIds []string `thrift:"taskIds,4" db:"taskIds" json:"taskIds,omitempty"` + Statuses []ScheduleStatus `thrift:"statuses,5" db:"statuses" json:"statuses,omitempty"` + // unused field # 6 + InstanceIds []int32 `thrift:"instanceIds,7" db:"instanceIds" json:"instanceIds,omitempty"` + // unused field # 8 + Environment *string `thrift:"environment,9" db:"environment" json:"environment,omitempty"` + SlaveHosts []string `thrift:"slaveHosts,10" db:"slaveHosts" json:"slaveHosts,omitempty"` + JobKeys []*JobKey `thrift:"jobKeys,11" db:"jobKeys" json:"jobKeys,omitempty"` + Offset *int32 `thrift:"offset,12" db:"offset" json:"offset,omitempty"` + Limit *int32 `thrift:"limit,13" db:"limit" json:"limit,omitempty"` + Role *string `thrift:"role,14" db:"role" 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 []string + +func (p *TaskQuery) GetTaskIds() []string { + return p.TaskIds +} + +var TaskQuery_Statuses_DEFAULT []ScheduleStatus + +func (p *TaskQuery) GetStatuses() []ScheduleStatus { + return p.Statuses +} + +var TaskQuery_InstanceIds_DEFAULT []int32 + +func (p *TaskQuery) GetInstanceIds() []int32 { + return p.InstanceIds +} + +var TaskQuery_SlaveHosts_DEFAULT []string + +func (p *TaskQuery) GetSlaveHosts() []string { + return p.SlaveHosts +} + +var TaskQuery_JobKeys_DEFAULT []*JobKey + +func (p *TaskQuery) GetJobKeys() []*JobKey { + 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 fieldTypeId == thrift.STRING { + if err := p.ReadField14(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.STRING { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.SET { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.SET { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.SET { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.SET { + if err := p.ReadField10(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.SET { + if err := p.ReadField11(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 12: + if fieldTypeId == thrift.I32 { + if err := p.ReadField12(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 13: + if fieldTypeId == thrift.I32 { + if err := p.ReadField13(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]string, 0, size) + p.TaskIds = tSet + for i := 0; i < size; i++ { + var _elem19 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem19 = v + } + p.TaskIds = append(p.TaskIds, _elem19) + } + 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([]ScheduleStatus, 0, size) + p.Statuses = tSet + for i := 0; i < size; i++ { + var _elem20 ScheduleStatus + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := ScheduleStatus(v) + _elem20 = temp + } + p.Statuses = append(p.Statuses, _elem20) + } + 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([]int32, 0, size) + p.InstanceIds = tSet + for i := 0; i < size; i++ { + var _elem21 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem21 = v + } + p.InstanceIds = append(p.InstanceIds, _elem21) + } + 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([]string, 0, size) + p.SlaveHosts = tSet + for i := 0; i < size; i++ { + var _elem22 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem22 = v + } + p.SlaveHosts = append(p.SlaveHosts, _elem22) + } + 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([]*JobKey, 0, size) + p.JobKeys = tSet + for i := 0; i < size; i++ { + _elem23 := &JobKey{} + if err := _elem23.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) + } + p.JobKeys = append(p.JobKeys, _elem23) + } + 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 p != nil { + 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 i := 0; i < len(p.TaskIds); i++ { + for j := i + 1; j < len(p.TaskIds); j++ { + if reflect.DeepEqual(p.TaskIds[i], p.TaskIds[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.TaskIds[i])) + } + } + } + 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 i := 0; i < len(p.Statuses); i++ { + for j := i + 1; j < len(p.Statuses); j++ { + if reflect.DeepEqual(p.Statuses[i], p.Statuses[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Statuses[i])) + } + } + } + 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 i := 0; i < len(p.InstanceIds); i++ { + for j := i + 1; j < len(p.InstanceIds); j++ { + if reflect.DeepEqual(p.InstanceIds[i], p.InstanceIds[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.InstanceIds[i])) + } + } + } + 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 i := 0; i < len(p.SlaveHosts); i++ { + for j := i + 1; j < len(p.SlaveHosts); j++ { + if reflect.DeepEqual(p.SlaveHosts[i], p.SlaveHosts[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.SlaveHosts[i])) + } + } + } + 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 i := 0; i < len(p.JobKeys); i++ { + for j := i + 1; j < len(p.JobKeys); j++ { + if reflect.DeepEqual(p.JobKeys[i], p.JobKeys[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.JobKeys[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("TaskQuery(%+v)", *p) +} + +// Attributes: +// - Host +// - Mode +type HostStatus struct { + Host string `thrift:"host,1" db:"host" json:"host"` + Mode MaintenanceMode `thrift:"mode,2" db:"mode" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + return fmt.Sprintf("HostStatus(%+v)", *p) +} + +// Attributes: +// - Role +// - JobCount +// - CronJobCount +type RoleSummary struct { + Role string `thrift:"role,1" db:"role" json:"role"` + JobCount int32 `thrift:"jobCount,2" db:"jobCount" json:"jobCount"` + CronJobCount int32 `thrift:"cronJobCount,3" db:"cronJobCount" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + return fmt.Sprintf("RoleSummary(%+v)", *p) +} + +// Attributes: +// - HostNames +type Hosts struct { + HostNames []string `thrift:"hostNames,1" db:"hostNames" json:"hostNames"` +} + +func NewHosts() *Hosts { + return &Hosts{} +} + +func (p *Hosts) GetHostNames() []string { + 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 fieldTypeId == thrift.SET { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]string, 0, size) + p.HostNames = tSet + for i := 0; i < size; i++ { + var _elem24 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem24 = v + } + p.HostNames = append(p.HostNames, _elem24) + } + 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 p != nil { + 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 i := 0; i < len(p.HostNames); i++ { + for j := i + 1; j < len(p.HostNames); j++ { + if reflect.DeepEqual(p.HostNames[i], p.HostNames[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.HostNames[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("Hosts(%+v)", *p) +} + +// Attributes: +// - TaskId +// - Reason +type PendingReason struct { + TaskId string `thrift:"taskId,1" db:"taskId" json:"taskId"` + Reason string `thrift:"reason,2" db:"reason" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"job" json:"job"` + ID string `thrift:"id,2" db:"id" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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. +// - SlaAware: If true, updates will obey the SLA requirements of the tasks being updated. If the SLA policy +// differs between the old and new task configurations, updates will use the newest configuration. +type JobUpdateSettings struct { + UpdateGroupSize int32 `thrift:"updateGroupSize,1" db:"updateGroupSize" json:"updateGroupSize"` + MaxPerInstanceFailures int32 `thrift:"maxPerInstanceFailures,2" db:"maxPerInstanceFailures" json:"maxPerInstanceFailures"` + MaxFailedInstances int32 `thrift:"maxFailedInstances,3" db:"maxFailedInstances" json:"maxFailedInstances"` + // unused field # 4 + MinWaitInInstanceRunningMs int32 `thrift:"minWaitInInstanceRunningMs,5" db:"minWaitInInstanceRunningMs" json:"minWaitInInstanceRunningMs"` + RollbackOnFailure bool `thrift:"rollbackOnFailure,6" db:"rollbackOnFailure" json:"rollbackOnFailure"` + UpdateOnlyTheseInstances []*Range `thrift:"updateOnlyTheseInstances,7" db:"updateOnlyTheseInstances" json:"updateOnlyTheseInstances"` + WaitForBatchCompletion bool `thrift:"waitForBatchCompletion,8" db:"waitForBatchCompletion" json:"waitForBatchCompletion"` + BlockIfNoPulsesAfterMs *int32 `thrift:"blockIfNoPulsesAfterMs,9" db:"blockIfNoPulsesAfterMs" json:"blockIfNoPulsesAfterMs,omitempty"` + SlaAware *bool `thrift:"slaAware,10" db:"slaAware" json:"slaAware,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() []*Range { + 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 +} + +var JobUpdateSettings_SlaAware_DEFAULT bool + +func (p *JobUpdateSettings) GetSlaAware() bool { + if !p.IsSetSlaAware() { + return JobUpdateSettings_SlaAware_DEFAULT + } + return *p.SlaAware +} +func (p *JobUpdateSettings) IsSetBlockIfNoPulsesAfterMs() bool { + return p.BlockIfNoPulsesAfterMs != nil +} + +func (p *JobUpdateSettings) IsSetSlaAware() bool { + return p.SlaAware != 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.SET { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.I32 { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField10(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*Range, 0, size) + p.UpdateOnlyTheseInstances = tSet + for i := 0; i < size; i++ { + _elem25 := &Range{} + if err := _elem25.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) + } + p.UpdateOnlyTheseInstances = append(p.UpdateOnlyTheseInstances, _elem25) + } + 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) ReadField10(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 10: ", err) + } else { + p.SlaAware = &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 p != nil { + 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 := p.writeField10(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 i := 0; i < len(p.UpdateOnlyTheseInstances); i++ { + for j := i + 1; j < len(p.UpdateOnlyTheseInstances); j++ { + if reflect.DeepEqual(p.UpdateOnlyTheseInstances[i], p.UpdateOnlyTheseInstances[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.UpdateOnlyTheseInstances[i])) + } + } + } + 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) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetSlaAware() { + if err := oprot.WriteFieldBegin("slaAware", thrift.BOOL, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:slaAware: ", p), err) + } + if err := oprot.WriteBool(bool(*p.SlaAware)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.slaAware (10) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:slaAware: ", p), err) + } + } + return err +} + +func (p *JobUpdateSettings) String() string { + if p == nil { + return "" + } + 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" db:"status" json:"status"` + TimestampMs int64 `thrift:"timestampMs,2" db:"timestampMs" json:"timestampMs"` + User *string `thrift:"user,3" db:"user" json:"user,omitempty"` + Message *string `thrift:"message,4" db:"message" 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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. +// - Message: Optional message explaining the instance update event. +type JobInstanceUpdateEvent struct { + InstanceId int32 `thrift:"instanceId,1" db:"instanceId" json:"instanceId"` + TimestampMs int64 `thrift:"timestampMs,2" db:"timestampMs" json:"timestampMs"` + Action JobUpdateAction `thrift:"action,3" db:"action" json:"action"` + Message *string `thrift:"message,4" db:"message" json:"message,omitempty"` +} + +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 +} + +var JobInstanceUpdateEvent_Message_DEFAULT string + +func (p *JobInstanceUpdateEvent) GetMessage() string { + if !p.IsSetMessage() { + return JobInstanceUpdateEvent_Message_DEFAULT + } + return *p.Message +} +func (p *JobInstanceUpdateEvent) IsSetMessage() bool { + return p.Message != nil +} + +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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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) 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 *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 p != nil { + 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 *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) 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 *JobInstanceUpdateEvent) String() string { + if p == nil { + return "" + } + 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" db:"task" json:"task"` + Instances []*Range `thrift:"instances,2" db:"instances" 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() []*Range { + 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.SET { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*Range, 0, size) + p.Instances = 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.Instances = append(p.Instances, _elem26) + } + 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 p != nil { + 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 i := 0; i < len(p.Instances); i++ { + for j := i + 1; j < len(p.Instances); j++ { + if reflect.DeepEqual(p.Instances[i], p.Instances[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Instances[i])) + } + } + } + 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 "" + } + 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" db:"status" json:"status"` + CreatedTimestampMs int64 `thrift:"createdTimestampMs,2" db:"createdTimestampMs" json:"createdTimestampMs"` + LastModifiedTimestampMs int64 `thrift:"lastModifiedTimestampMs,3" db:"lastModifiedTimestampMs" 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"user" json:"user"` + State *JobUpdateState `thrift:"state,4" db:"state" json:"state"` + Key *JobUpdateKey `thrift:"key,5" db:"key" json:"key"` + Metadata []*Metadata `thrift:"metadata,6" db:"metadata" 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 []*Metadata + +func (p *JobUpdateSummary) GetMetadata() []*Metadata { + 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.SET { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*Metadata, 0, size) + p.Metadata = tSet + for i := 0; i < size; i++ { + _elem27 := &Metadata{} + if err := _elem27.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) + } + p.Metadata = append(p.Metadata, _elem27) + } + 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 p != nil { + 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 i := 0; i < len(p.Metadata); i++ { + for j := i + 1; j < len(p.Metadata); j++ { + if reflect.DeepEqual(p.Metadata[i], p.Metadata[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Metadata[i])) + } + } + } + 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 "" + } + 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 []*InstanceTaskConfig `thrift:"initialState,1" db:"initialState" json:"initialState"` + DesiredState *InstanceTaskConfig `thrift:"desiredState,2" db:"desiredState" json:"desiredState"` + Settings *JobUpdateSettings `thrift:"settings,3" db:"settings" json:"settings"` +} + +func NewJobUpdateInstructions() *JobUpdateInstructions { + return &JobUpdateInstructions{} +} + +func (p *JobUpdateInstructions) GetInitialState() []*InstanceTaskConfig { + 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 fieldTypeId == thrift.SET { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*InstanceTaskConfig, 0, size) + p.InitialState = tSet + for i := 0; i < size; i++ { + _elem28 := &InstanceTaskConfig{} + if err := _elem28.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem28), err) + } + p.InitialState = append(p.InitialState, _elem28) + } + 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 p != nil { + 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 i := 0; i < len(p.InitialState); i++ { + for j := i + 1; j < len(p.InitialState); j++ { + if reflect.DeepEqual(p.InitialState[i], p.InitialState[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.InitialState[i])) + } + } + } + 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 "" + } + 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" db:"summary" json:"summary"` + Instructions *JobUpdateInstructions `thrift:"instructions,2" db:"instructions" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"update" json:"update"` + UpdateEvents []*JobUpdateEvent `thrift:"updateEvents,2" db:"updateEvents" json:"updateEvents"` + InstanceEvents []*JobInstanceUpdateEvent `thrift:"instanceEvents,3" db:"instanceEvents" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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++ { + _elem29 := &JobUpdateEvent{} + if err := _elem29.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) + } + p.UpdateEvents = append(p.UpdateEvents, _elem29) + } + 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++ { + _elem30 := &JobInstanceUpdateEvent{} + if err := _elem30.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) + } + p.InstanceEvents = append(p.InstanceEvents, _elem30) + } + 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 p != nil { + 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 "" + } + 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" db:"taskConfig" json:"taskConfig"` + InstanceCount int32 `thrift:"instanceCount,2" db:"instanceCount" json:"instanceCount"` + Settings *JobUpdateSettings `thrift:"settings,3" db:"settings" json:"settings"` + Metadata []*Metadata `thrift:"metadata,4" db:"metadata" 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 []*Metadata + +func (p *JobUpdateRequest) GetMetadata() []*Metadata { + 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.SET { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*Metadata, 0, size) + p.Metadata = tSet + for i := 0; i < size; i++ { + _elem31 := &Metadata{} + if err := _elem31.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem31), err) + } + p.Metadata = append(p.Metadata, _elem31) + } + 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 p != nil { + 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 i := 0; i < len(p.Metadata); i++ { + for j := i + 1; j < len(p.Metadata); j++ { + if reflect.DeepEqual(p.Metadata[i], p.Metadata[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Metadata[i])) + } + } + } + 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 "" + } + 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" db:"role" json:"role,omitempty"` + JobKey *JobKey `thrift:"jobKey,3" db:"jobKey" json:"jobKey,omitempty"` + User *string `thrift:"user,4" db:"user" json:"user,omitempty"` + UpdateStatuses []JobUpdateStatus `thrift:"updateStatuses,5" db:"updateStatuses" json:"updateStatuses,omitempty"` + Offset int32 `thrift:"offset,6" db:"offset" json:"offset"` + Limit int32 `thrift:"limit,7" db:"limit" json:"limit"` + Key *JobUpdateKey `thrift:"key,8" db:"key" 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 []JobUpdateStatus + +func (p *JobUpdateQuery) GetUpdateStatuses() []JobUpdateStatus { + 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 fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.SET { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I32 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I32 { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]JobUpdateStatus, 0, size) + p.UpdateStatuses = tSet + for i := 0; i < size; i++ { + var _elem32 JobUpdateStatus + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + temp := JobUpdateStatus(v) + _elem32 = temp + } + p.UpdateStatuses = append(p.UpdateStatuses, _elem32) + } + 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 p != nil { + 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 i := 0; i < len(p.UpdateStatuses); i++ { + for j := i + 1; j < len(p.UpdateStatuses); j++ { + if reflect.DeepEqual(p.UpdateStatuses[i], p.UpdateStatuses[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.UpdateStatuses[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("JobUpdateQuery(%+v)", *p) +} + +// Attributes: +// - Host +// - DefaultSlaPolicy +// - TimeoutSecs +// - CreatedTimestampMs +type HostMaintenanceRequest struct { + Host string `thrift:"host,1" db:"host" json:"host"` + DefaultSlaPolicy *SlaPolicy `thrift:"defaultSlaPolicy,2" db:"defaultSlaPolicy" json:"defaultSlaPolicy"` + TimeoutSecs int64 `thrift:"timeoutSecs,3" db:"timeoutSecs" json:"timeoutSecs"` + CreatedTimestampMs int64 `thrift:"createdTimestampMs,4" db:"createdTimestampMs" json:"createdTimestampMs"` +} + +func NewHostMaintenanceRequest() *HostMaintenanceRequest { + return &HostMaintenanceRequest{} +} + +func (p *HostMaintenanceRequest) GetHost() string { + return p.Host +} + +var HostMaintenanceRequest_DefaultSlaPolicy_DEFAULT *SlaPolicy + +func (p *HostMaintenanceRequest) GetDefaultSlaPolicy() *SlaPolicy { + if !p.IsSetDefaultSlaPolicy() { + return HostMaintenanceRequest_DefaultSlaPolicy_DEFAULT + } + return p.DefaultSlaPolicy +} + +func (p *HostMaintenanceRequest) GetTimeoutSecs() int64 { + return p.TimeoutSecs +} + +func (p *HostMaintenanceRequest) GetCreatedTimestampMs() int64 { + return p.CreatedTimestampMs +} +func (p *HostMaintenanceRequest) IsSetDefaultSlaPolicy() bool { + return p.DefaultSlaPolicy != nil +} + +func (p *HostMaintenanceRequest) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *HostMaintenanceRequest) 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 *HostMaintenanceRequest) ReadField2(iprot thrift.TProtocol) error { + p.DefaultSlaPolicy = &SlaPolicy{} + if err := p.DefaultSlaPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DefaultSlaPolicy), err) + } + return nil +} + +func (p *HostMaintenanceRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.TimeoutSecs = v + } + return nil +} + +func (p *HostMaintenanceRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.CreatedTimestampMs = v + } + return nil +} + +func (p *HostMaintenanceRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("HostMaintenanceRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *HostMaintenanceRequest) 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 *HostMaintenanceRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("defaultSlaPolicy", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:defaultSlaPolicy: ", p), err) + } + if err := p.DefaultSlaPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DefaultSlaPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:defaultSlaPolicy: ", p), err) + } + return err +} + +func (p *HostMaintenanceRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("timeoutSecs", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:timeoutSecs: ", p), err) + } + if err := oprot.WriteI64(int64(p.TimeoutSecs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timeoutSecs (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:timeoutSecs: ", p), err) + } + return err +} + +func (p *HostMaintenanceRequest) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("createdTimestampMs", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:createdTimestampMs: ", p), err) + } + if err := oprot.WriteI64(int64(p.CreatedTimestampMs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.createdTimestampMs (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:createdTimestampMs: ", p), err) + } + return err +} + +func (p *HostMaintenanceRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HostMaintenanceRequest(%+v)", *p) +} + +// Attributes: +// - Backups +type ListBackupsResult_ struct { + Backups []string `thrift:"backups,1" db:"backups" json:"backups"` +} + +func NewListBackupsResult_() *ListBackupsResult_ { + return &ListBackupsResult_{} +} + +func (p *ListBackupsResult_) GetBackups() []string { + 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 fieldTypeId == thrift.SET { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]string, 0, size) + p.Backups = tSet + for i := 0; i < size; i++ { + var _elem33 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem33 = v + } + p.Backups = append(p.Backups, _elem33) + } + 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 p != nil { + 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 i := 0; i < len(p.Backups); i++ { + for j := i + 1; j < len(p.Backups); j++ { + if reflect.DeepEqual(p.Backups[i], p.Backups[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Backups[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("ListBackupsResult_(%+v)", *p) +} + +// Attributes: +// - Statuses +type StartMaintenanceResult_ struct { + Statuses []*HostStatus `thrift:"statuses,1" db:"statuses" json:"statuses"` +} + +func NewStartMaintenanceResult_() *StartMaintenanceResult_ { + return &StartMaintenanceResult_{} +} + +func (p *StartMaintenanceResult_) GetStatuses() []*HostStatus { + 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 fieldTypeId == thrift.SET { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*HostStatus, 0, size) + p.Statuses = tSet + for i := 0; i < size; i++ { + _elem34 := &HostStatus{} + if err := _elem34.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem34), err) + } + p.Statuses = append(p.Statuses, _elem34) + } + 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 p != nil { + 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 i := 0; i < len(p.Statuses); i++ { + for j := i + 1; j < len(p.Statuses); j++ { + if reflect.DeepEqual(p.Statuses[i], p.Statuses[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Statuses[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("StartMaintenanceResult_(%+v)", *p) +} + +// Attributes: +// - Statuses +type DrainHostsResult_ struct { + Statuses []*HostStatus `thrift:"statuses,1" db:"statuses" json:"statuses"` +} + +func NewDrainHostsResult_() *DrainHostsResult_ { + return &DrainHostsResult_{} +} + +func (p *DrainHostsResult_) GetStatuses() []*HostStatus { + 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 fieldTypeId == thrift.SET { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*HostStatus, 0, 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 = append(p.Statuses, _elem35) + } + 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 p != nil { + 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 i := 0; i < len(p.Statuses); i++ { + for j := i + 1; j < len(p.Statuses); j++ { + if reflect.DeepEqual(p.Statuses[i], p.Statuses[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Statuses[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("DrainHostsResult_(%+v)", *p) +} + +// Attributes: +// - Tasks +type QueryRecoveryResult_ struct { + Tasks []*ScheduledTask `thrift:"tasks,1" db:"tasks" json:"tasks"` +} + +func NewQueryRecoveryResult_() *QueryRecoveryResult_ { + return &QueryRecoveryResult_{} +} + +func (p *QueryRecoveryResult_) GetTasks() []*ScheduledTask { + 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 fieldTypeId == thrift.SET { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*ScheduledTask, 0, size) + p.Tasks = tSet + for i := 0; i < size; i++ { + _elem36 := &ScheduledTask{} + if err := _elem36.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem36), err) + } + p.Tasks = append(p.Tasks, _elem36) + } + 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 p != nil { + 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 i := 0; i < len(p.Tasks); i++ { + for j := i + 1; j < len(p.Tasks); j++ { + if reflect.DeepEqual(p.Tasks[i], p.Tasks[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Tasks[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("QueryRecoveryResult_(%+v)", *p) +} + +// Attributes: +// - Statuses +type MaintenanceStatusResult_ struct { + Statuses []*HostStatus `thrift:"statuses,1" db:"statuses" json:"statuses"` +} + +func NewMaintenanceStatusResult_() *MaintenanceStatusResult_ { + return &MaintenanceStatusResult_{} +} + +func (p *MaintenanceStatusResult_) GetStatuses() []*HostStatus { + 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 fieldTypeId == thrift.SET { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*HostStatus, 0, size) + p.Statuses = tSet + for i := 0; i < size; i++ { + _elem37 := &HostStatus{} + if err := _elem37.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem37), err) + } + p.Statuses = append(p.Statuses, _elem37) + } + 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 p != nil { + 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 i := 0; i < len(p.Statuses); i++ { + for j := i + 1; j < len(p.Statuses); j++ { + if reflect.DeepEqual(p.Statuses[i], p.Statuses[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Statuses[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("MaintenanceStatusResult_(%+v)", *p) +} + +// Attributes: +// - Statuses +type EndMaintenanceResult_ struct { + Statuses []*HostStatus `thrift:"statuses,1" db:"statuses" json:"statuses"` +} + +func NewEndMaintenanceResult_() *EndMaintenanceResult_ { + return &EndMaintenanceResult_{} +} + +func (p *EndMaintenanceResult_) GetStatuses() []*HostStatus { + 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 fieldTypeId == thrift.SET { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*HostStatus, 0, 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 = append(p.Statuses, _elem38) + } + 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 p != nil { + 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 i := 0; i < len(p.Statuses); i++ { + for j := i + 1; j < len(p.Statuses); j++ { + if reflect.DeepEqual(p.Statuses[i], p.Statuses[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Statuses[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("EndMaintenanceResult_(%+v)", *p) +} + +// Attributes: +// - Summaries +type RoleSummaryResult_ struct { + Summaries []*RoleSummary `thrift:"summaries,1" db:"summaries" json:"summaries"` +} + +func NewRoleSummaryResult_() *RoleSummaryResult_ { + return &RoleSummaryResult_{} +} + +func (p *RoleSummaryResult_) GetSummaries() []*RoleSummary { + 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 fieldTypeId == thrift.SET { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*RoleSummary, 0, size) + p.Summaries = tSet + for i := 0; i < size; i++ { + _elem39 := &RoleSummary{} + if err := _elem39.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem39), err) + } + p.Summaries = append(p.Summaries, _elem39) + } + 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 p != nil { + 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 i := 0; i < len(p.Summaries); i++ { + for j := i + 1; j < len(p.Summaries); j++ { + if reflect.DeepEqual(p.Summaries[i], p.Summaries[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Summaries[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("RoleSummaryResult_(%+v)", *p) +} + +// Attributes: +// - Summaries +type JobSummaryResult_ struct { + Summaries []*JobSummary `thrift:"summaries,1" db:"summaries" json:"summaries"` +} + +func NewJobSummaryResult_() *JobSummaryResult_ { + return &JobSummaryResult_{} +} + +func (p *JobSummaryResult_) GetSummaries() []*JobSummary { + 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 fieldTypeId == thrift.SET { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*JobSummary, 0, size) + p.Summaries = tSet + for i := 0; i < size; i++ { + _elem40 := &JobSummary{} + if err := _elem40.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem40), err) + } + p.Summaries = append(p.Summaries, _elem40) + } + 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 p != nil { + 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 i := 0; i < len(p.Summaries); i++ { + for j := i + 1; j < len(p.Summaries); j++ { + if reflect.DeepEqual(p.Summaries[i], p.Summaries[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Summaries[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("JobSummaryResult_(%+v)", *p) +} + +// Attributes: +// - Summary +type ConfigSummaryResult_ struct { + Summary *ConfigSummary `thrift:"summary,1" db:"summary" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + return fmt.Sprintf("ConfigSummaryResult_(%+v)", *p) +} + +// Attributes: +// - Reasons +type GetPendingReasonResult_ struct { + Reasons []*PendingReason `thrift:"reasons,1" db:"reasons" json:"reasons"` +} + +func NewGetPendingReasonResult_() *GetPendingReasonResult_ { + return &GetPendingReasonResult_{} +} + +func (p *GetPendingReasonResult_) GetReasons() []*PendingReason { + 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 fieldTypeId == thrift.SET { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*PendingReason, 0, size) + p.Reasons = tSet + for i := 0; i < size; i++ { + _elem41 := &PendingReason{} + if err := _elem41.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem41), err) + } + p.Reasons = append(p.Reasons, _elem41) + } + 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 p != nil { + 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 i := 0; i < len(p.Reasons); i++ { + for j := i + 1; j < len(p.Reasons); j++ { + if reflect.DeepEqual(p.Reasons[i], p.Reasons[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Reasons[i])) + } + } + } + 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 "" + } + 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" db:"key" json:"key"` + UpdateSummary *JobUpdateSummary `thrift:"updateSummary,2" db:"updateSummary" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + return fmt.Sprintf("StartJobUpdateResult_(%+v)", *p) +} + +// Result of the getJobUpdateSummaries call. +// +// Attributes: +// - UpdateSummaries +type GetJobUpdateSummariesResult_ struct { + UpdateSummaries []*JobUpdateSummary `thrift:"updateSummaries,1" db:"updateSummaries" 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 fieldTypeId == thrift.LIST { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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++ { + _elem42 := &JobUpdateSummary{} + if err := _elem42.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem42), err) + } + p.UpdateSummaries = append(p.UpdateSummaries, _elem42) + } + 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 p != nil { + 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 "" + } + return fmt.Sprintf("GetJobUpdateSummariesResult_(%+v)", *p) +} + +// Result of the getJobUpdateDetails call. +// +// Attributes: +// - Details +// - DetailsList +type GetJobUpdateDetailsResult_ struct { + Details *JobUpdateDetails `thrift:"details,1" db:"details" json:"details"` + DetailsList []*JobUpdateDetails `thrift:"detailsList,2" db:"detailsList" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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++ { + _elem43 := &JobUpdateDetails{} + if err := _elem43.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem43), err) + } + p.DetailsList = append(p.DetailsList, _elem43) + } + 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 p != nil { + 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 "" + } + return fmt.Sprintf("GetJobUpdateDetailsResult_(%+v)", *p) +} + +// Result of the pulseJobUpdate call. +// +// Attributes: +// - Status +type PulseJobUpdateResult_ struct { + Status JobUpdatePulseStatus `thrift:"status,1" db:"status" 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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 []*ConfigGroup `thrift:"add,1" db:"add" json:"add"` + Remove []*ConfigGroup `thrift:"remove,2" db:"remove" json:"remove"` + Update []*ConfigGroup `thrift:"update,3" db:"update" json:"update"` + Unchanged []*ConfigGroup `thrift:"unchanged,4" db:"unchanged" json:"unchanged"` +} + +func NewGetJobUpdateDiffResult_() *GetJobUpdateDiffResult_ { + return &GetJobUpdateDiffResult_{} +} + +func (p *GetJobUpdateDiffResult_) GetAdd() []*ConfigGroup { + return p.Add +} + +func (p *GetJobUpdateDiffResult_) GetRemove() []*ConfigGroup { + return p.Remove +} + +func (p *GetJobUpdateDiffResult_) GetUpdate() []*ConfigGroup { + return p.Update +} + +func (p *GetJobUpdateDiffResult_) GetUnchanged() []*ConfigGroup { + 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 fieldTypeId == thrift.SET { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.SET { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.SET { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.SET { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*ConfigGroup, 0, size) + p.Add = tSet + for i := 0; i < size; i++ { + _elem44 := &ConfigGroup{} + if err := _elem44.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem44), err) + } + p.Add = append(p.Add, _elem44) + } + 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([]*ConfigGroup, 0, size) + p.Remove = 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.Remove = append(p.Remove, _elem45) + } + 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([]*ConfigGroup, 0, size) + p.Update = 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.Update = append(p.Update, _elem46) + } + 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([]*ConfigGroup, 0, size) + p.Unchanged = 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.Unchanged = append(p.Unchanged, _elem47) + } + 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 p != nil { + 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 i := 0; i < len(p.Add); i++ { + for j := i + 1; j < len(p.Add); j++ { + if reflect.DeepEqual(p.Add[i], p.Add[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Add[i])) + } + } + } + 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 i := 0; i < len(p.Remove); i++ { + for j := i + 1; j < len(p.Remove); j++ { + if reflect.DeepEqual(p.Remove[i], p.Remove[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Remove[i])) + } + } + } + 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 i := 0; i < len(p.Update); i++ { + for j := i + 1; j < len(p.Update); j++ { + if reflect.DeepEqual(p.Update[i], p.Update[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Update[i])) + } + } + } + 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 i := 0; i < len(p.Unchanged); i++ { + for j := i + 1; j < len(p.Unchanged); j++ { + if reflect.DeepEqual(p.Unchanged[i], p.Unchanged[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Unchanged[i])) + } + } + } + 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 "" + } + return fmt.Sprintf("GetJobUpdateDiffResult_(%+v)", *p) +} + +// Tier information. +// +// Attributes: +// - Name: Name of tier. +// - Settings: Tier attributes. +type TierConfig struct { + Name string `thrift:"name,1" db:"name" json:"name"` + Settings map[string]string `thrift:"settings,2" db:"settings" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 _key48 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _key48 = v + } + var _val49 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _val49 = v + } + p.Settings[_key48] = _val49 + } + 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 p != nil { + 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 "" + } + 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" db:"defaultTierName" json:"defaultTierName"` + Tiers []*TierConfig `thrift:"tiers,2" db:"tiers" json:"tiers"` +} + +func NewGetTierConfigResult_() *GetTierConfigResult_ { + return &GetTierConfigResult_{} +} + +func (p *GetTierConfigResult_) GetDefaultTierName() string { + return p.DefaultTierName +} + +func (p *GetTierConfigResult_) GetTiers() []*TierConfig { + 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.SET { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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([]*TierConfig, 0, size) + p.Tiers = tSet + for i := 0; i < size; i++ { + _elem50 := &TierConfig{} + if err := _elem50.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem50), err) + } + p.Tiers = append(p.Tiers, _elem50) + } + 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 p != nil { + 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 i := 0; i < len(p.Tiers); i++ { + for j := i + 1; j < len(p.Tiers); j++ { + if reflect.DeepEqual(p.Tiers[i], p.Tiers[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Tiers[i])) + } + } + } + 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 "" + } + 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" db:"clusterName" json:"clusterName"` + // unused field # 2 + StatsUrlPrefix string `thrift:"statsUrlPrefix,3" db:"statsUrlPrefix" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"populateJobResult" json:"populateJobResult,omitempty"` + // unused field # 2 + ScheduleStatusResult_ *ScheduleStatusResult_ `thrift:"scheduleStatusResult,3" db:"scheduleStatusResult" json:"scheduleStatusResult,omitempty"` + GetJobsResult_ *GetJobsResult_ `thrift:"getJobsResult,4" db:"getJobsResult" json:"getJobsResult,omitempty"` + GetQuotaResult_ *GetQuotaResult_ `thrift:"getQuotaResult,5" db:"getQuotaResult" json:"getQuotaResult,omitempty"` + ListBackupsResult_ *ListBackupsResult_ `thrift:"listBackupsResult,6" db:"listBackupsResult" json:"listBackupsResult,omitempty"` + StartMaintenanceResult_ *StartMaintenanceResult_ `thrift:"startMaintenanceResult,7" db:"startMaintenanceResult" json:"startMaintenanceResult,omitempty"` + DrainHostsResult_ *DrainHostsResult_ `thrift:"drainHostsResult,8" db:"drainHostsResult" json:"drainHostsResult,omitempty"` + QueryRecoveryResult_ *QueryRecoveryResult_ `thrift:"queryRecoveryResult,9" db:"queryRecoveryResult" json:"queryRecoveryResult,omitempty"` + MaintenanceStatusResult_ *MaintenanceStatusResult_ `thrift:"maintenanceStatusResult,10" db:"maintenanceStatusResult" json:"maintenanceStatusResult,omitempty"` + EndMaintenanceResult_ *EndMaintenanceResult_ `thrift:"endMaintenanceResult,11" db:"endMaintenanceResult" json:"endMaintenanceResult,omitempty"` + // unused fields # 12 to 16 + RoleSummaryResult_ *RoleSummaryResult_ `thrift:"roleSummaryResult,17" db:"roleSummaryResult" json:"roleSummaryResult,omitempty"` + JobSummaryResult_ *JobSummaryResult_ `thrift:"jobSummaryResult,18" db:"jobSummaryResult" json:"jobSummaryResult,omitempty"` + // unused field # 19 + ConfigSummaryResult_ *ConfigSummaryResult_ `thrift:"configSummaryResult,20" db:"configSummaryResult" json:"configSummaryResult,omitempty"` + GetPendingReasonResult_ *GetPendingReasonResult_ `thrift:"getPendingReasonResult,21" db:"getPendingReasonResult" json:"getPendingReasonResult,omitempty"` + StartJobUpdateResult_ *StartJobUpdateResult_ `thrift:"startJobUpdateResult,22" db:"startJobUpdateResult" json:"startJobUpdateResult,omitempty"` + GetJobUpdateSummariesResult_ *GetJobUpdateSummariesResult_ `thrift:"getJobUpdateSummariesResult,23" db:"getJobUpdateSummariesResult" json:"getJobUpdateSummariesResult,omitempty"` + GetJobUpdateDetailsResult_ *GetJobUpdateDetailsResult_ `thrift:"getJobUpdateDetailsResult,24" db:"getJobUpdateDetailsResult" json:"getJobUpdateDetailsResult,omitempty"` + PulseJobUpdateResult_ *PulseJobUpdateResult_ `thrift:"pulseJobUpdateResult,25" db:"pulseJobUpdateResult" json:"pulseJobUpdateResult,omitempty"` + GetJobUpdateDiffResult_ *GetJobUpdateDiffResult_ `thrift:"getJobUpdateDiffResult,26" db:"getJobUpdateDiffResult" json:"getJobUpdateDiffResult,omitempty"` + GetTierConfigResult_ *GetTierConfigResult_ `thrift:"getTierConfigResult,27" db:"getTierConfigResult" 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField9(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField10(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField11(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 17: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField17(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 18: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField18(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 20: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField20(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 21: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField21(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 22: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField22(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 23: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField23(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 24: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField24(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 25: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField25(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 26: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField26(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 27: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField27(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + return fmt.Sprintf("Result_(%+v)", *p) +} + +// Attributes: +// - Message +type ResponseDetail struct { + Message string `thrift:"message,1" db:"message" 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + 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" db:"responseCode" json:"responseCode"` + // unused field # 2 + Result_ *Result_ `thrift:"result,3" db:"result" json:"result,omitempty"` + // unused field # 4 + ServerInfo *ServerInfo `thrift:"serverInfo,5" db:"serverInfo" json:"serverInfo"` + Details []*ResponseDetail `thrift:"details,6" db:"details" 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.LIST { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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++ { + _elem51 := &ResponseDetail{} + if err := _elem51.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err) + } + p.Details = append(p.Details, _elem51) + } + 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 p != nil { + 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 "" + } + return fmt.Sprintf("Response(%+v)", *p) +} + +// Attributes: +// - BatchSize +type ExplicitReconciliationSettings struct { + BatchSize *int32 `thrift:"batchSize,1" db:"batchSize" 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 fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 p != nil { + 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 "" + } + return fmt.Sprintf("ExplicitReconciliationSettings(%+v)", *p) +} + +type ReadOnlyScheduler interface { + // Returns a summary of the jobs grouped by role. + GetRoleSummary(ctx context.Context) (r *Response, err error) + // Returns a summary of jobs, optionally only those owned by a specific role. + // + // Parameters: + // - Role + GetJobSummary(ctx context.Context, role string) (r *Response, err error) + // Fetches the status of tasks. + // + // Parameters: + // - Query + GetTasksStatus(ctx context.Context, query *TaskQuery) (r *Response, err error) + // Same as getTaskStatus but without the TaskConfig.ExecutorConfig data set. + // This is an interim solution until we have a better way to query TaskConfigs (AURORA-541). + // + // Parameters: + // - Query + GetTasksWithoutConfigs(ctx context.Context, query *TaskQuery) (r *Response, err error) + // Returns user-friendly reasons (if available) for tasks retained in PENDING state. + // + // Parameters: + // - Query + GetPendingReason(ctx context.Context, query *TaskQuery) (r *Response, err error) + // Fetches the configuration summary of active tasks for the specified job. + // + // Parameters: + // - Job + GetConfigSummary(ctx context.Context, job *JobKey) (r *Response, err error) + // Fetches the status of jobs. + // ownerRole is optional, in which case all jobs are returned. + // + // Parameters: + // - OwnerRole + GetJobs(ctx context.Context, ownerRole string) (r *Response, err error) + // Fetches the quota allocated for a user. + // + // Parameters: + // - OwnerRole + GetQuota(ctx context.Context, ownerRole string) (r *Response, err error) + // Populates fields in a job configuration as though it were about to be run. + // This can be used to diff a configuration running tasks. + // + // Parameters: + // - Description + PopulateJobConfig(ctx context.Context, description *JobConfiguration) (r *Response, err error) + // Gets job update summaries. + // + // Parameters: + // - JobUpdateQuery + GetJobUpdateSummaries(ctx context.Context, jobUpdateQuery *JobUpdateQuery) (r *Response, err error) + // Gets job update details. + // + // Parameters: + // - Query + GetJobUpdateDetails(ctx context.Context, query *JobUpdateQuery) (r *Response, err error) + // Gets the diff between client (desired) and server (current) job states. + // + // Parameters: + // - Request + GetJobUpdateDiff(ctx context.Context, request *JobUpdateRequest) (r *Response, err error) + // Gets tier configurations. + GetTierConfigs(ctx context.Context) (r *Response, err error) +} + +type ReadOnlySchedulerClient struct { + c thrift.TClient +} + +func NewReadOnlySchedulerClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ReadOnlySchedulerClient { + return &ReadOnlySchedulerClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewReadOnlySchedulerClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ReadOnlySchedulerClient { + return &ReadOnlySchedulerClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewReadOnlySchedulerClient(c thrift.TClient) *ReadOnlySchedulerClient { + return &ReadOnlySchedulerClient{ + c: c, + } +} + +func (p *ReadOnlySchedulerClient) Client_() thrift.TClient { + return p.c +} + +// Returns a summary of the jobs grouped by role. +func (p *ReadOnlySchedulerClient) GetRoleSummary(ctx context.Context) (r *Response, err error) { + var _args52 ReadOnlySchedulerGetRoleSummaryArgs + var _result53 ReadOnlySchedulerGetRoleSummaryResult + if err = p.Client_().Call(ctx, "getRoleSummary", &_args52, &_result53); err != nil { + return + } + return _result53.GetSuccess(), nil +} + +// Returns a summary of jobs, optionally only those owned by a specific role. +// +// Parameters: +// - Role +func (p *ReadOnlySchedulerClient) GetJobSummary(ctx context.Context, role string) (r *Response, err error) { + var _args54 ReadOnlySchedulerGetJobSummaryArgs + _args54.Role = role + var _result55 ReadOnlySchedulerGetJobSummaryResult + if err = p.Client_().Call(ctx, "getJobSummary", &_args54, &_result55); err != nil { + return + } + return _result55.GetSuccess(), nil +} + +// Fetches the status of tasks. +// +// Parameters: +// - Query +func (p *ReadOnlySchedulerClient) GetTasksStatus(ctx context.Context, query *TaskQuery) (r *Response, err error) { + var _args56 ReadOnlySchedulerGetTasksStatusArgs + _args56.Query = query + var _result57 ReadOnlySchedulerGetTasksStatusResult + if err = p.Client_().Call(ctx, "getTasksStatus", &_args56, &_result57); err != nil { + return + } + return _result57.GetSuccess(), nil +} + +// Same as getTaskStatus but without the TaskConfig.ExecutorConfig data set. +// This is an interim solution until we have a better way to query TaskConfigs (AURORA-541). +// +// Parameters: +// - Query +func (p *ReadOnlySchedulerClient) GetTasksWithoutConfigs(ctx context.Context, query *TaskQuery) (r *Response, err error) { + var _args58 ReadOnlySchedulerGetTasksWithoutConfigsArgs + _args58.Query = query + var _result59 ReadOnlySchedulerGetTasksWithoutConfigsResult + if err = p.Client_().Call(ctx, "getTasksWithoutConfigs", &_args58, &_result59); err != nil { + return + } + return _result59.GetSuccess(), nil +} + +// Returns user-friendly reasons (if available) for tasks retained in PENDING state. +// +// Parameters: +// - Query +func (p *ReadOnlySchedulerClient) GetPendingReason(ctx context.Context, query *TaskQuery) (r *Response, err error) { + var _args60 ReadOnlySchedulerGetPendingReasonArgs + _args60.Query = query + var _result61 ReadOnlySchedulerGetPendingReasonResult + if err = p.Client_().Call(ctx, "getPendingReason", &_args60, &_result61); err != nil { + return + } + return _result61.GetSuccess(), nil +} + +// Fetches the configuration summary of active tasks for the specified job. +// +// Parameters: +// - Job +func (p *ReadOnlySchedulerClient) GetConfigSummary(ctx context.Context, job *JobKey) (r *Response, err error) { + var _args62 ReadOnlySchedulerGetConfigSummaryArgs + _args62.Job = job + var _result63 ReadOnlySchedulerGetConfigSummaryResult + if err = p.Client_().Call(ctx, "getConfigSummary", &_args62, &_result63); err != nil { + return + } + return _result63.GetSuccess(), nil +} + +// Fetches the status of jobs. +// ownerRole is optional, in which case all jobs are returned. +// +// Parameters: +// - OwnerRole +func (p *ReadOnlySchedulerClient) GetJobs(ctx context.Context, ownerRole string) (r *Response, err error) { + var _args64 ReadOnlySchedulerGetJobsArgs + _args64.OwnerRole = ownerRole + var _result65 ReadOnlySchedulerGetJobsResult + if err = p.Client_().Call(ctx, "getJobs", &_args64, &_result65); err != nil { + return + } + return _result65.GetSuccess(), nil +} + +// Fetches the quota allocated for a user. +// +// Parameters: +// - OwnerRole +func (p *ReadOnlySchedulerClient) GetQuota(ctx context.Context, ownerRole string) (r *Response, err error) { + var _args66 ReadOnlySchedulerGetQuotaArgs + _args66.OwnerRole = ownerRole + var _result67 ReadOnlySchedulerGetQuotaResult + if err = p.Client_().Call(ctx, "getQuota", &_args66, &_result67); err != nil { + return + } + return _result67.GetSuccess(), nil +} + +// Populates fields in a job configuration as though it were about to be run. +// This can be used to diff a configuration running tasks. +// +// Parameters: +// - Description +func (p *ReadOnlySchedulerClient) PopulateJobConfig(ctx context.Context, description *JobConfiguration) (r *Response, err error) { + var _args68 ReadOnlySchedulerPopulateJobConfigArgs + _args68.Description = description + var _result69 ReadOnlySchedulerPopulateJobConfigResult + if err = p.Client_().Call(ctx, "populateJobConfig", &_args68, &_result69); err != nil { + return + } + return _result69.GetSuccess(), nil +} + +// Gets job update summaries. +// +// Parameters: +// - JobUpdateQuery +func (p *ReadOnlySchedulerClient) GetJobUpdateSummaries(ctx context.Context, jobUpdateQuery *JobUpdateQuery) (r *Response, err error) { + var _args70 ReadOnlySchedulerGetJobUpdateSummariesArgs + _args70.JobUpdateQuery = jobUpdateQuery + var _result71 ReadOnlySchedulerGetJobUpdateSummariesResult + if err = p.Client_().Call(ctx, "getJobUpdateSummaries", &_args70, &_result71); err != nil { + return + } + return _result71.GetSuccess(), nil +} + +// Gets job update details. +// +// Parameters: +// - Query +func (p *ReadOnlySchedulerClient) GetJobUpdateDetails(ctx context.Context, query *JobUpdateQuery) (r *Response, err error) { + var _args72 ReadOnlySchedulerGetJobUpdateDetailsArgs + _args72.Query = query + var _result73 ReadOnlySchedulerGetJobUpdateDetailsResult + if err = p.Client_().Call(ctx, "getJobUpdateDetails", &_args72, &_result73); err != nil { + return + } + return _result73.GetSuccess(), nil +} + +// Gets the diff between client (desired) and server (current) job states. +// +// Parameters: +// - Request +func (p *ReadOnlySchedulerClient) GetJobUpdateDiff(ctx context.Context, request *JobUpdateRequest) (r *Response, err error) { + var _args74 ReadOnlySchedulerGetJobUpdateDiffArgs + _args74.Request = request + var _result75 ReadOnlySchedulerGetJobUpdateDiffResult + if err = p.Client_().Call(ctx, "getJobUpdateDiff", &_args74, &_result75); err != nil { + return + } + return _result75.GetSuccess(), nil +} + +// Gets tier configurations. +func (p *ReadOnlySchedulerClient) GetTierConfigs(ctx context.Context) (r *Response, err error) { + var _args76 ReadOnlySchedulerGetTierConfigsArgs + var _result77 ReadOnlySchedulerGetTierConfigsResult + if err = p.Client_().Call(ctx, "getTierConfigs", &_args76, &_result77); err != nil { + return + } + return _result77.GetSuccess(), nil +} + +type ReadOnlySchedulerProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler ReadOnlyScheduler +} + +func (p *ReadOnlySchedulerProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *ReadOnlySchedulerProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *ReadOnlySchedulerProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewReadOnlySchedulerProcessor(handler ReadOnlyScheduler) *ReadOnlySchedulerProcessor { + + self78 := &ReadOnlySchedulerProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} + self78.processorMap["getRoleSummary"] = &readOnlySchedulerProcessorGetRoleSummary{handler: handler} + self78.processorMap["getJobSummary"] = &readOnlySchedulerProcessorGetJobSummary{handler: handler} + self78.processorMap["getTasksStatus"] = &readOnlySchedulerProcessorGetTasksStatus{handler: handler} + self78.processorMap["getTasksWithoutConfigs"] = &readOnlySchedulerProcessorGetTasksWithoutConfigs{handler: handler} + self78.processorMap["getPendingReason"] = &readOnlySchedulerProcessorGetPendingReason{handler: handler} + self78.processorMap["getConfigSummary"] = &readOnlySchedulerProcessorGetConfigSummary{handler: handler} + self78.processorMap["getJobs"] = &readOnlySchedulerProcessorGetJobs{handler: handler} + self78.processorMap["getQuota"] = &readOnlySchedulerProcessorGetQuota{handler: handler} + self78.processorMap["populateJobConfig"] = &readOnlySchedulerProcessorPopulateJobConfig{handler: handler} + self78.processorMap["getJobUpdateSummaries"] = &readOnlySchedulerProcessorGetJobUpdateSummaries{handler: handler} + self78.processorMap["getJobUpdateDetails"] = &readOnlySchedulerProcessorGetJobUpdateDetails{handler: handler} + self78.processorMap["getJobUpdateDiff"] = &readOnlySchedulerProcessorGetJobUpdateDiff{handler: handler} + self78.processorMap["getTierConfigs"] = &readOnlySchedulerProcessorGetTierConfigs{handler: handler} + return self78 +} + +func (p *ReadOnlySchedulerProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err := iprot.ReadMessageBegin() + if err != nil { + return false, err + } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(thrift.STRUCT) + iprot.ReadMessageEnd() + x79 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) + oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) + x79.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, x79 + +} + +type readOnlySchedulerProcessorGetRoleSummary struct { + handler ReadOnlyScheduler +} + +func (p *readOnlySchedulerProcessorGetRoleSummary) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReadOnlySchedulerGetRoleSummaryArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getRoleSummary", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReadOnlySchedulerGetRoleSummaryResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.GetRoleSummary(ctx); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getRoleSummary: "+err2.Error()) + oprot.WriteMessageBegin("getRoleSummary", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getRoleSummary", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type readOnlySchedulerProcessorGetJobSummary struct { + handler ReadOnlyScheduler +} + +func (p *readOnlySchedulerProcessorGetJobSummary) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReadOnlySchedulerGetJobSummaryArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getJobSummary", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReadOnlySchedulerGetJobSummaryResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.GetJobSummary(ctx, args.Role); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getJobSummary: "+err2.Error()) + oprot.WriteMessageBegin("getJobSummary", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getJobSummary", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type readOnlySchedulerProcessorGetTasksStatus struct { + handler ReadOnlyScheduler +} + +func (p *readOnlySchedulerProcessorGetTasksStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReadOnlySchedulerGetTasksStatusArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getTasksStatus", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReadOnlySchedulerGetTasksStatusResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.GetTasksStatus(ctx, args.Query); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTasksStatus: "+err2.Error()) + oprot.WriteMessageBegin("getTasksStatus", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getTasksStatus", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type readOnlySchedulerProcessorGetTasksWithoutConfigs struct { + handler ReadOnlyScheduler +} + +func (p *readOnlySchedulerProcessorGetTasksWithoutConfigs) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReadOnlySchedulerGetTasksWithoutConfigsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getTasksWithoutConfigs", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReadOnlySchedulerGetTasksWithoutConfigsResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.GetTasksWithoutConfigs(ctx, args.Query); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTasksWithoutConfigs: "+err2.Error()) + oprot.WriteMessageBegin("getTasksWithoutConfigs", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getTasksWithoutConfigs", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type readOnlySchedulerProcessorGetPendingReason struct { + handler ReadOnlyScheduler +} + +func (p *readOnlySchedulerProcessorGetPendingReason) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReadOnlySchedulerGetPendingReasonArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getPendingReason", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReadOnlySchedulerGetPendingReasonResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.GetPendingReason(ctx, args.Query); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPendingReason: "+err2.Error()) + oprot.WriteMessageBegin("getPendingReason", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getPendingReason", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type readOnlySchedulerProcessorGetConfigSummary struct { + handler ReadOnlyScheduler +} + +func (p *readOnlySchedulerProcessorGetConfigSummary) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReadOnlySchedulerGetConfigSummaryArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getConfigSummary", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReadOnlySchedulerGetConfigSummaryResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.GetConfigSummary(ctx, args.Job); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getConfigSummary: "+err2.Error()) + oprot.WriteMessageBegin("getConfigSummary", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getConfigSummary", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type readOnlySchedulerProcessorGetJobs struct { + handler ReadOnlyScheduler +} + +func (p *readOnlySchedulerProcessorGetJobs) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReadOnlySchedulerGetJobsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getJobs", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReadOnlySchedulerGetJobsResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.GetJobs(ctx, args.OwnerRole); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getJobs: "+err2.Error()) + oprot.WriteMessageBegin("getJobs", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getJobs", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type readOnlySchedulerProcessorGetQuota struct { + handler ReadOnlyScheduler +} + +func (p *readOnlySchedulerProcessorGetQuota) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReadOnlySchedulerGetQuotaArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getQuota", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReadOnlySchedulerGetQuotaResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.GetQuota(ctx, args.OwnerRole); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getQuota: "+err2.Error()) + oprot.WriteMessageBegin("getQuota", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getQuota", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type readOnlySchedulerProcessorPopulateJobConfig struct { + handler ReadOnlyScheduler +} + +func (p *readOnlySchedulerProcessorPopulateJobConfig) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReadOnlySchedulerPopulateJobConfigArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("populateJobConfig", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReadOnlySchedulerPopulateJobConfigResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.PopulateJobConfig(ctx, args.Description); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing populateJobConfig: "+err2.Error()) + oprot.WriteMessageBegin("populateJobConfig", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("populateJobConfig", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type readOnlySchedulerProcessorGetJobUpdateSummaries struct { + handler ReadOnlyScheduler +} + +func (p *readOnlySchedulerProcessorGetJobUpdateSummaries) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReadOnlySchedulerGetJobUpdateSummariesArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getJobUpdateSummaries", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReadOnlySchedulerGetJobUpdateSummariesResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.GetJobUpdateSummaries(ctx, args.JobUpdateQuery); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getJobUpdateSummaries: "+err2.Error()) + oprot.WriteMessageBegin("getJobUpdateSummaries", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getJobUpdateSummaries", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type readOnlySchedulerProcessorGetJobUpdateDetails struct { + handler ReadOnlyScheduler +} + +func (p *readOnlySchedulerProcessorGetJobUpdateDetails) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReadOnlySchedulerGetJobUpdateDetailsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getJobUpdateDetails", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReadOnlySchedulerGetJobUpdateDetailsResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.GetJobUpdateDetails(ctx, args.Query); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getJobUpdateDetails: "+err2.Error()) + oprot.WriteMessageBegin("getJobUpdateDetails", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getJobUpdateDetails", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type readOnlySchedulerProcessorGetJobUpdateDiff struct { + handler ReadOnlyScheduler +} + +func (p *readOnlySchedulerProcessorGetJobUpdateDiff) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReadOnlySchedulerGetJobUpdateDiffArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getJobUpdateDiff", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReadOnlySchedulerGetJobUpdateDiffResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.GetJobUpdateDiff(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getJobUpdateDiff: "+err2.Error()) + oprot.WriteMessageBegin("getJobUpdateDiff", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getJobUpdateDiff", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type readOnlySchedulerProcessorGetTierConfigs struct { + handler ReadOnlyScheduler +} + +func (p *readOnlySchedulerProcessorGetTierConfigs) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := ReadOnlySchedulerGetTierConfigsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("getTierConfigs", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := ReadOnlySchedulerGetTierConfigsResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.GetTierConfigs(ctx); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTierConfigs: "+err2.Error()) + oprot.WriteMessageBegin("getTierConfigs", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("getTierConfigs", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +// HELPER FUNCTIONS AND STRUCTURES + +type ReadOnlySchedulerGetRoleSummaryArgs struct { +} + +func NewReadOnlySchedulerGetRoleSummaryArgs() *ReadOnlySchedulerGetRoleSummaryArgs { + return &ReadOnlySchedulerGetRoleSummaryArgs{} +} + +func (p *ReadOnlySchedulerGetRoleSummaryArgs) 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 + } + 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 *ReadOnlySchedulerGetRoleSummaryArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getRoleSummary_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + } + 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 *ReadOnlySchedulerGetRoleSummaryArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetRoleSummaryArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReadOnlySchedulerGetRoleSummaryResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReadOnlySchedulerGetRoleSummaryResult() *ReadOnlySchedulerGetRoleSummaryResult { + return &ReadOnlySchedulerGetRoleSummaryResult{} +} + +var ReadOnlySchedulerGetRoleSummaryResult_Success_DEFAULT *Response + +func (p *ReadOnlySchedulerGetRoleSummaryResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return ReadOnlySchedulerGetRoleSummaryResult_Success_DEFAULT + } + return p.Success +} +func (p *ReadOnlySchedulerGetRoleSummaryResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReadOnlySchedulerGetRoleSummaryResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetRoleSummaryResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetRoleSummaryResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getRoleSummary_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *ReadOnlySchedulerGetRoleSummaryResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *ReadOnlySchedulerGetRoleSummaryResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetRoleSummaryResult(%+v)", *p) +} + +// Attributes: +// - Role +type ReadOnlySchedulerGetJobSummaryArgs struct { + Role string `thrift:"role,1" db:"role" json:"role"` +} + +func NewReadOnlySchedulerGetJobSummaryArgs() *ReadOnlySchedulerGetJobSummaryArgs { + return &ReadOnlySchedulerGetJobSummaryArgs{} +} + +func (p *ReadOnlySchedulerGetJobSummaryArgs) GetRole() string { + return p.Role +} +func (p *ReadOnlySchedulerGetJobSummaryArgs) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetJobSummaryArgs) 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 *ReadOnlySchedulerGetJobSummaryArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getJobSummary_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *ReadOnlySchedulerGetJobSummaryArgs) 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 *ReadOnlySchedulerGetJobSummaryArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetJobSummaryArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReadOnlySchedulerGetJobSummaryResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReadOnlySchedulerGetJobSummaryResult() *ReadOnlySchedulerGetJobSummaryResult { + return &ReadOnlySchedulerGetJobSummaryResult{} +} + +var ReadOnlySchedulerGetJobSummaryResult_Success_DEFAULT *Response + +func (p *ReadOnlySchedulerGetJobSummaryResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return ReadOnlySchedulerGetJobSummaryResult_Success_DEFAULT + } + return p.Success +} +func (p *ReadOnlySchedulerGetJobSummaryResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReadOnlySchedulerGetJobSummaryResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetJobSummaryResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetJobSummaryResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getJobSummary_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *ReadOnlySchedulerGetJobSummaryResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *ReadOnlySchedulerGetJobSummaryResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetJobSummaryResult(%+v)", *p) +} + +// Attributes: +// - Query +type ReadOnlySchedulerGetTasksStatusArgs struct { + Query *TaskQuery `thrift:"query,1" db:"query" json:"query"` +} + +func NewReadOnlySchedulerGetTasksStatusArgs() *ReadOnlySchedulerGetTasksStatusArgs { + return &ReadOnlySchedulerGetTasksStatusArgs{} +} + +var ReadOnlySchedulerGetTasksStatusArgs_Query_DEFAULT *TaskQuery + +func (p *ReadOnlySchedulerGetTasksStatusArgs) GetQuery() *TaskQuery { + if !p.IsSetQuery() { + return ReadOnlySchedulerGetTasksStatusArgs_Query_DEFAULT + } + return p.Query +} +func (p *ReadOnlySchedulerGetTasksStatusArgs) IsSetQuery() bool { + return p.Query != nil +} + +func (p *ReadOnlySchedulerGetTasksStatusArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetTasksStatusArgs) ReadField1(iprot thrift.TProtocol) error { + p.Query = &TaskQuery{} + if err := p.Query.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetTasksStatusArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getTasksStatus_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *ReadOnlySchedulerGetTasksStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err) + } + if err := p.Query.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err) + } + return err +} + +func (p *ReadOnlySchedulerGetTasksStatusArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetTasksStatusArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReadOnlySchedulerGetTasksStatusResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReadOnlySchedulerGetTasksStatusResult() *ReadOnlySchedulerGetTasksStatusResult { + return &ReadOnlySchedulerGetTasksStatusResult{} +} + +var ReadOnlySchedulerGetTasksStatusResult_Success_DEFAULT *Response + +func (p *ReadOnlySchedulerGetTasksStatusResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return ReadOnlySchedulerGetTasksStatusResult_Success_DEFAULT + } + return p.Success +} +func (p *ReadOnlySchedulerGetTasksStatusResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReadOnlySchedulerGetTasksStatusResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetTasksStatusResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetTasksStatusResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getTasksStatus_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *ReadOnlySchedulerGetTasksStatusResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *ReadOnlySchedulerGetTasksStatusResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetTasksStatusResult(%+v)", *p) +} + +// Attributes: +// - Query +type ReadOnlySchedulerGetTasksWithoutConfigsArgs struct { + Query *TaskQuery `thrift:"query,1" db:"query" json:"query"` +} + +func NewReadOnlySchedulerGetTasksWithoutConfigsArgs() *ReadOnlySchedulerGetTasksWithoutConfigsArgs { + return &ReadOnlySchedulerGetTasksWithoutConfigsArgs{} +} + +var ReadOnlySchedulerGetTasksWithoutConfigsArgs_Query_DEFAULT *TaskQuery + +func (p *ReadOnlySchedulerGetTasksWithoutConfigsArgs) GetQuery() *TaskQuery { + if !p.IsSetQuery() { + return ReadOnlySchedulerGetTasksWithoutConfigsArgs_Query_DEFAULT + } + return p.Query +} +func (p *ReadOnlySchedulerGetTasksWithoutConfigsArgs) IsSetQuery() bool { + return p.Query != nil +} + +func (p *ReadOnlySchedulerGetTasksWithoutConfigsArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetTasksWithoutConfigsArgs) ReadField1(iprot thrift.TProtocol) error { + p.Query = &TaskQuery{} + if err := p.Query.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetTasksWithoutConfigsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getTasksWithoutConfigs_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *ReadOnlySchedulerGetTasksWithoutConfigsArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err) + } + if err := p.Query.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err) + } + return err +} + +func (p *ReadOnlySchedulerGetTasksWithoutConfigsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetTasksWithoutConfigsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReadOnlySchedulerGetTasksWithoutConfigsResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReadOnlySchedulerGetTasksWithoutConfigsResult() *ReadOnlySchedulerGetTasksWithoutConfigsResult { + return &ReadOnlySchedulerGetTasksWithoutConfigsResult{} +} + +var ReadOnlySchedulerGetTasksWithoutConfigsResult_Success_DEFAULT *Response + +func (p *ReadOnlySchedulerGetTasksWithoutConfigsResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return ReadOnlySchedulerGetTasksWithoutConfigsResult_Success_DEFAULT + } + return p.Success +} +func (p *ReadOnlySchedulerGetTasksWithoutConfigsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReadOnlySchedulerGetTasksWithoutConfigsResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetTasksWithoutConfigsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetTasksWithoutConfigsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getTasksWithoutConfigs_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *ReadOnlySchedulerGetTasksWithoutConfigsResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *ReadOnlySchedulerGetTasksWithoutConfigsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetTasksWithoutConfigsResult(%+v)", *p) +} + +// Attributes: +// - Query +type ReadOnlySchedulerGetPendingReasonArgs struct { + Query *TaskQuery `thrift:"query,1" db:"query" json:"query"` +} + +func NewReadOnlySchedulerGetPendingReasonArgs() *ReadOnlySchedulerGetPendingReasonArgs { + return &ReadOnlySchedulerGetPendingReasonArgs{} +} + +var ReadOnlySchedulerGetPendingReasonArgs_Query_DEFAULT *TaskQuery + +func (p *ReadOnlySchedulerGetPendingReasonArgs) GetQuery() *TaskQuery { + if !p.IsSetQuery() { + return ReadOnlySchedulerGetPendingReasonArgs_Query_DEFAULT + } + return p.Query +} +func (p *ReadOnlySchedulerGetPendingReasonArgs) IsSetQuery() bool { + return p.Query != nil +} + +func (p *ReadOnlySchedulerGetPendingReasonArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetPendingReasonArgs) ReadField1(iprot thrift.TProtocol) error { + p.Query = &TaskQuery{} + if err := p.Query.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetPendingReasonArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getPendingReason_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *ReadOnlySchedulerGetPendingReasonArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err) + } + if err := p.Query.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err) + } + return err +} + +func (p *ReadOnlySchedulerGetPendingReasonArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetPendingReasonArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReadOnlySchedulerGetPendingReasonResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReadOnlySchedulerGetPendingReasonResult() *ReadOnlySchedulerGetPendingReasonResult { + return &ReadOnlySchedulerGetPendingReasonResult{} +} + +var ReadOnlySchedulerGetPendingReasonResult_Success_DEFAULT *Response + +func (p *ReadOnlySchedulerGetPendingReasonResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return ReadOnlySchedulerGetPendingReasonResult_Success_DEFAULT + } + return p.Success +} +func (p *ReadOnlySchedulerGetPendingReasonResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReadOnlySchedulerGetPendingReasonResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetPendingReasonResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetPendingReasonResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getPendingReason_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *ReadOnlySchedulerGetPendingReasonResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *ReadOnlySchedulerGetPendingReasonResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetPendingReasonResult(%+v)", *p) +} + +// Attributes: +// - Job +type ReadOnlySchedulerGetConfigSummaryArgs struct { + Job *JobKey `thrift:"job,1" db:"job" json:"job"` +} + +func NewReadOnlySchedulerGetConfigSummaryArgs() *ReadOnlySchedulerGetConfigSummaryArgs { + return &ReadOnlySchedulerGetConfigSummaryArgs{} +} + +var ReadOnlySchedulerGetConfigSummaryArgs_Job_DEFAULT *JobKey + +func (p *ReadOnlySchedulerGetConfigSummaryArgs) GetJob() *JobKey { + if !p.IsSetJob() { + return ReadOnlySchedulerGetConfigSummaryArgs_Job_DEFAULT + } + return p.Job +} +func (p *ReadOnlySchedulerGetConfigSummaryArgs) IsSetJob() bool { + return p.Job != nil +} + +func (p *ReadOnlySchedulerGetConfigSummaryArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetConfigSummaryArgs) 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 *ReadOnlySchedulerGetConfigSummaryArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getConfigSummary_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *ReadOnlySchedulerGetConfigSummaryArgs) 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 *ReadOnlySchedulerGetConfigSummaryArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetConfigSummaryArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReadOnlySchedulerGetConfigSummaryResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReadOnlySchedulerGetConfigSummaryResult() *ReadOnlySchedulerGetConfigSummaryResult { + return &ReadOnlySchedulerGetConfigSummaryResult{} +} + +var ReadOnlySchedulerGetConfigSummaryResult_Success_DEFAULT *Response + +func (p *ReadOnlySchedulerGetConfigSummaryResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return ReadOnlySchedulerGetConfigSummaryResult_Success_DEFAULT + } + return p.Success +} +func (p *ReadOnlySchedulerGetConfigSummaryResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReadOnlySchedulerGetConfigSummaryResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetConfigSummaryResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetConfigSummaryResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getConfigSummary_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *ReadOnlySchedulerGetConfigSummaryResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *ReadOnlySchedulerGetConfigSummaryResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetConfigSummaryResult(%+v)", *p) +} + +// Attributes: +// - OwnerRole +type ReadOnlySchedulerGetJobsArgs struct { + OwnerRole string `thrift:"ownerRole,1" db:"ownerRole" json:"ownerRole"` +} + +func NewReadOnlySchedulerGetJobsArgs() *ReadOnlySchedulerGetJobsArgs { + return &ReadOnlySchedulerGetJobsArgs{} +} + +func (p *ReadOnlySchedulerGetJobsArgs) GetOwnerRole() string { + return p.OwnerRole +} +func (p *ReadOnlySchedulerGetJobsArgs) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetJobsArgs) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.OwnerRole = v + } + return nil +} + +func (p *ReadOnlySchedulerGetJobsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getJobs_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *ReadOnlySchedulerGetJobsArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ownerRole", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ownerRole: ", p), err) + } + if err := oprot.WriteString(string(p.OwnerRole)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ownerRole (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ownerRole: ", p), err) + } + return err +} + +func (p *ReadOnlySchedulerGetJobsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetJobsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReadOnlySchedulerGetJobsResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReadOnlySchedulerGetJobsResult() *ReadOnlySchedulerGetJobsResult { + return &ReadOnlySchedulerGetJobsResult{} +} + +var ReadOnlySchedulerGetJobsResult_Success_DEFAULT *Response + +func (p *ReadOnlySchedulerGetJobsResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return ReadOnlySchedulerGetJobsResult_Success_DEFAULT + } + return p.Success +} +func (p *ReadOnlySchedulerGetJobsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReadOnlySchedulerGetJobsResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetJobsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetJobsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getJobs_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *ReadOnlySchedulerGetJobsResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *ReadOnlySchedulerGetJobsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetJobsResult(%+v)", *p) +} + +// Attributes: +// - OwnerRole +type ReadOnlySchedulerGetQuotaArgs struct { + OwnerRole string `thrift:"ownerRole,1" db:"ownerRole" json:"ownerRole"` +} + +func NewReadOnlySchedulerGetQuotaArgs() *ReadOnlySchedulerGetQuotaArgs { + return &ReadOnlySchedulerGetQuotaArgs{} +} + +func (p *ReadOnlySchedulerGetQuotaArgs) GetOwnerRole() string { + return p.OwnerRole +} +func (p *ReadOnlySchedulerGetQuotaArgs) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetQuotaArgs) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.OwnerRole = v + } + return nil +} + +func (p *ReadOnlySchedulerGetQuotaArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getQuota_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *ReadOnlySchedulerGetQuotaArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ownerRole", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ownerRole: ", p), err) + } + if err := oprot.WriteString(string(p.OwnerRole)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ownerRole (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ownerRole: ", p), err) + } + return err +} + +func (p *ReadOnlySchedulerGetQuotaArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetQuotaArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReadOnlySchedulerGetQuotaResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReadOnlySchedulerGetQuotaResult() *ReadOnlySchedulerGetQuotaResult { + return &ReadOnlySchedulerGetQuotaResult{} +} + +var ReadOnlySchedulerGetQuotaResult_Success_DEFAULT *Response + +func (p *ReadOnlySchedulerGetQuotaResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return ReadOnlySchedulerGetQuotaResult_Success_DEFAULT + } + return p.Success +} +func (p *ReadOnlySchedulerGetQuotaResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReadOnlySchedulerGetQuotaResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetQuotaResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetQuotaResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getQuota_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *ReadOnlySchedulerGetQuotaResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *ReadOnlySchedulerGetQuotaResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetQuotaResult(%+v)", *p) +} + +// Attributes: +// - Description +type ReadOnlySchedulerPopulateJobConfigArgs struct { + Description *JobConfiguration `thrift:"description,1" db:"description" json:"description"` +} + +func NewReadOnlySchedulerPopulateJobConfigArgs() *ReadOnlySchedulerPopulateJobConfigArgs { + return &ReadOnlySchedulerPopulateJobConfigArgs{} +} + +var ReadOnlySchedulerPopulateJobConfigArgs_Description_DEFAULT *JobConfiguration + +func (p *ReadOnlySchedulerPopulateJobConfigArgs) GetDescription() *JobConfiguration { + if !p.IsSetDescription() { + return ReadOnlySchedulerPopulateJobConfigArgs_Description_DEFAULT + } + return p.Description +} +func (p *ReadOnlySchedulerPopulateJobConfigArgs) IsSetDescription() bool { + return p.Description != nil +} + +func (p *ReadOnlySchedulerPopulateJobConfigArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerPopulateJobConfigArgs) ReadField1(iprot thrift.TProtocol) error { + p.Description = &JobConfiguration{} + if err := p.Description.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Description), err) + } + return nil +} + +func (p *ReadOnlySchedulerPopulateJobConfigArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("populateJobConfig_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *ReadOnlySchedulerPopulateJobConfigArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("description", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:description: ", p), err) + } + if err := p.Description.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Description), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:description: ", p), err) + } + return err +} + +func (p *ReadOnlySchedulerPopulateJobConfigArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerPopulateJobConfigArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReadOnlySchedulerPopulateJobConfigResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReadOnlySchedulerPopulateJobConfigResult() *ReadOnlySchedulerPopulateJobConfigResult { + return &ReadOnlySchedulerPopulateJobConfigResult{} +} + +var ReadOnlySchedulerPopulateJobConfigResult_Success_DEFAULT *Response + +func (p *ReadOnlySchedulerPopulateJobConfigResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return ReadOnlySchedulerPopulateJobConfigResult_Success_DEFAULT + } + return p.Success +} +func (p *ReadOnlySchedulerPopulateJobConfigResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReadOnlySchedulerPopulateJobConfigResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerPopulateJobConfigResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReadOnlySchedulerPopulateJobConfigResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("populateJobConfig_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *ReadOnlySchedulerPopulateJobConfigResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *ReadOnlySchedulerPopulateJobConfigResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerPopulateJobConfigResult(%+v)", *p) +} + +// Attributes: +// - JobUpdateQuery +type ReadOnlySchedulerGetJobUpdateSummariesArgs struct { + JobUpdateQuery *JobUpdateQuery `thrift:"jobUpdateQuery,1" db:"jobUpdateQuery" json:"jobUpdateQuery"` +} + +func NewReadOnlySchedulerGetJobUpdateSummariesArgs() *ReadOnlySchedulerGetJobUpdateSummariesArgs { + return &ReadOnlySchedulerGetJobUpdateSummariesArgs{} +} + +var ReadOnlySchedulerGetJobUpdateSummariesArgs_JobUpdateQuery_DEFAULT *JobUpdateQuery + +func (p *ReadOnlySchedulerGetJobUpdateSummariesArgs) GetJobUpdateQuery() *JobUpdateQuery { + if !p.IsSetJobUpdateQuery() { + return ReadOnlySchedulerGetJobUpdateSummariesArgs_JobUpdateQuery_DEFAULT + } + return p.JobUpdateQuery +} +func (p *ReadOnlySchedulerGetJobUpdateSummariesArgs) IsSetJobUpdateQuery() bool { + return p.JobUpdateQuery != nil +} + +func (p *ReadOnlySchedulerGetJobUpdateSummariesArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetJobUpdateSummariesArgs) ReadField1(iprot thrift.TProtocol) error { + p.JobUpdateQuery = &JobUpdateQuery{} + if err := p.JobUpdateQuery.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JobUpdateQuery), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetJobUpdateSummariesArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getJobUpdateSummaries_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *ReadOnlySchedulerGetJobUpdateSummariesArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("jobUpdateQuery", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:jobUpdateQuery: ", p), err) + } + if err := p.JobUpdateQuery.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JobUpdateQuery), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:jobUpdateQuery: ", p), err) + } + return err +} + +func (p *ReadOnlySchedulerGetJobUpdateSummariesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetJobUpdateSummariesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReadOnlySchedulerGetJobUpdateSummariesResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReadOnlySchedulerGetJobUpdateSummariesResult() *ReadOnlySchedulerGetJobUpdateSummariesResult { + return &ReadOnlySchedulerGetJobUpdateSummariesResult{} +} + +var ReadOnlySchedulerGetJobUpdateSummariesResult_Success_DEFAULT *Response + +func (p *ReadOnlySchedulerGetJobUpdateSummariesResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return ReadOnlySchedulerGetJobUpdateSummariesResult_Success_DEFAULT + } + return p.Success +} +func (p *ReadOnlySchedulerGetJobUpdateSummariesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReadOnlySchedulerGetJobUpdateSummariesResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetJobUpdateSummariesResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetJobUpdateSummariesResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getJobUpdateSummaries_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *ReadOnlySchedulerGetJobUpdateSummariesResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *ReadOnlySchedulerGetJobUpdateSummariesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetJobUpdateSummariesResult(%+v)", *p) +} + +// Attributes: +// - Query +type ReadOnlySchedulerGetJobUpdateDetailsArgs struct { + // unused field # 1 + Query *JobUpdateQuery `thrift:"query,2" db:"query" json:"query"` +} + +func NewReadOnlySchedulerGetJobUpdateDetailsArgs() *ReadOnlySchedulerGetJobUpdateDetailsArgs { + return &ReadOnlySchedulerGetJobUpdateDetailsArgs{} +} + +var ReadOnlySchedulerGetJobUpdateDetailsArgs_Query_DEFAULT *JobUpdateQuery + +func (p *ReadOnlySchedulerGetJobUpdateDetailsArgs) GetQuery() *JobUpdateQuery { + if !p.IsSetQuery() { + return ReadOnlySchedulerGetJobUpdateDetailsArgs_Query_DEFAULT + } + return p.Query +} +func (p *ReadOnlySchedulerGetJobUpdateDetailsArgs) IsSetQuery() bool { + return p.Query != nil +} + +func (p *ReadOnlySchedulerGetJobUpdateDetailsArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetJobUpdateDetailsArgs) ReadField2(iprot thrift.TProtocol) error { + p.Query = &JobUpdateQuery{} + if err := p.Query.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetJobUpdateDetailsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getJobUpdateDetails_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *ReadOnlySchedulerGetJobUpdateDetailsArgs) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:query: ", p), err) + } + if err := p.Query.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:query: ", p), err) + } + return err +} + +func (p *ReadOnlySchedulerGetJobUpdateDetailsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetJobUpdateDetailsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReadOnlySchedulerGetJobUpdateDetailsResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReadOnlySchedulerGetJobUpdateDetailsResult() *ReadOnlySchedulerGetJobUpdateDetailsResult { + return &ReadOnlySchedulerGetJobUpdateDetailsResult{} +} + +var ReadOnlySchedulerGetJobUpdateDetailsResult_Success_DEFAULT *Response + +func (p *ReadOnlySchedulerGetJobUpdateDetailsResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return ReadOnlySchedulerGetJobUpdateDetailsResult_Success_DEFAULT + } + return p.Success +} +func (p *ReadOnlySchedulerGetJobUpdateDetailsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReadOnlySchedulerGetJobUpdateDetailsResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetJobUpdateDetailsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetJobUpdateDetailsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getJobUpdateDetails_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *ReadOnlySchedulerGetJobUpdateDetailsResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *ReadOnlySchedulerGetJobUpdateDetailsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetJobUpdateDetailsResult(%+v)", *p) +} + +// Attributes: +// - Request +type ReadOnlySchedulerGetJobUpdateDiffArgs struct { + Request *JobUpdateRequest `thrift:"request,1" db:"request" json:"request"` +} + +func NewReadOnlySchedulerGetJobUpdateDiffArgs() *ReadOnlySchedulerGetJobUpdateDiffArgs { + return &ReadOnlySchedulerGetJobUpdateDiffArgs{} +} + +var ReadOnlySchedulerGetJobUpdateDiffArgs_Request_DEFAULT *JobUpdateRequest + +func (p *ReadOnlySchedulerGetJobUpdateDiffArgs) GetRequest() *JobUpdateRequest { + if !p.IsSetRequest() { + return ReadOnlySchedulerGetJobUpdateDiffArgs_Request_DEFAULT + } + return p.Request +} +func (p *ReadOnlySchedulerGetJobUpdateDiffArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *ReadOnlySchedulerGetJobUpdateDiffArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetJobUpdateDiffArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &JobUpdateRequest{} + if err := p.Request.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetJobUpdateDiffArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getJobUpdateDiff_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *ReadOnlySchedulerGetJobUpdateDiffArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) + } + if err := p.Request.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) + } + return err +} + +func (p *ReadOnlySchedulerGetJobUpdateDiffArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetJobUpdateDiffArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReadOnlySchedulerGetJobUpdateDiffResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReadOnlySchedulerGetJobUpdateDiffResult() *ReadOnlySchedulerGetJobUpdateDiffResult { + return &ReadOnlySchedulerGetJobUpdateDiffResult{} +} + +var ReadOnlySchedulerGetJobUpdateDiffResult_Success_DEFAULT *Response + +func (p *ReadOnlySchedulerGetJobUpdateDiffResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return ReadOnlySchedulerGetJobUpdateDiffResult_Success_DEFAULT + } + return p.Success +} +func (p *ReadOnlySchedulerGetJobUpdateDiffResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReadOnlySchedulerGetJobUpdateDiffResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetJobUpdateDiffResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetJobUpdateDiffResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getJobUpdateDiff_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *ReadOnlySchedulerGetJobUpdateDiffResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *ReadOnlySchedulerGetJobUpdateDiffResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetJobUpdateDiffResult(%+v)", *p) +} + +type ReadOnlySchedulerGetTierConfigsArgs struct { +} + +func NewReadOnlySchedulerGetTierConfigsArgs() *ReadOnlySchedulerGetTierConfigsArgs { + return &ReadOnlySchedulerGetTierConfigsArgs{} +} + +func (p *ReadOnlySchedulerGetTierConfigsArgs) 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 + } + 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 *ReadOnlySchedulerGetTierConfigsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getTierConfigs_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + } + 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 *ReadOnlySchedulerGetTierConfigsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetTierConfigsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type ReadOnlySchedulerGetTierConfigsResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewReadOnlySchedulerGetTierConfigsResult() *ReadOnlySchedulerGetTierConfigsResult { + return &ReadOnlySchedulerGetTierConfigsResult{} +} + +var ReadOnlySchedulerGetTierConfigsResult_Success_DEFAULT *Response + +func (p *ReadOnlySchedulerGetTierConfigsResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return ReadOnlySchedulerGetTierConfigsResult_Success_DEFAULT + } + return p.Success +} +func (p *ReadOnlySchedulerGetTierConfigsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *ReadOnlySchedulerGetTierConfigsResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *ReadOnlySchedulerGetTierConfigsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *ReadOnlySchedulerGetTierConfigsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("getTierConfigs_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *ReadOnlySchedulerGetTierConfigsResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *ReadOnlySchedulerGetTierConfigsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReadOnlySchedulerGetTierConfigsResult(%+v)", *p) +} + +type AuroraSchedulerManager interface { + ReadOnlyScheduler + + // Creates a new job. The request will be denied if a job with the provided name already exists + // in the cluster. + // + // Parameters: + // - Description + CreateJob(ctx context.Context, description *JobConfiguration) (r *Response, err error) + // Enters a job into the cron schedule, without actually starting the job. + // If the job is already present in the schedule, this will update the schedule entry with the new + // configuration. + // + // Parameters: + // - Description + ScheduleCronJob(ctx context.Context, description *JobConfiguration) (r *Response, err error) + // Removes a job from the cron schedule. The request will be denied if the job was not previously + // scheduled with scheduleCronJob. + // + // Parameters: + // - Job + DescheduleCronJob(ctx context.Context, job *JobKey) (r *Response, err error) + // Starts a cron job immediately. The request will be denied if the specified job does not + // exist for the role account, or the job is not a cron job. + // + // Parameters: + // - Job + StartCronJob(ctx context.Context, job *JobKey) (r *Response, err error) + // Restarts a batch of shards. + // + // Parameters: + // - Job + // - ShardIds + RestartShards(ctx context.Context, job *JobKey, shardIds []int32) (r *Response, err error) + // Initiates a kill on tasks. + // + // Parameters: + // - Job + // - Instances + // - Message + KillTasks(ctx context.Context, job *JobKey, instances []int32, message string) (r *Response, err error) + // Adds new instances with the TaskConfig of the existing instance pointed by the key. + // + // Parameters: + // - Key + // - Count + AddInstances(ctx context.Context, key *InstanceKey, count int32) (r *Response, err error) + // Replaces the template (configuration) for the existing cron job. + // The cron job template (configuration) must exist for the call to succeed. + // + // Parameters: + // - Config + ReplaceCronTemplate(ctx context.Context, config *JobConfiguration) (r *Response, err error) + // Starts update of the existing service job. + // + // Parameters: + // - Request: A description of how to change the job. + // - Message: A user-specified message to include with the induced job update state change. + StartJobUpdate(ctx context.Context, request *JobUpdateRequest, message string) (r *Response, err error) + // Pauses the specified job update. Can be resumed by resumeUpdate call. + // + // Parameters: + // - Key: The update to pause. + // - Message: A user-specified message to include with the induced job update state change. + PauseJobUpdate(ctx context.Context, key *JobUpdateKey, message string) (r *Response, err error) + // Resumes progress of a previously paused job update. + // + // Parameters: + // - Key: The update to resume. + // - Message: A user-specified message to include with the induced job update state change. + ResumeJobUpdate(ctx context.Context, key *JobUpdateKey, message string) (r *Response, err error) + // Permanently aborts the job update. Does not remove the update history. + // + // Parameters: + // - Key: The update to abort. + // - Message: A user-specified message to include with the induced job update state change. + AbortJobUpdate(ctx context.Context, key *JobUpdateKey, message string) (r *Response, err error) + // Rollbacks the specified active job update to the initial state. + // + // Parameters: + // - Key: The update to rollback. + // - Message: A user-specified message to include with the induced job update state change. + RollbackJobUpdate(ctx context.Context, key *JobUpdateKey, message string) (r *Response, err error) + // Allows progress of the job update in case blockIfNoPulsesAfterMs is specified in + // JobUpdateSettings. Unblocks progress if the update was previously blocked. + // Responds with ResponseCode.INVALID_REQUEST in case an unknown update key is specified. + // + // Parameters: + // - Key + PulseJobUpdate(ctx context.Context, key *JobUpdateKey) (r *Response, err error) +} + +type AuroraSchedulerManagerClient struct { + *ReadOnlySchedulerClient +} + +func NewAuroraSchedulerManagerClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AuroraSchedulerManagerClient { + return &AuroraSchedulerManagerClient{ReadOnlySchedulerClient: NewReadOnlySchedulerClientFactory(t, f)} +} + +func NewAuroraSchedulerManagerClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AuroraSchedulerManagerClient { + return &AuroraSchedulerManagerClient{ReadOnlySchedulerClient: NewReadOnlySchedulerClientProtocol(t, iprot, oprot)} +} + +func NewAuroraSchedulerManagerClient(c thrift.TClient) *AuroraSchedulerManagerClient { + return &AuroraSchedulerManagerClient{ + ReadOnlySchedulerClient: NewReadOnlySchedulerClient(c), + } +} + +// Creates a new job. The request will be denied if a job with the provided name already exists +// in the cluster. +// +// Parameters: +// - Description +func (p *AuroraSchedulerManagerClient) CreateJob(ctx context.Context, description *JobConfiguration) (r *Response, err error) { + var _args131 AuroraSchedulerManagerCreateJobArgs + _args131.Description = description + var _result132 AuroraSchedulerManagerCreateJobResult + if err = p.Client_().Call(ctx, "createJob", &_args131, &_result132); err != nil { + return + } + return _result132.GetSuccess(), nil +} + +// Enters a job into the cron schedule, without actually starting the job. +// If the job is already present in the schedule, this will update the schedule entry with the new +// configuration. +// +// Parameters: +// - Description +func (p *AuroraSchedulerManagerClient) ScheduleCronJob(ctx context.Context, description *JobConfiguration) (r *Response, err error) { + var _args133 AuroraSchedulerManagerScheduleCronJobArgs + _args133.Description = description + var _result134 AuroraSchedulerManagerScheduleCronJobResult + if err = p.Client_().Call(ctx, "scheduleCronJob", &_args133, &_result134); err != nil { + return + } + return _result134.GetSuccess(), nil +} + +// Removes a job from the cron schedule. The request will be denied if the job was not previously +// scheduled with scheduleCronJob. +// +// Parameters: +// - Job +func (p *AuroraSchedulerManagerClient) DescheduleCronJob(ctx context.Context, job *JobKey) (r *Response, err error) { + var _args135 AuroraSchedulerManagerDescheduleCronJobArgs + _args135.Job = job + var _result136 AuroraSchedulerManagerDescheduleCronJobResult + if err = p.Client_().Call(ctx, "descheduleCronJob", &_args135, &_result136); err != nil { + return + } + return _result136.GetSuccess(), nil +} + +// Starts a cron job immediately. The request will be denied if the specified job does not +// exist for the role account, or the job is not a cron job. +// +// Parameters: +// - Job +func (p *AuroraSchedulerManagerClient) StartCronJob(ctx context.Context, job *JobKey) (r *Response, err error) { + var _args137 AuroraSchedulerManagerStartCronJobArgs + _args137.Job = job + var _result138 AuroraSchedulerManagerStartCronJobResult + if err = p.Client_().Call(ctx, "startCronJob", &_args137, &_result138); err != nil { + return + } + return _result138.GetSuccess(), nil +} + +// Restarts a batch of shards. +// +// Parameters: +// - Job +// - ShardIds +func (p *AuroraSchedulerManagerClient) RestartShards(ctx context.Context, job *JobKey, shardIds []int32) (r *Response, err error) { + var _args139 AuroraSchedulerManagerRestartShardsArgs + _args139.Job = job + _args139.ShardIds = shardIds + var _result140 AuroraSchedulerManagerRestartShardsResult + if err = p.Client_().Call(ctx, "restartShards", &_args139, &_result140); err != nil { + return + } + return _result140.GetSuccess(), nil +} + +// Initiates a kill on tasks. +// +// Parameters: +// - Job +// - Instances +// - Message +func (p *AuroraSchedulerManagerClient) KillTasks(ctx context.Context, job *JobKey, instances []int32, message string) (r *Response, err error) { + var _args141 AuroraSchedulerManagerKillTasksArgs + _args141.Job = job + _args141.Instances = instances + _args141.Message = message + var _result142 AuroraSchedulerManagerKillTasksResult + if err = p.Client_().Call(ctx, "killTasks", &_args141, &_result142); err != nil { + return + } + return _result142.GetSuccess(), nil +} + +// Adds new instances with the TaskConfig of the existing instance pointed by the key. +// +// Parameters: +// - Key +// - Count +func (p *AuroraSchedulerManagerClient) AddInstances(ctx context.Context, key *InstanceKey, count int32) (r *Response, err error) { + var _args143 AuroraSchedulerManagerAddInstancesArgs + _args143.Key = key + _args143.Count = count + var _result144 AuroraSchedulerManagerAddInstancesResult + if err = p.Client_().Call(ctx, "addInstances", &_args143, &_result144); err != nil { + return + } + return _result144.GetSuccess(), nil +} + +// Replaces the template (configuration) for the existing cron job. +// The cron job template (configuration) must exist for the call to succeed. +// +// Parameters: +// - Config +func (p *AuroraSchedulerManagerClient) ReplaceCronTemplate(ctx context.Context, config *JobConfiguration) (r *Response, err error) { + var _args145 AuroraSchedulerManagerReplaceCronTemplateArgs + _args145.Config = config + var _result146 AuroraSchedulerManagerReplaceCronTemplateResult + if err = p.Client_().Call(ctx, "replaceCronTemplate", &_args145, &_result146); err != nil { + return + } + return _result146.GetSuccess(), nil +} + +// Starts update of the existing service job. +// +// Parameters: +// - Request: A description of how to change the job. +// - Message: A user-specified message to include with the induced job update state change. +func (p *AuroraSchedulerManagerClient) StartJobUpdate(ctx context.Context, request *JobUpdateRequest, message string) (r *Response, err error) { + var _args147 AuroraSchedulerManagerStartJobUpdateArgs + _args147.Request = request + _args147.Message = message + var _result148 AuroraSchedulerManagerStartJobUpdateResult + if err = p.Client_().Call(ctx, "startJobUpdate", &_args147, &_result148); err != nil { + return + } + return _result148.GetSuccess(), nil +} + +// Pauses the specified job update. Can be resumed by resumeUpdate call. +// +// Parameters: +// - Key: The update to pause. +// - Message: A user-specified message to include with the induced job update state change. +func (p *AuroraSchedulerManagerClient) PauseJobUpdate(ctx context.Context, key *JobUpdateKey, message string) (r *Response, err error) { + var _args149 AuroraSchedulerManagerPauseJobUpdateArgs + _args149.Key = key + _args149.Message = message + var _result150 AuroraSchedulerManagerPauseJobUpdateResult + if err = p.Client_().Call(ctx, "pauseJobUpdate", &_args149, &_result150); err != nil { + return + } + return _result150.GetSuccess(), nil +} + +// Resumes progress of a previously paused job update. +// +// Parameters: +// - Key: The update to resume. +// - Message: A user-specified message to include with the induced job update state change. +func (p *AuroraSchedulerManagerClient) ResumeJobUpdate(ctx context.Context, key *JobUpdateKey, message string) (r *Response, err error) { + var _args151 AuroraSchedulerManagerResumeJobUpdateArgs + _args151.Key = key + _args151.Message = message + var _result152 AuroraSchedulerManagerResumeJobUpdateResult + if err = p.Client_().Call(ctx, "resumeJobUpdate", &_args151, &_result152); err != nil { + return + } + return _result152.GetSuccess(), nil +} + +// Permanently aborts the job update. Does not remove the update history. +// +// Parameters: +// - Key: The update to abort. +// - Message: A user-specified message to include with the induced job update state change. +func (p *AuroraSchedulerManagerClient) AbortJobUpdate(ctx context.Context, key *JobUpdateKey, message string) (r *Response, err error) { + var _args153 AuroraSchedulerManagerAbortJobUpdateArgs + _args153.Key = key + _args153.Message = message + var _result154 AuroraSchedulerManagerAbortJobUpdateResult + if err = p.Client_().Call(ctx, "abortJobUpdate", &_args153, &_result154); err != nil { + return + } + return _result154.GetSuccess(), nil +} + +// Rollbacks the specified active job update to the initial state. +// +// Parameters: +// - Key: The update to rollback. +// - Message: A user-specified message to include with the induced job update state change. +func (p *AuroraSchedulerManagerClient) RollbackJobUpdate(ctx context.Context, key *JobUpdateKey, message string) (r *Response, err error) { + var _args155 AuroraSchedulerManagerRollbackJobUpdateArgs + _args155.Key = key + _args155.Message = message + var _result156 AuroraSchedulerManagerRollbackJobUpdateResult + if err = p.Client_().Call(ctx, "rollbackJobUpdate", &_args155, &_result156); err != nil { + return + } + return _result156.GetSuccess(), nil +} + +// Allows progress of the job update in case blockIfNoPulsesAfterMs is specified in +// JobUpdateSettings. Unblocks progress if the update was previously blocked. +// Responds with ResponseCode.INVALID_REQUEST in case an unknown update key is specified. +// +// Parameters: +// - Key +func (p *AuroraSchedulerManagerClient) PulseJobUpdate(ctx context.Context, key *JobUpdateKey) (r *Response, err error) { + var _args157 AuroraSchedulerManagerPulseJobUpdateArgs + _args157.Key = key + var _result158 AuroraSchedulerManagerPulseJobUpdateResult + if err = p.Client_().Call(ctx, "pulseJobUpdate", &_args157, &_result158); err != nil { + return + } + return _result158.GetSuccess(), nil +} + +type AuroraSchedulerManagerProcessor struct { + *ReadOnlySchedulerProcessor +} + +func NewAuroraSchedulerManagerProcessor(handler AuroraSchedulerManager) *AuroraSchedulerManagerProcessor { + self159 := &AuroraSchedulerManagerProcessor{NewReadOnlySchedulerProcessor(handler)} + self159.AddToProcessorMap("createJob", &auroraSchedulerManagerProcessorCreateJob{handler: handler}) + self159.AddToProcessorMap("scheduleCronJob", &auroraSchedulerManagerProcessorScheduleCronJob{handler: handler}) + self159.AddToProcessorMap("descheduleCronJob", &auroraSchedulerManagerProcessorDescheduleCronJob{handler: handler}) + self159.AddToProcessorMap("startCronJob", &auroraSchedulerManagerProcessorStartCronJob{handler: handler}) + self159.AddToProcessorMap("restartShards", &auroraSchedulerManagerProcessorRestartShards{handler: handler}) + self159.AddToProcessorMap("killTasks", &auroraSchedulerManagerProcessorKillTasks{handler: handler}) + self159.AddToProcessorMap("addInstances", &auroraSchedulerManagerProcessorAddInstances{handler: handler}) + self159.AddToProcessorMap("replaceCronTemplate", &auroraSchedulerManagerProcessorReplaceCronTemplate{handler: handler}) + self159.AddToProcessorMap("startJobUpdate", &auroraSchedulerManagerProcessorStartJobUpdate{handler: handler}) + self159.AddToProcessorMap("pauseJobUpdate", &auroraSchedulerManagerProcessorPauseJobUpdate{handler: handler}) + self159.AddToProcessorMap("resumeJobUpdate", &auroraSchedulerManagerProcessorResumeJobUpdate{handler: handler}) + self159.AddToProcessorMap("abortJobUpdate", &auroraSchedulerManagerProcessorAbortJobUpdate{handler: handler}) + self159.AddToProcessorMap("rollbackJobUpdate", &auroraSchedulerManagerProcessorRollbackJobUpdate{handler: handler}) + self159.AddToProcessorMap("pulseJobUpdate", &auroraSchedulerManagerProcessorPulseJobUpdate{handler: handler}) + return self159 +} + +type auroraSchedulerManagerProcessorCreateJob struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorCreateJob) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerCreateJobArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("createJob", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerCreateJobResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.CreateJob(ctx, args.Description); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createJob: "+err2.Error()) + oprot.WriteMessageBegin("createJob", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("createJob", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraSchedulerManagerProcessorScheduleCronJob struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorScheduleCronJob) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerScheduleCronJobArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("scheduleCronJob", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerScheduleCronJobResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.ScheduleCronJob(ctx, args.Description); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scheduleCronJob: "+err2.Error()) + oprot.WriteMessageBegin("scheduleCronJob", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("scheduleCronJob", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraSchedulerManagerProcessorDescheduleCronJob struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorDescheduleCronJob) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerDescheduleCronJobArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("descheduleCronJob", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerDescheduleCronJobResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.DescheduleCronJob(ctx, args.Job); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing descheduleCronJob: "+err2.Error()) + oprot.WriteMessageBegin("descheduleCronJob", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("descheduleCronJob", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraSchedulerManagerProcessorStartCronJob struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorStartCronJob) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerStartCronJobArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("startCronJob", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerStartCronJobResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.StartCronJob(ctx, args.Job); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing startCronJob: "+err2.Error()) + oprot.WriteMessageBegin("startCronJob", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("startCronJob", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraSchedulerManagerProcessorRestartShards struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorRestartShards) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerRestartShardsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("restartShards", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerRestartShardsResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.RestartShards(ctx, args.Job, args.ShardIds); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing restartShards: "+err2.Error()) + oprot.WriteMessageBegin("restartShards", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("restartShards", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraSchedulerManagerProcessorKillTasks struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorKillTasks) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerKillTasksArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("killTasks", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerKillTasksResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.KillTasks(ctx, args.Job, args.Instances, args.Message); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing killTasks: "+err2.Error()) + oprot.WriteMessageBegin("killTasks", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("killTasks", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraSchedulerManagerProcessorAddInstances struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorAddInstances) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerAddInstancesArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("addInstances", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerAddInstancesResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.AddInstances(ctx, args.Key, args.Count); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addInstances: "+err2.Error()) + oprot.WriteMessageBegin("addInstances", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("addInstances", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraSchedulerManagerProcessorReplaceCronTemplate struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorReplaceCronTemplate) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerReplaceCronTemplateArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("replaceCronTemplate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerReplaceCronTemplateResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.ReplaceCronTemplate(ctx, args.Config); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing replaceCronTemplate: "+err2.Error()) + oprot.WriteMessageBegin("replaceCronTemplate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("replaceCronTemplate", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraSchedulerManagerProcessorStartJobUpdate struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorStartJobUpdate) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerStartJobUpdateArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("startJobUpdate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerStartJobUpdateResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.StartJobUpdate(ctx, args.Request, args.Message); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing startJobUpdate: "+err2.Error()) + oprot.WriteMessageBegin("startJobUpdate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("startJobUpdate", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraSchedulerManagerProcessorPauseJobUpdate struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorPauseJobUpdate) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerPauseJobUpdateArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("pauseJobUpdate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerPauseJobUpdateResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.PauseJobUpdate(ctx, args.Key, args.Message); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing pauseJobUpdate: "+err2.Error()) + oprot.WriteMessageBegin("pauseJobUpdate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("pauseJobUpdate", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraSchedulerManagerProcessorResumeJobUpdate struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorResumeJobUpdate) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerResumeJobUpdateArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("resumeJobUpdate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerResumeJobUpdateResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.ResumeJobUpdate(ctx, args.Key, args.Message); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing resumeJobUpdate: "+err2.Error()) + oprot.WriteMessageBegin("resumeJobUpdate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("resumeJobUpdate", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraSchedulerManagerProcessorAbortJobUpdate struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorAbortJobUpdate) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerAbortJobUpdateArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("abortJobUpdate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerAbortJobUpdateResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.AbortJobUpdate(ctx, args.Key, args.Message); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing abortJobUpdate: "+err2.Error()) + oprot.WriteMessageBegin("abortJobUpdate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("abortJobUpdate", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraSchedulerManagerProcessorRollbackJobUpdate struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorRollbackJobUpdate) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerRollbackJobUpdateArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("rollbackJobUpdate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerRollbackJobUpdateResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.RollbackJobUpdate(ctx, args.Key, args.Message); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rollbackJobUpdate: "+err2.Error()) + oprot.WriteMessageBegin("rollbackJobUpdate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("rollbackJobUpdate", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraSchedulerManagerProcessorPulseJobUpdate struct { + handler AuroraSchedulerManager +} + +func (p *auroraSchedulerManagerProcessorPulseJobUpdate) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraSchedulerManagerPulseJobUpdateArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("pulseJobUpdate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraSchedulerManagerPulseJobUpdateResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.PulseJobUpdate(ctx, args.Key); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing pulseJobUpdate: "+err2.Error()) + oprot.WriteMessageBegin("pulseJobUpdate", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("pulseJobUpdate", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Description +type AuroraSchedulerManagerCreateJobArgs struct { + Description *JobConfiguration `thrift:"description,1" db:"description" json:"description"` +} + +func NewAuroraSchedulerManagerCreateJobArgs() *AuroraSchedulerManagerCreateJobArgs { + return &AuroraSchedulerManagerCreateJobArgs{} +} + +var AuroraSchedulerManagerCreateJobArgs_Description_DEFAULT *JobConfiguration + +func (p *AuroraSchedulerManagerCreateJobArgs) GetDescription() *JobConfiguration { + if !p.IsSetDescription() { + return AuroraSchedulerManagerCreateJobArgs_Description_DEFAULT + } + return p.Description +} +func (p *AuroraSchedulerManagerCreateJobArgs) IsSetDescription() bool { + return p.Description != nil +} + +func (p *AuroraSchedulerManagerCreateJobArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerCreateJobArgs) ReadField1(iprot thrift.TProtocol) error { + p.Description = &JobConfiguration{} + if err := p.Description.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Description), err) + } + return nil +} + +func (p *AuroraSchedulerManagerCreateJobArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("createJob_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraSchedulerManagerCreateJobArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("description", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:description: ", p), err) + } + if err := p.Description.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Description), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:description: ", p), err) + } + return err +} + +func (p *AuroraSchedulerManagerCreateJobArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerCreateJobArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerCreateJobResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerCreateJobResult() *AuroraSchedulerManagerCreateJobResult { + return &AuroraSchedulerManagerCreateJobResult{} +} + +var AuroraSchedulerManagerCreateJobResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerCreateJobResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerCreateJobResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerCreateJobResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerCreateJobResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerCreateJobResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerCreateJobResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("createJob_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerCreateJobResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerCreateJobResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerCreateJobResult(%+v)", *p) +} + +// Attributes: +// - Description +type AuroraSchedulerManagerScheduleCronJobArgs struct { + Description *JobConfiguration `thrift:"description,1" db:"description" json:"description"` +} + +func NewAuroraSchedulerManagerScheduleCronJobArgs() *AuroraSchedulerManagerScheduleCronJobArgs { + return &AuroraSchedulerManagerScheduleCronJobArgs{} +} + +var AuroraSchedulerManagerScheduleCronJobArgs_Description_DEFAULT *JobConfiguration + +func (p *AuroraSchedulerManagerScheduleCronJobArgs) GetDescription() *JobConfiguration { + if !p.IsSetDescription() { + return AuroraSchedulerManagerScheduleCronJobArgs_Description_DEFAULT + } + return p.Description +} +func (p *AuroraSchedulerManagerScheduleCronJobArgs) IsSetDescription() bool { + return p.Description != nil +} + +func (p *AuroraSchedulerManagerScheduleCronJobArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerScheduleCronJobArgs) ReadField1(iprot thrift.TProtocol) error { + p.Description = &JobConfiguration{} + if err := p.Description.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Description), err) + } + return nil +} + +func (p *AuroraSchedulerManagerScheduleCronJobArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("scheduleCronJob_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraSchedulerManagerScheduleCronJobArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("description", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:description: ", p), err) + } + if err := p.Description.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Description), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:description: ", p), err) + } + return err +} + +func (p *AuroraSchedulerManagerScheduleCronJobArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerScheduleCronJobArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerScheduleCronJobResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerScheduleCronJobResult() *AuroraSchedulerManagerScheduleCronJobResult { + return &AuroraSchedulerManagerScheduleCronJobResult{} +} + +var AuroraSchedulerManagerScheduleCronJobResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerScheduleCronJobResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerScheduleCronJobResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerScheduleCronJobResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerScheduleCronJobResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerScheduleCronJobResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerScheduleCronJobResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("scheduleCronJob_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerScheduleCronJobResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerScheduleCronJobResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerScheduleCronJobResult(%+v)", *p) +} + +// Attributes: +// - Job +type AuroraSchedulerManagerDescheduleCronJobArgs struct { + // unused fields # 1 to 3 + Job *JobKey `thrift:"job,4" db:"job" json:"job"` +} + +func NewAuroraSchedulerManagerDescheduleCronJobArgs() *AuroraSchedulerManagerDescheduleCronJobArgs { + return &AuroraSchedulerManagerDescheduleCronJobArgs{} +} + +var AuroraSchedulerManagerDescheduleCronJobArgs_Job_DEFAULT *JobKey + +func (p *AuroraSchedulerManagerDescheduleCronJobArgs) GetJob() *JobKey { + if !p.IsSetJob() { + return AuroraSchedulerManagerDescheduleCronJobArgs_Job_DEFAULT + } + return p.Job +} +func (p *AuroraSchedulerManagerDescheduleCronJobArgs) IsSetJob() bool { + return p.Job != nil +} + +func (p *AuroraSchedulerManagerDescheduleCronJobArgs) 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 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerDescheduleCronJobArgs) ReadField4(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 *AuroraSchedulerManagerDescheduleCronJobArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("descheduleCronJob_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraSchedulerManagerDescheduleCronJobArgs) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("job", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4: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 4:job: ", p), err) + } + return err +} + +func (p *AuroraSchedulerManagerDescheduleCronJobArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerDescheduleCronJobArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerDescheduleCronJobResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerDescheduleCronJobResult() *AuroraSchedulerManagerDescheduleCronJobResult { + return &AuroraSchedulerManagerDescheduleCronJobResult{} +} + +var AuroraSchedulerManagerDescheduleCronJobResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerDescheduleCronJobResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerDescheduleCronJobResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerDescheduleCronJobResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerDescheduleCronJobResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerDescheduleCronJobResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerDescheduleCronJobResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("descheduleCronJob_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerDescheduleCronJobResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerDescheduleCronJobResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerDescheduleCronJobResult(%+v)", *p) +} + +// Attributes: +// - Job +type AuroraSchedulerManagerStartCronJobArgs struct { + // unused fields # 1 to 3 + Job *JobKey `thrift:"job,4" db:"job" json:"job"` +} + +func NewAuroraSchedulerManagerStartCronJobArgs() *AuroraSchedulerManagerStartCronJobArgs { + return &AuroraSchedulerManagerStartCronJobArgs{} +} + +var AuroraSchedulerManagerStartCronJobArgs_Job_DEFAULT *JobKey + +func (p *AuroraSchedulerManagerStartCronJobArgs) GetJob() *JobKey { + if !p.IsSetJob() { + return AuroraSchedulerManagerStartCronJobArgs_Job_DEFAULT + } + return p.Job +} +func (p *AuroraSchedulerManagerStartCronJobArgs) IsSetJob() bool { + return p.Job != nil +} + +func (p *AuroraSchedulerManagerStartCronJobArgs) 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 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerStartCronJobArgs) ReadField4(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 *AuroraSchedulerManagerStartCronJobArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("startCronJob_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraSchedulerManagerStartCronJobArgs) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("job", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4: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 4:job: ", p), err) + } + return err +} + +func (p *AuroraSchedulerManagerStartCronJobArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerStartCronJobArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerStartCronJobResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerStartCronJobResult() *AuroraSchedulerManagerStartCronJobResult { + return &AuroraSchedulerManagerStartCronJobResult{} +} + +var AuroraSchedulerManagerStartCronJobResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerStartCronJobResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerStartCronJobResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerStartCronJobResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerStartCronJobResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerStartCronJobResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerStartCronJobResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("startCronJob_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerStartCronJobResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerStartCronJobResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerStartCronJobResult(%+v)", *p) +} + +// Attributes: +// - Job +// - ShardIds +type AuroraSchedulerManagerRestartShardsArgs struct { + // unused fields # 1 to 2 + ShardIds []int32 `thrift:"shardIds,3" db:"shardIds" json:"shardIds"` + // unused field # 4 + Job *JobKey `thrift:"job,5" db:"job" json:"job"` +} + +func NewAuroraSchedulerManagerRestartShardsArgs() *AuroraSchedulerManagerRestartShardsArgs { + return &AuroraSchedulerManagerRestartShardsArgs{} +} + +var AuroraSchedulerManagerRestartShardsArgs_Job_DEFAULT *JobKey + +func (p *AuroraSchedulerManagerRestartShardsArgs) GetJob() *JobKey { + if !p.IsSetJob() { + return AuroraSchedulerManagerRestartShardsArgs_Job_DEFAULT + } + return p.Job +} + +func (p *AuroraSchedulerManagerRestartShardsArgs) GetShardIds() []int32 { + return p.ShardIds +} +func (p *AuroraSchedulerManagerRestartShardsArgs) IsSetJob() bool { + return p.Job != nil +} + +func (p *AuroraSchedulerManagerRestartShardsArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.SET { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerRestartShardsArgs) ReadField5(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 *AuroraSchedulerManagerRestartShardsArgs) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]int32, 0, size) + p.ShardIds = tSet + for i := 0; i < size; i++ { + var _elem160 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem160 = v + } + p.ShardIds = append(p.ShardIds, _elem160) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + return nil +} + +func (p *AuroraSchedulerManagerRestartShardsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("restartShards_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField3(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 *AuroraSchedulerManagerRestartShardsArgs) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("shardIds", thrift.SET, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:shardIds: ", p), err) + } + if err := oprot.WriteSetBegin(thrift.I32, len(p.ShardIds)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + for i := 0; i < len(p.ShardIds); i++ { + for j := i + 1; j < len(p.ShardIds); j++ { + if reflect.DeepEqual(p.ShardIds[i], p.ShardIds[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.ShardIds[i])) + } + } + } + for _, v := range p.ShardIds { + 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 3:shardIds: ", p), err) + } + return err +} + +func (p *AuroraSchedulerManagerRestartShardsArgs) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("job", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5: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 5:job: ", p), err) + } + return err +} + +func (p *AuroraSchedulerManagerRestartShardsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerRestartShardsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerRestartShardsResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerRestartShardsResult() *AuroraSchedulerManagerRestartShardsResult { + return &AuroraSchedulerManagerRestartShardsResult{} +} + +var AuroraSchedulerManagerRestartShardsResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerRestartShardsResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerRestartShardsResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerRestartShardsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerRestartShardsResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerRestartShardsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerRestartShardsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("restartShards_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerRestartShardsResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerRestartShardsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerRestartShardsResult(%+v)", *p) +} + +// Attributes: +// - Job +// - Instances +// - Message +type AuroraSchedulerManagerKillTasksArgs struct { + // unused fields # 1 to 3 + Job *JobKey `thrift:"job,4" db:"job" json:"job"` + Instances []int32 `thrift:"instances,5" db:"instances" json:"instances"` + Message string `thrift:"message,6" db:"message" json:"message"` +} + +func NewAuroraSchedulerManagerKillTasksArgs() *AuroraSchedulerManagerKillTasksArgs { + return &AuroraSchedulerManagerKillTasksArgs{} +} + +var AuroraSchedulerManagerKillTasksArgs_Job_DEFAULT *JobKey + +func (p *AuroraSchedulerManagerKillTasksArgs) GetJob() *JobKey { + if !p.IsSetJob() { + return AuroraSchedulerManagerKillTasksArgs_Job_DEFAULT + } + return p.Job +} + +func (p *AuroraSchedulerManagerKillTasksArgs) GetInstances() []int32 { + return p.Instances +} + +func (p *AuroraSchedulerManagerKillTasksArgs) GetMessage() string { + return p.Message +} +func (p *AuroraSchedulerManagerKillTasksArgs) IsSetJob() bool { + return p.Job != nil +} + +func (p *AuroraSchedulerManagerKillTasksArgs) 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 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.SET { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerKillTasksArgs) ReadField4(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 *AuroraSchedulerManagerKillTasksArgs) ReadField5(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadSetBegin() + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]int32, 0, size) + p.Instances = tSet + for i := 0; i < size; i++ { + var _elem161 int32 + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 0: ", err) + } else { + _elem161 = v + } + p.Instances = append(p.Instances, _elem161) + } + if err := iprot.ReadSetEnd(); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + return nil +} + +func (p *AuroraSchedulerManagerKillTasksArgs) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 6: ", err) + } else { + p.Message = v + } + return nil +} + +func (p *AuroraSchedulerManagerKillTasksArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("killTasks_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraSchedulerManagerKillTasksArgs) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("job", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4: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 4:job: ", p), err) + } + return err +} + +func (p *AuroraSchedulerManagerKillTasksArgs) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("instances", thrift.SET, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:instances: ", p), err) + } + if err := oprot.WriteSetBegin(thrift.I32, len(p.Instances)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + for i := 0; i < len(p.Instances); i++ { + for j := i + 1; j < len(p.Instances); j++ { + if reflect.DeepEqual(p.Instances[i], p.Instances[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Instances[i])) + } + } + } + for _, v := range p.Instances { + 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:instances: ", p), err) + } + return err +} + +func (p *AuroraSchedulerManagerKillTasksArgs) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("message", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:message: ", p), err) + } + if err := oprot.WriteString(string(p.Message)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.message (6) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:message: ", p), err) + } + return err +} + +func (p *AuroraSchedulerManagerKillTasksArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerKillTasksArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerKillTasksResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerKillTasksResult() *AuroraSchedulerManagerKillTasksResult { + return &AuroraSchedulerManagerKillTasksResult{} +} + +var AuroraSchedulerManagerKillTasksResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerKillTasksResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerKillTasksResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerKillTasksResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerKillTasksResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerKillTasksResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerKillTasksResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("killTasks_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerKillTasksResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerKillTasksResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerKillTasksResult(%+v)", *p) +} + +// Attributes: +// - Key +// - Count +type AuroraSchedulerManagerAddInstancesArgs struct { + // unused fields # 1 to 2 + Key *InstanceKey `thrift:"key,3" db:"key" json:"key"` + Count int32 `thrift:"count,4" db:"count" json:"count"` +} + +func NewAuroraSchedulerManagerAddInstancesArgs() *AuroraSchedulerManagerAddInstancesArgs { + return &AuroraSchedulerManagerAddInstancesArgs{} +} + +var AuroraSchedulerManagerAddInstancesArgs_Key_DEFAULT *InstanceKey + +func (p *AuroraSchedulerManagerAddInstancesArgs) GetKey() *InstanceKey { + if !p.IsSetKey() { + return AuroraSchedulerManagerAddInstancesArgs_Key_DEFAULT + } + return p.Key +} + +func (p *AuroraSchedulerManagerAddInstancesArgs) GetCount() int32 { + return p.Count +} +func (p *AuroraSchedulerManagerAddInstancesArgs) IsSetKey() bool { + return p.Key != nil +} + +func (p *AuroraSchedulerManagerAddInstancesArgs) 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 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerAddInstancesArgs) ReadField3(iprot thrift.TProtocol) error { + p.Key = &InstanceKey{} + if err := p.Key.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err) + } + return nil +} + +func (p *AuroraSchedulerManagerAddInstancesArgs) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 4: ", err) + } else { + p.Count = v + } + return nil +} + +func (p *AuroraSchedulerManagerAddInstancesArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("addInstances_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraSchedulerManagerAddInstancesArgs) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:key: ", p), err) + } + return err +} + +func (p *AuroraSchedulerManagerAddInstancesArgs) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("count", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:count: ", p), err) + } + if err := oprot.WriteI32(int32(p.Count)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.count (4) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:count: ", p), err) + } + return err +} + +func (p *AuroraSchedulerManagerAddInstancesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerAddInstancesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerAddInstancesResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerAddInstancesResult() *AuroraSchedulerManagerAddInstancesResult { + return &AuroraSchedulerManagerAddInstancesResult{} +} + +var AuroraSchedulerManagerAddInstancesResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerAddInstancesResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerAddInstancesResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerAddInstancesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerAddInstancesResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerAddInstancesResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerAddInstancesResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("addInstances_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerAddInstancesResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerAddInstancesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerAddInstancesResult(%+v)", *p) +} + +// Attributes: +// - Config +type AuroraSchedulerManagerReplaceCronTemplateArgs struct { + Config *JobConfiguration `thrift:"config,1" db:"config" json:"config"` +} + +func NewAuroraSchedulerManagerReplaceCronTemplateArgs() *AuroraSchedulerManagerReplaceCronTemplateArgs { + return &AuroraSchedulerManagerReplaceCronTemplateArgs{} +} + +var AuroraSchedulerManagerReplaceCronTemplateArgs_Config_DEFAULT *JobConfiguration + +func (p *AuroraSchedulerManagerReplaceCronTemplateArgs) GetConfig() *JobConfiguration { + if !p.IsSetConfig() { + return AuroraSchedulerManagerReplaceCronTemplateArgs_Config_DEFAULT + } + return p.Config +} +func (p *AuroraSchedulerManagerReplaceCronTemplateArgs) IsSetConfig() bool { + return p.Config != nil +} + +func (p *AuroraSchedulerManagerReplaceCronTemplateArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerReplaceCronTemplateArgs) ReadField1(iprot thrift.TProtocol) error { + p.Config = &JobConfiguration{} + if err := p.Config.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Config), err) + } + return nil +} + +func (p *AuroraSchedulerManagerReplaceCronTemplateArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("replaceCronTemplate_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraSchedulerManagerReplaceCronTemplateArgs) 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 *AuroraSchedulerManagerReplaceCronTemplateArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerReplaceCronTemplateArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerReplaceCronTemplateResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerReplaceCronTemplateResult() *AuroraSchedulerManagerReplaceCronTemplateResult { + return &AuroraSchedulerManagerReplaceCronTemplateResult{} +} + +var AuroraSchedulerManagerReplaceCronTemplateResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerReplaceCronTemplateResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerReplaceCronTemplateResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerReplaceCronTemplateResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerReplaceCronTemplateResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerReplaceCronTemplateResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerReplaceCronTemplateResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("replaceCronTemplate_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerReplaceCronTemplateResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerReplaceCronTemplateResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerReplaceCronTemplateResult(%+v)", *p) +} + +// Attributes: +// - Request: A description of how to change the job. +// - Message: A user-specified message to include with the induced job update state change. +type AuroraSchedulerManagerStartJobUpdateArgs struct { + Request *JobUpdateRequest `thrift:"request,1" db:"request" json:"request"` + // unused field # 2 + Message string `thrift:"message,3" db:"message" json:"message"` +} + +func NewAuroraSchedulerManagerStartJobUpdateArgs() *AuroraSchedulerManagerStartJobUpdateArgs { + return &AuroraSchedulerManagerStartJobUpdateArgs{} +} + +var AuroraSchedulerManagerStartJobUpdateArgs_Request_DEFAULT *JobUpdateRequest + +func (p *AuroraSchedulerManagerStartJobUpdateArgs) GetRequest() *JobUpdateRequest { + if !p.IsSetRequest() { + return AuroraSchedulerManagerStartJobUpdateArgs_Request_DEFAULT + } + return p.Request +} + +func (p *AuroraSchedulerManagerStartJobUpdateArgs) GetMessage() string { + return p.Message +} +func (p *AuroraSchedulerManagerStartJobUpdateArgs) IsSetRequest() bool { + return p.Request != nil +} + +func (p *AuroraSchedulerManagerStartJobUpdateArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerStartJobUpdateArgs) ReadField1(iprot thrift.TProtocol) error { + p.Request = &JobUpdateRequest{} + if err := p.Request.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) + } + return nil +} + +func (p *AuroraSchedulerManagerStartJobUpdateArgs) 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 *AuroraSchedulerManagerStartJobUpdateArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("startJobUpdate_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraSchedulerManagerStartJobUpdateArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) + } + if err := p.Request.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) + } + return err +} + +func (p *AuroraSchedulerManagerStartJobUpdateArgs) writeField3(oprot thrift.TProtocol) (err error) { + 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 *AuroraSchedulerManagerStartJobUpdateArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerStartJobUpdateArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerStartJobUpdateResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerStartJobUpdateResult() *AuroraSchedulerManagerStartJobUpdateResult { + return &AuroraSchedulerManagerStartJobUpdateResult{} +} + +var AuroraSchedulerManagerStartJobUpdateResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerStartJobUpdateResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerStartJobUpdateResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerStartJobUpdateResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerStartJobUpdateResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerStartJobUpdateResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerStartJobUpdateResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("startJobUpdate_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerStartJobUpdateResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerStartJobUpdateResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerStartJobUpdateResult(%+v)", *p) +} + +// Attributes: +// - Key: The update to pause. +// - Message: A user-specified message to include with the induced job update state change. +type AuroraSchedulerManagerPauseJobUpdateArgs struct { + Key *JobUpdateKey `thrift:"key,1" db:"key" json:"key"` + // unused field # 2 + Message string `thrift:"message,3" db:"message" json:"message"` +} + +func NewAuroraSchedulerManagerPauseJobUpdateArgs() *AuroraSchedulerManagerPauseJobUpdateArgs { + return &AuroraSchedulerManagerPauseJobUpdateArgs{} +} + +var AuroraSchedulerManagerPauseJobUpdateArgs_Key_DEFAULT *JobUpdateKey + +func (p *AuroraSchedulerManagerPauseJobUpdateArgs) GetKey() *JobUpdateKey { + if !p.IsSetKey() { + return AuroraSchedulerManagerPauseJobUpdateArgs_Key_DEFAULT + } + return p.Key +} + +func (p *AuroraSchedulerManagerPauseJobUpdateArgs) GetMessage() string { + return p.Message +} +func (p *AuroraSchedulerManagerPauseJobUpdateArgs) IsSetKey() bool { + return p.Key != nil +} + +func (p *AuroraSchedulerManagerPauseJobUpdateArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerPauseJobUpdateArgs) 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 *AuroraSchedulerManagerPauseJobUpdateArgs) 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 *AuroraSchedulerManagerPauseJobUpdateArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("pauseJobUpdate_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraSchedulerManagerPauseJobUpdateArgs) 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 *AuroraSchedulerManagerPauseJobUpdateArgs) writeField3(oprot thrift.TProtocol) (err error) { + 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 *AuroraSchedulerManagerPauseJobUpdateArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerPauseJobUpdateArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerPauseJobUpdateResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerPauseJobUpdateResult() *AuroraSchedulerManagerPauseJobUpdateResult { + return &AuroraSchedulerManagerPauseJobUpdateResult{} +} + +var AuroraSchedulerManagerPauseJobUpdateResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerPauseJobUpdateResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerPauseJobUpdateResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerPauseJobUpdateResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerPauseJobUpdateResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerPauseJobUpdateResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerPauseJobUpdateResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("pauseJobUpdate_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerPauseJobUpdateResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerPauseJobUpdateResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerPauseJobUpdateResult(%+v)", *p) +} + +// Attributes: +// - Key: The update to resume. +// - Message: A user-specified message to include with the induced job update state change. +type AuroraSchedulerManagerResumeJobUpdateArgs struct { + Key *JobUpdateKey `thrift:"key,1" db:"key" json:"key"` + // unused field # 2 + Message string `thrift:"message,3" db:"message" json:"message"` +} + +func NewAuroraSchedulerManagerResumeJobUpdateArgs() *AuroraSchedulerManagerResumeJobUpdateArgs { + return &AuroraSchedulerManagerResumeJobUpdateArgs{} +} + +var AuroraSchedulerManagerResumeJobUpdateArgs_Key_DEFAULT *JobUpdateKey + +func (p *AuroraSchedulerManagerResumeJobUpdateArgs) GetKey() *JobUpdateKey { + if !p.IsSetKey() { + return AuroraSchedulerManagerResumeJobUpdateArgs_Key_DEFAULT + } + return p.Key +} + +func (p *AuroraSchedulerManagerResumeJobUpdateArgs) GetMessage() string { + return p.Message +} +func (p *AuroraSchedulerManagerResumeJobUpdateArgs) IsSetKey() bool { + return p.Key != nil +} + +func (p *AuroraSchedulerManagerResumeJobUpdateArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerResumeJobUpdateArgs) 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 *AuroraSchedulerManagerResumeJobUpdateArgs) 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 *AuroraSchedulerManagerResumeJobUpdateArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("resumeJobUpdate_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraSchedulerManagerResumeJobUpdateArgs) 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 *AuroraSchedulerManagerResumeJobUpdateArgs) writeField3(oprot thrift.TProtocol) (err error) { + 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 *AuroraSchedulerManagerResumeJobUpdateArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerResumeJobUpdateArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerResumeJobUpdateResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerResumeJobUpdateResult() *AuroraSchedulerManagerResumeJobUpdateResult { + return &AuroraSchedulerManagerResumeJobUpdateResult{} +} + +var AuroraSchedulerManagerResumeJobUpdateResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerResumeJobUpdateResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerResumeJobUpdateResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerResumeJobUpdateResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerResumeJobUpdateResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerResumeJobUpdateResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerResumeJobUpdateResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("resumeJobUpdate_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerResumeJobUpdateResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerResumeJobUpdateResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerResumeJobUpdateResult(%+v)", *p) +} + +// Attributes: +// - Key: The update to abort. +// - Message: A user-specified message to include with the induced job update state change. +type AuroraSchedulerManagerAbortJobUpdateArgs struct { + Key *JobUpdateKey `thrift:"key,1" db:"key" json:"key"` + // unused field # 2 + Message string `thrift:"message,3" db:"message" json:"message"` +} + +func NewAuroraSchedulerManagerAbortJobUpdateArgs() *AuroraSchedulerManagerAbortJobUpdateArgs { + return &AuroraSchedulerManagerAbortJobUpdateArgs{} +} + +var AuroraSchedulerManagerAbortJobUpdateArgs_Key_DEFAULT *JobUpdateKey + +func (p *AuroraSchedulerManagerAbortJobUpdateArgs) GetKey() *JobUpdateKey { + if !p.IsSetKey() { + return AuroraSchedulerManagerAbortJobUpdateArgs_Key_DEFAULT + } + return p.Key +} + +func (p *AuroraSchedulerManagerAbortJobUpdateArgs) GetMessage() string { + return p.Message +} +func (p *AuroraSchedulerManagerAbortJobUpdateArgs) IsSetKey() bool { + return p.Key != nil +} + +func (p *AuroraSchedulerManagerAbortJobUpdateArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerAbortJobUpdateArgs) 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 *AuroraSchedulerManagerAbortJobUpdateArgs) 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 *AuroraSchedulerManagerAbortJobUpdateArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("abortJobUpdate_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraSchedulerManagerAbortJobUpdateArgs) 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 *AuroraSchedulerManagerAbortJobUpdateArgs) writeField3(oprot thrift.TProtocol) (err error) { + 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 *AuroraSchedulerManagerAbortJobUpdateArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerAbortJobUpdateArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerAbortJobUpdateResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerAbortJobUpdateResult() *AuroraSchedulerManagerAbortJobUpdateResult { + return &AuroraSchedulerManagerAbortJobUpdateResult{} +} + +var AuroraSchedulerManagerAbortJobUpdateResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerAbortJobUpdateResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerAbortJobUpdateResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerAbortJobUpdateResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerAbortJobUpdateResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerAbortJobUpdateResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerAbortJobUpdateResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("abortJobUpdate_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerAbortJobUpdateResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerAbortJobUpdateResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerAbortJobUpdateResult(%+v)", *p) +} + +// Attributes: +// - Key: The update to rollback. +// - Message: A user-specified message to include with the induced job update state change. +type AuroraSchedulerManagerRollbackJobUpdateArgs struct { + Key *JobUpdateKey `thrift:"key,1" db:"key" json:"key"` + Message string `thrift:"message,2" db:"message" json:"message"` +} + +func NewAuroraSchedulerManagerRollbackJobUpdateArgs() *AuroraSchedulerManagerRollbackJobUpdateArgs { + return &AuroraSchedulerManagerRollbackJobUpdateArgs{} +} + +var AuroraSchedulerManagerRollbackJobUpdateArgs_Key_DEFAULT *JobUpdateKey + +func (p *AuroraSchedulerManagerRollbackJobUpdateArgs) GetKey() *JobUpdateKey { + if !p.IsSetKey() { + return AuroraSchedulerManagerRollbackJobUpdateArgs_Key_DEFAULT + } + return p.Key +} + +func (p *AuroraSchedulerManagerRollbackJobUpdateArgs) GetMessage() string { + return p.Message +} +func (p *AuroraSchedulerManagerRollbackJobUpdateArgs) IsSetKey() bool { + return p.Key != nil +} + +func (p *AuroraSchedulerManagerRollbackJobUpdateArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerRollbackJobUpdateArgs) 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 *AuroraSchedulerManagerRollbackJobUpdateArgs) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) + } else { + p.Message = v + } + return nil +} + +func (p *AuroraSchedulerManagerRollbackJobUpdateArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("rollbackJobUpdate_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraSchedulerManagerRollbackJobUpdateArgs) 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 *AuroraSchedulerManagerRollbackJobUpdateArgs) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("message", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:message: ", p), err) + } + if err := oprot.WriteString(string(p.Message)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.message (2) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:message: ", p), err) + } + return err +} + +func (p *AuroraSchedulerManagerRollbackJobUpdateArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerRollbackJobUpdateArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerRollbackJobUpdateResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerRollbackJobUpdateResult() *AuroraSchedulerManagerRollbackJobUpdateResult { + return &AuroraSchedulerManagerRollbackJobUpdateResult{} +} + +var AuroraSchedulerManagerRollbackJobUpdateResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerRollbackJobUpdateResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerRollbackJobUpdateResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerRollbackJobUpdateResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerRollbackJobUpdateResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerRollbackJobUpdateResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerRollbackJobUpdateResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("rollbackJobUpdate_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerRollbackJobUpdateResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerRollbackJobUpdateResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerRollbackJobUpdateResult(%+v)", *p) +} + +// Attributes: +// - Key +type AuroraSchedulerManagerPulseJobUpdateArgs struct { + Key *JobUpdateKey `thrift:"key,1" db:"key" json:"key"` +} + +func NewAuroraSchedulerManagerPulseJobUpdateArgs() *AuroraSchedulerManagerPulseJobUpdateArgs { + return &AuroraSchedulerManagerPulseJobUpdateArgs{} +} + +var AuroraSchedulerManagerPulseJobUpdateArgs_Key_DEFAULT *JobUpdateKey + +func (p *AuroraSchedulerManagerPulseJobUpdateArgs) GetKey() *JobUpdateKey { + if !p.IsSetKey() { + return AuroraSchedulerManagerPulseJobUpdateArgs_Key_DEFAULT + } + return p.Key +} +func (p *AuroraSchedulerManagerPulseJobUpdateArgs) IsSetKey() bool { + return p.Key != nil +} + +func (p *AuroraSchedulerManagerPulseJobUpdateArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerPulseJobUpdateArgs) 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 *AuroraSchedulerManagerPulseJobUpdateArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("pulseJobUpdate_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraSchedulerManagerPulseJobUpdateArgs) 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 *AuroraSchedulerManagerPulseJobUpdateArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerPulseJobUpdateArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraSchedulerManagerPulseJobUpdateResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraSchedulerManagerPulseJobUpdateResult() *AuroraSchedulerManagerPulseJobUpdateResult { + return &AuroraSchedulerManagerPulseJobUpdateResult{} +} + +var AuroraSchedulerManagerPulseJobUpdateResult_Success_DEFAULT *Response + +func (p *AuroraSchedulerManagerPulseJobUpdateResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraSchedulerManagerPulseJobUpdateResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraSchedulerManagerPulseJobUpdateResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraSchedulerManagerPulseJobUpdateResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraSchedulerManagerPulseJobUpdateResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraSchedulerManagerPulseJobUpdateResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("pulseJobUpdate_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraSchedulerManagerPulseJobUpdateResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraSchedulerManagerPulseJobUpdateResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraSchedulerManagerPulseJobUpdateResult(%+v)", *p) +} + +type AuroraAdmin interface { + AuroraSchedulerManager + + // Assign quota to a user. This will overwrite any pre-existing quota for the user. + // + // Parameters: + // - OwnerRole + // - Quota + SetQuota(ctx context.Context, ownerRole string, quota *ResourceAggregate) (r *Response, err error) + // Forces a task into a specific state. This does not guarantee the task will enter the given + // state, as the task must still transition within the bounds of the state machine. However, + // it attempts to enter that state via the state machine. + // + // Parameters: + // - TaskId + // - Status + ForceTaskState(ctx context.Context, taskId string, status ScheduleStatus) (r *Response, err error) + // Immediately writes a storage snapshot to disk. + PerformBackup(ctx context.Context) (r *Response, err error) + // Lists backups that are available for recovery. + ListBackups(ctx context.Context) (r *Response, err error) + // Loads a backup to an in-memory storage. This must precede all other recovery operations. + // + // Parameters: + // - BackupId + StageRecovery(ctx context.Context, backupId string) (r *Response, err error) + // Queries for tasks in a staged recovery. + // + // Parameters: + // - Query + QueryRecovery(ctx context.Context, query *TaskQuery) (r *Response, err error) + // Deletes tasks from a staged recovery. + // + // Parameters: + // - Query + DeleteRecoveryTasks(ctx context.Context, query *TaskQuery) (r *Response, err error) + // Commits a staged recovery, completely replacing the previous storage state. + CommitRecovery(ctx context.Context) (r *Response, err error) + // Unloads (aborts) a staged recovery. + UnloadRecovery(ctx context.Context) (r *Response, err error) + // Put the given hosts into maintenance mode. + // + // Parameters: + // - Hosts + StartMaintenance(ctx context.Context, hosts *Hosts) (r *Response, err error) + // Ask scheduler to begin moving tasks scheduled on given hosts. + // + // Parameters: + // - Hosts + DrainHosts(ctx context.Context, hosts *Hosts) (r *Response, err error) + // Retrieve the current maintenance states for a group of hosts. + // + // Parameters: + // - Hosts + MaintenanceStatus(ctx context.Context, hosts *Hosts) (r *Response, err error) + // Set the given hosts back into serving mode. + // + // Parameters: + // - Hosts + EndMaintenance(ctx context.Context, hosts *Hosts) (r *Response, err error) + // Ask scheduler to put hosts into DRAINING mode and move scheduled tasks off of the hosts + // such that its SLA requirements are satisfied. Use defaultSlaPolicy if it is not set for a task. + // + // + // Parameters: + // - Hosts + // - DefaultSlaPolicy + // - TimeoutSecs + SlaDrainHosts(ctx context.Context, hosts *Hosts, defaultSlaPolicy *SlaPolicy, timeoutSecs int64) (r *Response, err error) + // Start a storage snapshot and block until it completes. + Snapshot(ctx context.Context) (r *Response, err error) + // Tell scheduler to trigger an explicit task reconciliation with the given settings. + // + // Parameters: + // - Settings + TriggerExplicitTaskReconciliation(ctx context.Context, settings *ExplicitReconciliationSettings) (r *Response, err error) + // Tell scheduler to trigger an implicit task reconciliation. + TriggerImplicitTaskReconciliation(ctx context.Context) (r *Response, err error) + // Force prune any (terminal) tasks that match the query. If no statuses are supplied with the + // query, it will default to all terminal task states. If statuses are supplied, they must be + // terminal states. + // + // Parameters: + // - Query + PruneTasks(ctx context.Context, query *TaskQuery) (r *Response, err error) +} + +type AuroraAdminClient struct { + *AuroraSchedulerManagerClient +} + +func NewAuroraAdminClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AuroraAdminClient { + return &AuroraAdminClient{AuroraSchedulerManagerClient: NewAuroraSchedulerManagerClientFactory(t, f)} +} + +func NewAuroraAdminClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AuroraAdminClient { + return &AuroraAdminClient{AuroraSchedulerManagerClient: NewAuroraSchedulerManagerClientProtocol(t, iprot, oprot)} +} + +func NewAuroraAdminClient(c thrift.TClient) *AuroraAdminClient { + return &AuroraAdminClient{ + AuroraSchedulerManagerClient: NewAuroraSchedulerManagerClient(c), + } +} + +// Assign quota to a user. This will overwrite any pre-existing quota for the user. +// +// Parameters: +// - OwnerRole +// - Quota +func (p *AuroraAdminClient) SetQuota(ctx context.Context, ownerRole string, quota *ResourceAggregate) (r *Response, err error) { + var _args316 AuroraAdminSetQuotaArgs + _args316.OwnerRole = ownerRole + _args316.Quota = quota + var _result317 AuroraAdminSetQuotaResult + if err = p.Client_().Call(ctx, "setQuota", &_args316, &_result317); err != nil { + return + } + return _result317.GetSuccess(), nil +} + +// Forces a task into a specific state. This does not guarantee the task will enter the given +// state, as the task must still transition within the bounds of the state machine. However, +// it attempts to enter that state via the state machine. +// +// Parameters: +// - TaskId +// - Status +func (p *AuroraAdminClient) ForceTaskState(ctx context.Context, taskId string, status ScheduleStatus) (r *Response, err error) { + var _args318 AuroraAdminForceTaskStateArgs + _args318.TaskId = taskId + _args318.Status = status + var _result319 AuroraAdminForceTaskStateResult + if err = p.Client_().Call(ctx, "forceTaskState", &_args318, &_result319); err != nil { + return + } + return _result319.GetSuccess(), nil +} + +// Immediately writes a storage snapshot to disk. +func (p *AuroraAdminClient) PerformBackup(ctx context.Context) (r *Response, err error) { + var _args320 AuroraAdminPerformBackupArgs + var _result321 AuroraAdminPerformBackupResult + if err = p.Client_().Call(ctx, "performBackup", &_args320, &_result321); err != nil { + return + } + return _result321.GetSuccess(), nil +} + +// Lists backups that are available for recovery. +func (p *AuroraAdminClient) ListBackups(ctx context.Context) (r *Response, err error) { + var _args322 AuroraAdminListBackupsArgs + var _result323 AuroraAdminListBackupsResult + if err = p.Client_().Call(ctx, "listBackups", &_args322, &_result323); err != nil { + return + } + return _result323.GetSuccess(), nil +} + +// Loads a backup to an in-memory storage. This must precede all other recovery operations. +// +// Parameters: +// - BackupId +func (p *AuroraAdminClient) StageRecovery(ctx context.Context, backupId string) (r *Response, err error) { + var _args324 AuroraAdminStageRecoveryArgs + _args324.BackupId = backupId + var _result325 AuroraAdminStageRecoveryResult + if err = p.Client_().Call(ctx, "stageRecovery", &_args324, &_result325); err != nil { + return + } + return _result325.GetSuccess(), nil +} + +// Queries for tasks in a staged recovery. +// +// Parameters: +// - Query +func (p *AuroraAdminClient) QueryRecovery(ctx context.Context, query *TaskQuery) (r *Response, err error) { + var _args326 AuroraAdminQueryRecoveryArgs + _args326.Query = query + var _result327 AuroraAdminQueryRecoveryResult + if err = p.Client_().Call(ctx, "queryRecovery", &_args326, &_result327); err != nil { + return + } + return _result327.GetSuccess(), nil +} + +// Deletes tasks from a staged recovery. +// +// Parameters: +// - Query +func (p *AuroraAdminClient) DeleteRecoveryTasks(ctx context.Context, query *TaskQuery) (r *Response, err error) { + var _args328 AuroraAdminDeleteRecoveryTasksArgs + _args328.Query = query + var _result329 AuroraAdminDeleteRecoveryTasksResult + if err = p.Client_().Call(ctx, "deleteRecoveryTasks", &_args328, &_result329); err != nil { + return + } + return _result329.GetSuccess(), nil +} + +// Commits a staged recovery, completely replacing the previous storage state. +func (p *AuroraAdminClient) CommitRecovery(ctx context.Context) (r *Response, err error) { + var _args330 AuroraAdminCommitRecoveryArgs + var _result331 AuroraAdminCommitRecoveryResult + if err = p.Client_().Call(ctx, "commitRecovery", &_args330, &_result331); err != nil { + return + } + return _result331.GetSuccess(), nil +} + +// Unloads (aborts) a staged recovery. +func (p *AuroraAdminClient) UnloadRecovery(ctx context.Context) (r *Response, err error) { + var _args332 AuroraAdminUnloadRecoveryArgs + var _result333 AuroraAdminUnloadRecoveryResult + if err = p.Client_().Call(ctx, "unloadRecovery", &_args332, &_result333); err != nil { + return + } + return _result333.GetSuccess(), nil +} + +// Put the given hosts into maintenance mode. +// +// Parameters: +// - Hosts +func (p *AuroraAdminClient) StartMaintenance(ctx context.Context, hosts *Hosts) (r *Response, err error) { + var _args334 AuroraAdminStartMaintenanceArgs + _args334.Hosts = hosts + var _result335 AuroraAdminStartMaintenanceResult + if err = p.Client_().Call(ctx, "startMaintenance", &_args334, &_result335); err != nil { + return + } + return _result335.GetSuccess(), nil +} + +// Ask scheduler to begin moving tasks scheduled on given hosts. +// +// Parameters: +// - Hosts +func (p *AuroraAdminClient) DrainHosts(ctx context.Context, hosts *Hosts) (r *Response, err error) { + var _args336 AuroraAdminDrainHostsArgs + _args336.Hosts = hosts + var _result337 AuroraAdminDrainHostsResult + if err = p.Client_().Call(ctx, "drainHosts", &_args336, &_result337); err != nil { + return + } + return _result337.GetSuccess(), nil +} + +// Retrieve the current maintenance states for a group of hosts. +// +// Parameters: +// - Hosts +func (p *AuroraAdminClient) MaintenanceStatus(ctx context.Context, hosts *Hosts) (r *Response, err error) { + var _args338 AuroraAdminMaintenanceStatusArgs + _args338.Hosts = hosts + var _result339 AuroraAdminMaintenanceStatusResult + if err = p.Client_().Call(ctx, "maintenanceStatus", &_args338, &_result339); err != nil { + return + } + return _result339.GetSuccess(), nil +} + +// Set the given hosts back into serving mode. +// +// Parameters: +// - Hosts +func (p *AuroraAdminClient) EndMaintenance(ctx context.Context, hosts *Hosts) (r *Response, err error) { + var _args340 AuroraAdminEndMaintenanceArgs + _args340.Hosts = hosts + var _result341 AuroraAdminEndMaintenanceResult + if err = p.Client_().Call(ctx, "endMaintenance", &_args340, &_result341); err != nil { + return + } + return _result341.GetSuccess(), nil +} + +// Ask scheduler to put hosts into DRAINING mode and move scheduled tasks off of the hosts +// such that its SLA requirements are satisfied. Use defaultSlaPolicy if it is not set for a task. +// +// +// Parameters: +// - Hosts +// - DefaultSlaPolicy +// - TimeoutSecs +func (p *AuroraAdminClient) SlaDrainHosts(ctx context.Context, hosts *Hosts, defaultSlaPolicy *SlaPolicy, timeoutSecs int64) (r *Response, err error) { + var _args342 AuroraAdminSlaDrainHostsArgs + _args342.Hosts = hosts + _args342.DefaultSlaPolicy = defaultSlaPolicy + _args342.TimeoutSecs = timeoutSecs + var _result343 AuroraAdminSlaDrainHostsResult + if err = p.Client_().Call(ctx, "slaDrainHosts", &_args342, &_result343); err != nil { + return + } + return _result343.GetSuccess(), nil +} + +// Start a storage snapshot and block until it completes. +func (p *AuroraAdminClient) Snapshot(ctx context.Context) (r *Response, err error) { + var _args344 AuroraAdminSnapshotArgs + var _result345 AuroraAdminSnapshotResult + if err = p.Client_().Call(ctx, "snapshot", &_args344, &_result345); err != nil { + return + } + return _result345.GetSuccess(), nil +} + +// Tell scheduler to trigger an explicit task reconciliation with the given settings. +// +// Parameters: +// - Settings +func (p *AuroraAdminClient) TriggerExplicitTaskReconciliation(ctx context.Context, settings *ExplicitReconciliationSettings) (r *Response, err error) { + var _args346 AuroraAdminTriggerExplicitTaskReconciliationArgs + _args346.Settings = settings + var _result347 AuroraAdminTriggerExplicitTaskReconciliationResult + if err = p.Client_().Call(ctx, "triggerExplicitTaskReconciliation", &_args346, &_result347); err != nil { + return + } + return _result347.GetSuccess(), nil +} + +// Tell scheduler to trigger an implicit task reconciliation. +func (p *AuroraAdminClient) TriggerImplicitTaskReconciliation(ctx context.Context) (r *Response, err error) { + var _args348 AuroraAdminTriggerImplicitTaskReconciliationArgs + var _result349 AuroraAdminTriggerImplicitTaskReconciliationResult + if err = p.Client_().Call(ctx, "triggerImplicitTaskReconciliation", &_args348, &_result349); err != nil { + return + } + return _result349.GetSuccess(), nil +} + +// Force prune any (terminal) tasks that match the query. If no statuses are supplied with the +// query, it will default to all terminal task states. If statuses are supplied, they must be +// terminal states. +// +// Parameters: +// - Query +func (p *AuroraAdminClient) PruneTasks(ctx context.Context, query *TaskQuery) (r *Response, err error) { + var _args350 AuroraAdminPruneTasksArgs + _args350.Query = query + var _result351 AuroraAdminPruneTasksResult + if err = p.Client_().Call(ctx, "pruneTasks", &_args350, &_result351); err != nil { + return + } + return _result351.GetSuccess(), nil +} + +type AuroraAdminProcessor struct { + *AuroraSchedulerManagerProcessor +} + +func NewAuroraAdminProcessor(handler AuroraAdmin) *AuroraAdminProcessor { + self352 := &AuroraAdminProcessor{NewAuroraSchedulerManagerProcessor(handler)} + self352.AddToProcessorMap("setQuota", &auroraAdminProcessorSetQuota{handler: handler}) + self352.AddToProcessorMap("forceTaskState", &auroraAdminProcessorForceTaskState{handler: handler}) + self352.AddToProcessorMap("performBackup", &auroraAdminProcessorPerformBackup{handler: handler}) + self352.AddToProcessorMap("listBackups", &auroraAdminProcessorListBackups{handler: handler}) + self352.AddToProcessorMap("stageRecovery", &auroraAdminProcessorStageRecovery{handler: handler}) + self352.AddToProcessorMap("queryRecovery", &auroraAdminProcessorQueryRecovery{handler: handler}) + self352.AddToProcessorMap("deleteRecoveryTasks", &auroraAdminProcessorDeleteRecoveryTasks{handler: handler}) + self352.AddToProcessorMap("commitRecovery", &auroraAdminProcessorCommitRecovery{handler: handler}) + self352.AddToProcessorMap("unloadRecovery", &auroraAdminProcessorUnloadRecovery{handler: handler}) + self352.AddToProcessorMap("startMaintenance", &auroraAdminProcessorStartMaintenance{handler: handler}) + self352.AddToProcessorMap("drainHosts", &auroraAdminProcessorDrainHosts{handler: handler}) + self352.AddToProcessorMap("maintenanceStatus", &auroraAdminProcessorMaintenanceStatus{handler: handler}) + self352.AddToProcessorMap("endMaintenance", &auroraAdminProcessorEndMaintenance{handler: handler}) + self352.AddToProcessorMap("slaDrainHosts", &auroraAdminProcessorSlaDrainHosts{handler: handler}) + self352.AddToProcessorMap("snapshot", &auroraAdminProcessorSnapshot{handler: handler}) + self352.AddToProcessorMap("triggerExplicitTaskReconciliation", &auroraAdminProcessorTriggerExplicitTaskReconciliation{handler: handler}) + self352.AddToProcessorMap("triggerImplicitTaskReconciliation", &auroraAdminProcessorTriggerImplicitTaskReconciliation{handler: handler}) + self352.AddToProcessorMap("pruneTasks", &auroraAdminProcessorPruneTasks{handler: handler}) + return self352 +} + +type auroraAdminProcessorSetQuota struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorSetQuota) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminSetQuotaArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("setQuota", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminSetQuotaResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.SetQuota(ctx, args.OwnerRole, args.Quota); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setQuota: "+err2.Error()) + oprot.WriteMessageBegin("setQuota", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("setQuota", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorForceTaskState struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorForceTaskState) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminForceTaskStateArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("forceTaskState", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminForceTaskStateResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.ForceTaskState(ctx, args.TaskId, args.Status); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing forceTaskState: "+err2.Error()) + oprot.WriteMessageBegin("forceTaskState", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("forceTaskState", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorPerformBackup struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorPerformBackup) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminPerformBackupArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("performBackup", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminPerformBackupResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.PerformBackup(ctx); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing performBackup: "+err2.Error()) + oprot.WriteMessageBegin("performBackup", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("performBackup", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorListBackups struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorListBackups) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminListBackupsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("listBackups", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminListBackupsResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.ListBackups(ctx); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listBackups: "+err2.Error()) + oprot.WriteMessageBegin("listBackups", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("listBackups", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorStageRecovery struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorStageRecovery) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminStageRecoveryArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("stageRecovery", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminStageRecoveryResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.StageRecovery(ctx, args.BackupId); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing stageRecovery: "+err2.Error()) + oprot.WriteMessageBegin("stageRecovery", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("stageRecovery", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorQueryRecovery struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorQueryRecovery) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminQueryRecoveryArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("queryRecovery", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminQueryRecoveryResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.QueryRecovery(ctx, args.Query); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryRecovery: "+err2.Error()) + oprot.WriteMessageBegin("queryRecovery", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("queryRecovery", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorDeleteRecoveryTasks struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorDeleteRecoveryTasks) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminDeleteRecoveryTasksArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("deleteRecoveryTasks", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminDeleteRecoveryTasksResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.DeleteRecoveryTasks(ctx, args.Query); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteRecoveryTasks: "+err2.Error()) + oprot.WriteMessageBegin("deleteRecoveryTasks", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("deleteRecoveryTasks", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorCommitRecovery struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorCommitRecovery) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminCommitRecoveryArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("commitRecovery", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminCommitRecoveryResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.CommitRecovery(ctx); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing commitRecovery: "+err2.Error()) + oprot.WriteMessageBegin("commitRecovery", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("commitRecovery", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorUnloadRecovery struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorUnloadRecovery) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminUnloadRecoveryArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("unloadRecovery", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminUnloadRecoveryResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.UnloadRecovery(ctx); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing unloadRecovery: "+err2.Error()) + oprot.WriteMessageBegin("unloadRecovery", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("unloadRecovery", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorStartMaintenance struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorStartMaintenance) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminStartMaintenanceArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("startMaintenance", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminStartMaintenanceResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.StartMaintenance(ctx, args.Hosts); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing startMaintenance: "+err2.Error()) + oprot.WriteMessageBegin("startMaintenance", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("startMaintenance", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorDrainHosts struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorDrainHosts) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminDrainHostsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("drainHosts", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminDrainHostsResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.DrainHosts(ctx, args.Hosts); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing drainHosts: "+err2.Error()) + oprot.WriteMessageBegin("drainHosts", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("drainHosts", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorMaintenanceStatus struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorMaintenanceStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminMaintenanceStatusArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("maintenanceStatus", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminMaintenanceStatusResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.MaintenanceStatus(ctx, args.Hosts); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing maintenanceStatus: "+err2.Error()) + oprot.WriteMessageBegin("maintenanceStatus", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("maintenanceStatus", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorEndMaintenance struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorEndMaintenance) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminEndMaintenanceArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("endMaintenance", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminEndMaintenanceResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.EndMaintenance(ctx, args.Hosts); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing endMaintenance: "+err2.Error()) + oprot.WriteMessageBegin("endMaintenance", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("endMaintenance", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorSlaDrainHosts struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorSlaDrainHosts) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminSlaDrainHostsArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("slaDrainHosts", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminSlaDrainHostsResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.SlaDrainHosts(ctx, args.Hosts, args.DefaultSlaPolicy, args.TimeoutSecs); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing slaDrainHosts: "+err2.Error()) + oprot.WriteMessageBegin("slaDrainHosts", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("slaDrainHosts", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorSnapshot struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorSnapshot) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminSnapshotArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("snapshot", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminSnapshotResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.Snapshot(ctx); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing snapshot: "+err2.Error()) + oprot.WriteMessageBegin("snapshot", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("snapshot", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorTriggerExplicitTaskReconciliation struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorTriggerExplicitTaskReconciliation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminTriggerExplicitTaskReconciliationArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("triggerExplicitTaskReconciliation", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminTriggerExplicitTaskReconciliationResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.TriggerExplicitTaskReconciliation(ctx, args.Settings); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing triggerExplicitTaskReconciliation: "+err2.Error()) + oprot.WriteMessageBegin("triggerExplicitTaskReconciliation", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("triggerExplicitTaskReconciliation", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorTriggerImplicitTaskReconciliation struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorTriggerImplicitTaskReconciliation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminTriggerImplicitTaskReconciliationArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("triggerImplicitTaskReconciliation", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminTriggerImplicitTaskReconciliationResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.TriggerImplicitTaskReconciliation(ctx); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing triggerImplicitTaskReconciliation: "+err2.Error()) + oprot.WriteMessageBegin("triggerImplicitTaskReconciliation", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("triggerImplicitTaskReconciliation", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +type auroraAdminProcessorPruneTasks struct { + handler AuroraAdmin +} + +func (p *auroraAdminProcessorPruneTasks) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := AuroraAdminPruneTasksArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("pruneTasks", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + result := AuroraAdminPruneTasksResult{} + var retval *Response + var err2 error + if retval, err2 = p.handler.PruneTasks(ctx, args.Query); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing pruneTasks: "+err2.Error()) + oprot.WriteMessageBegin("pruneTasks", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("pruneTasks", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - OwnerRole +// - Quota +type AuroraAdminSetQuotaArgs struct { + OwnerRole string `thrift:"ownerRole,1" db:"ownerRole" json:"ownerRole"` + Quota *ResourceAggregate `thrift:"quota,2" db:"quota" json:"quota"` +} + +func NewAuroraAdminSetQuotaArgs() *AuroraAdminSetQuotaArgs { + return &AuroraAdminSetQuotaArgs{} +} + +func (p *AuroraAdminSetQuotaArgs) GetOwnerRole() string { + return p.OwnerRole +} + +var AuroraAdminSetQuotaArgs_Quota_DEFAULT *ResourceAggregate + +func (p *AuroraAdminSetQuotaArgs) GetQuota() *ResourceAggregate { + if !p.IsSetQuota() { + return AuroraAdminSetQuotaArgs_Quota_DEFAULT + } + return p.Quota +} +func (p *AuroraAdminSetQuotaArgs) IsSetQuota() bool { + return p.Quota != nil +} + +func (p *AuroraAdminSetQuotaArgs) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminSetQuotaArgs) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.OwnerRole = v + } + return nil +} + +func (p *AuroraAdminSetQuotaArgs) ReadField2(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 *AuroraAdminSetQuotaArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("setQuota_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraAdminSetQuotaArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("ownerRole", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ownerRole: ", p), err) + } + if err := oprot.WriteString(string(p.OwnerRole)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ownerRole (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ownerRole: ", p), err) + } + return err +} + +func (p *AuroraAdminSetQuotaArgs) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("quota", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2: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 2:quota: ", p), err) + } + return err +} + +func (p *AuroraAdminSetQuotaArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminSetQuotaArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminSetQuotaResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminSetQuotaResult() *AuroraAdminSetQuotaResult { + return &AuroraAdminSetQuotaResult{} +} + +var AuroraAdminSetQuotaResult_Success_DEFAULT *Response + +func (p *AuroraAdminSetQuotaResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminSetQuotaResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminSetQuotaResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminSetQuotaResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminSetQuotaResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminSetQuotaResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("setQuota_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminSetQuotaResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminSetQuotaResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminSetQuotaResult(%+v)", *p) +} + +// Attributes: +// - TaskId +// - Status +type AuroraAdminForceTaskStateArgs struct { + TaskId string `thrift:"taskId,1" db:"taskId" json:"taskId"` + Status ScheduleStatus `thrift:"status,2" db:"status" json:"status"` +} + +func NewAuroraAdminForceTaskStateArgs() *AuroraAdminForceTaskStateArgs { + return &AuroraAdminForceTaskStateArgs{} +} + +func (p *AuroraAdminForceTaskStateArgs) GetTaskId() string { + return p.TaskId +} + +func (p *AuroraAdminForceTaskStateArgs) GetStatus() ScheduleStatus { + return p.Status +} +func (p *AuroraAdminForceTaskStateArgs) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminForceTaskStateArgs) 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 *AuroraAdminForceTaskStateArgs) 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 *AuroraAdminForceTaskStateArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("forceTaskState_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraAdminForceTaskStateArgs) 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 *AuroraAdminForceTaskStateArgs) 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 *AuroraAdminForceTaskStateArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminForceTaskStateArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminForceTaskStateResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminForceTaskStateResult() *AuroraAdminForceTaskStateResult { + return &AuroraAdminForceTaskStateResult{} +} + +var AuroraAdminForceTaskStateResult_Success_DEFAULT *Response + +func (p *AuroraAdminForceTaskStateResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminForceTaskStateResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminForceTaskStateResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminForceTaskStateResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminForceTaskStateResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminForceTaskStateResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("forceTaskState_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminForceTaskStateResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminForceTaskStateResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminForceTaskStateResult(%+v)", *p) +} + +type AuroraAdminPerformBackupArgs struct { +} + +func NewAuroraAdminPerformBackupArgs() *AuroraAdminPerformBackupArgs { + return &AuroraAdminPerformBackupArgs{} +} + +func (p *AuroraAdminPerformBackupArgs) 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 + } + 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 *AuroraAdminPerformBackupArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("performBackup_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + } + 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 *AuroraAdminPerformBackupArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminPerformBackupArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminPerformBackupResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminPerformBackupResult() *AuroraAdminPerformBackupResult { + return &AuroraAdminPerformBackupResult{} +} + +var AuroraAdminPerformBackupResult_Success_DEFAULT *Response + +func (p *AuroraAdminPerformBackupResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminPerformBackupResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminPerformBackupResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminPerformBackupResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminPerformBackupResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminPerformBackupResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("performBackup_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminPerformBackupResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminPerformBackupResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminPerformBackupResult(%+v)", *p) +} + +type AuroraAdminListBackupsArgs struct { +} + +func NewAuroraAdminListBackupsArgs() *AuroraAdminListBackupsArgs { + return &AuroraAdminListBackupsArgs{} +} + +func (p *AuroraAdminListBackupsArgs) 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 + } + 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 *AuroraAdminListBackupsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("listBackups_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + } + 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 *AuroraAdminListBackupsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminListBackupsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminListBackupsResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminListBackupsResult() *AuroraAdminListBackupsResult { + return &AuroraAdminListBackupsResult{} +} + +var AuroraAdminListBackupsResult_Success_DEFAULT *Response + +func (p *AuroraAdminListBackupsResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminListBackupsResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminListBackupsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminListBackupsResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminListBackupsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminListBackupsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("listBackups_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminListBackupsResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminListBackupsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminListBackupsResult(%+v)", *p) +} + +// Attributes: +// - BackupId +type AuroraAdminStageRecoveryArgs struct { + BackupId string `thrift:"backupId,1" db:"backupId" json:"backupId"` +} + +func NewAuroraAdminStageRecoveryArgs() *AuroraAdminStageRecoveryArgs { + return &AuroraAdminStageRecoveryArgs{} +} + +func (p *AuroraAdminStageRecoveryArgs) GetBackupId() string { + return p.BackupId +} +func (p *AuroraAdminStageRecoveryArgs) 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 fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminStageRecoveryArgs) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) + } else { + p.BackupId = v + } + return nil +} + +func (p *AuroraAdminStageRecoveryArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("stageRecovery_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraAdminStageRecoveryArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("backupId", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backupId: ", p), err) + } + if err := oprot.WriteString(string(p.BackupId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backupId (1) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backupId: ", p), err) + } + return err +} + +func (p *AuroraAdminStageRecoveryArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminStageRecoveryArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminStageRecoveryResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminStageRecoveryResult() *AuroraAdminStageRecoveryResult { + return &AuroraAdminStageRecoveryResult{} +} + +var AuroraAdminStageRecoveryResult_Success_DEFAULT *Response + +func (p *AuroraAdminStageRecoveryResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminStageRecoveryResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminStageRecoveryResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminStageRecoveryResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminStageRecoveryResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminStageRecoveryResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("stageRecovery_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminStageRecoveryResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminStageRecoveryResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminStageRecoveryResult(%+v)", *p) +} + +// Attributes: +// - Query +type AuroraAdminQueryRecoveryArgs struct { + Query *TaskQuery `thrift:"query,1" db:"query" json:"query"` +} + +func NewAuroraAdminQueryRecoveryArgs() *AuroraAdminQueryRecoveryArgs { + return &AuroraAdminQueryRecoveryArgs{} +} + +var AuroraAdminQueryRecoveryArgs_Query_DEFAULT *TaskQuery + +func (p *AuroraAdminQueryRecoveryArgs) GetQuery() *TaskQuery { + if !p.IsSetQuery() { + return AuroraAdminQueryRecoveryArgs_Query_DEFAULT + } + return p.Query +} +func (p *AuroraAdminQueryRecoveryArgs) IsSetQuery() bool { + return p.Query != nil +} + +func (p *AuroraAdminQueryRecoveryArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminQueryRecoveryArgs) ReadField1(iprot thrift.TProtocol) error { + p.Query = &TaskQuery{} + if err := p.Query.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) + } + return nil +} + +func (p *AuroraAdminQueryRecoveryArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("queryRecovery_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraAdminQueryRecoveryArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err) + } + if err := p.Query.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err) + } + return err +} + +func (p *AuroraAdminQueryRecoveryArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminQueryRecoveryArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminQueryRecoveryResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminQueryRecoveryResult() *AuroraAdminQueryRecoveryResult { + return &AuroraAdminQueryRecoveryResult{} +} + +var AuroraAdminQueryRecoveryResult_Success_DEFAULT *Response + +func (p *AuroraAdminQueryRecoveryResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminQueryRecoveryResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminQueryRecoveryResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminQueryRecoveryResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminQueryRecoveryResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminQueryRecoveryResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("queryRecovery_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminQueryRecoveryResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminQueryRecoveryResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminQueryRecoveryResult(%+v)", *p) +} + +// Attributes: +// - Query +type AuroraAdminDeleteRecoveryTasksArgs struct { + Query *TaskQuery `thrift:"query,1" db:"query" json:"query"` +} + +func NewAuroraAdminDeleteRecoveryTasksArgs() *AuroraAdminDeleteRecoveryTasksArgs { + return &AuroraAdminDeleteRecoveryTasksArgs{} +} + +var AuroraAdminDeleteRecoveryTasksArgs_Query_DEFAULT *TaskQuery + +func (p *AuroraAdminDeleteRecoveryTasksArgs) GetQuery() *TaskQuery { + if !p.IsSetQuery() { + return AuroraAdminDeleteRecoveryTasksArgs_Query_DEFAULT + } + return p.Query +} +func (p *AuroraAdminDeleteRecoveryTasksArgs) IsSetQuery() bool { + return p.Query != nil +} + +func (p *AuroraAdminDeleteRecoveryTasksArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminDeleteRecoveryTasksArgs) ReadField1(iprot thrift.TProtocol) error { + p.Query = &TaskQuery{} + if err := p.Query.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) + } + return nil +} + +func (p *AuroraAdminDeleteRecoveryTasksArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("deleteRecoveryTasks_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraAdminDeleteRecoveryTasksArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err) + } + if err := p.Query.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err) + } + return err +} + +func (p *AuroraAdminDeleteRecoveryTasksArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminDeleteRecoveryTasksArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminDeleteRecoveryTasksResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminDeleteRecoveryTasksResult() *AuroraAdminDeleteRecoveryTasksResult { + return &AuroraAdminDeleteRecoveryTasksResult{} +} + +var AuroraAdminDeleteRecoveryTasksResult_Success_DEFAULT *Response + +func (p *AuroraAdminDeleteRecoveryTasksResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminDeleteRecoveryTasksResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminDeleteRecoveryTasksResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminDeleteRecoveryTasksResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminDeleteRecoveryTasksResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminDeleteRecoveryTasksResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("deleteRecoveryTasks_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminDeleteRecoveryTasksResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminDeleteRecoveryTasksResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminDeleteRecoveryTasksResult(%+v)", *p) +} + +type AuroraAdminCommitRecoveryArgs struct { +} + +func NewAuroraAdminCommitRecoveryArgs() *AuroraAdminCommitRecoveryArgs { + return &AuroraAdminCommitRecoveryArgs{} +} + +func (p *AuroraAdminCommitRecoveryArgs) 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 + } + 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 *AuroraAdminCommitRecoveryArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("commitRecovery_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + } + 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 *AuroraAdminCommitRecoveryArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminCommitRecoveryArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminCommitRecoveryResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminCommitRecoveryResult() *AuroraAdminCommitRecoveryResult { + return &AuroraAdminCommitRecoveryResult{} +} + +var AuroraAdminCommitRecoveryResult_Success_DEFAULT *Response + +func (p *AuroraAdminCommitRecoveryResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminCommitRecoveryResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminCommitRecoveryResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminCommitRecoveryResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminCommitRecoveryResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminCommitRecoveryResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("commitRecovery_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminCommitRecoveryResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminCommitRecoveryResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminCommitRecoveryResult(%+v)", *p) +} + +type AuroraAdminUnloadRecoveryArgs struct { +} + +func NewAuroraAdminUnloadRecoveryArgs() *AuroraAdminUnloadRecoveryArgs { + return &AuroraAdminUnloadRecoveryArgs{} +} + +func (p *AuroraAdminUnloadRecoveryArgs) 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 + } + 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 *AuroraAdminUnloadRecoveryArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("unloadRecovery_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + } + 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 *AuroraAdminUnloadRecoveryArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminUnloadRecoveryArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminUnloadRecoveryResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminUnloadRecoveryResult() *AuroraAdminUnloadRecoveryResult { + return &AuroraAdminUnloadRecoveryResult{} +} + +var AuroraAdminUnloadRecoveryResult_Success_DEFAULT *Response + +func (p *AuroraAdminUnloadRecoveryResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminUnloadRecoveryResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminUnloadRecoveryResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminUnloadRecoveryResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminUnloadRecoveryResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminUnloadRecoveryResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("unloadRecovery_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminUnloadRecoveryResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminUnloadRecoveryResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminUnloadRecoveryResult(%+v)", *p) +} + +// Attributes: +// - Hosts +type AuroraAdminStartMaintenanceArgs struct { + Hosts *Hosts `thrift:"hosts,1" db:"hosts" json:"hosts"` +} + +func NewAuroraAdminStartMaintenanceArgs() *AuroraAdminStartMaintenanceArgs { + return &AuroraAdminStartMaintenanceArgs{} +} + +var AuroraAdminStartMaintenanceArgs_Hosts_DEFAULT *Hosts + +func (p *AuroraAdminStartMaintenanceArgs) GetHosts() *Hosts { + if !p.IsSetHosts() { + return AuroraAdminStartMaintenanceArgs_Hosts_DEFAULT + } + return p.Hosts +} +func (p *AuroraAdminStartMaintenanceArgs) IsSetHosts() bool { + return p.Hosts != nil +} + +func (p *AuroraAdminStartMaintenanceArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminStartMaintenanceArgs) ReadField1(iprot thrift.TProtocol) error { + p.Hosts = &Hosts{} + if err := p.Hosts.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Hosts), err) + } + return nil +} + +func (p *AuroraAdminStartMaintenanceArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("startMaintenance_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraAdminStartMaintenanceArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) + } + if err := p.Hosts.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Hosts), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) + } + return err +} + +func (p *AuroraAdminStartMaintenanceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminStartMaintenanceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminStartMaintenanceResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminStartMaintenanceResult() *AuroraAdminStartMaintenanceResult { + return &AuroraAdminStartMaintenanceResult{} +} + +var AuroraAdminStartMaintenanceResult_Success_DEFAULT *Response + +func (p *AuroraAdminStartMaintenanceResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminStartMaintenanceResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminStartMaintenanceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminStartMaintenanceResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminStartMaintenanceResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminStartMaintenanceResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("startMaintenance_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminStartMaintenanceResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminStartMaintenanceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminStartMaintenanceResult(%+v)", *p) +} + +// Attributes: +// - Hosts +type AuroraAdminDrainHostsArgs struct { + Hosts *Hosts `thrift:"hosts,1" db:"hosts" json:"hosts"` +} + +func NewAuroraAdminDrainHostsArgs() *AuroraAdminDrainHostsArgs { + return &AuroraAdminDrainHostsArgs{} +} + +var AuroraAdminDrainHostsArgs_Hosts_DEFAULT *Hosts + +func (p *AuroraAdminDrainHostsArgs) GetHosts() *Hosts { + if !p.IsSetHosts() { + return AuroraAdminDrainHostsArgs_Hosts_DEFAULT + } + return p.Hosts +} +func (p *AuroraAdminDrainHostsArgs) IsSetHosts() bool { + return p.Hosts != nil +} + +func (p *AuroraAdminDrainHostsArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminDrainHostsArgs) ReadField1(iprot thrift.TProtocol) error { + p.Hosts = &Hosts{} + if err := p.Hosts.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Hosts), err) + } + return nil +} + +func (p *AuroraAdminDrainHostsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("drainHosts_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraAdminDrainHostsArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) + } + if err := p.Hosts.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Hosts), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) + } + return err +} + +func (p *AuroraAdminDrainHostsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminDrainHostsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminDrainHostsResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminDrainHostsResult() *AuroraAdminDrainHostsResult { + return &AuroraAdminDrainHostsResult{} +} + +var AuroraAdminDrainHostsResult_Success_DEFAULT *Response + +func (p *AuroraAdminDrainHostsResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminDrainHostsResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminDrainHostsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminDrainHostsResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminDrainHostsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminDrainHostsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("drainHosts_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminDrainHostsResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminDrainHostsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminDrainHostsResult(%+v)", *p) +} + +// Attributes: +// - Hosts +type AuroraAdminMaintenanceStatusArgs struct { + Hosts *Hosts `thrift:"hosts,1" db:"hosts" json:"hosts"` +} + +func NewAuroraAdminMaintenanceStatusArgs() *AuroraAdminMaintenanceStatusArgs { + return &AuroraAdminMaintenanceStatusArgs{} +} + +var AuroraAdminMaintenanceStatusArgs_Hosts_DEFAULT *Hosts + +func (p *AuroraAdminMaintenanceStatusArgs) GetHosts() *Hosts { + if !p.IsSetHosts() { + return AuroraAdminMaintenanceStatusArgs_Hosts_DEFAULT + } + return p.Hosts +} +func (p *AuroraAdminMaintenanceStatusArgs) IsSetHosts() bool { + return p.Hosts != nil +} + +func (p *AuroraAdminMaintenanceStatusArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminMaintenanceStatusArgs) ReadField1(iprot thrift.TProtocol) error { + p.Hosts = &Hosts{} + if err := p.Hosts.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Hosts), err) + } + return nil +} + +func (p *AuroraAdminMaintenanceStatusArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("maintenanceStatus_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraAdminMaintenanceStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) + } + if err := p.Hosts.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Hosts), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) + } + return err +} + +func (p *AuroraAdminMaintenanceStatusArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminMaintenanceStatusArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminMaintenanceStatusResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminMaintenanceStatusResult() *AuroraAdminMaintenanceStatusResult { + return &AuroraAdminMaintenanceStatusResult{} +} + +var AuroraAdminMaintenanceStatusResult_Success_DEFAULT *Response + +func (p *AuroraAdminMaintenanceStatusResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminMaintenanceStatusResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminMaintenanceStatusResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminMaintenanceStatusResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminMaintenanceStatusResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminMaintenanceStatusResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("maintenanceStatus_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminMaintenanceStatusResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminMaintenanceStatusResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminMaintenanceStatusResult(%+v)", *p) +} + +// Attributes: +// - Hosts +type AuroraAdminEndMaintenanceArgs struct { + Hosts *Hosts `thrift:"hosts,1" db:"hosts" json:"hosts"` +} + +func NewAuroraAdminEndMaintenanceArgs() *AuroraAdminEndMaintenanceArgs { + return &AuroraAdminEndMaintenanceArgs{} +} + +var AuroraAdminEndMaintenanceArgs_Hosts_DEFAULT *Hosts + +func (p *AuroraAdminEndMaintenanceArgs) GetHosts() *Hosts { + if !p.IsSetHosts() { + return AuroraAdminEndMaintenanceArgs_Hosts_DEFAULT + } + return p.Hosts +} +func (p *AuroraAdminEndMaintenanceArgs) IsSetHosts() bool { + return p.Hosts != nil +} + +func (p *AuroraAdminEndMaintenanceArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminEndMaintenanceArgs) ReadField1(iprot thrift.TProtocol) error { + p.Hosts = &Hosts{} + if err := p.Hosts.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Hosts), err) + } + return nil +} + +func (p *AuroraAdminEndMaintenanceArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("endMaintenance_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraAdminEndMaintenanceArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) + } + if err := p.Hosts.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Hosts), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) + } + return err +} + +func (p *AuroraAdminEndMaintenanceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminEndMaintenanceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminEndMaintenanceResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminEndMaintenanceResult() *AuroraAdminEndMaintenanceResult { + return &AuroraAdminEndMaintenanceResult{} +} + +var AuroraAdminEndMaintenanceResult_Success_DEFAULT *Response + +func (p *AuroraAdminEndMaintenanceResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminEndMaintenanceResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminEndMaintenanceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminEndMaintenanceResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminEndMaintenanceResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminEndMaintenanceResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("endMaintenance_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminEndMaintenanceResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminEndMaintenanceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminEndMaintenanceResult(%+v)", *p) +} + +// Attributes: +// - Hosts +// - DefaultSlaPolicy +// - TimeoutSecs +type AuroraAdminSlaDrainHostsArgs struct { + Hosts *Hosts `thrift:"hosts,1" db:"hosts" json:"hosts"` + DefaultSlaPolicy *SlaPolicy `thrift:"defaultSlaPolicy,2" db:"defaultSlaPolicy" json:"defaultSlaPolicy"` + TimeoutSecs int64 `thrift:"timeoutSecs,3" db:"timeoutSecs" json:"timeoutSecs"` +} + +func NewAuroraAdminSlaDrainHostsArgs() *AuroraAdminSlaDrainHostsArgs { + return &AuroraAdminSlaDrainHostsArgs{} +} + +var AuroraAdminSlaDrainHostsArgs_Hosts_DEFAULT *Hosts + +func (p *AuroraAdminSlaDrainHostsArgs) GetHosts() *Hosts { + if !p.IsSetHosts() { + return AuroraAdminSlaDrainHostsArgs_Hosts_DEFAULT + } + return p.Hosts +} + +var AuroraAdminSlaDrainHostsArgs_DefaultSlaPolicy_DEFAULT *SlaPolicy + +func (p *AuroraAdminSlaDrainHostsArgs) GetDefaultSlaPolicy() *SlaPolicy { + if !p.IsSetDefaultSlaPolicy() { + return AuroraAdminSlaDrainHostsArgs_DefaultSlaPolicy_DEFAULT + } + return p.DefaultSlaPolicy +} + +func (p *AuroraAdminSlaDrainHostsArgs) GetTimeoutSecs() int64 { + return p.TimeoutSecs +} +func (p *AuroraAdminSlaDrainHostsArgs) IsSetHosts() bool { + return p.Hosts != nil +} + +func (p *AuroraAdminSlaDrainHostsArgs) IsSetDefaultSlaPolicy() bool { + return p.DefaultSlaPolicy != nil +} + +func (p *AuroraAdminSlaDrainHostsArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminSlaDrainHostsArgs) ReadField1(iprot thrift.TProtocol) error { + p.Hosts = &Hosts{} + if err := p.Hosts.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Hosts), err) + } + return nil +} + +func (p *AuroraAdminSlaDrainHostsArgs) ReadField2(iprot thrift.TProtocol) error { + p.DefaultSlaPolicy = &SlaPolicy{} + if err := p.DefaultSlaPolicy.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DefaultSlaPolicy), err) + } + return nil +} + +func (p *AuroraAdminSlaDrainHostsArgs) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(); err != nil { + return thrift.PrependError("error reading field 3: ", err) + } else { + p.TimeoutSecs = v + } + return nil +} + +func (p *AuroraAdminSlaDrainHostsArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("slaDrainHosts_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraAdminSlaDrainHostsArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("hosts", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) + } + if err := p.Hosts.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Hosts), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) + } + return err +} + +func (p *AuroraAdminSlaDrainHostsArgs) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("defaultSlaPolicy", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:defaultSlaPolicy: ", p), err) + } + if err := p.DefaultSlaPolicy.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DefaultSlaPolicy), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:defaultSlaPolicy: ", p), err) + } + return err +} + +func (p *AuroraAdminSlaDrainHostsArgs) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("timeoutSecs", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:timeoutSecs: ", p), err) + } + if err := oprot.WriteI64(int64(p.TimeoutSecs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timeoutSecs (3) field write error: ", p), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:timeoutSecs: ", p), err) + } + return err +} + +func (p *AuroraAdminSlaDrainHostsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminSlaDrainHostsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminSlaDrainHostsResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminSlaDrainHostsResult() *AuroraAdminSlaDrainHostsResult { + return &AuroraAdminSlaDrainHostsResult{} +} + +var AuroraAdminSlaDrainHostsResult_Success_DEFAULT *Response + +func (p *AuroraAdminSlaDrainHostsResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminSlaDrainHostsResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminSlaDrainHostsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminSlaDrainHostsResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminSlaDrainHostsResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminSlaDrainHostsResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("slaDrainHosts_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminSlaDrainHostsResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminSlaDrainHostsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminSlaDrainHostsResult(%+v)", *p) +} + +type AuroraAdminSnapshotArgs struct { +} + +func NewAuroraAdminSnapshotArgs() *AuroraAdminSnapshotArgs { + return &AuroraAdminSnapshotArgs{} +} + +func (p *AuroraAdminSnapshotArgs) 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 + } + 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 *AuroraAdminSnapshotArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("snapshot_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + } + 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 *AuroraAdminSnapshotArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminSnapshotArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminSnapshotResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminSnapshotResult() *AuroraAdminSnapshotResult { + return &AuroraAdminSnapshotResult{} +} + +var AuroraAdminSnapshotResult_Success_DEFAULT *Response + +func (p *AuroraAdminSnapshotResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminSnapshotResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminSnapshotResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminSnapshotResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminSnapshotResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminSnapshotResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("snapshot_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminSnapshotResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminSnapshotResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminSnapshotResult(%+v)", *p) +} + +// Attributes: +// - Settings +type AuroraAdminTriggerExplicitTaskReconciliationArgs struct { + Settings *ExplicitReconciliationSettings `thrift:"settings,1" db:"settings" json:"settings"` +} + +func NewAuroraAdminTriggerExplicitTaskReconciliationArgs() *AuroraAdminTriggerExplicitTaskReconciliationArgs { + return &AuroraAdminTriggerExplicitTaskReconciliationArgs{} +} + +var AuroraAdminTriggerExplicitTaskReconciliationArgs_Settings_DEFAULT *ExplicitReconciliationSettings + +func (p *AuroraAdminTriggerExplicitTaskReconciliationArgs) GetSettings() *ExplicitReconciliationSettings { + if !p.IsSetSettings() { + return AuroraAdminTriggerExplicitTaskReconciliationArgs_Settings_DEFAULT + } + return p.Settings +} +func (p *AuroraAdminTriggerExplicitTaskReconciliationArgs) IsSetSettings() bool { + return p.Settings != nil +} + +func (p *AuroraAdminTriggerExplicitTaskReconciliationArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminTriggerExplicitTaskReconciliationArgs) ReadField1(iprot thrift.TProtocol) error { + p.Settings = &ExplicitReconciliationSettings{} + if err := p.Settings.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Settings), err) + } + return nil +} + +func (p *AuroraAdminTriggerExplicitTaskReconciliationArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("triggerExplicitTaskReconciliation_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraAdminTriggerExplicitTaskReconciliationArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("settings", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1: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 1:settings: ", p), err) + } + return err +} + +func (p *AuroraAdminTriggerExplicitTaskReconciliationArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminTriggerExplicitTaskReconciliationArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminTriggerExplicitTaskReconciliationResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminTriggerExplicitTaskReconciliationResult() *AuroraAdminTriggerExplicitTaskReconciliationResult { + return &AuroraAdminTriggerExplicitTaskReconciliationResult{} +} + +var AuroraAdminTriggerExplicitTaskReconciliationResult_Success_DEFAULT *Response + +func (p *AuroraAdminTriggerExplicitTaskReconciliationResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminTriggerExplicitTaskReconciliationResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminTriggerExplicitTaskReconciliationResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminTriggerExplicitTaskReconciliationResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminTriggerExplicitTaskReconciliationResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminTriggerExplicitTaskReconciliationResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("triggerExplicitTaskReconciliation_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminTriggerExplicitTaskReconciliationResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminTriggerExplicitTaskReconciliationResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminTriggerExplicitTaskReconciliationResult(%+v)", *p) +} + +type AuroraAdminTriggerImplicitTaskReconciliationArgs struct { +} + +func NewAuroraAdminTriggerImplicitTaskReconciliationArgs() *AuroraAdminTriggerImplicitTaskReconciliationArgs { + return &AuroraAdminTriggerImplicitTaskReconciliationArgs{} +} + +func (p *AuroraAdminTriggerImplicitTaskReconciliationArgs) 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 + } + 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 *AuroraAdminTriggerImplicitTaskReconciliationArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("triggerImplicitTaskReconciliation_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + } + 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 *AuroraAdminTriggerImplicitTaskReconciliationArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminTriggerImplicitTaskReconciliationArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminTriggerImplicitTaskReconciliationResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminTriggerImplicitTaskReconciliationResult() *AuroraAdminTriggerImplicitTaskReconciliationResult { + return &AuroraAdminTriggerImplicitTaskReconciliationResult{} +} + +var AuroraAdminTriggerImplicitTaskReconciliationResult_Success_DEFAULT *Response + +func (p *AuroraAdminTriggerImplicitTaskReconciliationResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminTriggerImplicitTaskReconciliationResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminTriggerImplicitTaskReconciliationResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminTriggerImplicitTaskReconciliationResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminTriggerImplicitTaskReconciliationResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminTriggerImplicitTaskReconciliationResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("triggerImplicitTaskReconciliation_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminTriggerImplicitTaskReconciliationResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminTriggerImplicitTaskReconciliationResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminTriggerImplicitTaskReconciliationResult(%+v)", *p) +} + +// Attributes: +// - Query +type AuroraAdminPruneTasksArgs struct { + Query *TaskQuery `thrift:"query,1" db:"query" json:"query"` +} + +func NewAuroraAdminPruneTasksArgs() *AuroraAdminPruneTasksArgs { + return &AuroraAdminPruneTasksArgs{} +} + +var AuroraAdminPruneTasksArgs_Query_DEFAULT *TaskQuery + +func (p *AuroraAdminPruneTasksArgs) GetQuery() *TaskQuery { + if !p.IsSetQuery() { + return AuroraAdminPruneTasksArgs_Query_DEFAULT + } + return p.Query +} +func (p *AuroraAdminPruneTasksArgs) IsSetQuery() bool { + return p.Query != nil +} + +func (p *AuroraAdminPruneTasksArgs) 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 fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminPruneTasksArgs) ReadField1(iprot thrift.TProtocol) error { + p.Query = &TaskQuery{} + if err := p.Query.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) + } + return nil +} + +func (p *AuroraAdminPruneTasksArgs) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("pruneTasks_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + 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 *AuroraAdminPruneTasksArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err) + } + if err := p.Query.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err) + } + return err +} + +func (p *AuroraAdminPruneTasksArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminPruneTasksArgs(%+v)", *p) +} + +// Attributes: +// - Success +type AuroraAdminPruneTasksResult struct { + Success *Response `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewAuroraAdminPruneTasksResult() *AuroraAdminPruneTasksResult { + return &AuroraAdminPruneTasksResult{} +} + +var AuroraAdminPruneTasksResult_Success_DEFAULT *Response + +func (p *AuroraAdminPruneTasksResult) GetSuccess() *Response { + if !p.IsSetSuccess() { + return AuroraAdminPruneTasksResult_Success_DEFAULT + } + return p.Success +} +func (p *AuroraAdminPruneTasksResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *AuroraAdminPruneTasksResult) 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 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); 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 *AuroraAdminPruneTasksResult) ReadField0(iprot thrift.TProtocol) error { + p.Success = &Response{} + if err := p.Success.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *AuroraAdminPruneTasksResult) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("pruneTasks_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) + } + if p != nil { + if err := p.writeField0(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 *AuroraAdminPruneTasksResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) + } + if err := p.Success.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) + } + } + return err +} + +func (p *AuroraAdminPruneTasksResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuroraAdminPruneTasksResult(%+v)", *p) +} diff --git a/gen-go/apache/aurora/aurora_admin-remote/aurora_admin-remote.go b/gen-go/apache/aurora/aurora_admin-remote/aurora_admin-remote.go index d6f7bfd..63d54ed 100755 --- a/gen-go/apache/aurora/aurora_admin-remote/aurora_admin-remote.go +++ b/gen-go/apache/aurora/aurora_admin-remote/aurora_admin-remote.go @@ -1,19 +1,21 @@ -// Autogenerated by Thrift Compiler (0.9.3) +// Autogenerated by Thrift Compiler (0.12.0) // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING package main import ( "apache/aurora" + "context" "flag" "fmt" - "git.apache.org/thrift.git/lib/go/thrift" "math" "net" "net/url" "os" "strconv" "strings" + + "git.apache.org/thrift.git/lib/go/thrift" ) func Usage() { @@ -69,6 +71,22 @@ func Usage() { os.Exit(0) } +type httpHeaders map[string]string + +func (h httpHeaders) String() string { + var m map[string]string = h + return fmt.Sprintf("%s", m) +} + +func (h httpHeaders) Set(value string) error { + parts := strings.Split(value, ": ") + if len(parts) != 2 { + return fmt.Errorf("header should be of format 'Key: Value'") + } + h[parts[0]] = parts[1] + return nil +} + func main() { flag.Usage = Usage var host string @@ -77,7 +95,8 @@ func main() { var urlString string var framed bool var useHttp bool - var parsedUrl url.URL + headers := make(httpHeaders) + var parsedUrl *url.URL var trans thrift.TTransport _ = strconv.Atoi _ = math.Abs @@ -88,16 +107,18 @@ func main() { flag.StringVar(&urlString, "u", "", "Specify the url") flag.BoolVar(&framed, "framed", false, "Use framed transport") flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Var(headers, "H", "Headers to set on the http(s) request (e.g. -H \"Key: Value\")") flag.Parse() if len(urlString) > 0 { - parsedUrl, err := url.Parse(urlString) + var err error + parsedUrl, err = url.Parse(urlString) if err != nil { fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) flag.Usage() } host = parsedUrl.Host - useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" || parsedUrl.Scheme == "https" } else if useHttp { _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) if err != nil { @@ -110,6 +131,12 @@ func main() { var err error if useHttp { trans, err = thrift.NewTHttpClient(parsedUrl.String()) + if len(headers) > 0 { + httptrans := trans.(*thrift.THttpClient) + for key, value := range headers { + httptrans.SetHeader(key, value) + } + } } else { portStr := fmt.Sprint(port) if strings.Contains(host, ":") { @@ -152,7 +179,9 @@ func main() { Usage() os.Exit(1) } - client := aurora.NewAuroraAdminClientFactory(trans, protocolFactory) + iprot := protocolFactory.GetProtocol(trans) + oprot := protocolFactory.GetProtocol(trans) + client := aurora.NewAuroraAdminClient(thrift.NewTStandardClient(iprot, oprot)) if err := trans.Open(); err != nil { fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) os.Exit(1) @@ -174,7 +203,7 @@ func main() { Usage() return } - factory357 := thrift.NewTSimpleJSONProtocolFactory() + factory357 := thrift.NewTJSONProtocolFactory() jsProt358 := factory357.GetProtocol(mbTrans355) argvalue1 := aurora.NewResourceAggregate() err359 := argvalue1.Read(jsProt358) @@ -183,7 +212,7 @@ func main() { return } value1 := argvalue1 - fmt.Print(client.SetQuota(value0, value1)) + fmt.Print(client.SetQuota(context.Background(), value0, value1)) fmt.Print("\n") break case "forceTaskState": @@ -200,7 +229,7 @@ func main() { } argvalue1 := aurora.ScheduleStatus(tmp1) value1 := argvalue1 - fmt.Print(client.ForceTaskState(value0, value1)) + fmt.Print(client.ForceTaskState(context.Background(), value0, value1)) fmt.Print("\n") break case "performBackup": @@ -208,7 +237,7 @@ func main() { fmt.Fprintln(os.Stderr, "PerformBackup requires 0 args") flag.Usage() } - fmt.Print(client.PerformBackup()) + fmt.Print(client.PerformBackup(context.Background())) fmt.Print("\n") break case "listBackups": @@ -216,7 +245,7 @@ func main() { fmt.Fprintln(os.Stderr, "ListBackups requires 0 args") flag.Usage() } - fmt.Print(client.ListBackups()) + fmt.Print(client.ListBackups(context.Background())) fmt.Print("\n") break case "stageRecovery": @@ -226,7 +255,7 @@ func main() { } argvalue0 := flag.Arg(1) value0 := argvalue0 - fmt.Print(client.StageRecovery(value0)) + fmt.Print(client.StageRecovery(context.Background(), value0)) fmt.Print("\n") break case "queryRecovery": @@ -242,7 +271,7 @@ func main() { Usage() return } - factory365 := thrift.NewTSimpleJSONProtocolFactory() + factory365 := thrift.NewTJSONProtocolFactory() jsProt366 := factory365.GetProtocol(mbTrans363) argvalue0 := aurora.NewTaskQuery() err367 := argvalue0.Read(jsProt366) @@ -251,7 +280,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.QueryRecovery(value0)) + fmt.Print(client.QueryRecovery(context.Background(), value0)) fmt.Print("\n") break case "deleteRecoveryTasks": @@ -267,7 +296,7 @@ func main() { Usage() return } - factory371 := thrift.NewTSimpleJSONProtocolFactory() + factory371 := thrift.NewTJSONProtocolFactory() jsProt372 := factory371.GetProtocol(mbTrans369) argvalue0 := aurora.NewTaskQuery() err373 := argvalue0.Read(jsProt372) @@ -276,7 +305,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.DeleteRecoveryTasks(value0)) + fmt.Print(client.DeleteRecoveryTasks(context.Background(), value0)) fmt.Print("\n") break case "commitRecovery": @@ -284,7 +313,7 @@ func main() { fmt.Fprintln(os.Stderr, "CommitRecovery requires 0 args") flag.Usage() } - fmt.Print(client.CommitRecovery()) + fmt.Print(client.CommitRecovery(context.Background())) fmt.Print("\n") break case "unloadRecovery": @@ -292,7 +321,7 @@ func main() { fmt.Fprintln(os.Stderr, "UnloadRecovery requires 0 args") flag.Usage() } - fmt.Print(client.UnloadRecovery()) + fmt.Print(client.UnloadRecovery(context.Background())) fmt.Print("\n") break case "startMaintenance": @@ -308,7 +337,7 @@ func main() { Usage() return } - factory377 := thrift.NewTSimpleJSONProtocolFactory() + factory377 := thrift.NewTJSONProtocolFactory() jsProt378 := factory377.GetProtocol(mbTrans375) argvalue0 := aurora.NewHosts() err379 := argvalue0.Read(jsProt378) @@ -317,7 +346,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.StartMaintenance(value0)) + fmt.Print(client.StartMaintenance(context.Background(), value0)) fmt.Print("\n") break case "drainHosts": @@ -333,7 +362,7 @@ func main() { Usage() return } - factory383 := thrift.NewTSimpleJSONProtocolFactory() + factory383 := thrift.NewTJSONProtocolFactory() jsProt384 := factory383.GetProtocol(mbTrans381) argvalue0 := aurora.NewHosts() err385 := argvalue0.Read(jsProt384) @@ -342,7 +371,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.DrainHosts(value0)) + fmt.Print(client.DrainHosts(context.Background(), value0)) fmt.Print("\n") break case "maintenanceStatus": @@ -358,7 +387,7 @@ func main() { Usage() return } - factory389 := thrift.NewTSimpleJSONProtocolFactory() + factory389 := thrift.NewTJSONProtocolFactory() jsProt390 := factory389.GetProtocol(mbTrans387) argvalue0 := aurora.NewHosts() err391 := argvalue0.Read(jsProt390) @@ -367,7 +396,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.MaintenanceStatus(value0)) + fmt.Print(client.MaintenanceStatus(context.Background(), value0)) fmt.Print("\n") break case "endMaintenance": @@ -383,7 +412,7 @@ func main() { Usage() return } - factory395 := thrift.NewTSimpleJSONProtocolFactory() + factory395 := thrift.NewTJSONProtocolFactory() jsProt396 := factory395.GetProtocol(mbTrans393) argvalue0 := aurora.NewHosts() err397 := argvalue0.Read(jsProt396) @@ -392,7 +421,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.EndMaintenance(value0)) + fmt.Print(client.EndMaintenance(context.Background(), value0)) fmt.Print("\n") break case "slaDrainHosts": @@ -408,7 +437,7 @@ func main() { Usage() return } - factory401 := thrift.NewTSimpleJSONProtocolFactory() + factory401 := thrift.NewTJSONProtocolFactory() jsProt402 := factory401.GetProtocol(mbTrans399) argvalue0 := aurora.NewHosts() err403 := argvalue0.Read(jsProt402) @@ -425,7 +454,7 @@ func main() { Usage() return } - factory407 := thrift.NewTSimpleJSONProtocolFactory() + factory407 := thrift.NewTJSONProtocolFactory() jsProt408 := factory407.GetProtocol(mbTrans405) argvalue1 := aurora.NewSlaPolicy() err409 := argvalue1.Read(jsProt408) @@ -440,7 +469,7 @@ func main() { return } value2 := argvalue2 - fmt.Print(client.SlaDrainHosts(value0, value1, value2)) + fmt.Print(client.SlaDrainHosts(context.Background(), value0, value1, value2)) fmt.Print("\n") break case "snapshot": @@ -448,7 +477,7 @@ func main() { fmt.Fprintln(os.Stderr, "Snapshot requires 0 args") flag.Usage() } - fmt.Print(client.Snapshot()) + fmt.Print(client.Snapshot(context.Background())) fmt.Print("\n") break case "triggerExplicitTaskReconciliation": @@ -464,7 +493,7 @@ func main() { Usage() return } - factory414 := thrift.NewTSimpleJSONProtocolFactory() + factory414 := thrift.NewTJSONProtocolFactory() jsProt415 := factory414.GetProtocol(mbTrans412) argvalue0 := aurora.NewExplicitReconciliationSettings() err416 := argvalue0.Read(jsProt415) @@ -473,7 +502,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.TriggerExplicitTaskReconciliation(value0)) + fmt.Print(client.TriggerExplicitTaskReconciliation(context.Background(), value0)) fmt.Print("\n") break case "triggerImplicitTaskReconciliation": @@ -481,7 +510,7 @@ func main() { fmt.Fprintln(os.Stderr, "TriggerImplicitTaskReconciliation requires 0 args") flag.Usage() } - fmt.Print(client.TriggerImplicitTaskReconciliation()) + fmt.Print(client.TriggerImplicitTaskReconciliation(context.Background())) fmt.Print("\n") break case "pruneTasks": @@ -497,7 +526,7 @@ func main() { Usage() return } - factory420 := thrift.NewTSimpleJSONProtocolFactory() + factory420 := thrift.NewTJSONProtocolFactory() jsProt421 := factory420.GetProtocol(mbTrans418) argvalue0 := aurora.NewTaskQuery() err422 := argvalue0.Read(jsProt421) @@ -506,7 +535,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.PruneTasks(value0)) + fmt.Print(client.PruneTasks(context.Background(), value0)) fmt.Print("\n") break case "createJob": @@ -522,7 +551,7 @@ func main() { Usage() return } - factory426 := thrift.NewTSimpleJSONProtocolFactory() + factory426 := thrift.NewTJSONProtocolFactory() jsProt427 := factory426.GetProtocol(mbTrans424) argvalue0 := aurora.NewJobConfiguration() err428 := argvalue0.Read(jsProt427) @@ -531,7 +560,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.CreateJob(value0)) + fmt.Print(client.CreateJob(context.Background(), value0)) fmt.Print("\n") break case "scheduleCronJob": @@ -547,7 +576,7 @@ func main() { Usage() return } - factory432 := thrift.NewTSimpleJSONProtocolFactory() + factory432 := thrift.NewTJSONProtocolFactory() jsProt433 := factory432.GetProtocol(mbTrans430) argvalue0 := aurora.NewJobConfiguration() err434 := argvalue0.Read(jsProt433) @@ -556,7 +585,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.ScheduleCronJob(value0)) + fmt.Print(client.ScheduleCronJob(context.Background(), value0)) fmt.Print("\n") break case "descheduleCronJob": @@ -572,7 +601,7 @@ func main() { Usage() return } - factory438 := thrift.NewTSimpleJSONProtocolFactory() + factory438 := thrift.NewTJSONProtocolFactory() jsProt439 := factory438.GetProtocol(mbTrans436) argvalue0 := aurora.NewJobKey() err440 := argvalue0.Read(jsProt439) @@ -581,7 +610,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.DescheduleCronJob(value0)) + fmt.Print(client.DescheduleCronJob(context.Background(), value0)) fmt.Print("\n") break case "startCronJob": @@ -597,7 +626,7 @@ func main() { Usage() return } - factory444 := thrift.NewTSimpleJSONProtocolFactory() + factory444 := thrift.NewTJSONProtocolFactory() jsProt445 := factory444.GetProtocol(mbTrans442) argvalue0 := aurora.NewJobKey() err446 := argvalue0.Read(jsProt445) @@ -606,7 +635,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.StartCronJob(value0)) + fmt.Print(client.StartCronJob(context.Background(), value0)) fmt.Print("\n") break case "restartShards": @@ -622,7 +651,7 @@ func main() { Usage() return } - factory450 := thrift.NewTSimpleJSONProtocolFactory() + factory450 := thrift.NewTJSONProtocolFactory() jsProt451 := factory450.GetProtocol(mbTrans448) argvalue0 := aurora.NewJobKey() err452 := argvalue0.Read(jsProt451) @@ -639,7 +668,7 @@ func main() { Usage() return } - factory456 := thrift.NewTSimpleJSONProtocolFactory() + factory456 := thrift.NewTJSONProtocolFactory() jsProt457 := factory456.GetProtocol(mbTrans454) containerStruct1 := aurora.NewAuroraAdminRestartShardsArgs() err458 := containerStruct1.ReadField2(jsProt457) @@ -649,7 +678,7 @@ func main() { } argvalue1 := containerStruct1.ShardIds value1 := argvalue1 - fmt.Print(client.RestartShards(value0, value1)) + fmt.Print(client.RestartShards(context.Background(), value0, value1)) fmt.Print("\n") break case "killTasks": @@ -665,7 +694,7 @@ func main() { Usage() return } - factory462 := thrift.NewTSimpleJSONProtocolFactory() + factory462 := thrift.NewTJSONProtocolFactory() jsProt463 := factory462.GetProtocol(mbTrans460) argvalue0 := aurora.NewJobKey() err464 := argvalue0.Read(jsProt463) @@ -682,7 +711,7 @@ func main() { Usage() return } - factory468 := thrift.NewTSimpleJSONProtocolFactory() + factory468 := thrift.NewTJSONProtocolFactory() jsProt469 := factory468.GetProtocol(mbTrans466) containerStruct1 := aurora.NewAuroraAdminKillTasksArgs() err470 := containerStruct1.ReadField2(jsProt469) @@ -694,7 +723,7 @@ func main() { value1 := argvalue1 argvalue2 := flag.Arg(3) value2 := argvalue2 - fmt.Print(client.KillTasks(value0, value1, value2)) + fmt.Print(client.KillTasks(context.Background(), value0, value1, value2)) fmt.Print("\n") break case "addInstances": @@ -710,7 +739,7 @@ func main() { Usage() return } - factory475 := thrift.NewTSimpleJSONProtocolFactory() + factory475 := thrift.NewTJSONProtocolFactory() jsProt476 := factory475.GetProtocol(mbTrans473) argvalue0 := aurora.NewInstanceKey() err477 := argvalue0.Read(jsProt476) @@ -726,7 +755,7 @@ func main() { } argvalue1 := int32(tmp1) value1 := argvalue1 - fmt.Print(client.AddInstances(value0, value1)) + fmt.Print(client.AddInstances(context.Background(), value0, value1)) fmt.Print("\n") break case "replaceCronTemplate": @@ -742,7 +771,7 @@ func main() { Usage() return } - factory482 := thrift.NewTSimpleJSONProtocolFactory() + factory482 := thrift.NewTJSONProtocolFactory() jsProt483 := factory482.GetProtocol(mbTrans480) argvalue0 := aurora.NewJobConfiguration() err484 := argvalue0.Read(jsProt483) @@ -751,7 +780,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.ReplaceCronTemplate(value0)) + fmt.Print(client.ReplaceCronTemplate(context.Background(), value0)) fmt.Print("\n") break case "startJobUpdate": @@ -767,7 +796,7 @@ func main() { Usage() return } - factory488 := thrift.NewTSimpleJSONProtocolFactory() + factory488 := thrift.NewTJSONProtocolFactory() jsProt489 := factory488.GetProtocol(mbTrans486) argvalue0 := aurora.NewJobUpdateRequest() err490 := argvalue0.Read(jsProt489) @@ -778,7 +807,7 @@ func main() { value0 := argvalue0 argvalue1 := flag.Arg(2) value1 := argvalue1 - fmt.Print(client.StartJobUpdate(value0, value1)) + fmt.Print(client.StartJobUpdate(context.Background(), value0, value1)) fmt.Print("\n") break case "pauseJobUpdate": @@ -794,7 +823,7 @@ func main() { Usage() return } - factory495 := thrift.NewTSimpleJSONProtocolFactory() + factory495 := thrift.NewTJSONProtocolFactory() jsProt496 := factory495.GetProtocol(mbTrans493) argvalue0 := aurora.NewJobUpdateKey() err497 := argvalue0.Read(jsProt496) @@ -805,7 +834,7 @@ func main() { value0 := argvalue0 argvalue1 := flag.Arg(2) value1 := argvalue1 - fmt.Print(client.PauseJobUpdate(value0, value1)) + fmt.Print(client.PauseJobUpdate(context.Background(), value0, value1)) fmt.Print("\n") break case "resumeJobUpdate": @@ -821,7 +850,7 @@ func main() { Usage() return } - factory502 := thrift.NewTSimpleJSONProtocolFactory() + factory502 := thrift.NewTJSONProtocolFactory() jsProt503 := factory502.GetProtocol(mbTrans500) argvalue0 := aurora.NewJobUpdateKey() err504 := argvalue0.Read(jsProt503) @@ -832,7 +861,7 @@ func main() { value0 := argvalue0 argvalue1 := flag.Arg(2) value1 := argvalue1 - fmt.Print(client.ResumeJobUpdate(value0, value1)) + fmt.Print(client.ResumeJobUpdate(context.Background(), value0, value1)) fmt.Print("\n") break case "abortJobUpdate": @@ -848,7 +877,7 @@ func main() { Usage() return } - factory509 := thrift.NewTSimpleJSONProtocolFactory() + factory509 := thrift.NewTJSONProtocolFactory() jsProt510 := factory509.GetProtocol(mbTrans507) argvalue0 := aurora.NewJobUpdateKey() err511 := argvalue0.Read(jsProt510) @@ -859,7 +888,7 @@ func main() { value0 := argvalue0 argvalue1 := flag.Arg(2) value1 := argvalue1 - fmt.Print(client.AbortJobUpdate(value0, value1)) + fmt.Print(client.AbortJobUpdate(context.Background(), value0, value1)) fmt.Print("\n") break case "rollbackJobUpdate": @@ -875,7 +904,7 @@ func main() { Usage() return } - factory516 := thrift.NewTSimpleJSONProtocolFactory() + factory516 := thrift.NewTJSONProtocolFactory() jsProt517 := factory516.GetProtocol(mbTrans514) argvalue0 := aurora.NewJobUpdateKey() err518 := argvalue0.Read(jsProt517) @@ -886,7 +915,7 @@ func main() { value0 := argvalue0 argvalue1 := flag.Arg(2) value1 := argvalue1 - fmt.Print(client.RollbackJobUpdate(value0, value1)) + fmt.Print(client.RollbackJobUpdate(context.Background(), value0, value1)) fmt.Print("\n") break case "pulseJobUpdate": @@ -902,7 +931,7 @@ func main() { Usage() return } - factory523 := thrift.NewTSimpleJSONProtocolFactory() + factory523 := thrift.NewTJSONProtocolFactory() jsProt524 := factory523.GetProtocol(mbTrans521) argvalue0 := aurora.NewJobUpdateKey() err525 := argvalue0.Read(jsProt524) @@ -911,7 +940,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.PulseJobUpdate(value0)) + fmt.Print(client.PulseJobUpdate(context.Background(), value0)) fmt.Print("\n") break case "getRoleSummary": @@ -919,7 +948,7 @@ func main() { fmt.Fprintln(os.Stderr, "GetRoleSummary requires 0 args") flag.Usage() } - fmt.Print(client.GetRoleSummary()) + fmt.Print(client.GetRoleSummary(context.Background())) fmt.Print("\n") break case "getJobSummary": @@ -929,7 +958,7 @@ func main() { } argvalue0 := flag.Arg(1) value0 := argvalue0 - fmt.Print(client.GetJobSummary(value0)) + fmt.Print(client.GetJobSummary(context.Background(), value0)) fmt.Print("\n") break case "getTasksStatus": @@ -945,7 +974,7 @@ func main() { Usage() return } - factory530 := thrift.NewTSimpleJSONProtocolFactory() + factory530 := thrift.NewTJSONProtocolFactory() jsProt531 := factory530.GetProtocol(mbTrans528) argvalue0 := aurora.NewTaskQuery() err532 := argvalue0.Read(jsProt531) @@ -954,7 +983,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetTasksStatus(value0)) + fmt.Print(client.GetTasksStatus(context.Background(), value0)) fmt.Print("\n") break case "getTasksWithoutConfigs": @@ -970,7 +999,7 @@ func main() { Usage() return } - factory536 := thrift.NewTSimpleJSONProtocolFactory() + factory536 := thrift.NewTJSONProtocolFactory() jsProt537 := factory536.GetProtocol(mbTrans534) argvalue0 := aurora.NewTaskQuery() err538 := argvalue0.Read(jsProt537) @@ -979,7 +1008,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetTasksWithoutConfigs(value0)) + fmt.Print(client.GetTasksWithoutConfigs(context.Background(), value0)) fmt.Print("\n") break case "getPendingReason": @@ -995,7 +1024,7 @@ func main() { Usage() return } - factory542 := thrift.NewTSimpleJSONProtocolFactory() + factory542 := thrift.NewTJSONProtocolFactory() jsProt543 := factory542.GetProtocol(mbTrans540) argvalue0 := aurora.NewTaskQuery() err544 := argvalue0.Read(jsProt543) @@ -1004,7 +1033,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetPendingReason(value0)) + fmt.Print(client.GetPendingReason(context.Background(), value0)) fmt.Print("\n") break case "getConfigSummary": @@ -1020,7 +1049,7 @@ func main() { Usage() return } - factory548 := thrift.NewTSimpleJSONProtocolFactory() + factory548 := thrift.NewTJSONProtocolFactory() jsProt549 := factory548.GetProtocol(mbTrans546) argvalue0 := aurora.NewJobKey() err550 := argvalue0.Read(jsProt549) @@ -1029,7 +1058,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetConfigSummary(value0)) + fmt.Print(client.GetConfigSummary(context.Background(), value0)) fmt.Print("\n") break case "getJobs": @@ -1039,7 +1068,7 @@ func main() { } argvalue0 := flag.Arg(1) value0 := argvalue0 - fmt.Print(client.GetJobs(value0)) + fmt.Print(client.GetJobs(context.Background(), value0)) fmt.Print("\n") break case "getQuota": @@ -1049,7 +1078,7 @@ func main() { } argvalue0 := flag.Arg(1) value0 := argvalue0 - fmt.Print(client.GetQuota(value0)) + fmt.Print(client.GetQuota(context.Background(), value0)) fmt.Print("\n") break case "populateJobConfig": @@ -1065,7 +1094,7 @@ func main() { Usage() return } - factory556 := thrift.NewTSimpleJSONProtocolFactory() + factory556 := thrift.NewTJSONProtocolFactory() jsProt557 := factory556.GetProtocol(mbTrans554) argvalue0 := aurora.NewJobConfiguration() err558 := argvalue0.Read(jsProt557) @@ -1074,7 +1103,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.PopulateJobConfig(value0)) + fmt.Print(client.PopulateJobConfig(context.Background(), value0)) fmt.Print("\n") break case "getJobUpdateSummaries": @@ -1090,7 +1119,7 @@ func main() { Usage() return } - factory562 := thrift.NewTSimpleJSONProtocolFactory() + factory562 := thrift.NewTJSONProtocolFactory() jsProt563 := factory562.GetProtocol(mbTrans560) argvalue0 := aurora.NewJobUpdateQuery() err564 := argvalue0.Read(jsProt563) @@ -1099,7 +1128,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetJobUpdateSummaries(value0)) + fmt.Print(client.GetJobUpdateSummaries(context.Background(), value0)) fmt.Print("\n") break case "getJobUpdateDetails": @@ -1115,7 +1144,7 @@ func main() { Usage() return } - factory568 := thrift.NewTSimpleJSONProtocolFactory() + factory568 := thrift.NewTJSONProtocolFactory() jsProt569 := factory568.GetProtocol(mbTrans566) argvalue0 := aurora.NewJobUpdateQuery() err570 := argvalue0.Read(jsProt569) @@ -1124,7 +1153,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetJobUpdateDetails(value0)) + fmt.Print(client.GetJobUpdateDetails(context.Background(), value0)) fmt.Print("\n") break case "getJobUpdateDiff": @@ -1140,7 +1169,7 @@ func main() { Usage() return } - factory574 := thrift.NewTSimpleJSONProtocolFactory() + factory574 := thrift.NewTJSONProtocolFactory() jsProt575 := factory574.GetProtocol(mbTrans572) argvalue0 := aurora.NewJobUpdateRequest() err576 := argvalue0.Read(jsProt575) @@ -1149,7 +1178,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetJobUpdateDiff(value0)) + fmt.Print(client.GetJobUpdateDiff(context.Background(), value0)) fmt.Print("\n") break case "getTierConfigs": @@ -1157,7 +1186,7 @@ func main() { fmt.Fprintln(os.Stderr, "GetTierConfigs requires 0 args") flag.Usage() } - fmt.Print(client.GetTierConfigs()) + fmt.Print(client.GetTierConfigs(context.Background())) fmt.Print("\n") break case "": diff --git a/gen-go/apache/aurora/aurora_scheduler_manager-remote/aurora_scheduler_manager-remote.go b/gen-go/apache/aurora/aurora_scheduler_manager-remote/aurora_scheduler_manager-remote.go index 3ca67ea..20cdd79 100755 --- a/gen-go/apache/aurora/aurora_scheduler_manager-remote/aurora_scheduler_manager-remote.go +++ b/gen-go/apache/aurora/aurora_scheduler_manager-remote/aurora_scheduler_manager-remote.go @@ -1,19 +1,21 @@ -// Autogenerated by Thrift Compiler (0.9.3) +// Autogenerated by Thrift Compiler (0.12.0) // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING package main import ( "apache/aurora" + "context" "flag" "fmt" - "git.apache.org/thrift.git/lib/go/thrift" "math" "net" "net/url" "os" "strconv" "strings" + + "git.apache.org/thrift.git/lib/go/thrift" ) func Usage() { @@ -51,6 +53,22 @@ func Usage() { os.Exit(0) } +type httpHeaders map[string]string + +func (h httpHeaders) String() string { + var m map[string]string = h + return fmt.Sprintf("%s", m) +} + +func (h httpHeaders) Set(value string) error { + parts := strings.Split(value, ": ") + if len(parts) != 2 { + return fmt.Errorf("header should be of format 'Key: Value'") + } + h[parts[0]] = parts[1] + return nil +} + func main() { flag.Usage = Usage var host string @@ -59,7 +77,8 @@ func main() { var urlString string var framed bool var useHttp bool - var parsedUrl url.URL + headers := make(httpHeaders) + var parsedUrl *url.URL var trans thrift.TTransport _ = strconv.Atoi _ = math.Abs @@ -70,16 +89,18 @@ func main() { flag.StringVar(&urlString, "u", "", "Specify the url") flag.BoolVar(&framed, "framed", false, "Use framed transport") flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Var(headers, "H", "Headers to set on the http(s) request (e.g. -H \"Key: Value\")") flag.Parse() if len(urlString) > 0 { - parsedUrl, err := url.Parse(urlString) + var err error + parsedUrl, err = url.Parse(urlString) if err != nil { fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) flag.Usage() } host = parsedUrl.Host - useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" || parsedUrl.Scheme == "https" } else if useHttp { _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) if err != nil { @@ -92,6 +113,12 @@ func main() { var err error if useHttp { trans, err = thrift.NewTHttpClient(parsedUrl.String()) + if len(headers) > 0 { + httptrans := trans.(*thrift.THttpClient) + for key, value := range headers { + httptrans.SetHeader(key, value) + } + } } else { portStr := fmt.Sprint(port) if strings.Contains(host, ":") { @@ -134,7 +161,9 @@ func main() { Usage() os.Exit(1) } - client := aurora.NewAuroraSchedulerManagerClientFactory(trans, protocolFactory) + iprot := protocolFactory.GetProtocol(trans) + oprot := protocolFactory.GetProtocol(trans) + client := aurora.NewAuroraSchedulerManagerClient(thrift.NewTStandardClient(iprot, oprot)) if err := trans.Open(); err != nil { fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) os.Exit(1) @@ -154,7 +183,7 @@ func main() { Usage() return } - factory165 := thrift.NewTSimpleJSONProtocolFactory() + factory165 := thrift.NewTJSONProtocolFactory() jsProt166 := factory165.GetProtocol(mbTrans163) argvalue0 := aurora.NewJobConfiguration() err167 := argvalue0.Read(jsProt166) @@ -163,7 +192,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.CreateJob(value0)) + fmt.Print(client.CreateJob(context.Background(), value0)) fmt.Print("\n") break case "scheduleCronJob": @@ -179,7 +208,7 @@ func main() { Usage() return } - factory171 := thrift.NewTSimpleJSONProtocolFactory() + factory171 := thrift.NewTJSONProtocolFactory() jsProt172 := factory171.GetProtocol(mbTrans169) argvalue0 := aurora.NewJobConfiguration() err173 := argvalue0.Read(jsProt172) @@ -188,7 +217,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.ScheduleCronJob(value0)) + fmt.Print(client.ScheduleCronJob(context.Background(), value0)) fmt.Print("\n") break case "descheduleCronJob": @@ -204,7 +233,7 @@ func main() { Usage() return } - factory177 := thrift.NewTSimpleJSONProtocolFactory() + factory177 := thrift.NewTJSONProtocolFactory() jsProt178 := factory177.GetProtocol(mbTrans175) argvalue0 := aurora.NewJobKey() err179 := argvalue0.Read(jsProt178) @@ -213,7 +242,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.DescheduleCronJob(value0)) + fmt.Print(client.DescheduleCronJob(context.Background(), value0)) fmt.Print("\n") break case "startCronJob": @@ -229,7 +258,7 @@ func main() { Usage() return } - factory183 := thrift.NewTSimpleJSONProtocolFactory() + factory183 := thrift.NewTJSONProtocolFactory() jsProt184 := factory183.GetProtocol(mbTrans181) argvalue0 := aurora.NewJobKey() err185 := argvalue0.Read(jsProt184) @@ -238,7 +267,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.StartCronJob(value0)) + fmt.Print(client.StartCronJob(context.Background(), value0)) fmt.Print("\n") break case "restartShards": @@ -254,7 +283,7 @@ func main() { Usage() return } - factory189 := thrift.NewTSimpleJSONProtocolFactory() + factory189 := thrift.NewTJSONProtocolFactory() jsProt190 := factory189.GetProtocol(mbTrans187) argvalue0 := aurora.NewJobKey() err191 := argvalue0.Read(jsProt190) @@ -271,7 +300,7 @@ func main() { Usage() return } - factory195 := thrift.NewTSimpleJSONProtocolFactory() + factory195 := thrift.NewTJSONProtocolFactory() jsProt196 := factory195.GetProtocol(mbTrans193) containerStruct1 := aurora.NewAuroraSchedulerManagerRestartShardsArgs() err197 := containerStruct1.ReadField2(jsProt196) @@ -281,7 +310,7 @@ func main() { } argvalue1 := containerStruct1.ShardIds value1 := argvalue1 - fmt.Print(client.RestartShards(value0, value1)) + fmt.Print(client.RestartShards(context.Background(), value0, value1)) fmt.Print("\n") break case "killTasks": @@ -297,7 +326,7 @@ func main() { Usage() return } - factory201 := thrift.NewTSimpleJSONProtocolFactory() + factory201 := thrift.NewTJSONProtocolFactory() jsProt202 := factory201.GetProtocol(mbTrans199) argvalue0 := aurora.NewJobKey() err203 := argvalue0.Read(jsProt202) @@ -314,7 +343,7 @@ func main() { Usage() return } - factory207 := thrift.NewTSimpleJSONProtocolFactory() + factory207 := thrift.NewTJSONProtocolFactory() jsProt208 := factory207.GetProtocol(mbTrans205) containerStruct1 := aurora.NewAuroraSchedulerManagerKillTasksArgs() err209 := containerStruct1.ReadField2(jsProt208) @@ -326,7 +355,7 @@ func main() { value1 := argvalue1 argvalue2 := flag.Arg(3) value2 := argvalue2 - fmt.Print(client.KillTasks(value0, value1, value2)) + fmt.Print(client.KillTasks(context.Background(), value0, value1, value2)) fmt.Print("\n") break case "addInstances": @@ -342,7 +371,7 @@ func main() { Usage() return } - factory214 := thrift.NewTSimpleJSONProtocolFactory() + factory214 := thrift.NewTJSONProtocolFactory() jsProt215 := factory214.GetProtocol(mbTrans212) argvalue0 := aurora.NewInstanceKey() err216 := argvalue0.Read(jsProt215) @@ -358,7 +387,7 @@ func main() { } argvalue1 := int32(tmp1) value1 := argvalue1 - fmt.Print(client.AddInstances(value0, value1)) + fmt.Print(client.AddInstances(context.Background(), value0, value1)) fmt.Print("\n") break case "replaceCronTemplate": @@ -374,7 +403,7 @@ func main() { Usage() return } - factory221 := thrift.NewTSimpleJSONProtocolFactory() + factory221 := thrift.NewTJSONProtocolFactory() jsProt222 := factory221.GetProtocol(mbTrans219) argvalue0 := aurora.NewJobConfiguration() err223 := argvalue0.Read(jsProt222) @@ -383,7 +412,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.ReplaceCronTemplate(value0)) + fmt.Print(client.ReplaceCronTemplate(context.Background(), value0)) fmt.Print("\n") break case "startJobUpdate": @@ -399,7 +428,7 @@ func main() { Usage() return } - factory227 := thrift.NewTSimpleJSONProtocolFactory() + factory227 := thrift.NewTJSONProtocolFactory() jsProt228 := factory227.GetProtocol(mbTrans225) argvalue0 := aurora.NewJobUpdateRequest() err229 := argvalue0.Read(jsProt228) @@ -410,7 +439,7 @@ func main() { value0 := argvalue0 argvalue1 := flag.Arg(2) value1 := argvalue1 - fmt.Print(client.StartJobUpdate(value0, value1)) + fmt.Print(client.StartJobUpdate(context.Background(), value0, value1)) fmt.Print("\n") break case "pauseJobUpdate": @@ -426,7 +455,7 @@ func main() { Usage() return } - factory234 := thrift.NewTSimpleJSONProtocolFactory() + factory234 := thrift.NewTJSONProtocolFactory() jsProt235 := factory234.GetProtocol(mbTrans232) argvalue0 := aurora.NewJobUpdateKey() err236 := argvalue0.Read(jsProt235) @@ -437,7 +466,7 @@ func main() { value0 := argvalue0 argvalue1 := flag.Arg(2) value1 := argvalue1 - fmt.Print(client.PauseJobUpdate(value0, value1)) + fmt.Print(client.PauseJobUpdate(context.Background(), value0, value1)) fmt.Print("\n") break case "resumeJobUpdate": @@ -453,7 +482,7 @@ func main() { Usage() return } - factory241 := thrift.NewTSimpleJSONProtocolFactory() + factory241 := thrift.NewTJSONProtocolFactory() jsProt242 := factory241.GetProtocol(mbTrans239) argvalue0 := aurora.NewJobUpdateKey() err243 := argvalue0.Read(jsProt242) @@ -464,7 +493,7 @@ func main() { value0 := argvalue0 argvalue1 := flag.Arg(2) value1 := argvalue1 - fmt.Print(client.ResumeJobUpdate(value0, value1)) + fmt.Print(client.ResumeJobUpdate(context.Background(), value0, value1)) fmt.Print("\n") break case "abortJobUpdate": @@ -480,7 +509,7 @@ func main() { Usage() return } - factory248 := thrift.NewTSimpleJSONProtocolFactory() + factory248 := thrift.NewTJSONProtocolFactory() jsProt249 := factory248.GetProtocol(mbTrans246) argvalue0 := aurora.NewJobUpdateKey() err250 := argvalue0.Read(jsProt249) @@ -491,7 +520,7 @@ func main() { value0 := argvalue0 argvalue1 := flag.Arg(2) value1 := argvalue1 - fmt.Print(client.AbortJobUpdate(value0, value1)) + fmt.Print(client.AbortJobUpdate(context.Background(), value0, value1)) fmt.Print("\n") break case "rollbackJobUpdate": @@ -507,7 +536,7 @@ func main() { Usage() return } - factory255 := thrift.NewTSimpleJSONProtocolFactory() + factory255 := thrift.NewTJSONProtocolFactory() jsProt256 := factory255.GetProtocol(mbTrans253) argvalue0 := aurora.NewJobUpdateKey() err257 := argvalue0.Read(jsProt256) @@ -518,7 +547,7 @@ func main() { value0 := argvalue0 argvalue1 := flag.Arg(2) value1 := argvalue1 - fmt.Print(client.RollbackJobUpdate(value0, value1)) + fmt.Print(client.RollbackJobUpdate(context.Background(), value0, value1)) fmt.Print("\n") break case "pulseJobUpdate": @@ -534,7 +563,7 @@ func main() { Usage() return } - factory262 := thrift.NewTSimpleJSONProtocolFactory() + factory262 := thrift.NewTJSONProtocolFactory() jsProt263 := factory262.GetProtocol(mbTrans260) argvalue0 := aurora.NewJobUpdateKey() err264 := argvalue0.Read(jsProt263) @@ -543,7 +572,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.PulseJobUpdate(value0)) + fmt.Print(client.PulseJobUpdate(context.Background(), value0)) fmt.Print("\n") break case "getRoleSummary": @@ -551,7 +580,7 @@ func main() { fmt.Fprintln(os.Stderr, "GetRoleSummary requires 0 args") flag.Usage() } - fmt.Print(client.GetRoleSummary()) + fmt.Print(client.GetRoleSummary(context.Background())) fmt.Print("\n") break case "getJobSummary": @@ -561,7 +590,7 @@ func main() { } argvalue0 := flag.Arg(1) value0 := argvalue0 - fmt.Print(client.GetJobSummary(value0)) + fmt.Print(client.GetJobSummary(context.Background(), value0)) fmt.Print("\n") break case "getTasksStatus": @@ -577,7 +606,7 @@ func main() { Usage() return } - factory269 := thrift.NewTSimpleJSONProtocolFactory() + factory269 := thrift.NewTJSONProtocolFactory() jsProt270 := factory269.GetProtocol(mbTrans267) argvalue0 := aurora.NewTaskQuery() err271 := argvalue0.Read(jsProt270) @@ -586,7 +615,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetTasksStatus(value0)) + fmt.Print(client.GetTasksStatus(context.Background(), value0)) fmt.Print("\n") break case "getTasksWithoutConfigs": @@ -602,7 +631,7 @@ func main() { Usage() return } - factory275 := thrift.NewTSimpleJSONProtocolFactory() + factory275 := thrift.NewTJSONProtocolFactory() jsProt276 := factory275.GetProtocol(mbTrans273) argvalue0 := aurora.NewTaskQuery() err277 := argvalue0.Read(jsProt276) @@ -611,7 +640,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetTasksWithoutConfigs(value0)) + fmt.Print(client.GetTasksWithoutConfigs(context.Background(), value0)) fmt.Print("\n") break case "getPendingReason": @@ -627,7 +656,7 @@ func main() { Usage() return } - factory281 := thrift.NewTSimpleJSONProtocolFactory() + factory281 := thrift.NewTJSONProtocolFactory() jsProt282 := factory281.GetProtocol(mbTrans279) argvalue0 := aurora.NewTaskQuery() err283 := argvalue0.Read(jsProt282) @@ -636,7 +665,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetPendingReason(value0)) + fmt.Print(client.GetPendingReason(context.Background(), value0)) fmt.Print("\n") break case "getConfigSummary": @@ -652,7 +681,7 @@ func main() { Usage() return } - factory287 := thrift.NewTSimpleJSONProtocolFactory() + factory287 := thrift.NewTJSONProtocolFactory() jsProt288 := factory287.GetProtocol(mbTrans285) argvalue0 := aurora.NewJobKey() err289 := argvalue0.Read(jsProt288) @@ -661,7 +690,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetConfigSummary(value0)) + fmt.Print(client.GetConfigSummary(context.Background(), value0)) fmt.Print("\n") break case "getJobs": @@ -671,7 +700,7 @@ func main() { } argvalue0 := flag.Arg(1) value0 := argvalue0 - fmt.Print(client.GetJobs(value0)) + fmt.Print(client.GetJobs(context.Background(), value0)) fmt.Print("\n") break case "getQuota": @@ -681,7 +710,7 @@ func main() { } argvalue0 := flag.Arg(1) value0 := argvalue0 - fmt.Print(client.GetQuota(value0)) + fmt.Print(client.GetQuota(context.Background(), value0)) fmt.Print("\n") break case "populateJobConfig": @@ -697,7 +726,7 @@ func main() { Usage() return } - factory295 := thrift.NewTSimpleJSONProtocolFactory() + factory295 := thrift.NewTJSONProtocolFactory() jsProt296 := factory295.GetProtocol(mbTrans293) argvalue0 := aurora.NewJobConfiguration() err297 := argvalue0.Read(jsProt296) @@ -706,7 +735,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.PopulateJobConfig(value0)) + fmt.Print(client.PopulateJobConfig(context.Background(), value0)) fmt.Print("\n") break case "getJobUpdateSummaries": @@ -722,7 +751,7 @@ func main() { Usage() return } - factory301 := thrift.NewTSimpleJSONProtocolFactory() + factory301 := thrift.NewTJSONProtocolFactory() jsProt302 := factory301.GetProtocol(mbTrans299) argvalue0 := aurora.NewJobUpdateQuery() err303 := argvalue0.Read(jsProt302) @@ -731,7 +760,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetJobUpdateSummaries(value0)) + fmt.Print(client.GetJobUpdateSummaries(context.Background(), value0)) fmt.Print("\n") break case "getJobUpdateDetails": @@ -747,7 +776,7 @@ func main() { Usage() return } - factory307 := thrift.NewTSimpleJSONProtocolFactory() + factory307 := thrift.NewTJSONProtocolFactory() jsProt308 := factory307.GetProtocol(mbTrans305) argvalue0 := aurora.NewJobUpdateQuery() err309 := argvalue0.Read(jsProt308) @@ -756,7 +785,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetJobUpdateDetails(value0)) + fmt.Print(client.GetJobUpdateDetails(context.Background(), value0)) fmt.Print("\n") break case "getJobUpdateDiff": @@ -772,7 +801,7 @@ func main() { Usage() return } - factory313 := thrift.NewTSimpleJSONProtocolFactory() + factory313 := thrift.NewTJSONProtocolFactory() jsProt314 := factory313.GetProtocol(mbTrans311) argvalue0 := aurora.NewJobUpdateRequest() err315 := argvalue0.Read(jsProt314) @@ -781,7 +810,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetJobUpdateDiff(value0)) + fmt.Print(client.GetJobUpdateDiff(context.Background(), value0)) fmt.Print("\n") break case "getTierConfigs": @@ -789,7 +818,7 @@ func main() { fmt.Fprintln(os.Stderr, "GetTierConfigs requires 0 args") flag.Usage() } - fmt.Print(client.GetTierConfigs()) + fmt.Print(client.GetTierConfigs(context.Background())) fmt.Print("\n") break case "": diff --git a/gen-go/apache/aurora/auroraadmin.go b/gen-go/apache/aurora/auroraadmin.go deleted file mode 100644 index b00e9cf..0000000 --- a/gen-go/apache/aurora/auroraadmin.go +++ /dev/null @@ -1,5870 +0,0 @@ -// 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 - -type AuroraAdmin interface { - AuroraSchedulerManager - - // Assign quota to a user. This will overwrite any pre-existing quota for the user. - // - // Parameters: - // - OwnerRole - // - Quota - SetQuota(ownerRole string, quota *ResourceAggregate) (r *Response, err error) - // Forces a task into a specific state. This does not guarantee the task will enter the given - // state, as the task must still transition within the bounds of the state machine. However, - // it attempts to enter that state via the state machine. - // - // Parameters: - // - TaskId - // - Status - ForceTaskState(taskId string, status ScheduleStatus) (r *Response, err error) - // Immediately writes a storage snapshot to disk. - PerformBackup() (r *Response, err error) - // Lists backups that are available for recovery. - ListBackups() (r *Response, err error) - // Loads a backup to an in-memory storage. This must precede all other recovery operations. - // - // Parameters: - // - BackupId - StageRecovery(backupId string) (r *Response, err error) - // Queries for tasks in a staged recovery. - // - // Parameters: - // - Query - QueryRecovery(query *TaskQuery) (r *Response, err error) - // Deletes tasks from a staged recovery. - // - // Parameters: - // - Query - DeleteRecoveryTasks(query *TaskQuery) (r *Response, err error) - // Commits a staged recovery, completely replacing the previous storage state. - CommitRecovery() (r *Response, err error) - // Unloads (aborts) a staged recovery. - UnloadRecovery() (r *Response, err error) - // Put the given hosts into maintenance mode. - // - // Parameters: - // - Hosts - StartMaintenance(hosts *Hosts) (r *Response, err error) - // Ask scheduler to begin moving tasks scheduled on given hosts. - // - // Parameters: - // - Hosts - DrainHosts(hosts *Hosts) (r *Response, err error) - // Retrieve the current maintenance states for a group of hosts. - // - // Parameters: - // - Hosts - MaintenanceStatus(hosts *Hosts) (r *Response, err error) - // Set the given hosts back into serving mode. - // - // Parameters: - // - Hosts - EndMaintenance(hosts *Hosts) (r *Response, err error) - // Ask scheduler to put hosts into DRAINING mode and move scheduled tasks off of the hosts - // such that its SLA requirements are satisfied. Use defaultSlaPolicy if it is not set for a task. - // - // - // Parameters: - // - Hosts - // - DefaultSlaPolicy - // - TimeoutSecs - SlaDrainHosts(hosts *Hosts, defaultSlaPolicy *SlaPolicy, timeoutSecs int64) (r *Response, err error) - // Start a storage snapshot and block until it completes. - Snapshot() (r *Response, err error) - // Tell scheduler to trigger an explicit task reconciliation with the given settings. - // - // Parameters: - // - Settings - TriggerExplicitTaskReconciliation(settings *ExplicitReconciliationSettings) (r *Response, err error) - // Tell scheduler to trigger an implicit task reconciliation. - TriggerImplicitTaskReconciliation() (r *Response, err error) - // Force prune any (terminal) tasks that match the query. If no statuses are supplied with the - // query, it will default to all terminal task states. If statuses are supplied, they must be - // terminal states. - // - // Parameters: - // - Query - PruneTasks(query *TaskQuery) (r *Response, err error) -} - -type AuroraAdminClient struct { - *AuroraSchedulerManagerClient -} - -func NewAuroraAdminClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AuroraAdminClient { - return &AuroraAdminClient{AuroraSchedulerManagerClient: NewAuroraSchedulerManagerClientFactory(t, f)} -} - -func NewAuroraAdminClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AuroraAdminClient { - return &AuroraAdminClient{AuroraSchedulerManagerClient: NewAuroraSchedulerManagerClientProtocol(t, iprot, oprot)} -} - -// Assign quota to a user. This will overwrite any pre-existing quota for the user. -// -// Parameters: -// - OwnerRole -// - Quota -func (p *AuroraAdminClient) SetQuota(ownerRole string, quota *ResourceAggregate) (r *Response, err error) { - if err = p.sendSetQuota(ownerRole, quota); err != nil { - return - } - return p.recvSetQuota() -} - -func (p *AuroraAdminClient) sendSetQuota(ownerRole string, quota *ResourceAggregate) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("setQuota", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminSetQuotaArgs{ - OwnerRole: ownerRole, - Quota: quota, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvSetQuota() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "setQuota" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "setQuota failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "setQuota failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error316 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error317 error - error317, err = error316.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error317 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "setQuota failed: invalid message type") - return - } - result := AuroraAdminSetQuotaResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Forces a task into a specific state. This does not guarantee the task will enter the given -// state, as the task must still transition within the bounds of the state machine. However, -// it attempts to enter that state via the state machine. -// -// Parameters: -// - TaskId -// - Status -func (p *AuroraAdminClient) ForceTaskState(taskId string, status ScheduleStatus) (r *Response, err error) { - if err = p.sendForceTaskState(taskId, status); err != nil { - return - } - return p.recvForceTaskState() -} - -func (p *AuroraAdminClient) sendForceTaskState(taskId string, status ScheduleStatus) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("forceTaskState", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminForceTaskStateArgs{ - TaskId: taskId, - Status: status, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvForceTaskState() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "forceTaskState" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "forceTaskState failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "forceTaskState failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error318 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error319 error - error319, err = error318.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error319 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "forceTaskState failed: invalid message type") - return - } - result := AuroraAdminForceTaskStateResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Immediately writes a storage snapshot to disk. -func (p *AuroraAdminClient) PerformBackup() (r *Response, err error) { - if err = p.sendPerformBackup(); err != nil { - return - } - return p.recvPerformBackup() -} - -func (p *AuroraAdminClient) sendPerformBackup() (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("performBackup", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminPerformBackupArgs{} - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvPerformBackup() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "performBackup" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "performBackup failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "performBackup failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error320 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error321 error - error321, err = error320.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error321 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "performBackup failed: invalid message type") - return - } - result := AuroraAdminPerformBackupResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Lists backups that are available for recovery. -func (p *AuroraAdminClient) ListBackups() (r *Response, err error) { - if err = p.sendListBackups(); err != nil { - return - } - return p.recvListBackups() -} - -func (p *AuroraAdminClient) sendListBackups() (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("listBackups", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminListBackupsArgs{} - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvListBackups() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "listBackups" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "listBackups failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "listBackups failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error322 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error323 error - error323, err = error322.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error323 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "listBackups failed: invalid message type") - return - } - result := AuroraAdminListBackupsResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Loads a backup to an in-memory storage. This must precede all other recovery operations. -// -// Parameters: -// - BackupId -func (p *AuroraAdminClient) StageRecovery(backupId string) (r *Response, err error) { - if err = p.sendStageRecovery(backupId); err != nil { - return - } - return p.recvStageRecovery() -} - -func (p *AuroraAdminClient) sendStageRecovery(backupId string) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("stageRecovery", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminStageRecoveryArgs{ - BackupId: backupId, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvStageRecovery() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "stageRecovery" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "stageRecovery failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "stageRecovery failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error324 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error325 error - error325, err = error324.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error325 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "stageRecovery failed: invalid message type") - return - } - result := AuroraAdminStageRecoveryResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Queries for tasks in a staged recovery. -// -// Parameters: -// - Query -func (p *AuroraAdminClient) QueryRecovery(query *TaskQuery) (r *Response, err error) { - if err = p.sendQueryRecovery(query); err != nil { - return - } - return p.recvQueryRecovery() -} - -func (p *AuroraAdminClient) sendQueryRecovery(query *TaskQuery) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("queryRecovery", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminQueryRecoveryArgs{ - Query: query, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvQueryRecovery() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "queryRecovery" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "queryRecovery failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "queryRecovery failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error326 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error327 error - error327, err = error326.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error327 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "queryRecovery failed: invalid message type") - return - } - result := AuroraAdminQueryRecoveryResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Deletes tasks from a staged recovery. -// -// Parameters: -// - Query -func (p *AuroraAdminClient) DeleteRecoveryTasks(query *TaskQuery) (r *Response, err error) { - if err = p.sendDeleteRecoveryTasks(query); err != nil { - return - } - return p.recvDeleteRecoveryTasks() -} - -func (p *AuroraAdminClient) sendDeleteRecoveryTasks(query *TaskQuery) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("deleteRecoveryTasks", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminDeleteRecoveryTasksArgs{ - Query: query, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvDeleteRecoveryTasks() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "deleteRecoveryTasks" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "deleteRecoveryTasks failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "deleteRecoveryTasks failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error328 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error329 error - error329, err = error328.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error329 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "deleteRecoveryTasks failed: invalid message type") - return - } - result := AuroraAdminDeleteRecoveryTasksResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Commits a staged recovery, completely replacing the previous storage state. -func (p *AuroraAdminClient) CommitRecovery() (r *Response, err error) { - if err = p.sendCommitRecovery(); err != nil { - return - } - return p.recvCommitRecovery() -} - -func (p *AuroraAdminClient) sendCommitRecovery() (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("commitRecovery", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminCommitRecoveryArgs{} - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvCommitRecovery() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "commitRecovery" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "commitRecovery failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "commitRecovery failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error330 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error331 error - error331, err = error330.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error331 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "commitRecovery failed: invalid message type") - return - } - result := AuroraAdminCommitRecoveryResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Unloads (aborts) a staged recovery. -func (p *AuroraAdminClient) UnloadRecovery() (r *Response, err error) { - if err = p.sendUnloadRecovery(); err != nil { - return - } - return p.recvUnloadRecovery() -} - -func (p *AuroraAdminClient) sendUnloadRecovery() (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("unloadRecovery", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminUnloadRecoveryArgs{} - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvUnloadRecovery() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "unloadRecovery" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "unloadRecovery failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "unloadRecovery failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error332 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error333 error - error333, err = error332.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error333 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "unloadRecovery failed: invalid message type") - return - } - result := AuroraAdminUnloadRecoveryResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Put the given hosts into maintenance mode. -// -// Parameters: -// - Hosts -func (p *AuroraAdminClient) StartMaintenance(hosts *Hosts) (r *Response, err error) { - if err = p.sendStartMaintenance(hosts); err != nil { - return - } - return p.recvStartMaintenance() -} - -func (p *AuroraAdminClient) sendStartMaintenance(hosts *Hosts) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("startMaintenance", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminStartMaintenanceArgs{ - Hosts: hosts, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvStartMaintenance() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "startMaintenance" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "startMaintenance failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "startMaintenance failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error334 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error335 error - error335, err = error334.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error335 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "startMaintenance failed: invalid message type") - return - } - result := AuroraAdminStartMaintenanceResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Ask scheduler to begin moving tasks scheduled on given hosts. -// -// Parameters: -// - Hosts -func (p *AuroraAdminClient) DrainHosts(hosts *Hosts) (r *Response, err error) { - if err = p.sendDrainHosts(hosts); err != nil { - return - } - return p.recvDrainHosts() -} - -func (p *AuroraAdminClient) sendDrainHosts(hosts *Hosts) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("drainHosts", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminDrainHostsArgs{ - Hosts: hosts, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvDrainHosts() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "drainHosts" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "drainHosts failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "drainHosts failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error336 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error337 error - error337, err = error336.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error337 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "drainHosts failed: invalid message type") - return - } - result := AuroraAdminDrainHostsResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Retrieve the current maintenance states for a group of hosts. -// -// Parameters: -// - Hosts -func (p *AuroraAdminClient) MaintenanceStatus(hosts *Hosts) (r *Response, err error) { - if err = p.sendMaintenanceStatus(hosts); err != nil { - return - } - return p.recvMaintenanceStatus() -} - -func (p *AuroraAdminClient) sendMaintenanceStatus(hosts *Hosts) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("maintenanceStatus", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminMaintenanceStatusArgs{ - Hosts: hosts, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvMaintenanceStatus() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "maintenanceStatus" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "maintenanceStatus failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "maintenanceStatus failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error338 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error339 error - error339, err = error338.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error339 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "maintenanceStatus failed: invalid message type") - return - } - result := AuroraAdminMaintenanceStatusResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Set the given hosts back into serving mode. -// -// Parameters: -// - Hosts -func (p *AuroraAdminClient) EndMaintenance(hosts *Hosts) (r *Response, err error) { - if err = p.sendEndMaintenance(hosts); err != nil { - return - } - return p.recvEndMaintenance() -} - -func (p *AuroraAdminClient) sendEndMaintenance(hosts *Hosts) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("endMaintenance", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminEndMaintenanceArgs{ - Hosts: hosts, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvEndMaintenance() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "endMaintenance" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "endMaintenance failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "endMaintenance failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error340 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error341 error - error341, err = error340.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error341 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "endMaintenance failed: invalid message type") - return - } - result := AuroraAdminEndMaintenanceResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Ask scheduler to put hosts into DRAINING mode and move scheduled tasks off of the hosts -// such that its SLA requirements are satisfied. Use defaultSlaPolicy if it is not set for a task. -// -// -// Parameters: -// - Hosts -// - DefaultSlaPolicy -// - TimeoutSecs -func (p *AuroraAdminClient) SlaDrainHosts(hosts *Hosts, defaultSlaPolicy *SlaPolicy, timeoutSecs int64) (r *Response, err error) { - if err = p.sendSlaDrainHosts(hosts, defaultSlaPolicy, timeoutSecs); err != nil { - return - } - return p.recvSlaDrainHosts() -} - -func (p *AuroraAdminClient) sendSlaDrainHosts(hosts *Hosts, defaultSlaPolicy *SlaPolicy, timeoutSecs int64) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("slaDrainHosts", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminSlaDrainHostsArgs{ - Hosts: hosts, - DefaultSlaPolicy: defaultSlaPolicy, - TimeoutSecs: timeoutSecs, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvSlaDrainHosts() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "slaDrainHosts" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "slaDrainHosts failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "slaDrainHosts failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error342 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error343 error - error343, err = error342.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error343 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "slaDrainHosts failed: invalid message type") - return - } - result := AuroraAdminSlaDrainHostsResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Start a storage snapshot and block until it completes. -func (p *AuroraAdminClient) Snapshot() (r *Response, err error) { - if err = p.sendSnapshot(); err != nil { - return - } - return p.recvSnapshot() -} - -func (p *AuroraAdminClient) sendSnapshot() (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("snapshot", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminSnapshotArgs{} - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvSnapshot() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "snapshot" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "snapshot failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "snapshot failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error344 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error345 error - error345, err = error344.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error345 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "snapshot failed: invalid message type") - return - } - result := AuroraAdminSnapshotResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Tell scheduler to trigger an explicit task reconciliation with the given settings. -// -// Parameters: -// - Settings -func (p *AuroraAdminClient) TriggerExplicitTaskReconciliation(settings *ExplicitReconciliationSettings) (r *Response, err error) { - if err = p.sendTriggerExplicitTaskReconciliation(settings); err != nil { - return - } - return p.recvTriggerExplicitTaskReconciliation() -} - -func (p *AuroraAdminClient) sendTriggerExplicitTaskReconciliation(settings *ExplicitReconciliationSettings) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("triggerExplicitTaskReconciliation", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminTriggerExplicitTaskReconciliationArgs{ - Settings: settings, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvTriggerExplicitTaskReconciliation() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "triggerExplicitTaskReconciliation" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "triggerExplicitTaskReconciliation failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "triggerExplicitTaskReconciliation failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error346 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error347 error - error347, err = error346.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error347 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "triggerExplicitTaskReconciliation failed: invalid message type") - return - } - result := AuroraAdminTriggerExplicitTaskReconciliationResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Tell scheduler to trigger an implicit task reconciliation. -func (p *AuroraAdminClient) TriggerImplicitTaskReconciliation() (r *Response, err error) { - if err = p.sendTriggerImplicitTaskReconciliation(); err != nil { - return - } - return p.recvTriggerImplicitTaskReconciliation() -} - -func (p *AuroraAdminClient) sendTriggerImplicitTaskReconciliation() (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("triggerImplicitTaskReconciliation", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminTriggerImplicitTaskReconciliationArgs{} - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvTriggerImplicitTaskReconciliation() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "triggerImplicitTaskReconciliation" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "triggerImplicitTaskReconciliation failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "triggerImplicitTaskReconciliation failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error348 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error349 error - error349, err = error348.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error349 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "triggerImplicitTaskReconciliation failed: invalid message type") - return - } - result := AuroraAdminTriggerImplicitTaskReconciliationResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Force prune any (terminal) tasks that match the query. If no statuses are supplied with the -// query, it will default to all terminal task states. If statuses are supplied, they must be -// terminal states. -// -// Parameters: -// - Query -func (p *AuroraAdminClient) PruneTasks(query *TaskQuery) (r *Response, err error) { - if err = p.sendPruneTasks(query); err != nil { - return - } - return p.recvPruneTasks() -} - -func (p *AuroraAdminClient) sendPruneTasks(query *TaskQuery) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("pruneTasks", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraAdminPruneTasksArgs{ - Query: query, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraAdminClient) recvPruneTasks() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "pruneTasks" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "pruneTasks failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "pruneTasks failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error350 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error351 error - error351, err = error350.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error351 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "pruneTasks failed: invalid message type") - return - } - result := AuroraAdminPruneTasksResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -type AuroraAdminProcessor struct { - *AuroraSchedulerManagerProcessor -} - -func NewAuroraAdminProcessor(handler AuroraAdmin) *AuroraAdminProcessor { - self352 := &AuroraAdminProcessor{NewAuroraSchedulerManagerProcessor(handler)} - self352.AddToProcessorMap("setQuota", &auroraAdminProcessorSetQuota{handler: handler}) - self352.AddToProcessorMap("forceTaskState", &auroraAdminProcessorForceTaskState{handler: handler}) - self352.AddToProcessorMap("performBackup", &auroraAdminProcessorPerformBackup{handler: handler}) - self352.AddToProcessorMap("listBackups", &auroraAdminProcessorListBackups{handler: handler}) - self352.AddToProcessorMap("stageRecovery", &auroraAdminProcessorStageRecovery{handler: handler}) - self352.AddToProcessorMap("queryRecovery", &auroraAdminProcessorQueryRecovery{handler: handler}) - self352.AddToProcessorMap("deleteRecoveryTasks", &auroraAdminProcessorDeleteRecoveryTasks{handler: handler}) - self352.AddToProcessorMap("commitRecovery", &auroraAdminProcessorCommitRecovery{handler: handler}) - self352.AddToProcessorMap("unloadRecovery", &auroraAdminProcessorUnloadRecovery{handler: handler}) - self352.AddToProcessorMap("startMaintenance", &auroraAdminProcessorStartMaintenance{handler: handler}) - self352.AddToProcessorMap("drainHosts", &auroraAdminProcessorDrainHosts{handler: handler}) - self352.AddToProcessorMap("maintenanceStatus", &auroraAdminProcessorMaintenanceStatus{handler: handler}) - self352.AddToProcessorMap("endMaintenance", &auroraAdminProcessorEndMaintenance{handler: handler}) - self352.AddToProcessorMap("slaDrainHosts", &auroraAdminProcessorSlaDrainHosts{handler: handler}) - self352.AddToProcessorMap("snapshot", &auroraAdminProcessorSnapshot{handler: handler}) - self352.AddToProcessorMap("triggerExplicitTaskReconciliation", &auroraAdminProcessorTriggerExplicitTaskReconciliation{handler: handler}) - self352.AddToProcessorMap("triggerImplicitTaskReconciliation", &auroraAdminProcessorTriggerImplicitTaskReconciliation{handler: handler}) - self352.AddToProcessorMap("pruneTasks", &auroraAdminProcessorPruneTasks{handler: handler}) - return self352 -} - -type auroraAdminProcessorSetQuota struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorSetQuota) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminSetQuotaArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("setQuota", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminSetQuotaResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.SetQuota(args.OwnerRole, args.Quota); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setQuota: "+err2.Error()) - oprot.WriteMessageBegin("setQuota", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("setQuota", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorForceTaskState struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorForceTaskState) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminForceTaskStateArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("forceTaskState", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminForceTaskStateResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.ForceTaskState(args.TaskId, args.Status); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing forceTaskState: "+err2.Error()) - oprot.WriteMessageBegin("forceTaskState", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("forceTaskState", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorPerformBackup struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorPerformBackup) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminPerformBackupArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("performBackup", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminPerformBackupResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.PerformBackup(); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing performBackup: "+err2.Error()) - oprot.WriteMessageBegin("performBackup", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("performBackup", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorListBackups struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorListBackups) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminListBackupsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("listBackups", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminListBackupsResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.ListBackups(); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listBackups: "+err2.Error()) - oprot.WriteMessageBegin("listBackups", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("listBackups", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorStageRecovery struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorStageRecovery) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminStageRecoveryArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("stageRecovery", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminStageRecoveryResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.StageRecovery(args.BackupId); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing stageRecovery: "+err2.Error()) - oprot.WriteMessageBegin("stageRecovery", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("stageRecovery", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorQueryRecovery struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorQueryRecovery) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminQueryRecoveryArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("queryRecovery", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminQueryRecoveryResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.QueryRecovery(args.Query); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing queryRecovery: "+err2.Error()) - oprot.WriteMessageBegin("queryRecovery", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("queryRecovery", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorDeleteRecoveryTasks struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorDeleteRecoveryTasks) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminDeleteRecoveryTasksArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("deleteRecoveryTasks", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminDeleteRecoveryTasksResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.DeleteRecoveryTasks(args.Query); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteRecoveryTasks: "+err2.Error()) - oprot.WriteMessageBegin("deleteRecoveryTasks", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("deleteRecoveryTasks", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorCommitRecovery struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorCommitRecovery) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminCommitRecoveryArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("commitRecovery", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminCommitRecoveryResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.CommitRecovery(); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing commitRecovery: "+err2.Error()) - oprot.WriteMessageBegin("commitRecovery", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("commitRecovery", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorUnloadRecovery struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorUnloadRecovery) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminUnloadRecoveryArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("unloadRecovery", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminUnloadRecoveryResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.UnloadRecovery(); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing unloadRecovery: "+err2.Error()) - oprot.WriteMessageBegin("unloadRecovery", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("unloadRecovery", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorStartMaintenance struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorStartMaintenance) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminStartMaintenanceArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("startMaintenance", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminStartMaintenanceResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.StartMaintenance(args.Hosts); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing startMaintenance: "+err2.Error()) - oprot.WriteMessageBegin("startMaintenance", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("startMaintenance", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorDrainHosts struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorDrainHosts) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminDrainHostsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("drainHosts", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminDrainHostsResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.DrainHosts(args.Hosts); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing drainHosts: "+err2.Error()) - oprot.WriteMessageBegin("drainHosts", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("drainHosts", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorMaintenanceStatus struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorMaintenanceStatus) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminMaintenanceStatusArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("maintenanceStatus", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminMaintenanceStatusResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.MaintenanceStatus(args.Hosts); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing maintenanceStatus: "+err2.Error()) - oprot.WriteMessageBegin("maintenanceStatus", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("maintenanceStatus", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorEndMaintenance struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorEndMaintenance) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminEndMaintenanceArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("endMaintenance", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminEndMaintenanceResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.EndMaintenance(args.Hosts); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing endMaintenance: "+err2.Error()) - oprot.WriteMessageBegin("endMaintenance", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("endMaintenance", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorSlaDrainHosts struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorSlaDrainHosts) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminSlaDrainHostsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("slaDrainHosts", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminSlaDrainHostsResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.SlaDrainHosts(args.Hosts, args.DefaultSlaPolicy, args.TimeoutSecs); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing slaDrainHosts: "+err2.Error()) - oprot.WriteMessageBegin("slaDrainHosts", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("slaDrainHosts", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorSnapshot struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorSnapshot) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminSnapshotArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("snapshot", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminSnapshotResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.Snapshot(); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing snapshot: "+err2.Error()) - oprot.WriteMessageBegin("snapshot", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("snapshot", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorTriggerExplicitTaskReconciliation struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorTriggerExplicitTaskReconciliation) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminTriggerExplicitTaskReconciliationArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("triggerExplicitTaskReconciliation", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminTriggerExplicitTaskReconciliationResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.TriggerExplicitTaskReconciliation(args.Settings); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing triggerExplicitTaskReconciliation: "+err2.Error()) - oprot.WriteMessageBegin("triggerExplicitTaskReconciliation", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("triggerExplicitTaskReconciliation", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorTriggerImplicitTaskReconciliation struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorTriggerImplicitTaskReconciliation) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminTriggerImplicitTaskReconciliationArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("triggerImplicitTaskReconciliation", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminTriggerImplicitTaskReconciliationResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.TriggerImplicitTaskReconciliation(); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing triggerImplicitTaskReconciliation: "+err2.Error()) - oprot.WriteMessageBegin("triggerImplicitTaskReconciliation", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("triggerImplicitTaskReconciliation", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraAdminProcessorPruneTasks struct { - handler AuroraAdmin -} - -func (p *auroraAdminProcessorPruneTasks) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraAdminPruneTasksArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("pruneTasks", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraAdminPruneTasksResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.PruneTasks(args.Query); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing pruneTasks: "+err2.Error()) - oprot.WriteMessageBegin("pruneTasks", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("pruneTasks", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -// HELPER FUNCTIONS AND STRUCTURES - -// Attributes: -// - OwnerRole -// - Quota -type AuroraAdminSetQuotaArgs struct { - OwnerRole string `thrift:"ownerRole,1" json:"ownerRole"` - Quota *ResourceAggregate `thrift:"quota,2" json:"quota"` -} - -func NewAuroraAdminSetQuotaArgs() *AuroraAdminSetQuotaArgs { - return &AuroraAdminSetQuotaArgs{} -} - -func (p *AuroraAdminSetQuotaArgs) GetOwnerRole() string { - return p.OwnerRole -} - -var AuroraAdminSetQuotaArgs_Quota_DEFAULT *ResourceAggregate - -func (p *AuroraAdminSetQuotaArgs) GetQuota() *ResourceAggregate { - if !p.IsSetQuota() { - return AuroraAdminSetQuotaArgs_Quota_DEFAULT - } - return p.Quota -} -func (p *AuroraAdminSetQuotaArgs) IsSetQuota() bool { - return p.Quota != nil -} - -func (p *AuroraAdminSetQuotaArgs) 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 *AuroraAdminSetQuotaArgs) readField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.OwnerRole = v - } - return nil -} - -func (p *AuroraAdminSetQuotaArgs) readField2(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 *AuroraAdminSetQuotaArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("setQuota_args"); 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 *AuroraAdminSetQuotaArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("ownerRole", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ownerRole: ", p), err) - } - if err := oprot.WriteString(string(p.OwnerRole)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.ownerRole (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ownerRole: ", p), err) - } - return err -} - -func (p *AuroraAdminSetQuotaArgs) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("quota", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2: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 2:quota: ", p), err) - } - return err -} - -func (p *AuroraAdminSetQuotaArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminSetQuotaArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminSetQuotaResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminSetQuotaResult() *AuroraAdminSetQuotaResult { - return &AuroraAdminSetQuotaResult{} -} - -var AuroraAdminSetQuotaResult_Success_DEFAULT *Response - -func (p *AuroraAdminSetQuotaResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminSetQuotaResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminSetQuotaResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminSetQuotaResult) 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 0: - if err := p.readField0(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 *AuroraAdminSetQuotaResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminSetQuotaResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("setQuota_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminSetQuotaResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminSetQuotaResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminSetQuotaResult(%+v)", *p) -} - -// Attributes: -// - TaskId -// - Status -type AuroraAdminForceTaskStateArgs struct { - TaskId string `thrift:"taskId,1" json:"taskId"` - Status ScheduleStatus `thrift:"status,2" json:"status"` -} - -func NewAuroraAdminForceTaskStateArgs() *AuroraAdminForceTaskStateArgs { - return &AuroraAdminForceTaskStateArgs{} -} - -func (p *AuroraAdminForceTaskStateArgs) GetTaskId() string { - return p.TaskId -} - -func (p *AuroraAdminForceTaskStateArgs) GetStatus() ScheduleStatus { - return p.Status -} -func (p *AuroraAdminForceTaskStateArgs) 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 *AuroraAdminForceTaskStateArgs) 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 *AuroraAdminForceTaskStateArgs) 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 *AuroraAdminForceTaskStateArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("forceTaskState_args"); 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 *AuroraAdminForceTaskStateArgs) 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 *AuroraAdminForceTaskStateArgs) 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 *AuroraAdminForceTaskStateArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminForceTaskStateArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminForceTaskStateResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminForceTaskStateResult() *AuroraAdminForceTaskStateResult { - return &AuroraAdminForceTaskStateResult{} -} - -var AuroraAdminForceTaskStateResult_Success_DEFAULT *Response - -func (p *AuroraAdminForceTaskStateResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminForceTaskStateResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminForceTaskStateResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminForceTaskStateResult) 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 0: - if err := p.readField0(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 *AuroraAdminForceTaskStateResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminForceTaskStateResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("forceTaskState_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminForceTaskStateResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminForceTaskStateResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminForceTaskStateResult(%+v)", *p) -} - -type AuroraAdminPerformBackupArgs struct { -} - -func NewAuroraAdminPerformBackupArgs() *AuroraAdminPerformBackupArgs { - return &AuroraAdminPerformBackupArgs{} -} - -func (p *AuroraAdminPerformBackupArgs) 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 - } - 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 *AuroraAdminPerformBackupArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("performBackup_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), 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 *AuroraAdminPerformBackupArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminPerformBackupArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminPerformBackupResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminPerformBackupResult() *AuroraAdminPerformBackupResult { - return &AuroraAdminPerformBackupResult{} -} - -var AuroraAdminPerformBackupResult_Success_DEFAULT *Response - -func (p *AuroraAdminPerformBackupResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminPerformBackupResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminPerformBackupResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminPerformBackupResult) 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 0: - if err := p.readField0(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 *AuroraAdminPerformBackupResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminPerformBackupResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("performBackup_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminPerformBackupResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminPerformBackupResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminPerformBackupResult(%+v)", *p) -} - -type AuroraAdminListBackupsArgs struct { -} - -func NewAuroraAdminListBackupsArgs() *AuroraAdminListBackupsArgs { - return &AuroraAdminListBackupsArgs{} -} - -func (p *AuroraAdminListBackupsArgs) 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 - } - 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 *AuroraAdminListBackupsArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("listBackups_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), 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 *AuroraAdminListBackupsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminListBackupsArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminListBackupsResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminListBackupsResult() *AuroraAdminListBackupsResult { - return &AuroraAdminListBackupsResult{} -} - -var AuroraAdminListBackupsResult_Success_DEFAULT *Response - -func (p *AuroraAdminListBackupsResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminListBackupsResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminListBackupsResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminListBackupsResult) 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 0: - if err := p.readField0(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 *AuroraAdminListBackupsResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminListBackupsResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("listBackups_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminListBackupsResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminListBackupsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminListBackupsResult(%+v)", *p) -} - -// Attributes: -// - BackupId -type AuroraAdminStageRecoveryArgs struct { - BackupId string `thrift:"backupId,1" json:"backupId"` -} - -func NewAuroraAdminStageRecoveryArgs() *AuroraAdminStageRecoveryArgs { - return &AuroraAdminStageRecoveryArgs{} -} - -func (p *AuroraAdminStageRecoveryArgs) GetBackupId() string { - return p.BackupId -} -func (p *AuroraAdminStageRecoveryArgs) 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 *AuroraAdminStageRecoveryArgs) readField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.BackupId = v - } - return nil -} - -func (p *AuroraAdminStageRecoveryArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("stageRecovery_args"); 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 *AuroraAdminStageRecoveryArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("backupId", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backupId: ", p), err) - } - if err := oprot.WriteString(string(p.BackupId)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.backupId (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backupId: ", p), err) - } - return err -} - -func (p *AuroraAdminStageRecoveryArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminStageRecoveryArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminStageRecoveryResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminStageRecoveryResult() *AuroraAdminStageRecoveryResult { - return &AuroraAdminStageRecoveryResult{} -} - -var AuroraAdminStageRecoveryResult_Success_DEFAULT *Response - -func (p *AuroraAdminStageRecoveryResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminStageRecoveryResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminStageRecoveryResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminStageRecoveryResult) 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 0: - if err := p.readField0(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 *AuroraAdminStageRecoveryResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminStageRecoveryResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("stageRecovery_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminStageRecoveryResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminStageRecoveryResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminStageRecoveryResult(%+v)", *p) -} - -// Attributes: -// - Query -type AuroraAdminQueryRecoveryArgs struct { - Query *TaskQuery `thrift:"query,1" json:"query"` -} - -func NewAuroraAdminQueryRecoveryArgs() *AuroraAdminQueryRecoveryArgs { - return &AuroraAdminQueryRecoveryArgs{} -} - -var AuroraAdminQueryRecoveryArgs_Query_DEFAULT *TaskQuery - -func (p *AuroraAdminQueryRecoveryArgs) GetQuery() *TaskQuery { - if !p.IsSetQuery() { - return AuroraAdminQueryRecoveryArgs_Query_DEFAULT - } - return p.Query -} -func (p *AuroraAdminQueryRecoveryArgs) IsSetQuery() bool { - return p.Query != nil -} - -func (p *AuroraAdminQueryRecoveryArgs) 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 *AuroraAdminQueryRecoveryArgs) readField1(iprot thrift.TProtocol) error { - p.Query = &TaskQuery{} - if err := p.Query.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) - } - return nil -} - -func (p *AuroraAdminQueryRecoveryArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("queryRecovery_args"); 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 *AuroraAdminQueryRecoveryArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err) - } - if err := p.Query.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err) - } - return err -} - -func (p *AuroraAdminQueryRecoveryArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminQueryRecoveryArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminQueryRecoveryResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminQueryRecoveryResult() *AuroraAdminQueryRecoveryResult { - return &AuroraAdminQueryRecoveryResult{} -} - -var AuroraAdminQueryRecoveryResult_Success_DEFAULT *Response - -func (p *AuroraAdminQueryRecoveryResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminQueryRecoveryResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminQueryRecoveryResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminQueryRecoveryResult) 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 0: - if err := p.readField0(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 *AuroraAdminQueryRecoveryResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminQueryRecoveryResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("queryRecovery_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminQueryRecoveryResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminQueryRecoveryResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminQueryRecoveryResult(%+v)", *p) -} - -// Attributes: -// - Query -type AuroraAdminDeleteRecoveryTasksArgs struct { - Query *TaskQuery `thrift:"query,1" json:"query"` -} - -func NewAuroraAdminDeleteRecoveryTasksArgs() *AuroraAdminDeleteRecoveryTasksArgs { - return &AuroraAdminDeleteRecoveryTasksArgs{} -} - -var AuroraAdminDeleteRecoveryTasksArgs_Query_DEFAULT *TaskQuery - -func (p *AuroraAdminDeleteRecoveryTasksArgs) GetQuery() *TaskQuery { - if !p.IsSetQuery() { - return AuroraAdminDeleteRecoveryTasksArgs_Query_DEFAULT - } - return p.Query -} -func (p *AuroraAdminDeleteRecoveryTasksArgs) IsSetQuery() bool { - return p.Query != nil -} - -func (p *AuroraAdminDeleteRecoveryTasksArgs) 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 *AuroraAdminDeleteRecoveryTasksArgs) readField1(iprot thrift.TProtocol) error { - p.Query = &TaskQuery{} - if err := p.Query.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) - } - return nil -} - -func (p *AuroraAdminDeleteRecoveryTasksArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("deleteRecoveryTasks_args"); 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 *AuroraAdminDeleteRecoveryTasksArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err) - } - if err := p.Query.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err) - } - return err -} - -func (p *AuroraAdminDeleteRecoveryTasksArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminDeleteRecoveryTasksArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminDeleteRecoveryTasksResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminDeleteRecoveryTasksResult() *AuroraAdminDeleteRecoveryTasksResult { - return &AuroraAdminDeleteRecoveryTasksResult{} -} - -var AuroraAdminDeleteRecoveryTasksResult_Success_DEFAULT *Response - -func (p *AuroraAdminDeleteRecoveryTasksResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminDeleteRecoveryTasksResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminDeleteRecoveryTasksResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminDeleteRecoveryTasksResult) 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 0: - if err := p.readField0(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 *AuroraAdminDeleteRecoveryTasksResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminDeleteRecoveryTasksResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("deleteRecoveryTasks_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminDeleteRecoveryTasksResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminDeleteRecoveryTasksResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminDeleteRecoveryTasksResult(%+v)", *p) -} - -type AuroraAdminCommitRecoveryArgs struct { -} - -func NewAuroraAdminCommitRecoveryArgs() *AuroraAdminCommitRecoveryArgs { - return &AuroraAdminCommitRecoveryArgs{} -} - -func (p *AuroraAdminCommitRecoveryArgs) 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 - } - 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 *AuroraAdminCommitRecoveryArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("commitRecovery_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), 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 *AuroraAdminCommitRecoveryArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminCommitRecoveryArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminCommitRecoveryResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminCommitRecoveryResult() *AuroraAdminCommitRecoveryResult { - return &AuroraAdminCommitRecoveryResult{} -} - -var AuroraAdminCommitRecoveryResult_Success_DEFAULT *Response - -func (p *AuroraAdminCommitRecoveryResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminCommitRecoveryResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminCommitRecoveryResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminCommitRecoveryResult) 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 0: - if err := p.readField0(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 *AuroraAdminCommitRecoveryResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminCommitRecoveryResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("commitRecovery_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminCommitRecoveryResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminCommitRecoveryResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminCommitRecoveryResult(%+v)", *p) -} - -type AuroraAdminUnloadRecoveryArgs struct { -} - -func NewAuroraAdminUnloadRecoveryArgs() *AuroraAdminUnloadRecoveryArgs { - return &AuroraAdminUnloadRecoveryArgs{} -} - -func (p *AuroraAdminUnloadRecoveryArgs) 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 - } - 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 *AuroraAdminUnloadRecoveryArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("unloadRecovery_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), 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 *AuroraAdminUnloadRecoveryArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminUnloadRecoveryArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminUnloadRecoveryResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminUnloadRecoveryResult() *AuroraAdminUnloadRecoveryResult { - return &AuroraAdminUnloadRecoveryResult{} -} - -var AuroraAdminUnloadRecoveryResult_Success_DEFAULT *Response - -func (p *AuroraAdminUnloadRecoveryResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminUnloadRecoveryResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminUnloadRecoveryResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminUnloadRecoveryResult) 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 0: - if err := p.readField0(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 *AuroraAdminUnloadRecoveryResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminUnloadRecoveryResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("unloadRecovery_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminUnloadRecoveryResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminUnloadRecoveryResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminUnloadRecoveryResult(%+v)", *p) -} - -// Attributes: -// - Hosts -type AuroraAdminStartMaintenanceArgs struct { - Hosts *Hosts `thrift:"hosts,1" json:"hosts"` -} - -func NewAuroraAdminStartMaintenanceArgs() *AuroraAdminStartMaintenanceArgs { - return &AuroraAdminStartMaintenanceArgs{} -} - -var AuroraAdminStartMaintenanceArgs_Hosts_DEFAULT *Hosts - -func (p *AuroraAdminStartMaintenanceArgs) GetHosts() *Hosts { - if !p.IsSetHosts() { - return AuroraAdminStartMaintenanceArgs_Hosts_DEFAULT - } - return p.Hosts -} -func (p *AuroraAdminStartMaintenanceArgs) IsSetHosts() bool { - return p.Hosts != nil -} - -func (p *AuroraAdminStartMaintenanceArgs) 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 *AuroraAdminStartMaintenanceArgs) readField1(iprot thrift.TProtocol) error { - p.Hosts = &Hosts{} - if err := p.Hosts.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Hosts), err) - } - return nil -} - -func (p *AuroraAdminStartMaintenanceArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("startMaintenance_args"); 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 *AuroraAdminStartMaintenanceArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("hosts", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) - } - if err := p.Hosts.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Hosts), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) - } - return err -} - -func (p *AuroraAdminStartMaintenanceArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminStartMaintenanceArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminStartMaintenanceResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminStartMaintenanceResult() *AuroraAdminStartMaintenanceResult { - return &AuroraAdminStartMaintenanceResult{} -} - -var AuroraAdminStartMaintenanceResult_Success_DEFAULT *Response - -func (p *AuroraAdminStartMaintenanceResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminStartMaintenanceResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminStartMaintenanceResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminStartMaintenanceResult) 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 0: - if err := p.readField0(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 *AuroraAdminStartMaintenanceResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminStartMaintenanceResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("startMaintenance_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminStartMaintenanceResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminStartMaintenanceResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminStartMaintenanceResult(%+v)", *p) -} - -// Attributes: -// - Hosts -type AuroraAdminDrainHostsArgs struct { - Hosts *Hosts `thrift:"hosts,1" json:"hosts"` -} - -func NewAuroraAdminDrainHostsArgs() *AuroraAdminDrainHostsArgs { - return &AuroraAdminDrainHostsArgs{} -} - -var AuroraAdminDrainHostsArgs_Hosts_DEFAULT *Hosts - -func (p *AuroraAdminDrainHostsArgs) GetHosts() *Hosts { - if !p.IsSetHosts() { - return AuroraAdminDrainHostsArgs_Hosts_DEFAULT - } - return p.Hosts -} -func (p *AuroraAdminDrainHostsArgs) IsSetHosts() bool { - return p.Hosts != nil -} - -func (p *AuroraAdminDrainHostsArgs) 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 *AuroraAdminDrainHostsArgs) readField1(iprot thrift.TProtocol) error { - p.Hosts = &Hosts{} - if err := p.Hosts.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Hosts), err) - } - return nil -} - -func (p *AuroraAdminDrainHostsArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("drainHosts_args"); 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 *AuroraAdminDrainHostsArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("hosts", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) - } - if err := p.Hosts.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Hosts), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) - } - return err -} - -func (p *AuroraAdminDrainHostsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminDrainHostsArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminDrainHostsResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminDrainHostsResult() *AuroraAdminDrainHostsResult { - return &AuroraAdminDrainHostsResult{} -} - -var AuroraAdminDrainHostsResult_Success_DEFAULT *Response - -func (p *AuroraAdminDrainHostsResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminDrainHostsResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminDrainHostsResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminDrainHostsResult) 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 0: - if err := p.readField0(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 *AuroraAdminDrainHostsResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminDrainHostsResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("drainHosts_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminDrainHostsResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminDrainHostsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminDrainHostsResult(%+v)", *p) -} - -// Attributes: -// - Hosts -type AuroraAdminMaintenanceStatusArgs struct { - Hosts *Hosts `thrift:"hosts,1" json:"hosts"` -} - -func NewAuroraAdminMaintenanceStatusArgs() *AuroraAdminMaintenanceStatusArgs { - return &AuroraAdminMaintenanceStatusArgs{} -} - -var AuroraAdminMaintenanceStatusArgs_Hosts_DEFAULT *Hosts - -func (p *AuroraAdminMaintenanceStatusArgs) GetHosts() *Hosts { - if !p.IsSetHosts() { - return AuroraAdminMaintenanceStatusArgs_Hosts_DEFAULT - } - return p.Hosts -} -func (p *AuroraAdminMaintenanceStatusArgs) IsSetHosts() bool { - return p.Hosts != nil -} - -func (p *AuroraAdminMaintenanceStatusArgs) 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 *AuroraAdminMaintenanceStatusArgs) readField1(iprot thrift.TProtocol) error { - p.Hosts = &Hosts{} - if err := p.Hosts.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Hosts), err) - } - return nil -} - -func (p *AuroraAdminMaintenanceStatusArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("maintenanceStatus_args"); 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 *AuroraAdminMaintenanceStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("hosts", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) - } - if err := p.Hosts.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Hosts), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) - } - return err -} - -func (p *AuroraAdminMaintenanceStatusArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminMaintenanceStatusArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminMaintenanceStatusResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminMaintenanceStatusResult() *AuroraAdminMaintenanceStatusResult { - return &AuroraAdminMaintenanceStatusResult{} -} - -var AuroraAdminMaintenanceStatusResult_Success_DEFAULT *Response - -func (p *AuroraAdminMaintenanceStatusResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminMaintenanceStatusResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminMaintenanceStatusResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminMaintenanceStatusResult) 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 0: - if err := p.readField0(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 *AuroraAdminMaintenanceStatusResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminMaintenanceStatusResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("maintenanceStatus_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminMaintenanceStatusResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminMaintenanceStatusResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminMaintenanceStatusResult(%+v)", *p) -} - -// Attributes: -// - Hosts -type AuroraAdminEndMaintenanceArgs struct { - Hosts *Hosts `thrift:"hosts,1" json:"hosts"` -} - -func NewAuroraAdminEndMaintenanceArgs() *AuroraAdminEndMaintenanceArgs { - return &AuroraAdminEndMaintenanceArgs{} -} - -var AuroraAdminEndMaintenanceArgs_Hosts_DEFAULT *Hosts - -func (p *AuroraAdminEndMaintenanceArgs) GetHosts() *Hosts { - if !p.IsSetHosts() { - return AuroraAdminEndMaintenanceArgs_Hosts_DEFAULT - } - return p.Hosts -} -func (p *AuroraAdminEndMaintenanceArgs) IsSetHosts() bool { - return p.Hosts != nil -} - -func (p *AuroraAdminEndMaintenanceArgs) 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 *AuroraAdminEndMaintenanceArgs) readField1(iprot thrift.TProtocol) error { - p.Hosts = &Hosts{} - if err := p.Hosts.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Hosts), err) - } - return nil -} - -func (p *AuroraAdminEndMaintenanceArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("endMaintenance_args"); 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 *AuroraAdminEndMaintenanceArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("hosts", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) - } - if err := p.Hosts.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Hosts), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) - } - return err -} - -func (p *AuroraAdminEndMaintenanceArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminEndMaintenanceArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminEndMaintenanceResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminEndMaintenanceResult() *AuroraAdminEndMaintenanceResult { - return &AuroraAdminEndMaintenanceResult{} -} - -var AuroraAdminEndMaintenanceResult_Success_DEFAULT *Response - -func (p *AuroraAdminEndMaintenanceResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminEndMaintenanceResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminEndMaintenanceResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminEndMaintenanceResult) 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 0: - if err := p.readField0(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 *AuroraAdminEndMaintenanceResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminEndMaintenanceResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("endMaintenance_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminEndMaintenanceResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminEndMaintenanceResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminEndMaintenanceResult(%+v)", *p) -} - -// Attributes: -// - Hosts -// - DefaultSlaPolicy -// - TimeoutSecs -type AuroraAdminSlaDrainHostsArgs struct { - Hosts *Hosts `thrift:"hosts,1" json:"hosts"` - DefaultSlaPolicy *SlaPolicy `thrift:"defaultSlaPolicy,2" json:"defaultSlaPolicy"` - TimeoutSecs int64 `thrift:"timeoutSecs,3" json:"timeoutSecs"` -} - -func NewAuroraAdminSlaDrainHostsArgs() *AuroraAdminSlaDrainHostsArgs { - return &AuroraAdminSlaDrainHostsArgs{} -} - -var AuroraAdminSlaDrainHostsArgs_Hosts_DEFAULT *Hosts - -func (p *AuroraAdminSlaDrainHostsArgs) GetHosts() *Hosts { - if !p.IsSetHosts() { - return AuroraAdminSlaDrainHostsArgs_Hosts_DEFAULT - } - return p.Hosts -} - -var AuroraAdminSlaDrainHostsArgs_DefaultSlaPolicy_DEFAULT *SlaPolicy - -func (p *AuroraAdminSlaDrainHostsArgs) GetDefaultSlaPolicy() *SlaPolicy { - if !p.IsSetDefaultSlaPolicy() { - return AuroraAdminSlaDrainHostsArgs_DefaultSlaPolicy_DEFAULT - } - return p.DefaultSlaPolicy -} - -func (p *AuroraAdminSlaDrainHostsArgs) GetTimeoutSecs() int64 { - return p.TimeoutSecs -} -func (p *AuroraAdminSlaDrainHostsArgs) IsSetHosts() bool { - return p.Hosts != nil -} - -func (p *AuroraAdminSlaDrainHostsArgs) IsSetDefaultSlaPolicy() bool { - return p.DefaultSlaPolicy != nil -} - -func (p *AuroraAdminSlaDrainHostsArgs) 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 *AuroraAdminSlaDrainHostsArgs) readField1(iprot thrift.TProtocol) error { - p.Hosts = &Hosts{} - if err := p.Hosts.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Hosts), err) - } - return nil -} - -func (p *AuroraAdminSlaDrainHostsArgs) readField2(iprot thrift.TProtocol) error { - p.DefaultSlaPolicy = &SlaPolicy{} - if err := p.DefaultSlaPolicy.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DefaultSlaPolicy), err) - } - return nil -} - -func (p *AuroraAdminSlaDrainHostsArgs) readField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.TimeoutSecs = v - } - return nil -} - -func (p *AuroraAdminSlaDrainHostsArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("slaDrainHosts_args"); 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 *AuroraAdminSlaDrainHostsArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("hosts", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) - } - if err := p.Hosts.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Hosts), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) - } - return err -} - -func (p *AuroraAdminSlaDrainHostsArgs) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("defaultSlaPolicy", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:defaultSlaPolicy: ", p), err) - } - if err := p.DefaultSlaPolicy.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DefaultSlaPolicy), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:defaultSlaPolicy: ", p), err) - } - return err -} - -func (p *AuroraAdminSlaDrainHostsArgs) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("timeoutSecs", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:timeoutSecs: ", p), err) - } - if err := oprot.WriteI64(int64(p.TimeoutSecs)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.timeoutSecs (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:timeoutSecs: ", p), err) - } - return err -} - -func (p *AuroraAdminSlaDrainHostsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminSlaDrainHostsArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminSlaDrainHostsResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminSlaDrainHostsResult() *AuroraAdminSlaDrainHostsResult { - return &AuroraAdminSlaDrainHostsResult{} -} - -var AuroraAdminSlaDrainHostsResult_Success_DEFAULT *Response - -func (p *AuroraAdminSlaDrainHostsResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminSlaDrainHostsResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminSlaDrainHostsResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminSlaDrainHostsResult) 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 0: - if err := p.readField0(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 *AuroraAdminSlaDrainHostsResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminSlaDrainHostsResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("slaDrainHosts_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminSlaDrainHostsResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminSlaDrainHostsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminSlaDrainHostsResult(%+v)", *p) -} - -type AuroraAdminSnapshotArgs struct { -} - -func NewAuroraAdminSnapshotArgs() *AuroraAdminSnapshotArgs { - return &AuroraAdminSnapshotArgs{} -} - -func (p *AuroraAdminSnapshotArgs) 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 - } - 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 *AuroraAdminSnapshotArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("snapshot_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), 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 *AuroraAdminSnapshotArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminSnapshotArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminSnapshotResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminSnapshotResult() *AuroraAdminSnapshotResult { - return &AuroraAdminSnapshotResult{} -} - -var AuroraAdminSnapshotResult_Success_DEFAULT *Response - -func (p *AuroraAdminSnapshotResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminSnapshotResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminSnapshotResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminSnapshotResult) 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 0: - if err := p.readField0(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 *AuroraAdminSnapshotResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminSnapshotResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("snapshot_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminSnapshotResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminSnapshotResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminSnapshotResult(%+v)", *p) -} - -// Attributes: -// - Settings -type AuroraAdminTriggerExplicitTaskReconciliationArgs struct { - Settings *ExplicitReconciliationSettings `thrift:"settings,1" json:"settings"` -} - -func NewAuroraAdminTriggerExplicitTaskReconciliationArgs() *AuroraAdminTriggerExplicitTaskReconciliationArgs { - return &AuroraAdminTriggerExplicitTaskReconciliationArgs{} -} - -var AuroraAdminTriggerExplicitTaskReconciliationArgs_Settings_DEFAULT *ExplicitReconciliationSettings - -func (p *AuroraAdminTriggerExplicitTaskReconciliationArgs) GetSettings() *ExplicitReconciliationSettings { - if !p.IsSetSettings() { - return AuroraAdminTriggerExplicitTaskReconciliationArgs_Settings_DEFAULT - } - return p.Settings -} -func (p *AuroraAdminTriggerExplicitTaskReconciliationArgs) IsSetSettings() bool { - return p.Settings != nil -} - -func (p *AuroraAdminTriggerExplicitTaskReconciliationArgs) 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 *AuroraAdminTriggerExplicitTaskReconciliationArgs) readField1(iprot thrift.TProtocol) error { - p.Settings = &ExplicitReconciliationSettings{} - if err := p.Settings.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Settings), err) - } - return nil -} - -func (p *AuroraAdminTriggerExplicitTaskReconciliationArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("triggerExplicitTaskReconciliation_args"); 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 *AuroraAdminTriggerExplicitTaskReconciliationArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("settings", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1: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 1:settings: ", p), err) - } - return err -} - -func (p *AuroraAdminTriggerExplicitTaskReconciliationArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminTriggerExplicitTaskReconciliationArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminTriggerExplicitTaskReconciliationResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminTriggerExplicitTaskReconciliationResult() *AuroraAdminTriggerExplicitTaskReconciliationResult { - return &AuroraAdminTriggerExplicitTaskReconciliationResult{} -} - -var AuroraAdminTriggerExplicitTaskReconciliationResult_Success_DEFAULT *Response - -func (p *AuroraAdminTriggerExplicitTaskReconciliationResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminTriggerExplicitTaskReconciliationResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminTriggerExplicitTaskReconciliationResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminTriggerExplicitTaskReconciliationResult) 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 0: - if err := p.readField0(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 *AuroraAdminTriggerExplicitTaskReconciliationResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminTriggerExplicitTaskReconciliationResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("triggerExplicitTaskReconciliation_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminTriggerExplicitTaskReconciliationResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminTriggerExplicitTaskReconciliationResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminTriggerExplicitTaskReconciliationResult(%+v)", *p) -} - -type AuroraAdminTriggerImplicitTaskReconciliationArgs struct { -} - -func NewAuroraAdminTriggerImplicitTaskReconciliationArgs() *AuroraAdminTriggerImplicitTaskReconciliationArgs { - return &AuroraAdminTriggerImplicitTaskReconciliationArgs{} -} - -func (p *AuroraAdminTriggerImplicitTaskReconciliationArgs) 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 - } - 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 *AuroraAdminTriggerImplicitTaskReconciliationArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("triggerImplicitTaskReconciliation_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), 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 *AuroraAdminTriggerImplicitTaskReconciliationArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminTriggerImplicitTaskReconciliationArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminTriggerImplicitTaskReconciliationResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminTriggerImplicitTaskReconciliationResult() *AuroraAdminTriggerImplicitTaskReconciliationResult { - return &AuroraAdminTriggerImplicitTaskReconciliationResult{} -} - -var AuroraAdminTriggerImplicitTaskReconciliationResult_Success_DEFAULT *Response - -func (p *AuroraAdminTriggerImplicitTaskReconciliationResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminTriggerImplicitTaskReconciliationResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminTriggerImplicitTaskReconciliationResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminTriggerImplicitTaskReconciliationResult) 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 0: - if err := p.readField0(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 *AuroraAdminTriggerImplicitTaskReconciliationResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminTriggerImplicitTaskReconciliationResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("triggerImplicitTaskReconciliation_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminTriggerImplicitTaskReconciliationResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminTriggerImplicitTaskReconciliationResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminTriggerImplicitTaskReconciliationResult(%+v)", *p) -} - -// Attributes: -// - Query -type AuroraAdminPruneTasksArgs struct { - Query *TaskQuery `thrift:"query,1" json:"query"` -} - -func NewAuroraAdminPruneTasksArgs() *AuroraAdminPruneTasksArgs { - return &AuroraAdminPruneTasksArgs{} -} - -var AuroraAdminPruneTasksArgs_Query_DEFAULT *TaskQuery - -func (p *AuroraAdminPruneTasksArgs) GetQuery() *TaskQuery { - if !p.IsSetQuery() { - return AuroraAdminPruneTasksArgs_Query_DEFAULT - } - return p.Query -} -func (p *AuroraAdminPruneTasksArgs) IsSetQuery() bool { - return p.Query != nil -} - -func (p *AuroraAdminPruneTasksArgs) 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 *AuroraAdminPruneTasksArgs) readField1(iprot thrift.TProtocol) error { - p.Query = &TaskQuery{} - if err := p.Query.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) - } - return nil -} - -func (p *AuroraAdminPruneTasksArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("pruneTasks_args"); 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 *AuroraAdminPruneTasksArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err) - } - if err := p.Query.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err) - } - return err -} - -func (p *AuroraAdminPruneTasksArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminPruneTasksArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraAdminPruneTasksResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraAdminPruneTasksResult() *AuroraAdminPruneTasksResult { - return &AuroraAdminPruneTasksResult{} -} - -var AuroraAdminPruneTasksResult_Success_DEFAULT *Response - -func (p *AuroraAdminPruneTasksResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraAdminPruneTasksResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraAdminPruneTasksResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraAdminPruneTasksResult) 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 0: - if err := p.readField0(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 *AuroraAdminPruneTasksResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraAdminPruneTasksResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("pruneTasks_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraAdminPruneTasksResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraAdminPruneTasksResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraAdminPruneTasksResult(%+v)", *p) -} diff --git a/gen-go/apache/aurora/auroraschedulermanager.go b/gen-go/apache/aurora/auroraschedulermanager.go deleted file mode 100644 index a448b72..0000000 --- a/gen-go/apache/aurora/auroraschedulermanager.go +++ /dev/null @@ -1,5115 +0,0 @@ -// 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 - -type AuroraSchedulerManager interface { - ReadOnlyScheduler - - // Creates a new job. The request will be denied if a job with the provided name already exists - // in the cluster. - // - // Parameters: - // - Description - CreateJob(description *JobConfiguration) (r *Response, err error) - // Enters a job into the cron schedule, without actually starting the job. - // If the job is already present in the schedule, this will update the schedule entry with the new - // configuration. - // - // Parameters: - // - Description - ScheduleCronJob(description *JobConfiguration) (r *Response, err error) - // Removes a job from the cron schedule. The request will be denied if the job was not previously - // scheduled with scheduleCronJob. - // - // Parameters: - // - Job - DescheduleCronJob(job *JobKey) (r *Response, err error) - // Starts a cron job immediately. The request will be denied if the specified job does not - // exist for the role account, or the job is not a cron job. - // - // Parameters: - // - Job - StartCronJob(job *JobKey) (r *Response, err error) - // Restarts a batch of shards. - // - // Parameters: - // - Job - // - ShardIds - RestartShards(job *JobKey, shardIds map[int32]bool) (r *Response, err error) - // Initiates a kill on tasks. - // - // Parameters: - // - Job - // - Instances - // - Message - KillTasks(job *JobKey, instances map[int32]bool, message string) (r *Response, err error) - // Adds new instances with the TaskConfig of the existing instance pointed by the key. - // - // Parameters: - // - Key - // - Count - AddInstances(key *InstanceKey, count int32) (r *Response, err error) - // Replaces the template (configuration) for the existing cron job. - // The cron job template (configuration) must exist for the call to succeed. - // - // Parameters: - // - Config - ReplaceCronTemplate(config *JobConfiguration) (r *Response, err error) - // Starts update of the existing service job. - // - // Parameters: - // - Request: A description of how to change the job. - // - Message: A user-specified message to include with the induced job update state change. - StartJobUpdate(request *JobUpdateRequest, message string) (r *Response, err error) - // Pauses the specified job update. Can be resumed by resumeUpdate call. - // - // Parameters: - // - Key: The update to pause. - // - Message: A user-specified message to include with the induced job update state change. - PauseJobUpdate(key *JobUpdateKey, message string) (r *Response, err error) - // Resumes progress of a previously paused job update. - // - // Parameters: - // - Key: The update to resume. - // - Message: A user-specified message to include with the induced job update state change. - ResumeJobUpdate(key *JobUpdateKey, message string) (r *Response, err error) - // Permanently aborts the job update. Does not remove the update history. - // - // Parameters: - // - Key: The update to abort. - // - Message: A user-specified message to include with the induced job update state change. - AbortJobUpdate(key *JobUpdateKey, message string) (r *Response, err error) - // Rollbacks the specified active job update to the initial state. - // - // Parameters: - // - Key: The update to rollback. - // - Message: A user-specified message to include with the induced job update state change. - RollbackJobUpdate(key *JobUpdateKey, message string) (r *Response, err error) - // Allows progress of the job update in case blockIfNoPulsesAfterMs is specified in - // JobUpdateSettings. Unblocks progress if the update was previously blocked. - // Responds with ResponseCode.INVALID_REQUEST in case an unknown update key is specified. - // - // Parameters: - // - Key - PulseJobUpdate(key *JobUpdateKey) (r *Response, err error) -} - -type AuroraSchedulerManagerClient struct { - *ReadOnlySchedulerClient -} - -func NewAuroraSchedulerManagerClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AuroraSchedulerManagerClient { - return &AuroraSchedulerManagerClient{ReadOnlySchedulerClient: NewReadOnlySchedulerClientFactory(t, f)} -} - -func NewAuroraSchedulerManagerClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AuroraSchedulerManagerClient { - return &AuroraSchedulerManagerClient{ReadOnlySchedulerClient: NewReadOnlySchedulerClientProtocol(t, iprot, oprot)} -} - -// Creates a new job. The request will be denied if a job with the provided name already exists -// in the cluster. -// -// Parameters: -// - Description -func (p *AuroraSchedulerManagerClient) CreateJob(description *JobConfiguration) (r *Response, err error) { - if err = p.sendCreateJob(description); err != nil { - return - } - return p.recvCreateJob() -} - -func (p *AuroraSchedulerManagerClient) sendCreateJob(description *JobConfiguration) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("createJob", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerCreateJobArgs{ - Description: description, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvCreateJob() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "createJob" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "createJob failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "createJob failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error131 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error132 error - error132, err = error131.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error132 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "createJob failed: invalid message type") - return - } - result := AuroraSchedulerManagerCreateJobResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Enters a job into the cron schedule, without actually starting the job. -// If the job is already present in the schedule, this will update the schedule entry with the new -// configuration. -// -// Parameters: -// - Description -func (p *AuroraSchedulerManagerClient) ScheduleCronJob(description *JobConfiguration) (r *Response, err error) { - if err = p.sendScheduleCronJob(description); err != nil { - return - } - return p.recvScheduleCronJob() -} - -func (p *AuroraSchedulerManagerClient) sendScheduleCronJob(description *JobConfiguration) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("scheduleCronJob", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerScheduleCronJobArgs{ - Description: description, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvScheduleCronJob() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "scheduleCronJob" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "scheduleCronJob failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "scheduleCronJob failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error133 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error134 error - error134, err = error133.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error134 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "scheduleCronJob failed: invalid message type") - return - } - result := AuroraSchedulerManagerScheduleCronJobResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Removes a job from the cron schedule. The request will be denied if the job was not previously -// scheduled with scheduleCronJob. -// -// Parameters: -// - Job -func (p *AuroraSchedulerManagerClient) DescheduleCronJob(job *JobKey) (r *Response, err error) { - if err = p.sendDescheduleCronJob(job); err != nil { - return - } - return p.recvDescheduleCronJob() -} - -func (p *AuroraSchedulerManagerClient) sendDescheduleCronJob(job *JobKey) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("descheduleCronJob", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerDescheduleCronJobArgs{ - Job: job, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvDescheduleCronJob() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "descheduleCronJob" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "descheduleCronJob failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "descheduleCronJob failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error135 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error136 error - error136, err = error135.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error136 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "descheduleCronJob failed: invalid message type") - return - } - result := AuroraSchedulerManagerDescheduleCronJobResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Starts a cron job immediately. The request will be denied if the specified job does not -// exist for the role account, or the job is not a cron job. -// -// Parameters: -// - Job -func (p *AuroraSchedulerManagerClient) StartCronJob(job *JobKey) (r *Response, err error) { - if err = p.sendStartCronJob(job); err != nil { - return - } - return p.recvStartCronJob() -} - -func (p *AuroraSchedulerManagerClient) sendStartCronJob(job *JobKey) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("startCronJob", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerStartCronJobArgs{ - Job: job, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvStartCronJob() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "startCronJob" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "startCronJob failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "startCronJob failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error137 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error138 error - error138, err = error137.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error138 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "startCronJob failed: invalid message type") - return - } - result := AuroraSchedulerManagerStartCronJobResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Restarts a batch of shards. -// -// Parameters: -// - Job -// - ShardIds -func (p *AuroraSchedulerManagerClient) RestartShards(job *JobKey, shardIds map[int32]bool) (r *Response, err error) { - if err = p.sendRestartShards(job, shardIds); err != nil { - return - } - return p.recvRestartShards() -} - -func (p *AuroraSchedulerManagerClient) sendRestartShards(job *JobKey, shardIds map[int32]bool) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("restartShards", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerRestartShardsArgs{ - Job: job, - ShardIds: shardIds, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvRestartShards() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "restartShards" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "restartShards failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "restartShards failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error139 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error140 error - error140, err = error139.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error140 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "restartShards failed: invalid message type") - return - } - result := AuroraSchedulerManagerRestartShardsResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Initiates a kill on tasks. -// -// Parameters: -// - Job -// - Instances -// - Message -func (p *AuroraSchedulerManagerClient) KillTasks(job *JobKey, instances map[int32]bool, message string) (r *Response, err error) { - if err = p.sendKillTasks(job, instances, message); err != nil { - return - } - return p.recvKillTasks() -} - -func (p *AuroraSchedulerManagerClient) sendKillTasks(job *JobKey, instances map[int32]bool, message string) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("killTasks", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerKillTasksArgs{ - Job: job, - Instances: instances, - Message: message, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvKillTasks() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "killTasks" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "killTasks failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "killTasks failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error141 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error142 error - error142, err = error141.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error142 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "killTasks failed: invalid message type") - return - } - result := AuroraSchedulerManagerKillTasksResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Adds new instances with the TaskConfig of the existing instance pointed by the key. -// -// Parameters: -// - Key -// - Count -func (p *AuroraSchedulerManagerClient) AddInstances(key *InstanceKey, count int32) (r *Response, err error) { - if err = p.sendAddInstances(key, count); err != nil { - return - } - return p.recvAddInstances() -} - -func (p *AuroraSchedulerManagerClient) sendAddInstances(key *InstanceKey, count int32) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("addInstances", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerAddInstancesArgs{ - Key: key, - Count: count, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvAddInstances() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "addInstances" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "addInstances failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "addInstances failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error143 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error144 error - error144, err = error143.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error144 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "addInstances failed: invalid message type") - return - } - result := AuroraSchedulerManagerAddInstancesResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Replaces the template (configuration) for the existing cron job. -// The cron job template (configuration) must exist for the call to succeed. -// -// Parameters: -// - Config -func (p *AuroraSchedulerManagerClient) ReplaceCronTemplate(config *JobConfiguration) (r *Response, err error) { - if err = p.sendReplaceCronTemplate(config); err != nil { - return - } - return p.recvReplaceCronTemplate() -} - -func (p *AuroraSchedulerManagerClient) sendReplaceCronTemplate(config *JobConfiguration) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("replaceCronTemplate", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerReplaceCronTemplateArgs{ - Config: config, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvReplaceCronTemplate() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "replaceCronTemplate" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "replaceCronTemplate failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "replaceCronTemplate failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error145 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error146 error - error146, err = error145.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error146 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "replaceCronTemplate failed: invalid message type") - return - } - result := AuroraSchedulerManagerReplaceCronTemplateResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Starts update of the existing service job. -// -// Parameters: -// - Request: A description of how to change the job. -// - Message: A user-specified message to include with the induced job update state change. -func (p *AuroraSchedulerManagerClient) StartJobUpdate(request *JobUpdateRequest, message string) (r *Response, err error) { - if err = p.sendStartJobUpdate(request, message); err != nil { - return - } - return p.recvStartJobUpdate() -} - -func (p *AuroraSchedulerManagerClient) sendStartJobUpdate(request *JobUpdateRequest, message string) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("startJobUpdate", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerStartJobUpdateArgs{ - Request: request, - Message: message, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvStartJobUpdate() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "startJobUpdate" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "startJobUpdate failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "startJobUpdate failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error147 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error148 error - error148, err = error147.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error148 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "startJobUpdate failed: invalid message type") - return - } - result := AuroraSchedulerManagerStartJobUpdateResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Pauses the specified job update. Can be resumed by resumeUpdate call. -// -// Parameters: -// - Key: The update to pause. -// - Message: A user-specified message to include with the induced job update state change. -func (p *AuroraSchedulerManagerClient) PauseJobUpdate(key *JobUpdateKey, message string) (r *Response, err error) { - if err = p.sendPauseJobUpdate(key, message); err != nil { - return - } - return p.recvPauseJobUpdate() -} - -func (p *AuroraSchedulerManagerClient) sendPauseJobUpdate(key *JobUpdateKey, message string) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("pauseJobUpdate", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerPauseJobUpdateArgs{ - Key: key, - Message: message, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvPauseJobUpdate() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "pauseJobUpdate" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "pauseJobUpdate failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "pauseJobUpdate failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error149 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error150 error - error150, err = error149.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error150 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "pauseJobUpdate failed: invalid message type") - return - } - result := AuroraSchedulerManagerPauseJobUpdateResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Resumes progress of a previously paused job update. -// -// Parameters: -// - Key: The update to resume. -// - Message: A user-specified message to include with the induced job update state change. -func (p *AuroraSchedulerManagerClient) ResumeJobUpdate(key *JobUpdateKey, message string) (r *Response, err error) { - if err = p.sendResumeJobUpdate(key, message); err != nil { - return - } - return p.recvResumeJobUpdate() -} - -func (p *AuroraSchedulerManagerClient) sendResumeJobUpdate(key *JobUpdateKey, message string) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("resumeJobUpdate", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerResumeJobUpdateArgs{ - Key: key, - Message: message, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvResumeJobUpdate() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "resumeJobUpdate" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "resumeJobUpdate failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "resumeJobUpdate failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error151 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error152 error - error152, err = error151.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error152 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "resumeJobUpdate failed: invalid message type") - return - } - result := AuroraSchedulerManagerResumeJobUpdateResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Permanently aborts the job update. Does not remove the update history. -// -// Parameters: -// - Key: The update to abort. -// - Message: A user-specified message to include with the induced job update state change. -func (p *AuroraSchedulerManagerClient) AbortJobUpdate(key *JobUpdateKey, message string) (r *Response, err error) { - if err = p.sendAbortJobUpdate(key, message); err != nil { - return - } - return p.recvAbortJobUpdate() -} - -func (p *AuroraSchedulerManagerClient) sendAbortJobUpdate(key *JobUpdateKey, message string) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("abortJobUpdate", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerAbortJobUpdateArgs{ - Key: key, - Message: message, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvAbortJobUpdate() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "abortJobUpdate" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "abortJobUpdate failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "abortJobUpdate failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error153 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error154 error - error154, err = error153.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error154 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "abortJobUpdate failed: invalid message type") - return - } - result := AuroraSchedulerManagerAbortJobUpdateResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Rollbacks the specified active job update to the initial state. -// -// Parameters: -// - Key: The update to rollback. -// - Message: A user-specified message to include with the induced job update state change. -func (p *AuroraSchedulerManagerClient) RollbackJobUpdate(key *JobUpdateKey, message string) (r *Response, err error) { - if err = p.sendRollbackJobUpdate(key, message); err != nil { - return - } - return p.recvRollbackJobUpdate() -} - -func (p *AuroraSchedulerManagerClient) sendRollbackJobUpdate(key *JobUpdateKey, message string) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("rollbackJobUpdate", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerRollbackJobUpdateArgs{ - Key: key, - Message: message, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvRollbackJobUpdate() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "rollbackJobUpdate" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "rollbackJobUpdate failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "rollbackJobUpdate failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error155 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error156 error - error156, err = error155.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error156 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "rollbackJobUpdate failed: invalid message type") - return - } - result := AuroraSchedulerManagerRollbackJobUpdateResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Allows progress of the job update in case blockIfNoPulsesAfterMs is specified in -// JobUpdateSettings. Unblocks progress if the update was previously blocked. -// Responds with ResponseCode.INVALID_REQUEST in case an unknown update key is specified. -// -// Parameters: -// - Key -func (p *AuroraSchedulerManagerClient) PulseJobUpdate(key *JobUpdateKey) (r *Response, err error) { - if err = p.sendPulseJobUpdate(key); err != nil { - return - } - return p.recvPulseJobUpdate() -} - -func (p *AuroraSchedulerManagerClient) sendPulseJobUpdate(key *JobUpdateKey) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("pulseJobUpdate", thrift.CALL, p.SeqId); err != nil { - return - } - args := AuroraSchedulerManagerPulseJobUpdateArgs{ - Key: key, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *AuroraSchedulerManagerClient) recvPulseJobUpdate() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "pulseJobUpdate" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "pulseJobUpdate failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "pulseJobUpdate failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error157 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error158 error - error158, err = error157.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error158 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "pulseJobUpdate failed: invalid message type") - return - } - result := AuroraSchedulerManagerPulseJobUpdateResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -type AuroraSchedulerManagerProcessor struct { - *ReadOnlySchedulerProcessor -} - -func NewAuroraSchedulerManagerProcessor(handler AuroraSchedulerManager) *AuroraSchedulerManagerProcessor { - self159 := &AuroraSchedulerManagerProcessor{NewReadOnlySchedulerProcessor(handler)} - self159.AddToProcessorMap("createJob", &auroraSchedulerManagerProcessorCreateJob{handler: handler}) - self159.AddToProcessorMap("scheduleCronJob", &auroraSchedulerManagerProcessorScheduleCronJob{handler: handler}) - self159.AddToProcessorMap("descheduleCronJob", &auroraSchedulerManagerProcessorDescheduleCronJob{handler: handler}) - self159.AddToProcessorMap("startCronJob", &auroraSchedulerManagerProcessorStartCronJob{handler: handler}) - self159.AddToProcessorMap("restartShards", &auroraSchedulerManagerProcessorRestartShards{handler: handler}) - self159.AddToProcessorMap("killTasks", &auroraSchedulerManagerProcessorKillTasks{handler: handler}) - self159.AddToProcessorMap("addInstances", &auroraSchedulerManagerProcessorAddInstances{handler: handler}) - self159.AddToProcessorMap("replaceCronTemplate", &auroraSchedulerManagerProcessorReplaceCronTemplate{handler: handler}) - self159.AddToProcessorMap("startJobUpdate", &auroraSchedulerManagerProcessorStartJobUpdate{handler: handler}) - self159.AddToProcessorMap("pauseJobUpdate", &auroraSchedulerManagerProcessorPauseJobUpdate{handler: handler}) - self159.AddToProcessorMap("resumeJobUpdate", &auroraSchedulerManagerProcessorResumeJobUpdate{handler: handler}) - self159.AddToProcessorMap("abortJobUpdate", &auroraSchedulerManagerProcessorAbortJobUpdate{handler: handler}) - self159.AddToProcessorMap("rollbackJobUpdate", &auroraSchedulerManagerProcessorRollbackJobUpdate{handler: handler}) - self159.AddToProcessorMap("pulseJobUpdate", &auroraSchedulerManagerProcessorPulseJobUpdate{handler: handler}) - return self159 -} - -type auroraSchedulerManagerProcessorCreateJob struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorCreateJob) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerCreateJobArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("createJob", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerCreateJobResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.CreateJob(args.Description); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createJob: "+err2.Error()) - oprot.WriteMessageBegin("createJob", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("createJob", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraSchedulerManagerProcessorScheduleCronJob struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorScheduleCronJob) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerScheduleCronJobArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("scheduleCronJob", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerScheduleCronJobResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.ScheduleCronJob(args.Description); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scheduleCronJob: "+err2.Error()) - oprot.WriteMessageBegin("scheduleCronJob", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("scheduleCronJob", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraSchedulerManagerProcessorDescheduleCronJob struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorDescheduleCronJob) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerDescheduleCronJobArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("descheduleCronJob", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerDescheduleCronJobResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.DescheduleCronJob(args.Job); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing descheduleCronJob: "+err2.Error()) - oprot.WriteMessageBegin("descheduleCronJob", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("descheduleCronJob", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraSchedulerManagerProcessorStartCronJob struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorStartCronJob) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerStartCronJobArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("startCronJob", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerStartCronJobResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.StartCronJob(args.Job); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing startCronJob: "+err2.Error()) - oprot.WriteMessageBegin("startCronJob", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("startCronJob", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraSchedulerManagerProcessorRestartShards struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorRestartShards) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerRestartShardsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("restartShards", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerRestartShardsResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.RestartShards(args.Job, args.ShardIds); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing restartShards: "+err2.Error()) - oprot.WriteMessageBegin("restartShards", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("restartShards", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraSchedulerManagerProcessorKillTasks struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorKillTasks) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerKillTasksArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("killTasks", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerKillTasksResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.KillTasks(args.Job, args.Instances, args.Message); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing killTasks: "+err2.Error()) - oprot.WriteMessageBegin("killTasks", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("killTasks", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraSchedulerManagerProcessorAddInstances struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorAddInstances) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerAddInstancesArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("addInstances", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerAddInstancesResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.AddInstances(args.Key, args.Count); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addInstances: "+err2.Error()) - oprot.WriteMessageBegin("addInstances", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("addInstances", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraSchedulerManagerProcessorReplaceCronTemplate struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorReplaceCronTemplate) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerReplaceCronTemplateArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("replaceCronTemplate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerReplaceCronTemplateResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.ReplaceCronTemplate(args.Config); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing replaceCronTemplate: "+err2.Error()) - oprot.WriteMessageBegin("replaceCronTemplate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("replaceCronTemplate", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraSchedulerManagerProcessorStartJobUpdate struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorStartJobUpdate) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerStartJobUpdateArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("startJobUpdate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerStartJobUpdateResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.StartJobUpdate(args.Request, args.Message); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing startJobUpdate: "+err2.Error()) - oprot.WriteMessageBegin("startJobUpdate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("startJobUpdate", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraSchedulerManagerProcessorPauseJobUpdate struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorPauseJobUpdate) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerPauseJobUpdateArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("pauseJobUpdate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerPauseJobUpdateResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.PauseJobUpdate(args.Key, args.Message); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing pauseJobUpdate: "+err2.Error()) - oprot.WriteMessageBegin("pauseJobUpdate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("pauseJobUpdate", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraSchedulerManagerProcessorResumeJobUpdate struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorResumeJobUpdate) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerResumeJobUpdateArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("resumeJobUpdate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerResumeJobUpdateResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.ResumeJobUpdate(args.Key, args.Message); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing resumeJobUpdate: "+err2.Error()) - oprot.WriteMessageBegin("resumeJobUpdate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("resumeJobUpdate", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraSchedulerManagerProcessorAbortJobUpdate struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorAbortJobUpdate) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerAbortJobUpdateArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("abortJobUpdate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerAbortJobUpdateResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.AbortJobUpdate(args.Key, args.Message); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing abortJobUpdate: "+err2.Error()) - oprot.WriteMessageBegin("abortJobUpdate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("abortJobUpdate", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraSchedulerManagerProcessorRollbackJobUpdate struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorRollbackJobUpdate) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerRollbackJobUpdateArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("rollbackJobUpdate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerRollbackJobUpdateResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.RollbackJobUpdate(args.Key, args.Message); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rollbackJobUpdate: "+err2.Error()) - oprot.WriteMessageBegin("rollbackJobUpdate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("rollbackJobUpdate", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type auroraSchedulerManagerProcessorPulseJobUpdate struct { - handler AuroraSchedulerManager -} - -func (p *auroraSchedulerManagerProcessorPulseJobUpdate) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := AuroraSchedulerManagerPulseJobUpdateArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("pulseJobUpdate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := AuroraSchedulerManagerPulseJobUpdateResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.PulseJobUpdate(args.Key); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing pulseJobUpdate: "+err2.Error()) - oprot.WriteMessageBegin("pulseJobUpdate", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("pulseJobUpdate", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -// HELPER FUNCTIONS AND STRUCTURES - -// Attributes: -// - Description -type AuroraSchedulerManagerCreateJobArgs struct { - Description *JobConfiguration `thrift:"description,1" json:"description"` -} - -func NewAuroraSchedulerManagerCreateJobArgs() *AuroraSchedulerManagerCreateJobArgs { - return &AuroraSchedulerManagerCreateJobArgs{} -} - -var AuroraSchedulerManagerCreateJobArgs_Description_DEFAULT *JobConfiguration - -func (p *AuroraSchedulerManagerCreateJobArgs) GetDescription() *JobConfiguration { - if !p.IsSetDescription() { - return AuroraSchedulerManagerCreateJobArgs_Description_DEFAULT - } - return p.Description -} -func (p *AuroraSchedulerManagerCreateJobArgs) IsSetDescription() bool { - return p.Description != nil -} - -func (p *AuroraSchedulerManagerCreateJobArgs) 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 *AuroraSchedulerManagerCreateJobArgs) readField1(iprot thrift.TProtocol) error { - p.Description = &JobConfiguration{} - if err := p.Description.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Description), err) - } - return nil -} - -func (p *AuroraSchedulerManagerCreateJobArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("createJob_args"); 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 *AuroraSchedulerManagerCreateJobArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("description", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:description: ", p), err) - } - if err := p.Description.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Description), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:description: ", p), err) - } - return err -} - -func (p *AuroraSchedulerManagerCreateJobArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerCreateJobArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerCreateJobResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerCreateJobResult() *AuroraSchedulerManagerCreateJobResult { - return &AuroraSchedulerManagerCreateJobResult{} -} - -var AuroraSchedulerManagerCreateJobResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerCreateJobResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerCreateJobResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerCreateJobResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerCreateJobResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerCreateJobResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerCreateJobResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("createJob_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerCreateJobResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerCreateJobResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerCreateJobResult(%+v)", *p) -} - -// Attributes: -// - Description -type AuroraSchedulerManagerScheduleCronJobArgs struct { - Description *JobConfiguration `thrift:"description,1" json:"description"` -} - -func NewAuroraSchedulerManagerScheduleCronJobArgs() *AuroraSchedulerManagerScheduleCronJobArgs { - return &AuroraSchedulerManagerScheduleCronJobArgs{} -} - -var AuroraSchedulerManagerScheduleCronJobArgs_Description_DEFAULT *JobConfiguration - -func (p *AuroraSchedulerManagerScheduleCronJobArgs) GetDescription() *JobConfiguration { - if !p.IsSetDescription() { - return AuroraSchedulerManagerScheduleCronJobArgs_Description_DEFAULT - } - return p.Description -} -func (p *AuroraSchedulerManagerScheduleCronJobArgs) IsSetDescription() bool { - return p.Description != nil -} - -func (p *AuroraSchedulerManagerScheduleCronJobArgs) 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 *AuroraSchedulerManagerScheduleCronJobArgs) readField1(iprot thrift.TProtocol) error { - p.Description = &JobConfiguration{} - if err := p.Description.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Description), err) - } - return nil -} - -func (p *AuroraSchedulerManagerScheduleCronJobArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("scheduleCronJob_args"); 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 *AuroraSchedulerManagerScheduleCronJobArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("description", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:description: ", p), err) - } - if err := p.Description.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Description), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:description: ", p), err) - } - return err -} - -func (p *AuroraSchedulerManagerScheduleCronJobArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerScheduleCronJobArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerScheduleCronJobResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerScheduleCronJobResult() *AuroraSchedulerManagerScheduleCronJobResult { - return &AuroraSchedulerManagerScheduleCronJobResult{} -} - -var AuroraSchedulerManagerScheduleCronJobResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerScheduleCronJobResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerScheduleCronJobResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerScheduleCronJobResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerScheduleCronJobResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerScheduleCronJobResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerScheduleCronJobResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("scheduleCronJob_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerScheduleCronJobResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerScheduleCronJobResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerScheduleCronJobResult(%+v)", *p) -} - -// Attributes: -// - Job -type AuroraSchedulerManagerDescheduleCronJobArgs struct { - // unused fields # 1 to 3 - Job *JobKey `thrift:"job,4" json:"job"` -} - -func NewAuroraSchedulerManagerDescheduleCronJobArgs() *AuroraSchedulerManagerDescheduleCronJobArgs { - return &AuroraSchedulerManagerDescheduleCronJobArgs{} -} - -var AuroraSchedulerManagerDescheduleCronJobArgs_Job_DEFAULT *JobKey - -func (p *AuroraSchedulerManagerDescheduleCronJobArgs) GetJob() *JobKey { - if !p.IsSetJob() { - return AuroraSchedulerManagerDescheduleCronJobArgs_Job_DEFAULT - } - return p.Job -} -func (p *AuroraSchedulerManagerDescheduleCronJobArgs) IsSetJob() bool { - return p.Job != nil -} - -func (p *AuroraSchedulerManagerDescheduleCronJobArgs) 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 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 *AuroraSchedulerManagerDescheduleCronJobArgs) readField4(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 *AuroraSchedulerManagerDescheduleCronJobArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("descheduleCronJob_args"); 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 := 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 *AuroraSchedulerManagerDescheduleCronJobArgs) writeField4(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("job", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4: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 4:job: ", p), err) - } - return err -} - -func (p *AuroraSchedulerManagerDescheduleCronJobArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerDescheduleCronJobArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerDescheduleCronJobResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerDescheduleCronJobResult() *AuroraSchedulerManagerDescheduleCronJobResult { - return &AuroraSchedulerManagerDescheduleCronJobResult{} -} - -var AuroraSchedulerManagerDescheduleCronJobResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerDescheduleCronJobResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerDescheduleCronJobResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerDescheduleCronJobResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerDescheduleCronJobResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerDescheduleCronJobResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerDescheduleCronJobResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("descheduleCronJob_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerDescheduleCronJobResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerDescheduleCronJobResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerDescheduleCronJobResult(%+v)", *p) -} - -// Attributes: -// - Job -type AuroraSchedulerManagerStartCronJobArgs struct { - // unused fields # 1 to 3 - Job *JobKey `thrift:"job,4" json:"job"` -} - -func NewAuroraSchedulerManagerStartCronJobArgs() *AuroraSchedulerManagerStartCronJobArgs { - return &AuroraSchedulerManagerStartCronJobArgs{} -} - -var AuroraSchedulerManagerStartCronJobArgs_Job_DEFAULT *JobKey - -func (p *AuroraSchedulerManagerStartCronJobArgs) GetJob() *JobKey { - if !p.IsSetJob() { - return AuroraSchedulerManagerStartCronJobArgs_Job_DEFAULT - } - return p.Job -} -func (p *AuroraSchedulerManagerStartCronJobArgs) IsSetJob() bool { - return p.Job != nil -} - -func (p *AuroraSchedulerManagerStartCronJobArgs) 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 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 *AuroraSchedulerManagerStartCronJobArgs) readField4(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 *AuroraSchedulerManagerStartCronJobArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("startCronJob_args"); 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 := 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 *AuroraSchedulerManagerStartCronJobArgs) writeField4(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("job", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4: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 4:job: ", p), err) - } - return err -} - -func (p *AuroraSchedulerManagerStartCronJobArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerStartCronJobArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerStartCronJobResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerStartCronJobResult() *AuroraSchedulerManagerStartCronJobResult { - return &AuroraSchedulerManagerStartCronJobResult{} -} - -var AuroraSchedulerManagerStartCronJobResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerStartCronJobResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerStartCronJobResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerStartCronJobResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerStartCronJobResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerStartCronJobResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerStartCronJobResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("startCronJob_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerStartCronJobResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerStartCronJobResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerStartCronJobResult(%+v)", *p) -} - -// Attributes: -// - Job -// - ShardIds -type AuroraSchedulerManagerRestartShardsArgs struct { - // unused fields # 1 to 2 - ShardIds map[int32]bool `thrift:"shardIds,3" json:"shardIds"` - // unused field # 4 - Job *JobKey `thrift:"job,5" json:"job"` -} - -func NewAuroraSchedulerManagerRestartShardsArgs() *AuroraSchedulerManagerRestartShardsArgs { - return &AuroraSchedulerManagerRestartShardsArgs{} -} - -var AuroraSchedulerManagerRestartShardsArgs_Job_DEFAULT *JobKey - -func (p *AuroraSchedulerManagerRestartShardsArgs) GetJob() *JobKey { - if !p.IsSetJob() { - return AuroraSchedulerManagerRestartShardsArgs_Job_DEFAULT - } - return p.Job -} - -func (p *AuroraSchedulerManagerRestartShardsArgs) GetShardIds() map[int32]bool { - return p.ShardIds -} -func (p *AuroraSchedulerManagerRestartShardsArgs) IsSetJob() bool { - return p.Job != nil -} - -func (p *AuroraSchedulerManagerRestartShardsArgs) 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 - } - 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 *AuroraSchedulerManagerRestartShardsArgs) readField5(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 *AuroraSchedulerManagerRestartShardsArgs) readField3(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.ShardIds = tSet - for i := 0; i < size; i++ { - var _elem160 int32 - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem160 = v - } - p.ShardIds[_elem160] = true - } - if err := iprot.ReadSetEnd(); err != nil { - return thrift.PrependError("error reading set end: ", err) - } - return nil -} - -func (p *AuroraSchedulerManagerRestartShardsArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("restartShards_args"); 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.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 *AuroraSchedulerManagerRestartShardsArgs) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("shardIds", thrift.SET, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:shardIds: ", p), err) - } - if err := oprot.WriteSetBegin(thrift.I32, len(p.ShardIds)); err != nil { - return thrift.PrependError("error writing set begin: ", err) - } - for v, _ := range p.ShardIds { - 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 3:shardIds: ", p), err) - } - return err -} - -func (p *AuroraSchedulerManagerRestartShardsArgs) writeField5(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("job", thrift.STRUCT, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5: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 5:job: ", p), err) - } - return err -} - -func (p *AuroraSchedulerManagerRestartShardsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerRestartShardsArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerRestartShardsResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerRestartShardsResult() *AuroraSchedulerManagerRestartShardsResult { - return &AuroraSchedulerManagerRestartShardsResult{} -} - -var AuroraSchedulerManagerRestartShardsResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerRestartShardsResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerRestartShardsResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerRestartShardsResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerRestartShardsResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerRestartShardsResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerRestartShardsResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("restartShards_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerRestartShardsResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerRestartShardsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerRestartShardsResult(%+v)", *p) -} - -// Attributes: -// - Job -// - Instances -// - Message -type AuroraSchedulerManagerKillTasksArgs struct { - // unused fields # 1 to 3 - Job *JobKey `thrift:"job,4" json:"job"` - Instances map[int32]bool `thrift:"instances,5" json:"instances"` - Message string `thrift:"message,6" json:"message"` -} - -func NewAuroraSchedulerManagerKillTasksArgs() *AuroraSchedulerManagerKillTasksArgs { - return &AuroraSchedulerManagerKillTasksArgs{} -} - -var AuroraSchedulerManagerKillTasksArgs_Job_DEFAULT *JobKey - -func (p *AuroraSchedulerManagerKillTasksArgs) GetJob() *JobKey { - if !p.IsSetJob() { - return AuroraSchedulerManagerKillTasksArgs_Job_DEFAULT - } - return p.Job -} - -func (p *AuroraSchedulerManagerKillTasksArgs) GetInstances() map[int32]bool { - return p.Instances -} - -func (p *AuroraSchedulerManagerKillTasksArgs) GetMessage() string { - return p.Message -} -func (p *AuroraSchedulerManagerKillTasksArgs) IsSetJob() bool { - return p.Job != nil -} - -func (p *AuroraSchedulerManagerKillTasksArgs) 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 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 *AuroraSchedulerManagerKillTasksArgs) readField4(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 *AuroraSchedulerManagerKillTasksArgs) readField5(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.Instances = tSet - for i := 0; i < size; i++ { - var _elem161 int32 - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem161 = v - } - p.Instances[_elem161] = true - } - if err := iprot.ReadSetEnd(); err != nil { - return thrift.PrependError("error reading set end: ", err) - } - return nil -} - -func (p *AuroraSchedulerManagerKillTasksArgs) readField6(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 6: ", err) - } else { - p.Message = v - } - return nil -} - -func (p *AuroraSchedulerManagerKillTasksArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("killTasks_args"); 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 := 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 *AuroraSchedulerManagerKillTasksArgs) writeField4(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("job", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4: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 4:job: ", p), err) - } - return err -} - -func (p *AuroraSchedulerManagerKillTasksArgs) writeField5(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("instances", thrift.SET, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:instances: ", p), err) - } - if err := oprot.WriteSetBegin(thrift.I32, len(p.Instances)); err != nil { - return thrift.PrependError("error writing set begin: ", err) - } - for v, _ := range p.Instances { - 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:instances: ", p), err) - } - return err -} - -func (p *AuroraSchedulerManagerKillTasksArgs) writeField6(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("message", thrift.STRING, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:message: ", p), err) - } - if err := oprot.WriteString(string(p.Message)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.message (6) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:message: ", p), err) - } - return err -} - -func (p *AuroraSchedulerManagerKillTasksArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerKillTasksArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerKillTasksResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerKillTasksResult() *AuroraSchedulerManagerKillTasksResult { - return &AuroraSchedulerManagerKillTasksResult{} -} - -var AuroraSchedulerManagerKillTasksResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerKillTasksResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerKillTasksResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerKillTasksResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerKillTasksResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerKillTasksResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerKillTasksResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("killTasks_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerKillTasksResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerKillTasksResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerKillTasksResult(%+v)", *p) -} - -// Attributes: -// - Key -// - Count -type AuroraSchedulerManagerAddInstancesArgs struct { - // unused fields # 1 to 2 - Key *InstanceKey `thrift:"key,3" json:"key"` - Count int32 `thrift:"count,4" json:"count"` -} - -func NewAuroraSchedulerManagerAddInstancesArgs() *AuroraSchedulerManagerAddInstancesArgs { - return &AuroraSchedulerManagerAddInstancesArgs{} -} - -var AuroraSchedulerManagerAddInstancesArgs_Key_DEFAULT *InstanceKey - -func (p *AuroraSchedulerManagerAddInstancesArgs) GetKey() *InstanceKey { - if !p.IsSetKey() { - return AuroraSchedulerManagerAddInstancesArgs_Key_DEFAULT - } - return p.Key -} - -func (p *AuroraSchedulerManagerAddInstancesArgs) GetCount() int32 { - return p.Count -} -func (p *AuroraSchedulerManagerAddInstancesArgs) IsSetKey() bool { - return p.Key != nil -} - -func (p *AuroraSchedulerManagerAddInstancesArgs) 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 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 *AuroraSchedulerManagerAddInstancesArgs) readField3(iprot thrift.TProtocol) error { - p.Key = &InstanceKey{} - if err := p.Key.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err) - } - return nil -} - -func (p *AuroraSchedulerManagerAddInstancesArgs) readField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.Count = v - } - return nil -} - -func (p *AuroraSchedulerManagerAddInstancesArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("addInstances_args"); 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 := 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 *AuroraSchedulerManagerAddInstancesArgs) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("key", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3: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 3:key: ", p), err) - } - return err -} - -func (p *AuroraSchedulerManagerAddInstancesArgs) writeField4(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("count", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:count: ", p), err) - } - if err := oprot.WriteI32(int32(p.Count)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.count (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:count: ", p), err) - } - return err -} - -func (p *AuroraSchedulerManagerAddInstancesArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerAddInstancesArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerAddInstancesResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerAddInstancesResult() *AuroraSchedulerManagerAddInstancesResult { - return &AuroraSchedulerManagerAddInstancesResult{} -} - -var AuroraSchedulerManagerAddInstancesResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerAddInstancesResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerAddInstancesResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerAddInstancesResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerAddInstancesResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerAddInstancesResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerAddInstancesResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("addInstances_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerAddInstancesResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerAddInstancesResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerAddInstancesResult(%+v)", *p) -} - -// Attributes: -// - Config -type AuroraSchedulerManagerReplaceCronTemplateArgs struct { - Config *JobConfiguration `thrift:"config,1" json:"config"` -} - -func NewAuroraSchedulerManagerReplaceCronTemplateArgs() *AuroraSchedulerManagerReplaceCronTemplateArgs { - return &AuroraSchedulerManagerReplaceCronTemplateArgs{} -} - -var AuroraSchedulerManagerReplaceCronTemplateArgs_Config_DEFAULT *JobConfiguration - -func (p *AuroraSchedulerManagerReplaceCronTemplateArgs) GetConfig() *JobConfiguration { - if !p.IsSetConfig() { - return AuroraSchedulerManagerReplaceCronTemplateArgs_Config_DEFAULT - } - return p.Config -} -func (p *AuroraSchedulerManagerReplaceCronTemplateArgs) IsSetConfig() bool { - return p.Config != nil -} - -func (p *AuroraSchedulerManagerReplaceCronTemplateArgs) 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 *AuroraSchedulerManagerReplaceCronTemplateArgs) readField1(iprot thrift.TProtocol) error { - p.Config = &JobConfiguration{} - if err := p.Config.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Config), err) - } - return nil -} - -func (p *AuroraSchedulerManagerReplaceCronTemplateArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("replaceCronTemplate_args"); 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 *AuroraSchedulerManagerReplaceCronTemplateArgs) 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 *AuroraSchedulerManagerReplaceCronTemplateArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerReplaceCronTemplateArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerReplaceCronTemplateResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerReplaceCronTemplateResult() *AuroraSchedulerManagerReplaceCronTemplateResult { - return &AuroraSchedulerManagerReplaceCronTemplateResult{} -} - -var AuroraSchedulerManagerReplaceCronTemplateResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerReplaceCronTemplateResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerReplaceCronTemplateResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerReplaceCronTemplateResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerReplaceCronTemplateResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerReplaceCronTemplateResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerReplaceCronTemplateResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("replaceCronTemplate_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerReplaceCronTemplateResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerReplaceCronTemplateResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerReplaceCronTemplateResult(%+v)", *p) -} - -// Attributes: -// - Request: A description of how to change the job. -// - Message: A user-specified message to include with the induced job update state change. -type AuroraSchedulerManagerStartJobUpdateArgs struct { - Request *JobUpdateRequest `thrift:"request,1" json:"request"` - // unused field # 2 - Message string `thrift:"message,3" json:"message"` -} - -func NewAuroraSchedulerManagerStartJobUpdateArgs() *AuroraSchedulerManagerStartJobUpdateArgs { - return &AuroraSchedulerManagerStartJobUpdateArgs{} -} - -var AuroraSchedulerManagerStartJobUpdateArgs_Request_DEFAULT *JobUpdateRequest - -func (p *AuroraSchedulerManagerStartJobUpdateArgs) GetRequest() *JobUpdateRequest { - if !p.IsSetRequest() { - return AuroraSchedulerManagerStartJobUpdateArgs_Request_DEFAULT - } - return p.Request -} - -func (p *AuroraSchedulerManagerStartJobUpdateArgs) GetMessage() string { - return p.Message -} -func (p *AuroraSchedulerManagerStartJobUpdateArgs) IsSetRequest() bool { - return p.Request != nil -} - -func (p *AuroraSchedulerManagerStartJobUpdateArgs) 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 *AuroraSchedulerManagerStartJobUpdateArgs) readField1(iprot thrift.TProtocol) error { - p.Request = &JobUpdateRequest{} - if err := p.Request.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) - } - return nil -} - -func (p *AuroraSchedulerManagerStartJobUpdateArgs) 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 *AuroraSchedulerManagerStartJobUpdateArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("startJobUpdate_args"); 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 *AuroraSchedulerManagerStartJobUpdateArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) - } - if err := p.Request.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) - } - return err -} - -func (p *AuroraSchedulerManagerStartJobUpdateArgs) writeField3(oprot thrift.TProtocol) (err error) { - 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 *AuroraSchedulerManagerStartJobUpdateArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerStartJobUpdateArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerStartJobUpdateResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerStartJobUpdateResult() *AuroraSchedulerManagerStartJobUpdateResult { - return &AuroraSchedulerManagerStartJobUpdateResult{} -} - -var AuroraSchedulerManagerStartJobUpdateResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerStartJobUpdateResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerStartJobUpdateResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerStartJobUpdateResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerStartJobUpdateResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerStartJobUpdateResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerStartJobUpdateResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("startJobUpdate_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerStartJobUpdateResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerStartJobUpdateResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerStartJobUpdateResult(%+v)", *p) -} - -// Attributes: -// - Key: The update to pause. -// - Message: A user-specified message to include with the induced job update state change. -type AuroraSchedulerManagerPauseJobUpdateArgs struct { - Key *JobUpdateKey `thrift:"key,1" json:"key"` - // unused field # 2 - Message string `thrift:"message,3" json:"message"` -} - -func NewAuroraSchedulerManagerPauseJobUpdateArgs() *AuroraSchedulerManagerPauseJobUpdateArgs { - return &AuroraSchedulerManagerPauseJobUpdateArgs{} -} - -var AuroraSchedulerManagerPauseJobUpdateArgs_Key_DEFAULT *JobUpdateKey - -func (p *AuroraSchedulerManagerPauseJobUpdateArgs) GetKey() *JobUpdateKey { - if !p.IsSetKey() { - return AuroraSchedulerManagerPauseJobUpdateArgs_Key_DEFAULT - } - return p.Key -} - -func (p *AuroraSchedulerManagerPauseJobUpdateArgs) GetMessage() string { - return p.Message -} -func (p *AuroraSchedulerManagerPauseJobUpdateArgs) IsSetKey() bool { - return p.Key != nil -} - -func (p *AuroraSchedulerManagerPauseJobUpdateArgs) 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 *AuroraSchedulerManagerPauseJobUpdateArgs) 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 *AuroraSchedulerManagerPauseJobUpdateArgs) 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 *AuroraSchedulerManagerPauseJobUpdateArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("pauseJobUpdate_args"); 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 *AuroraSchedulerManagerPauseJobUpdateArgs) 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 *AuroraSchedulerManagerPauseJobUpdateArgs) writeField3(oprot thrift.TProtocol) (err error) { - 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 *AuroraSchedulerManagerPauseJobUpdateArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerPauseJobUpdateArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerPauseJobUpdateResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerPauseJobUpdateResult() *AuroraSchedulerManagerPauseJobUpdateResult { - return &AuroraSchedulerManagerPauseJobUpdateResult{} -} - -var AuroraSchedulerManagerPauseJobUpdateResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerPauseJobUpdateResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerPauseJobUpdateResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerPauseJobUpdateResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerPauseJobUpdateResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerPauseJobUpdateResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerPauseJobUpdateResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("pauseJobUpdate_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerPauseJobUpdateResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerPauseJobUpdateResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerPauseJobUpdateResult(%+v)", *p) -} - -// Attributes: -// - Key: The update to resume. -// - Message: A user-specified message to include with the induced job update state change. -type AuroraSchedulerManagerResumeJobUpdateArgs struct { - Key *JobUpdateKey `thrift:"key,1" json:"key"` - // unused field # 2 - Message string `thrift:"message,3" json:"message"` -} - -func NewAuroraSchedulerManagerResumeJobUpdateArgs() *AuroraSchedulerManagerResumeJobUpdateArgs { - return &AuroraSchedulerManagerResumeJobUpdateArgs{} -} - -var AuroraSchedulerManagerResumeJobUpdateArgs_Key_DEFAULT *JobUpdateKey - -func (p *AuroraSchedulerManagerResumeJobUpdateArgs) GetKey() *JobUpdateKey { - if !p.IsSetKey() { - return AuroraSchedulerManagerResumeJobUpdateArgs_Key_DEFAULT - } - return p.Key -} - -func (p *AuroraSchedulerManagerResumeJobUpdateArgs) GetMessage() string { - return p.Message -} -func (p *AuroraSchedulerManagerResumeJobUpdateArgs) IsSetKey() bool { - return p.Key != nil -} - -func (p *AuroraSchedulerManagerResumeJobUpdateArgs) 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 *AuroraSchedulerManagerResumeJobUpdateArgs) 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 *AuroraSchedulerManagerResumeJobUpdateArgs) 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 *AuroraSchedulerManagerResumeJobUpdateArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("resumeJobUpdate_args"); 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 *AuroraSchedulerManagerResumeJobUpdateArgs) 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 *AuroraSchedulerManagerResumeJobUpdateArgs) writeField3(oprot thrift.TProtocol) (err error) { - 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 *AuroraSchedulerManagerResumeJobUpdateArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerResumeJobUpdateArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerResumeJobUpdateResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerResumeJobUpdateResult() *AuroraSchedulerManagerResumeJobUpdateResult { - return &AuroraSchedulerManagerResumeJobUpdateResult{} -} - -var AuroraSchedulerManagerResumeJobUpdateResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerResumeJobUpdateResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerResumeJobUpdateResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerResumeJobUpdateResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerResumeJobUpdateResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerResumeJobUpdateResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerResumeJobUpdateResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("resumeJobUpdate_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerResumeJobUpdateResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerResumeJobUpdateResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerResumeJobUpdateResult(%+v)", *p) -} - -// Attributes: -// - Key: The update to abort. -// - Message: A user-specified message to include with the induced job update state change. -type AuroraSchedulerManagerAbortJobUpdateArgs struct { - Key *JobUpdateKey `thrift:"key,1" json:"key"` - // unused field # 2 - Message string `thrift:"message,3" json:"message"` -} - -func NewAuroraSchedulerManagerAbortJobUpdateArgs() *AuroraSchedulerManagerAbortJobUpdateArgs { - return &AuroraSchedulerManagerAbortJobUpdateArgs{} -} - -var AuroraSchedulerManagerAbortJobUpdateArgs_Key_DEFAULT *JobUpdateKey - -func (p *AuroraSchedulerManagerAbortJobUpdateArgs) GetKey() *JobUpdateKey { - if !p.IsSetKey() { - return AuroraSchedulerManagerAbortJobUpdateArgs_Key_DEFAULT - } - return p.Key -} - -func (p *AuroraSchedulerManagerAbortJobUpdateArgs) GetMessage() string { - return p.Message -} -func (p *AuroraSchedulerManagerAbortJobUpdateArgs) IsSetKey() bool { - return p.Key != nil -} - -func (p *AuroraSchedulerManagerAbortJobUpdateArgs) 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 *AuroraSchedulerManagerAbortJobUpdateArgs) 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 *AuroraSchedulerManagerAbortJobUpdateArgs) 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 *AuroraSchedulerManagerAbortJobUpdateArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("abortJobUpdate_args"); 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 *AuroraSchedulerManagerAbortJobUpdateArgs) 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 *AuroraSchedulerManagerAbortJobUpdateArgs) writeField3(oprot thrift.TProtocol) (err error) { - 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 *AuroraSchedulerManagerAbortJobUpdateArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerAbortJobUpdateArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerAbortJobUpdateResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerAbortJobUpdateResult() *AuroraSchedulerManagerAbortJobUpdateResult { - return &AuroraSchedulerManagerAbortJobUpdateResult{} -} - -var AuroraSchedulerManagerAbortJobUpdateResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerAbortJobUpdateResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerAbortJobUpdateResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerAbortJobUpdateResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerAbortJobUpdateResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerAbortJobUpdateResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerAbortJobUpdateResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("abortJobUpdate_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerAbortJobUpdateResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerAbortJobUpdateResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerAbortJobUpdateResult(%+v)", *p) -} - -// Attributes: -// - Key: The update to rollback. -// - Message: A user-specified message to include with the induced job update state change. -type AuroraSchedulerManagerRollbackJobUpdateArgs struct { - Key *JobUpdateKey `thrift:"key,1" json:"key"` - Message string `thrift:"message,2" json:"message"` -} - -func NewAuroraSchedulerManagerRollbackJobUpdateArgs() *AuroraSchedulerManagerRollbackJobUpdateArgs { - return &AuroraSchedulerManagerRollbackJobUpdateArgs{} -} - -var AuroraSchedulerManagerRollbackJobUpdateArgs_Key_DEFAULT *JobUpdateKey - -func (p *AuroraSchedulerManagerRollbackJobUpdateArgs) GetKey() *JobUpdateKey { - if !p.IsSetKey() { - return AuroraSchedulerManagerRollbackJobUpdateArgs_Key_DEFAULT - } - return p.Key -} - -func (p *AuroraSchedulerManagerRollbackJobUpdateArgs) GetMessage() string { - return p.Message -} -func (p *AuroraSchedulerManagerRollbackJobUpdateArgs) IsSetKey() bool { - return p.Key != nil -} - -func (p *AuroraSchedulerManagerRollbackJobUpdateArgs) 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 *AuroraSchedulerManagerRollbackJobUpdateArgs) 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 *AuroraSchedulerManagerRollbackJobUpdateArgs) readField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Message = v - } - return nil -} - -func (p *AuroraSchedulerManagerRollbackJobUpdateArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("rollbackJobUpdate_args"); 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 *AuroraSchedulerManagerRollbackJobUpdateArgs) 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 *AuroraSchedulerManagerRollbackJobUpdateArgs) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("message", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:message: ", p), err) - } - if err := oprot.WriteString(string(p.Message)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.message (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:message: ", p), err) - } - return err -} - -func (p *AuroraSchedulerManagerRollbackJobUpdateArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerRollbackJobUpdateArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerRollbackJobUpdateResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerRollbackJobUpdateResult() *AuroraSchedulerManagerRollbackJobUpdateResult { - return &AuroraSchedulerManagerRollbackJobUpdateResult{} -} - -var AuroraSchedulerManagerRollbackJobUpdateResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerRollbackJobUpdateResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerRollbackJobUpdateResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerRollbackJobUpdateResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerRollbackJobUpdateResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerRollbackJobUpdateResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerRollbackJobUpdateResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("rollbackJobUpdate_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerRollbackJobUpdateResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerRollbackJobUpdateResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerRollbackJobUpdateResult(%+v)", *p) -} - -// Attributes: -// - Key -type AuroraSchedulerManagerPulseJobUpdateArgs struct { - Key *JobUpdateKey `thrift:"key,1" json:"key"` -} - -func NewAuroraSchedulerManagerPulseJobUpdateArgs() *AuroraSchedulerManagerPulseJobUpdateArgs { - return &AuroraSchedulerManagerPulseJobUpdateArgs{} -} - -var AuroraSchedulerManagerPulseJobUpdateArgs_Key_DEFAULT *JobUpdateKey - -func (p *AuroraSchedulerManagerPulseJobUpdateArgs) GetKey() *JobUpdateKey { - if !p.IsSetKey() { - return AuroraSchedulerManagerPulseJobUpdateArgs_Key_DEFAULT - } - return p.Key -} -func (p *AuroraSchedulerManagerPulseJobUpdateArgs) IsSetKey() bool { - return p.Key != nil -} - -func (p *AuroraSchedulerManagerPulseJobUpdateArgs) 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 *AuroraSchedulerManagerPulseJobUpdateArgs) 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 *AuroraSchedulerManagerPulseJobUpdateArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("pulseJobUpdate_args"); 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 *AuroraSchedulerManagerPulseJobUpdateArgs) 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 *AuroraSchedulerManagerPulseJobUpdateArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerPulseJobUpdateArgs(%+v)", *p) -} - -// Attributes: -// - Success -type AuroraSchedulerManagerPulseJobUpdateResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewAuroraSchedulerManagerPulseJobUpdateResult() *AuroraSchedulerManagerPulseJobUpdateResult { - return &AuroraSchedulerManagerPulseJobUpdateResult{} -} - -var AuroraSchedulerManagerPulseJobUpdateResult_Success_DEFAULT *Response - -func (p *AuroraSchedulerManagerPulseJobUpdateResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return AuroraSchedulerManagerPulseJobUpdateResult_Success_DEFAULT - } - return p.Success -} -func (p *AuroraSchedulerManagerPulseJobUpdateResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *AuroraSchedulerManagerPulseJobUpdateResult) 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 0: - if err := p.readField0(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 *AuroraSchedulerManagerPulseJobUpdateResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *AuroraSchedulerManagerPulseJobUpdateResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("pulseJobUpdate_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *AuroraSchedulerManagerPulseJobUpdateResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *AuroraSchedulerManagerPulseJobUpdateResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("AuroraSchedulerManagerPulseJobUpdateResult(%+v)", *p) -} diff --git a/gen-go/apache/aurora/constants.go b/gen-go/apache/aurora/constants.go deleted file mode 100644 index 9284ff5..0000000 --- a/gen-go/apache/aurora/constants.go +++ /dev/null @@ -1,89 +0,0 @@ -// 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 - -const AURORA_EXECUTOR_NAME = "AuroraExecutor" - -var ACTIVE_STATES map[ScheduleStatus]bool -var SLAVE_ASSIGNED_STATES map[ScheduleStatus]bool -var LIVE_STATES map[ScheduleStatus]bool -var TERMINAL_STATES map[ScheduleStatus]bool - -const GOOD_IDENTIFIER_PATTERN = "^[\\w\\-\\.]+$" -const GOOD_IDENTIFIER_PATTERN_JVM = "^[\\w\\-\\.]+$" -const GOOD_IDENTIFIER_PATTERN_PYTHON = "^[\\w\\-\\.]+$" - -var ACTIVE_JOB_UPDATE_STATES map[JobUpdateStatus]bool -var AWAITNG_PULSE_JOB_UPDATE_STATES map[JobUpdateStatus]bool - -const BYPASS_LEADER_REDIRECT_HEADER_NAME = "Bypass-Leader-Redirect" -const TASK_FILESYSTEM_MOUNT_POINT = "taskfs" - -func init() { - ACTIVE_STATES = map[ScheduleStatus]bool{ - 9: true, - 17: true, - 6: true, - 0: true, - 13: true, - 12: true, - 2: true, - 1: true, - 18: true, - 16: true, - } - - SLAVE_ASSIGNED_STATES = map[ScheduleStatus]bool{ - 9: true, - 17: true, - 6: true, - 13: true, - 12: true, - 2: true, - 18: true, - 1: true, - } - - LIVE_STATES = map[ScheduleStatus]bool{ - 6: true, - 13: true, - 12: true, - 17: true, - 18: true, - 2: true, - } - - TERMINAL_STATES = map[ScheduleStatus]bool{ - 4: true, - 3: true, - 5: true, - 7: true, - } - - ACTIVE_JOB_UPDATE_STATES = map[JobUpdateStatus]bool{ - 0: true, - 1: true, - 2: true, - 3: true, - 9: true, - 10: true, - } - - AWAITNG_PULSE_JOB_UPDATE_STATES = map[JobUpdateStatus]bool{ - 9: true, - 10: true, - } - -} diff --git a/gen-go/apache/aurora/read_only_scheduler-remote/read_only_scheduler-remote.go b/gen-go/apache/aurora/read_only_scheduler-remote/read_only_scheduler-remote.go index 2c2687f..01a1f77 100755 --- a/gen-go/apache/aurora/read_only_scheduler-remote/read_only_scheduler-remote.go +++ b/gen-go/apache/aurora/read_only_scheduler-remote/read_only_scheduler-remote.go @@ -1,19 +1,21 @@ -// Autogenerated by Thrift Compiler (0.9.3) +// Autogenerated by Thrift Compiler (0.12.0) // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING package main import ( "apache/aurora" + "context" "flag" "fmt" - "git.apache.org/thrift.git/lib/go/thrift" "math" "net" "net/url" "os" "strconv" "strings" + + "git.apache.org/thrift.git/lib/go/thrift" ) func Usage() { @@ -37,6 +39,22 @@ func Usage() { os.Exit(0) } +type httpHeaders map[string]string + +func (h httpHeaders) String() string { + var m map[string]string = h + return fmt.Sprintf("%s", m) +} + +func (h httpHeaders) Set(value string) error { + parts := strings.Split(value, ": ") + if len(parts) != 2 { + return fmt.Errorf("header should be of format 'Key: Value'") + } + h[parts[0]] = parts[1] + return nil +} + func main() { flag.Usage = Usage var host string @@ -45,7 +63,8 @@ func main() { var urlString string var framed bool var useHttp bool - var parsedUrl url.URL + headers := make(httpHeaders) + var parsedUrl *url.URL var trans thrift.TTransport _ = strconv.Atoi _ = math.Abs @@ -56,16 +75,18 @@ func main() { flag.StringVar(&urlString, "u", "", "Specify the url") flag.BoolVar(&framed, "framed", false, "Use framed transport") flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Var(headers, "H", "Headers to set on the http(s) request (e.g. -H \"Key: Value\")") flag.Parse() if len(urlString) > 0 { - parsedUrl, err := url.Parse(urlString) + var err error + parsedUrl, err = url.Parse(urlString) if err != nil { fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) flag.Usage() } host = parsedUrl.Host - useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" || parsedUrl.Scheme == "https" } else if useHttp { _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) if err != nil { @@ -78,6 +99,12 @@ func main() { var err error if useHttp { trans, err = thrift.NewTHttpClient(parsedUrl.String()) + if len(headers) > 0 { + httptrans := trans.(*thrift.THttpClient) + for key, value := range headers { + httptrans.SetHeader(key, value) + } + } } else { portStr := fmt.Sprint(port) if strings.Contains(host, ":") { @@ -120,7 +147,9 @@ func main() { Usage() os.Exit(1) } - client := aurora.NewReadOnlySchedulerClientFactory(trans, protocolFactory) + iprot := protocolFactory.GetProtocol(trans) + oprot := protocolFactory.GetProtocol(trans) + client := aurora.NewReadOnlySchedulerClient(thrift.NewTStandardClient(iprot, oprot)) if err := trans.Open(); err != nil { fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) os.Exit(1) @@ -132,7 +161,7 @@ func main() { fmt.Fprintln(os.Stderr, "GetRoleSummary requires 0 args") flag.Usage() } - fmt.Print(client.GetRoleSummary()) + fmt.Print(client.GetRoleSummary(context.Background())) fmt.Print("\n") break case "getJobSummary": @@ -142,7 +171,7 @@ func main() { } argvalue0 := flag.Arg(1) value0 := argvalue0 - fmt.Print(client.GetJobSummary(value0)) + fmt.Print(client.GetJobSummary(context.Background(), value0)) fmt.Print("\n") break case "getTasksStatus": @@ -158,7 +187,7 @@ func main() { Usage() return } - factory84 := thrift.NewTSimpleJSONProtocolFactory() + factory84 := thrift.NewTJSONProtocolFactory() jsProt85 := factory84.GetProtocol(mbTrans82) argvalue0 := aurora.NewTaskQuery() err86 := argvalue0.Read(jsProt85) @@ -167,7 +196,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetTasksStatus(value0)) + fmt.Print(client.GetTasksStatus(context.Background(), value0)) fmt.Print("\n") break case "getTasksWithoutConfigs": @@ -183,7 +212,7 @@ func main() { Usage() return } - factory90 := thrift.NewTSimpleJSONProtocolFactory() + factory90 := thrift.NewTJSONProtocolFactory() jsProt91 := factory90.GetProtocol(mbTrans88) argvalue0 := aurora.NewTaskQuery() err92 := argvalue0.Read(jsProt91) @@ -192,7 +221,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetTasksWithoutConfigs(value0)) + fmt.Print(client.GetTasksWithoutConfigs(context.Background(), value0)) fmt.Print("\n") break case "getPendingReason": @@ -208,7 +237,7 @@ func main() { Usage() return } - factory96 := thrift.NewTSimpleJSONProtocolFactory() + factory96 := thrift.NewTJSONProtocolFactory() jsProt97 := factory96.GetProtocol(mbTrans94) argvalue0 := aurora.NewTaskQuery() err98 := argvalue0.Read(jsProt97) @@ -217,7 +246,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetPendingReason(value0)) + fmt.Print(client.GetPendingReason(context.Background(), value0)) fmt.Print("\n") break case "getConfigSummary": @@ -233,7 +262,7 @@ func main() { Usage() return } - factory102 := thrift.NewTSimpleJSONProtocolFactory() + factory102 := thrift.NewTJSONProtocolFactory() jsProt103 := factory102.GetProtocol(mbTrans100) argvalue0 := aurora.NewJobKey() err104 := argvalue0.Read(jsProt103) @@ -242,7 +271,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetConfigSummary(value0)) + fmt.Print(client.GetConfigSummary(context.Background(), value0)) fmt.Print("\n") break case "getJobs": @@ -252,7 +281,7 @@ func main() { } argvalue0 := flag.Arg(1) value0 := argvalue0 - fmt.Print(client.GetJobs(value0)) + fmt.Print(client.GetJobs(context.Background(), value0)) fmt.Print("\n") break case "getQuota": @@ -262,7 +291,7 @@ func main() { } argvalue0 := flag.Arg(1) value0 := argvalue0 - fmt.Print(client.GetQuota(value0)) + fmt.Print(client.GetQuota(context.Background(), value0)) fmt.Print("\n") break case "populateJobConfig": @@ -278,7 +307,7 @@ func main() { Usage() return } - factory110 := thrift.NewTSimpleJSONProtocolFactory() + factory110 := thrift.NewTJSONProtocolFactory() jsProt111 := factory110.GetProtocol(mbTrans108) argvalue0 := aurora.NewJobConfiguration() err112 := argvalue0.Read(jsProt111) @@ -287,7 +316,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.PopulateJobConfig(value0)) + fmt.Print(client.PopulateJobConfig(context.Background(), value0)) fmt.Print("\n") break case "getJobUpdateSummaries": @@ -303,7 +332,7 @@ func main() { Usage() return } - factory116 := thrift.NewTSimpleJSONProtocolFactory() + factory116 := thrift.NewTJSONProtocolFactory() jsProt117 := factory116.GetProtocol(mbTrans114) argvalue0 := aurora.NewJobUpdateQuery() err118 := argvalue0.Read(jsProt117) @@ -312,7 +341,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetJobUpdateSummaries(value0)) + fmt.Print(client.GetJobUpdateSummaries(context.Background(), value0)) fmt.Print("\n") break case "getJobUpdateDetails": @@ -328,7 +357,7 @@ func main() { Usage() return } - factory122 := thrift.NewTSimpleJSONProtocolFactory() + factory122 := thrift.NewTJSONProtocolFactory() jsProt123 := factory122.GetProtocol(mbTrans120) argvalue0 := aurora.NewJobUpdateQuery() err124 := argvalue0.Read(jsProt123) @@ -337,7 +366,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetJobUpdateDetails(value0)) + fmt.Print(client.GetJobUpdateDetails(context.Background(), value0)) fmt.Print("\n") break case "getJobUpdateDiff": @@ -353,7 +382,7 @@ func main() { Usage() return } - factory128 := thrift.NewTSimpleJSONProtocolFactory() + factory128 := thrift.NewTJSONProtocolFactory() jsProt129 := factory128.GetProtocol(mbTrans126) argvalue0 := aurora.NewJobUpdateRequest() err130 := argvalue0.Read(jsProt129) @@ -362,7 +391,7 @@ func main() { return } value0 := argvalue0 - fmt.Print(client.GetJobUpdateDiff(value0)) + fmt.Print(client.GetJobUpdateDiff(context.Background(), value0)) fmt.Print("\n") break case "getTierConfigs": @@ -370,7 +399,7 @@ func main() { fmt.Fprintln(os.Stderr, "GetTierConfigs requires 0 args") flag.Usage() } - fmt.Print(client.GetTierConfigs()) + fmt.Print(client.GetTierConfigs(context.Background())) fmt.Print("\n") break case "": diff --git a/gen-go/apache/aurora/readonlyscheduler.go b/gen-go/apache/aurora/readonlyscheduler.go deleted file mode 100644 index dba7255..0000000 --- a/gen-go/apache/aurora/readonlyscheduler.go +++ /dev/null @@ -1,4293 +0,0 @@ -// 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 - -type ReadOnlyScheduler interface { - // Returns a summary of the jobs grouped by role. - GetRoleSummary() (r *Response, err error) - // Returns a summary of jobs, optionally only those owned by a specific role. - // - // Parameters: - // - Role - GetJobSummary(role string) (r *Response, err error) - // Fetches the status of tasks. - // - // Parameters: - // - Query - GetTasksStatus(query *TaskQuery) (r *Response, err error) - // Same as getTaskStatus but without the TaskConfig.ExecutorConfig data set. - // This is an interim solution until we have a better way to query TaskConfigs (AURORA-541). - // - // Parameters: - // - Query - GetTasksWithoutConfigs(query *TaskQuery) (r *Response, err error) - // Returns user-friendly reasons (if available) for tasks retained in PENDING state. - // - // Parameters: - // - Query - GetPendingReason(query *TaskQuery) (r *Response, err error) - // Fetches the configuration summary of active tasks for the specified job. - // - // Parameters: - // - Job - GetConfigSummary(job *JobKey) (r *Response, err error) - // Fetches the status of jobs. - // ownerRole is optional, in which case all jobs are returned. - // - // Parameters: - // - OwnerRole - GetJobs(ownerRole string) (r *Response, err error) - // Fetches the quota allocated for a user. - // - // Parameters: - // - OwnerRole - GetQuota(ownerRole string) (r *Response, err error) - // Populates fields in a job configuration as though it were about to be run. - // This can be used to diff a configuration running tasks. - // - // Parameters: - // - Description - PopulateJobConfig(description *JobConfiguration) (r *Response, err error) - // Gets job update summaries. - // - // Parameters: - // - JobUpdateQuery - GetJobUpdateSummaries(jobUpdateQuery *JobUpdateQuery) (r *Response, err error) - // Gets job update details. - // - // Parameters: - // - Query - GetJobUpdateDetails(query *JobUpdateQuery) (r *Response, err error) - // Gets the diff between client (desired) and server (current) job states. - // - // Parameters: - // - Request - GetJobUpdateDiff(request *JobUpdateRequest) (r *Response, err error) - // Gets tier configurations. - GetTierConfigs() (r *Response, err error) -} - -type ReadOnlySchedulerClient struct { - Transport thrift.TTransport - ProtocolFactory thrift.TProtocolFactory - InputProtocol thrift.TProtocol - OutputProtocol thrift.TProtocol - SeqId int32 -} - -func NewReadOnlySchedulerClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ReadOnlySchedulerClient { - return &ReadOnlySchedulerClient{Transport: t, - ProtocolFactory: f, - InputProtocol: f.GetProtocol(t), - OutputProtocol: f.GetProtocol(t), - SeqId: 0, - } -} - -func NewReadOnlySchedulerClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ReadOnlySchedulerClient { - return &ReadOnlySchedulerClient{Transport: t, - ProtocolFactory: nil, - InputProtocol: iprot, - OutputProtocol: oprot, - SeqId: 0, - } -} - -// Returns a summary of the jobs grouped by role. -func (p *ReadOnlySchedulerClient) GetRoleSummary() (r *Response, err error) { - if err = p.sendGetRoleSummary(); err != nil { - return - } - return p.recvGetRoleSummary() -} - -func (p *ReadOnlySchedulerClient) sendGetRoleSummary() (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("getRoleSummary", thrift.CALL, p.SeqId); err != nil { - return - } - args := ReadOnlySchedulerGetRoleSummaryArgs{} - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *ReadOnlySchedulerClient) recvGetRoleSummary() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "getRoleSummary" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "getRoleSummary failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getRoleSummary failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error52 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error53 error - error53, err = error52.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error53 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getRoleSummary failed: invalid message type") - return - } - result := ReadOnlySchedulerGetRoleSummaryResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Returns a summary of jobs, optionally only those owned by a specific role. -// -// Parameters: -// - Role -func (p *ReadOnlySchedulerClient) GetJobSummary(role string) (r *Response, err error) { - if err = p.sendGetJobSummary(role); err != nil { - return - } - return p.recvGetJobSummary() -} - -func (p *ReadOnlySchedulerClient) sendGetJobSummary(role string) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("getJobSummary", thrift.CALL, p.SeqId); err != nil { - return - } - args := ReadOnlySchedulerGetJobSummaryArgs{ - Role: role, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *ReadOnlySchedulerClient) recvGetJobSummary() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "getJobSummary" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "getJobSummary failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getJobSummary failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error54 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error55 error - error55, err = error54.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error55 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getJobSummary failed: invalid message type") - return - } - result := ReadOnlySchedulerGetJobSummaryResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Fetches the status of tasks. -// -// Parameters: -// - Query -func (p *ReadOnlySchedulerClient) GetTasksStatus(query *TaskQuery) (r *Response, err error) { - if err = p.sendGetTasksStatus(query); err != nil { - return - } - return p.recvGetTasksStatus() -} - -func (p *ReadOnlySchedulerClient) sendGetTasksStatus(query *TaskQuery) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("getTasksStatus", thrift.CALL, p.SeqId); err != nil { - return - } - args := ReadOnlySchedulerGetTasksStatusArgs{ - Query: query, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *ReadOnlySchedulerClient) recvGetTasksStatus() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "getTasksStatus" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "getTasksStatus failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getTasksStatus failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error56 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error57 error - error57, err = error56.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error57 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getTasksStatus failed: invalid message type") - return - } - result := ReadOnlySchedulerGetTasksStatusResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Same as getTaskStatus but without the TaskConfig.ExecutorConfig data set. -// This is an interim solution until we have a better way to query TaskConfigs (AURORA-541). -// -// Parameters: -// - Query -func (p *ReadOnlySchedulerClient) GetTasksWithoutConfigs(query *TaskQuery) (r *Response, err error) { - if err = p.sendGetTasksWithoutConfigs(query); err != nil { - return - } - return p.recvGetTasksWithoutConfigs() -} - -func (p *ReadOnlySchedulerClient) sendGetTasksWithoutConfigs(query *TaskQuery) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("getTasksWithoutConfigs", thrift.CALL, p.SeqId); err != nil { - return - } - args := ReadOnlySchedulerGetTasksWithoutConfigsArgs{ - Query: query, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *ReadOnlySchedulerClient) recvGetTasksWithoutConfigs() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "getTasksWithoutConfigs" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "getTasksWithoutConfigs failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getTasksWithoutConfigs failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error58 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error59 error - error59, err = error58.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error59 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getTasksWithoutConfigs failed: invalid message type") - return - } - result := ReadOnlySchedulerGetTasksWithoutConfigsResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Returns user-friendly reasons (if available) for tasks retained in PENDING state. -// -// Parameters: -// - Query -func (p *ReadOnlySchedulerClient) GetPendingReason(query *TaskQuery) (r *Response, err error) { - if err = p.sendGetPendingReason(query); err != nil { - return - } - return p.recvGetPendingReason() -} - -func (p *ReadOnlySchedulerClient) sendGetPendingReason(query *TaskQuery) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("getPendingReason", thrift.CALL, p.SeqId); err != nil { - return - } - args := ReadOnlySchedulerGetPendingReasonArgs{ - Query: query, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *ReadOnlySchedulerClient) recvGetPendingReason() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "getPendingReason" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "getPendingReason failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getPendingReason failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error60 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error61 error - error61, err = error60.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error61 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getPendingReason failed: invalid message type") - return - } - result := ReadOnlySchedulerGetPendingReasonResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Fetches the configuration summary of active tasks for the specified job. -// -// Parameters: -// - Job -func (p *ReadOnlySchedulerClient) GetConfigSummary(job *JobKey) (r *Response, err error) { - if err = p.sendGetConfigSummary(job); err != nil { - return - } - return p.recvGetConfigSummary() -} - -func (p *ReadOnlySchedulerClient) sendGetConfigSummary(job *JobKey) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("getConfigSummary", thrift.CALL, p.SeqId); err != nil { - return - } - args := ReadOnlySchedulerGetConfigSummaryArgs{ - Job: job, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *ReadOnlySchedulerClient) recvGetConfigSummary() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "getConfigSummary" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "getConfigSummary failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getConfigSummary failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error62 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error63 error - error63, err = error62.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error63 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getConfigSummary failed: invalid message type") - return - } - result := ReadOnlySchedulerGetConfigSummaryResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Fetches the status of jobs. -// ownerRole is optional, in which case all jobs are returned. -// -// Parameters: -// - OwnerRole -func (p *ReadOnlySchedulerClient) GetJobs(ownerRole string) (r *Response, err error) { - if err = p.sendGetJobs(ownerRole); err != nil { - return - } - return p.recvGetJobs() -} - -func (p *ReadOnlySchedulerClient) sendGetJobs(ownerRole string) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("getJobs", thrift.CALL, p.SeqId); err != nil { - return - } - args := ReadOnlySchedulerGetJobsArgs{ - OwnerRole: ownerRole, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *ReadOnlySchedulerClient) recvGetJobs() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "getJobs" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "getJobs failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getJobs failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error64 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error65 error - error65, err = error64.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error65 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getJobs failed: invalid message type") - return - } - result := ReadOnlySchedulerGetJobsResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Fetches the quota allocated for a user. -// -// Parameters: -// - OwnerRole -func (p *ReadOnlySchedulerClient) GetQuota(ownerRole string) (r *Response, err error) { - if err = p.sendGetQuota(ownerRole); err != nil { - return - } - return p.recvGetQuota() -} - -func (p *ReadOnlySchedulerClient) sendGetQuota(ownerRole string) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("getQuota", thrift.CALL, p.SeqId); err != nil { - return - } - args := ReadOnlySchedulerGetQuotaArgs{ - OwnerRole: ownerRole, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *ReadOnlySchedulerClient) recvGetQuota() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "getQuota" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "getQuota failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getQuota failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error66 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error67 error - error67, err = error66.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error67 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getQuota failed: invalid message type") - return - } - result := ReadOnlySchedulerGetQuotaResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Populates fields in a job configuration as though it were about to be run. -// This can be used to diff a configuration running tasks. -// -// Parameters: -// - Description -func (p *ReadOnlySchedulerClient) PopulateJobConfig(description *JobConfiguration) (r *Response, err error) { - if err = p.sendPopulateJobConfig(description); err != nil { - return - } - return p.recvPopulateJobConfig() -} - -func (p *ReadOnlySchedulerClient) sendPopulateJobConfig(description *JobConfiguration) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("populateJobConfig", thrift.CALL, p.SeqId); err != nil { - return - } - args := ReadOnlySchedulerPopulateJobConfigArgs{ - Description: description, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *ReadOnlySchedulerClient) recvPopulateJobConfig() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "populateJobConfig" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "populateJobConfig failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "populateJobConfig failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error68 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error69 error - error69, err = error68.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error69 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "populateJobConfig failed: invalid message type") - return - } - result := ReadOnlySchedulerPopulateJobConfigResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Gets job update summaries. -// -// Parameters: -// - JobUpdateQuery -func (p *ReadOnlySchedulerClient) GetJobUpdateSummaries(jobUpdateQuery *JobUpdateQuery) (r *Response, err error) { - if err = p.sendGetJobUpdateSummaries(jobUpdateQuery); err != nil { - return - } - return p.recvGetJobUpdateSummaries() -} - -func (p *ReadOnlySchedulerClient) sendGetJobUpdateSummaries(jobUpdateQuery *JobUpdateQuery) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("getJobUpdateSummaries", thrift.CALL, p.SeqId); err != nil { - return - } - args := ReadOnlySchedulerGetJobUpdateSummariesArgs{ - JobUpdateQuery: jobUpdateQuery, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *ReadOnlySchedulerClient) recvGetJobUpdateSummaries() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "getJobUpdateSummaries" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "getJobUpdateSummaries failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getJobUpdateSummaries failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error70 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error71 error - error71, err = error70.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error71 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getJobUpdateSummaries failed: invalid message type") - return - } - result := ReadOnlySchedulerGetJobUpdateSummariesResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Gets job update details. -// -// Parameters: -// - Query -func (p *ReadOnlySchedulerClient) GetJobUpdateDetails(query *JobUpdateQuery) (r *Response, err error) { - if err = p.sendGetJobUpdateDetails(query); err != nil { - return - } - return p.recvGetJobUpdateDetails() -} - -func (p *ReadOnlySchedulerClient) sendGetJobUpdateDetails(query *JobUpdateQuery) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("getJobUpdateDetails", thrift.CALL, p.SeqId); err != nil { - return - } - args := ReadOnlySchedulerGetJobUpdateDetailsArgs{ - Query: query, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *ReadOnlySchedulerClient) recvGetJobUpdateDetails() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "getJobUpdateDetails" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "getJobUpdateDetails failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getJobUpdateDetails failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error72 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error73 error - error73, err = error72.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error73 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getJobUpdateDetails failed: invalid message type") - return - } - result := ReadOnlySchedulerGetJobUpdateDetailsResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Gets the diff between client (desired) and server (current) job states. -// -// Parameters: -// - Request -func (p *ReadOnlySchedulerClient) GetJobUpdateDiff(request *JobUpdateRequest) (r *Response, err error) { - if err = p.sendGetJobUpdateDiff(request); err != nil { - return - } - return p.recvGetJobUpdateDiff() -} - -func (p *ReadOnlySchedulerClient) sendGetJobUpdateDiff(request *JobUpdateRequest) (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("getJobUpdateDiff", thrift.CALL, p.SeqId); err != nil { - return - } - args := ReadOnlySchedulerGetJobUpdateDiffArgs{ - Request: request, - } - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *ReadOnlySchedulerClient) recvGetJobUpdateDiff() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "getJobUpdateDiff" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "getJobUpdateDiff failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getJobUpdateDiff failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error74 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error75 error - error75, err = error74.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error75 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getJobUpdateDiff failed: invalid message type") - return - } - result := ReadOnlySchedulerGetJobUpdateDiffResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -// Gets tier configurations. -func (p *ReadOnlySchedulerClient) GetTierConfigs() (r *Response, err error) { - if err = p.sendGetTierConfigs(); err != nil { - return - } - return p.recvGetTierConfigs() -} - -func (p *ReadOnlySchedulerClient) sendGetTierConfigs() (err error) { - oprot := p.OutputProtocol - if oprot == nil { - oprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.OutputProtocol = oprot - } - p.SeqId++ - if err = oprot.WriteMessageBegin("getTierConfigs", thrift.CALL, p.SeqId); err != nil { - return - } - args := ReadOnlySchedulerGetTierConfigsArgs{} - if err = args.Write(oprot); err != nil { - return - } - if err = oprot.WriteMessageEnd(); err != nil { - return - } - return oprot.Flush() -} - -func (p *ReadOnlySchedulerClient) recvGetTierConfigs() (value *Response, err error) { - iprot := p.InputProtocol - if iprot == nil { - iprot = p.ProtocolFactory.GetProtocol(p.Transport) - p.InputProtocol = iprot - } - method, mTypeId, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return - } - if method != "getTierConfigs" { - err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "getTierConfigs failed: wrong method name") - return - } - if p.SeqId != seqId { - err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "getTierConfigs failed: out of sequence response") - return - } - if mTypeId == thrift.EXCEPTION { - error76 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception") - var error77 error - error77, err = error76.Read(iprot) - if err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - err = error77 - return - } - if mTypeId != thrift.REPLY { - err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "getTierConfigs failed: invalid message type") - return - } - result := ReadOnlySchedulerGetTierConfigsResult{} - if err = result.Read(iprot); err != nil { - return - } - if err = iprot.ReadMessageEnd(); err != nil { - return - } - value = result.GetSuccess() - return -} - -type ReadOnlySchedulerProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler ReadOnlyScheduler -} - -func (p *ReadOnlySchedulerProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor -} - -func (p *ReadOnlySchedulerProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok -} - -func (p *ReadOnlySchedulerProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap -} - -func NewReadOnlySchedulerProcessor(handler ReadOnlyScheduler) *ReadOnlySchedulerProcessor { - - self78 := &ReadOnlySchedulerProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} - self78.processorMap["getRoleSummary"] = &readOnlySchedulerProcessorGetRoleSummary{handler: handler} - self78.processorMap["getJobSummary"] = &readOnlySchedulerProcessorGetJobSummary{handler: handler} - self78.processorMap["getTasksStatus"] = &readOnlySchedulerProcessorGetTasksStatus{handler: handler} - self78.processorMap["getTasksWithoutConfigs"] = &readOnlySchedulerProcessorGetTasksWithoutConfigs{handler: handler} - self78.processorMap["getPendingReason"] = &readOnlySchedulerProcessorGetPendingReason{handler: handler} - self78.processorMap["getConfigSummary"] = &readOnlySchedulerProcessorGetConfigSummary{handler: handler} - self78.processorMap["getJobs"] = &readOnlySchedulerProcessorGetJobs{handler: handler} - self78.processorMap["getQuota"] = &readOnlySchedulerProcessorGetQuota{handler: handler} - self78.processorMap["populateJobConfig"] = &readOnlySchedulerProcessorPopulateJobConfig{handler: handler} - self78.processorMap["getJobUpdateSummaries"] = &readOnlySchedulerProcessorGetJobUpdateSummaries{handler: handler} - self78.processorMap["getJobUpdateDetails"] = &readOnlySchedulerProcessorGetJobUpdateDetails{handler: handler} - self78.processorMap["getJobUpdateDiff"] = &readOnlySchedulerProcessorGetJobUpdateDiff{handler: handler} - self78.processorMap["getTierConfigs"] = &readOnlySchedulerProcessorGetTierConfigs{handler: handler} - return self78 -} - -func (p *ReadOnlySchedulerProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err := iprot.ReadMessageBegin() - if err != nil { - return false, err - } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(seqId, iprot, oprot) - } - iprot.Skip(thrift.STRUCT) - iprot.ReadMessageEnd() - x79 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name) - oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x79.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, x79 - -} - -type readOnlySchedulerProcessorGetRoleSummary struct { - handler ReadOnlyScheduler -} - -func (p *readOnlySchedulerProcessorGetRoleSummary) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ReadOnlySchedulerGetRoleSummaryArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getRoleSummary", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ReadOnlySchedulerGetRoleSummaryResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.GetRoleSummary(); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getRoleSummary: "+err2.Error()) - oprot.WriteMessageBegin("getRoleSummary", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("getRoleSummary", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type readOnlySchedulerProcessorGetJobSummary struct { - handler ReadOnlyScheduler -} - -func (p *readOnlySchedulerProcessorGetJobSummary) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ReadOnlySchedulerGetJobSummaryArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getJobSummary", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ReadOnlySchedulerGetJobSummaryResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.GetJobSummary(args.Role); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getJobSummary: "+err2.Error()) - oprot.WriteMessageBegin("getJobSummary", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("getJobSummary", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type readOnlySchedulerProcessorGetTasksStatus struct { - handler ReadOnlyScheduler -} - -func (p *readOnlySchedulerProcessorGetTasksStatus) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ReadOnlySchedulerGetTasksStatusArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getTasksStatus", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ReadOnlySchedulerGetTasksStatusResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.GetTasksStatus(args.Query); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTasksStatus: "+err2.Error()) - oprot.WriteMessageBegin("getTasksStatus", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("getTasksStatus", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type readOnlySchedulerProcessorGetTasksWithoutConfigs struct { - handler ReadOnlyScheduler -} - -func (p *readOnlySchedulerProcessorGetTasksWithoutConfigs) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ReadOnlySchedulerGetTasksWithoutConfigsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getTasksWithoutConfigs", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ReadOnlySchedulerGetTasksWithoutConfigsResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.GetTasksWithoutConfigs(args.Query); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTasksWithoutConfigs: "+err2.Error()) - oprot.WriteMessageBegin("getTasksWithoutConfigs", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("getTasksWithoutConfigs", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type readOnlySchedulerProcessorGetPendingReason struct { - handler ReadOnlyScheduler -} - -func (p *readOnlySchedulerProcessorGetPendingReason) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ReadOnlySchedulerGetPendingReasonArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getPendingReason", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ReadOnlySchedulerGetPendingReasonResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.GetPendingReason(args.Query); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPendingReason: "+err2.Error()) - oprot.WriteMessageBegin("getPendingReason", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("getPendingReason", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type readOnlySchedulerProcessorGetConfigSummary struct { - handler ReadOnlyScheduler -} - -func (p *readOnlySchedulerProcessorGetConfigSummary) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ReadOnlySchedulerGetConfigSummaryArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getConfigSummary", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ReadOnlySchedulerGetConfigSummaryResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.GetConfigSummary(args.Job); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getConfigSummary: "+err2.Error()) - oprot.WriteMessageBegin("getConfigSummary", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("getConfigSummary", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type readOnlySchedulerProcessorGetJobs struct { - handler ReadOnlyScheduler -} - -func (p *readOnlySchedulerProcessorGetJobs) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ReadOnlySchedulerGetJobsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getJobs", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ReadOnlySchedulerGetJobsResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.GetJobs(args.OwnerRole); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getJobs: "+err2.Error()) - oprot.WriteMessageBegin("getJobs", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("getJobs", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type readOnlySchedulerProcessorGetQuota struct { - handler ReadOnlyScheduler -} - -func (p *readOnlySchedulerProcessorGetQuota) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ReadOnlySchedulerGetQuotaArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getQuota", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ReadOnlySchedulerGetQuotaResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.GetQuota(args.OwnerRole); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getQuota: "+err2.Error()) - oprot.WriteMessageBegin("getQuota", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("getQuota", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type readOnlySchedulerProcessorPopulateJobConfig struct { - handler ReadOnlyScheduler -} - -func (p *readOnlySchedulerProcessorPopulateJobConfig) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ReadOnlySchedulerPopulateJobConfigArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("populateJobConfig", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ReadOnlySchedulerPopulateJobConfigResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.PopulateJobConfig(args.Description); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing populateJobConfig: "+err2.Error()) - oprot.WriteMessageBegin("populateJobConfig", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("populateJobConfig", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type readOnlySchedulerProcessorGetJobUpdateSummaries struct { - handler ReadOnlyScheduler -} - -func (p *readOnlySchedulerProcessorGetJobUpdateSummaries) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ReadOnlySchedulerGetJobUpdateSummariesArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getJobUpdateSummaries", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ReadOnlySchedulerGetJobUpdateSummariesResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.GetJobUpdateSummaries(args.JobUpdateQuery); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getJobUpdateSummaries: "+err2.Error()) - oprot.WriteMessageBegin("getJobUpdateSummaries", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("getJobUpdateSummaries", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type readOnlySchedulerProcessorGetJobUpdateDetails struct { - handler ReadOnlyScheduler -} - -func (p *readOnlySchedulerProcessorGetJobUpdateDetails) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ReadOnlySchedulerGetJobUpdateDetailsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getJobUpdateDetails", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ReadOnlySchedulerGetJobUpdateDetailsResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.GetJobUpdateDetails(args.Query); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getJobUpdateDetails: "+err2.Error()) - oprot.WriteMessageBegin("getJobUpdateDetails", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("getJobUpdateDetails", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type readOnlySchedulerProcessorGetJobUpdateDiff struct { - handler ReadOnlyScheduler -} - -func (p *readOnlySchedulerProcessorGetJobUpdateDiff) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ReadOnlySchedulerGetJobUpdateDiffArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getJobUpdateDiff", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ReadOnlySchedulerGetJobUpdateDiffResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.GetJobUpdateDiff(args.Request); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getJobUpdateDiff: "+err2.Error()) - oprot.WriteMessageBegin("getJobUpdateDiff", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("getJobUpdateDiff", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -type readOnlySchedulerProcessorGetTierConfigs struct { - handler ReadOnlyScheduler -} - -func (p *readOnlySchedulerProcessorGetTierConfigs) Process(seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := ReadOnlySchedulerGetTierConfigsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("getTierConfigs", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return false, err - } - - iprot.ReadMessageEnd() - result := ReadOnlySchedulerGetTierConfigsResult{} - var retval *Response - var err2 error - if retval, err2 = p.handler.GetTierConfigs(); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTierConfigs: "+err2.Error()) - oprot.WriteMessageBegin("getTierConfigs", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush() - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("getTierConfigs", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - -// HELPER FUNCTIONS AND STRUCTURES - -type ReadOnlySchedulerGetRoleSummaryArgs struct { -} - -func NewReadOnlySchedulerGetRoleSummaryArgs() *ReadOnlySchedulerGetRoleSummaryArgs { - return &ReadOnlySchedulerGetRoleSummaryArgs{} -} - -func (p *ReadOnlySchedulerGetRoleSummaryArgs) 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 - } - 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 *ReadOnlySchedulerGetRoleSummaryArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getRoleSummary_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), 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 *ReadOnlySchedulerGetRoleSummaryArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetRoleSummaryArgs(%+v)", *p) -} - -// Attributes: -// - Success -type ReadOnlySchedulerGetRoleSummaryResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewReadOnlySchedulerGetRoleSummaryResult() *ReadOnlySchedulerGetRoleSummaryResult { - return &ReadOnlySchedulerGetRoleSummaryResult{} -} - -var ReadOnlySchedulerGetRoleSummaryResult_Success_DEFAULT *Response - -func (p *ReadOnlySchedulerGetRoleSummaryResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return ReadOnlySchedulerGetRoleSummaryResult_Success_DEFAULT - } - return p.Success -} -func (p *ReadOnlySchedulerGetRoleSummaryResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ReadOnlySchedulerGetRoleSummaryResult) 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 0: - if err := p.readField0(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 *ReadOnlySchedulerGetRoleSummaryResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetRoleSummaryResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getRoleSummary_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *ReadOnlySchedulerGetRoleSummaryResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *ReadOnlySchedulerGetRoleSummaryResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetRoleSummaryResult(%+v)", *p) -} - -// Attributes: -// - Role -type ReadOnlySchedulerGetJobSummaryArgs struct { - Role string `thrift:"role,1" json:"role"` -} - -func NewReadOnlySchedulerGetJobSummaryArgs() *ReadOnlySchedulerGetJobSummaryArgs { - return &ReadOnlySchedulerGetJobSummaryArgs{} -} - -func (p *ReadOnlySchedulerGetJobSummaryArgs) GetRole() string { - return p.Role -} -func (p *ReadOnlySchedulerGetJobSummaryArgs) 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 *ReadOnlySchedulerGetJobSummaryArgs) 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 *ReadOnlySchedulerGetJobSummaryArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getJobSummary_args"); 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 *ReadOnlySchedulerGetJobSummaryArgs) 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 *ReadOnlySchedulerGetJobSummaryArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetJobSummaryArgs(%+v)", *p) -} - -// Attributes: -// - Success -type ReadOnlySchedulerGetJobSummaryResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewReadOnlySchedulerGetJobSummaryResult() *ReadOnlySchedulerGetJobSummaryResult { - return &ReadOnlySchedulerGetJobSummaryResult{} -} - -var ReadOnlySchedulerGetJobSummaryResult_Success_DEFAULT *Response - -func (p *ReadOnlySchedulerGetJobSummaryResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return ReadOnlySchedulerGetJobSummaryResult_Success_DEFAULT - } - return p.Success -} -func (p *ReadOnlySchedulerGetJobSummaryResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ReadOnlySchedulerGetJobSummaryResult) 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 0: - if err := p.readField0(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 *ReadOnlySchedulerGetJobSummaryResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetJobSummaryResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getJobSummary_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *ReadOnlySchedulerGetJobSummaryResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *ReadOnlySchedulerGetJobSummaryResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetJobSummaryResult(%+v)", *p) -} - -// Attributes: -// - Query -type ReadOnlySchedulerGetTasksStatusArgs struct { - Query *TaskQuery `thrift:"query,1" json:"query"` -} - -func NewReadOnlySchedulerGetTasksStatusArgs() *ReadOnlySchedulerGetTasksStatusArgs { - return &ReadOnlySchedulerGetTasksStatusArgs{} -} - -var ReadOnlySchedulerGetTasksStatusArgs_Query_DEFAULT *TaskQuery - -func (p *ReadOnlySchedulerGetTasksStatusArgs) GetQuery() *TaskQuery { - if !p.IsSetQuery() { - return ReadOnlySchedulerGetTasksStatusArgs_Query_DEFAULT - } - return p.Query -} -func (p *ReadOnlySchedulerGetTasksStatusArgs) IsSetQuery() bool { - return p.Query != nil -} - -func (p *ReadOnlySchedulerGetTasksStatusArgs) 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 *ReadOnlySchedulerGetTasksStatusArgs) readField1(iprot thrift.TProtocol) error { - p.Query = &TaskQuery{} - if err := p.Query.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetTasksStatusArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getTasksStatus_args"); 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 *ReadOnlySchedulerGetTasksStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err) - } - if err := p.Query.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err) - } - return err -} - -func (p *ReadOnlySchedulerGetTasksStatusArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetTasksStatusArgs(%+v)", *p) -} - -// Attributes: -// - Success -type ReadOnlySchedulerGetTasksStatusResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewReadOnlySchedulerGetTasksStatusResult() *ReadOnlySchedulerGetTasksStatusResult { - return &ReadOnlySchedulerGetTasksStatusResult{} -} - -var ReadOnlySchedulerGetTasksStatusResult_Success_DEFAULT *Response - -func (p *ReadOnlySchedulerGetTasksStatusResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return ReadOnlySchedulerGetTasksStatusResult_Success_DEFAULT - } - return p.Success -} -func (p *ReadOnlySchedulerGetTasksStatusResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ReadOnlySchedulerGetTasksStatusResult) 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 0: - if err := p.readField0(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 *ReadOnlySchedulerGetTasksStatusResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetTasksStatusResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getTasksStatus_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *ReadOnlySchedulerGetTasksStatusResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *ReadOnlySchedulerGetTasksStatusResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetTasksStatusResult(%+v)", *p) -} - -// Attributes: -// - Query -type ReadOnlySchedulerGetTasksWithoutConfigsArgs struct { - Query *TaskQuery `thrift:"query,1" json:"query"` -} - -func NewReadOnlySchedulerGetTasksWithoutConfigsArgs() *ReadOnlySchedulerGetTasksWithoutConfigsArgs { - return &ReadOnlySchedulerGetTasksWithoutConfigsArgs{} -} - -var ReadOnlySchedulerGetTasksWithoutConfigsArgs_Query_DEFAULT *TaskQuery - -func (p *ReadOnlySchedulerGetTasksWithoutConfigsArgs) GetQuery() *TaskQuery { - if !p.IsSetQuery() { - return ReadOnlySchedulerGetTasksWithoutConfigsArgs_Query_DEFAULT - } - return p.Query -} -func (p *ReadOnlySchedulerGetTasksWithoutConfigsArgs) IsSetQuery() bool { - return p.Query != nil -} - -func (p *ReadOnlySchedulerGetTasksWithoutConfigsArgs) 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 *ReadOnlySchedulerGetTasksWithoutConfigsArgs) readField1(iprot thrift.TProtocol) error { - p.Query = &TaskQuery{} - if err := p.Query.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetTasksWithoutConfigsArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getTasksWithoutConfigs_args"); 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 *ReadOnlySchedulerGetTasksWithoutConfigsArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err) - } - if err := p.Query.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err) - } - return err -} - -func (p *ReadOnlySchedulerGetTasksWithoutConfigsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetTasksWithoutConfigsArgs(%+v)", *p) -} - -// Attributes: -// - Success -type ReadOnlySchedulerGetTasksWithoutConfigsResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewReadOnlySchedulerGetTasksWithoutConfigsResult() *ReadOnlySchedulerGetTasksWithoutConfigsResult { - return &ReadOnlySchedulerGetTasksWithoutConfigsResult{} -} - -var ReadOnlySchedulerGetTasksWithoutConfigsResult_Success_DEFAULT *Response - -func (p *ReadOnlySchedulerGetTasksWithoutConfigsResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return ReadOnlySchedulerGetTasksWithoutConfigsResult_Success_DEFAULT - } - return p.Success -} -func (p *ReadOnlySchedulerGetTasksWithoutConfigsResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ReadOnlySchedulerGetTasksWithoutConfigsResult) 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 0: - if err := p.readField0(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 *ReadOnlySchedulerGetTasksWithoutConfigsResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetTasksWithoutConfigsResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getTasksWithoutConfigs_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *ReadOnlySchedulerGetTasksWithoutConfigsResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *ReadOnlySchedulerGetTasksWithoutConfigsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetTasksWithoutConfigsResult(%+v)", *p) -} - -// Attributes: -// - Query -type ReadOnlySchedulerGetPendingReasonArgs struct { - Query *TaskQuery `thrift:"query,1" json:"query"` -} - -func NewReadOnlySchedulerGetPendingReasonArgs() *ReadOnlySchedulerGetPendingReasonArgs { - return &ReadOnlySchedulerGetPendingReasonArgs{} -} - -var ReadOnlySchedulerGetPendingReasonArgs_Query_DEFAULT *TaskQuery - -func (p *ReadOnlySchedulerGetPendingReasonArgs) GetQuery() *TaskQuery { - if !p.IsSetQuery() { - return ReadOnlySchedulerGetPendingReasonArgs_Query_DEFAULT - } - return p.Query -} -func (p *ReadOnlySchedulerGetPendingReasonArgs) IsSetQuery() bool { - return p.Query != nil -} - -func (p *ReadOnlySchedulerGetPendingReasonArgs) 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 *ReadOnlySchedulerGetPendingReasonArgs) readField1(iprot thrift.TProtocol) error { - p.Query = &TaskQuery{} - if err := p.Query.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetPendingReasonArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getPendingReason_args"); 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 *ReadOnlySchedulerGetPendingReasonArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:query: ", p), err) - } - if err := p.Query.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:query: ", p), err) - } - return err -} - -func (p *ReadOnlySchedulerGetPendingReasonArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetPendingReasonArgs(%+v)", *p) -} - -// Attributes: -// - Success -type ReadOnlySchedulerGetPendingReasonResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewReadOnlySchedulerGetPendingReasonResult() *ReadOnlySchedulerGetPendingReasonResult { - return &ReadOnlySchedulerGetPendingReasonResult{} -} - -var ReadOnlySchedulerGetPendingReasonResult_Success_DEFAULT *Response - -func (p *ReadOnlySchedulerGetPendingReasonResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return ReadOnlySchedulerGetPendingReasonResult_Success_DEFAULT - } - return p.Success -} -func (p *ReadOnlySchedulerGetPendingReasonResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ReadOnlySchedulerGetPendingReasonResult) 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 0: - if err := p.readField0(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 *ReadOnlySchedulerGetPendingReasonResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetPendingReasonResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getPendingReason_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *ReadOnlySchedulerGetPendingReasonResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *ReadOnlySchedulerGetPendingReasonResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetPendingReasonResult(%+v)", *p) -} - -// Attributes: -// - Job -type ReadOnlySchedulerGetConfigSummaryArgs struct { - Job *JobKey `thrift:"job,1" json:"job"` -} - -func NewReadOnlySchedulerGetConfigSummaryArgs() *ReadOnlySchedulerGetConfigSummaryArgs { - return &ReadOnlySchedulerGetConfigSummaryArgs{} -} - -var ReadOnlySchedulerGetConfigSummaryArgs_Job_DEFAULT *JobKey - -func (p *ReadOnlySchedulerGetConfigSummaryArgs) GetJob() *JobKey { - if !p.IsSetJob() { - return ReadOnlySchedulerGetConfigSummaryArgs_Job_DEFAULT - } - return p.Job -} -func (p *ReadOnlySchedulerGetConfigSummaryArgs) IsSetJob() bool { - return p.Job != nil -} - -func (p *ReadOnlySchedulerGetConfigSummaryArgs) 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 *ReadOnlySchedulerGetConfigSummaryArgs) 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 *ReadOnlySchedulerGetConfigSummaryArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getConfigSummary_args"); 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 *ReadOnlySchedulerGetConfigSummaryArgs) 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 *ReadOnlySchedulerGetConfigSummaryArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetConfigSummaryArgs(%+v)", *p) -} - -// Attributes: -// - Success -type ReadOnlySchedulerGetConfigSummaryResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewReadOnlySchedulerGetConfigSummaryResult() *ReadOnlySchedulerGetConfigSummaryResult { - return &ReadOnlySchedulerGetConfigSummaryResult{} -} - -var ReadOnlySchedulerGetConfigSummaryResult_Success_DEFAULT *Response - -func (p *ReadOnlySchedulerGetConfigSummaryResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return ReadOnlySchedulerGetConfigSummaryResult_Success_DEFAULT - } - return p.Success -} -func (p *ReadOnlySchedulerGetConfigSummaryResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ReadOnlySchedulerGetConfigSummaryResult) 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 0: - if err := p.readField0(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 *ReadOnlySchedulerGetConfigSummaryResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetConfigSummaryResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getConfigSummary_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *ReadOnlySchedulerGetConfigSummaryResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *ReadOnlySchedulerGetConfigSummaryResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetConfigSummaryResult(%+v)", *p) -} - -// Attributes: -// - OwnerRole -type ReadOnlySchedulerGetJobsArgs struct { - OwnerRole string `thrift:"ownerRole,1" json:"ownerRole"` -} - -func NewReadOnlySchedulerGetJobsArgs() *ReadOnlySchedulerGetJobsArgs { - return &ReadOnlySchedulerGetJobsArgs{} -} - -func (p *ReadOnlySchedulerGetJobsArgs) GetOwnerRole() string { - return p.OwnerRole -} -func (p *ReadOnlySchedulerGetJobsArgs) 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 *ReadOnlySchedulerGetJobsArgs) readField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.OwnerRole = v - } - return nil -} - -func (p *ReadOnlySchedulerGetJobsArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getJobs_args"); 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 *ReadOnlySchedulerGetJobsArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("ownerRole", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ownerRole: ", p), err) - } - if err := oprot.WriteString(string(p.OwnerRole)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.ownerRole (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ownerRole: ", p), err) - } - return err -} - -func (p *ReadOnlySchedulerGetJobsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetJobsArgs(%+v)", *p) -} - -// Attributes: -// - Success -type ReadOnlySchedulerGetJobsResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewReadOnlySchedulerGetJobsResult() *ReadOnlySchedulerGetJobsResult { - return &ReadOnlySchedulerGetJobsResult{} -} - -var ReadOnlySchedulerGetJobsResult_Success_DEFAULT *Response - -func (p *ReadOnlySchedulerGetJobsResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return ReadOnlySchedulerGetJobsResult_Success_DEFAULT - } - return p.Success -} -func (p *ReadOnlySchedulerGetJobsResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ReadOnlySchedulerGetJobsResult) 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 0: - if err := p.readField0(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 *ReadOnlySchedulerGetJobsResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetJobsResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getJobs_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *ReadOnlySchedulerGetJobsResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *ReadOnlySchedulerGetJobsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetJobsResult(%+v)", *p) -} - -// Attributes: -// - OwnerRole -type ReadOnlySchedulerGetQuotaArgs struct { - OwnerRole string `thrift:"ownerRole,1" json:"ownerRole"` -} - -func NewReadOnlySchedulerGetQuotaArgs() *ReadOnlySchedulerGetQuotaArgs { - return &ReadOnlySchedulerGetQuotaArgs{} -} - -func (p *ReadOnlySchedulerGetQuotaArgs) GetOwnerRole() string { - return p.OwnerRole -} -func (p *ReadOnlySchedulerGetQuotaArgs) 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 *ReadOnlySchedulerGetQuotaArgs) readField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.OwnerRole = v - } - return nil -} - -func (p *ReadOnlySchedulerGetQuotaArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getQuota_args"); 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 *ReadOnlySchedulerGetQuotaArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("ownerRole", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ownerRole: ", p), err) - } - if err := oprot.WriteString(string(p.OwnerRole)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.ownerRole (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ownerRole: ", p), err) - } - return err -} - -func (p *ReadOnlySchedulerGetQuotaArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetQuotaArgs(%+v)", *p) -} - -// Attributes: -// - Success -type ReadOnlySchedulerGetQuotaResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewReadOnlySchedulerGetQuotaResult() *ReadOnlySchedulerGetQuotaResult { - return &ReadOnlySchedulerGetQuotaResult{} -} - -var ReadOnlySchedulerGetQuotaResult_Success_DEFAULT *Response - -func (p *ReadOnlySchedulerGetQuotaResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return ReadOnlySchedulerGetQuotaResult_Success_DEFAULT - } - return p.Success -} -func (p *ReadOnlySchedulerGetQuotaResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ReadOnlySchedulerGetQuotaResult) 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 0: - if err := p.readField0(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 *ReadOnlySchedulerGetQuotaResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetQuotaResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getQuota_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *ReadOnlySchedulerGetQuotaResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *ReadOnlySchedulerGetQuotaResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetQuotaResult(%+v)", *p) -} - -// Attributes: -// - Description -type ReadOnlySchedulerPopulateJobConfigArgs struct { - Description *JobConfiguration `thrift:"description,1" json:"description"` -} - -func NewReadOnlySchedulerPopulateJobConfigArgs() *ReadOnlySchedulerPopulateJobConfigArgs { - return &ReadOnlySchedulerPopulateJobConfigArgs{} -} - -var ReadOnlySchedulerPopulateJobConfigArgs_Description_DEFAULT *JobConfiguration - -func (p *ReadOnlySchedulerPopulateJobConfigArgs) GetDescription() *JobConfiguration { - if !p.IsSetDescription() { - return ReadOnlySchedulerPopulateJobConfigArgs_Description_DEFAULT - } - return p.Description -} -func (p *ReadOnlySchedulerPopulateJobConfigArgs) IsSetDescription() bool { - return p.Description != nil -} - -func (p *ReadOnlySchedulerPopulateJobConfigArgs) 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 *ReadOnlySchedulerPopulateJobConfigArgs) readField1(iprot thrift.TProtocol) error { - p.Description = &JobConfiguration{} - if err := p.Description.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Description), err) - } - return nil -} - -func (p *ReadOnlySchedulerPopulateJobConfigArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("populateJobConfig_args"); 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 *ReadOnlySchedulerPopulateJobConfigArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("description", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:description: ", p), err) - } - if err := p.Description.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Description), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:description: ", p), err) - } - return err -} - -func (p *ReadOnlySchedulerPopulateJobConfigArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerPopulateJobConfigArgs(%+v)", *p) -} - -// Attributes: -// - Success -type ReadOnlySchedulerPopulateJobConfigResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewReadOnlySchedulerPopulateJobConfigResult() *ReadOnlySchedulerPopulateJobConfigResult { - return &ReadOnlySchedulerPopulateJobConfigResult{} -} - -var ReadOnlySchedulerPopulateJobConfigResult_Success_DEFAULT *Response - -func (p *ReadOnlySchedulerPopulateJobConfigResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return ReadOnlySchedulerPopulateJobConfigResult_Success_DEFAULT - } - return p.Success -} -func (p *ReadOnlySchedulerPopulateJobConfigResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ReadOnlySchedulerPopulateJobConfigResult) 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 0: - if err := p.readField0(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 *ReadOnlySchedulerPopulateJobConfigResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *ReadOnlySchedulerPopulateJobConfigResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("populateJobConfig_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *ReadOnlySchedulerPopulateJobConfigResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *ReadOnlySchedulerPopulateJobConfigResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerPopulateJobConfigResult(%+v)", *p) -} - -// Attributes: -// - JobUpdateQuery -type ReadOnlySchedulerGetJobUpdateSummariesArgs struct { - JobUpdateQuery *JobUpdateQuery `thrift:"jobUpdateQuery,1" json:"jobUpdateQuery"` -} - -func NewReadOnlySchedulerGetJobUpdateSummariesArgs() *ReadOnlySchedulerGetJobUpdateSummariesArgs { - return &ReadOnlySchedulerGetJobUpdateSummariesArgs{} -} - -var ReadOnlySchedulerGetJobUpdateSummariesArgs_JobUpdateQuery_DEFAULT *JobUpdateQuery - -func (p *ReadOnlySchedulerGetJobUpdateSummariesArgs) GetJobUpdateQuery() *JobUpdateQuery { - if !p.IsSetJobUpdateQuery() { - return ReadOnlySchedulerGetJobUpdateSummariesArgs_JobUpdateQuery_DEFAULT - } - return p.JobUpdateQuery -} -func (p *ReadOnlySchedulerGetJobUpdateSummariesArgs) IsSetJobUpdateQuery() bool { - return p.JobUpdateQuery != nil -} - -func (p *ReadOnlySchedulerGetJobUpdateSummariesArgs) 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 *ReadOnlySchedulerGetJobUpdateSummariesArgs) readField1(iprot thrift.TProtocol) error { - p.JobUpdateQuery = &JobUpdateQuery{} - if err := p.JobUpdateQuery.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JobUpdateQuery), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetJobUpdateSummariesArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getJobUpdateSummaries_args"); 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 *ReadOnlySchedulerGetJobUpdateSummariesArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("jobUpdateQuery", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:jobUpdateQuery: ", p), err) - } - if err := p.JobUpdateQuery.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JobUpdateQuery), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:jobUpdateQuery: ", p), err) - } - return err -} - -func (p *ReadOnlySchedulerGetJobUpdateSummariesArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetJobUpdateSummariesArgs(%+v)", *p) -} - -// Attributes: -// - Success -type ReadOnlySchedulerGetJobUpdateSummariesResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewReadOnlySchedulerGetJobUpdateSummariesResult() *ReadOnlySchedulerGetJobUpdateSummariesResult { - return &ReadOnlySchedulerGetJobUpdateSummariesResult{} -} - -var ReadOnlySchedulerGetJobUpdateSummariesResult_Success_DEFAULT *Response - -func (p *ReadOnlySchedulerGetJobUpdateSummariesResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return ReadOnlySchedulerGetJobUpdateSummariesResult_Success_DEFAULT - } - return p.Success -} -func (p *ReadOnlySchedulerGetJobUpdateSummariesResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ReadOnlySchedulerGetJobUpdateSummariesResult) 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 0: - if err := p.readField0(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 *ReadOnlySchedulerGetJobUpdateSummariesResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetJobUpdateSummariesResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getJobUpdateSummaries_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *ReadOnlySchedulerGetJobUpdateSummariesResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *ReadOnlySchedulerGetJobUpdateSummariesResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetJobUpdateSummariesResult(%+v)", *p) -} - -// Attributes: -// - Query -type ReadOnlySchedulerGetJobUpdateDetailsArgs struct { - // unused field # 1 - Query *JobUpdateQuery `thrift:"query,2" json:"query"` -} - -func NewReadOnlySchedulerGetJobUpdateDetailsArgs() *ReadOnlySchedulerGetJobUpdateDetailsArgs { - return &ReadOnlySchedulerGetJobUpdateDetailsArgs{} -} - -var ReadOnlySchedulerGetJobUpdateDetailsArgs_Query_DEFAULT *JobUpdateQuery - -func (p *ReadOnlySchedulerGetJobUpdateDetailsArgs) GetQuery() *JobUpdateQuery { - if !p.IsSetQuery() { - return ReadOnlySchedulerGetJobUpdateDetailsArgs_Query_DEFAULT - } - return p.Query -} -func (p *ReadOnlySchedulerGetJobUpdateDetailsArgs) IsSetQuery() bool { - return p.Query != nil -} - -func (p *ReadOnlySchedulerGetJobUpdateDetailsArgs) 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 *ReadOnlySchedulerGetJobUpdateDetailsArgs) readField2(iprot thrift.TProtocol) error { - p.Query = &JobUpdateQuery{} - if err := p.Query.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Query), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetJobUpdateDetailsArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getJobUpdateDetails_args"); 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 *ReadOnlySchedulerGetJobUpdateDetailsArgs) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("query", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:query: ", p), err) - } - if err := p.Query.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Query), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:query: ", p), err) - } - return err -} - -func (p *ReadOnlySchedulerGetJobUpdateDetailsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetJobUpdateDetailsArgs(%+v)", *p) -} - -// Attributes: -// - Success -type ReadOnlySchedulerGetJobUpdateDetailsResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewReadOnlySchedulerGetJobUpdateDetailsResult() *ReadOnlySchedulerGetJobUpdateDetailsResult { - return &ReadOnlySchedulerGetJobUpdateDetailsResult{} -} - -var ReadOnlySchedulerGetJobUpdateDetailsResult_Success_DEFAULT *Response - -func (p *ReadOnlySchedulerGetJobUpdateDetailsResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return ReadOnlySchedulerGetJobUpdateDetailsResult_Success_DEFAULT - } - return p.Success -} -func (p *ReadOnlySchedulerGetJobUpdateDetailsResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ReadOnlySchedulerGetJobUpdateDetailsResult) 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 0: - if err := p.readField0(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 *ReadOnlySchedulerGetJobUpdateDetailsResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetJobUpdateDetailsResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getJobUpdateDetails_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *ReadOnlySchedulerGetJobUpdateDetailsResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *ReadOnlySchedulerGetJobUpdateDetailsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetJobUpdateDetailsResult(%+v)", *p) -} - -// Attributes: -// - Request -type ReadOnlySchedulerGetJobUpdateDiffArgs struct { - Request *JobUpdateRequest `thrift:"request,1" json:"request"` -} - -func NewReadOnlySchedulerGetJobUpdateDiffArgs() *ReadOnlySchedulerGetJobUpdateDiffArgs { - return &ReadOnlySchedulerGetJobUpdateDiffArgs{} -} - -var ReadOnlySchedulerGetJobUpdateDiffArgs_Request_DEFAULT *JobUpdateRequest - -func (p *ReadOnlySchedulerGetJobUpdateDiffArgs) GetRequest() *JobUpdateRequest { - if !p.IsSetRequest() { - return ReadOnlySchedulerGetJobUpdateDiffArgs_Request_DEFAULT - } - return p.Request -} -func (p *ReadOnlySchedulerGetJobUpdateDiffArgs) IsSetRequest() bool { - return p.Request != nil -} - -func (p *ReadOnlySchedulerGetJobUpdateDiffArgs) 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 *ReadOnlySchedulerGetJobUpdateDiffArgs) readField1(iprot thrift.TProtocol) error { - p.Request = &JobUpdateRequest{} - if err := p.Request.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Request), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetJobUpdateDiffArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getJobUpdateDiff_args"); 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 *ReadOnlySchedulerGetJobUpdateDiffArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request: ", p), err) - } - if err := p.Request.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Request), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request: ", p), err) - } - return err -} - -func (p *ReadOnlySchedulerGetJobUpdateDiffArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetJobUpdateDiffArgs(%+v)", *p) -} - -// Attributes: -// - Success -type ReadOnlySchedulerGetJobUpdateDiffResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewReadOnlySchedulerGetJobUpdateDiffResult() *ReadOnlySchedulerGetJobUpdateDiffResult { - return &ReadOnlySchedulerGetJobUpdateDiffResult{} -} - -var ReadOnlySchedulerGetJobUpdateDiffResult_Success_DEFAULT *Response - -func (p *ReadOnlySchedulerGetJobUpdateDiffResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return ReadOnlySchedulerGetJobUpdateDiffResult_Success_DEFAULT - } - return p.Success -} -func (p *ReadOnlySchedulerGetJobUpdateDiffResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ReadOnlySchedulerGetJobUpdateDiffResult) 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 0: - if err := p.readField0(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 *ReadOnlySchedulerGetJobUpdateDiffResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetJobUpdateDiffResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getJobUpdateDiff_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *ReadOnlySchedulerGetJobUpdateDiffResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *ReadOnlySchedulerGetJobUpdateDiffResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetJobUpdateDiffResult(%+v)", *p) -} - -type ReadOnlySchedulerGetTierConfigsArgs struct { -} - -func NewReadOnlySchedulerGetTierConfigsArgs() *ReadOnlySchedulerGetTierConfigsArgs { - return &ReadOnlySchedulerGetTierConfigsArgs{} -} - -func (p *ReadOnlySchedulerGetTierConfigsArgs) 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 - } - 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 *ReadOnlySchedulerGetTierConfigsArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getTierConfigs_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), 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 *ReadOnlySchedulerGetTierConfigsArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetTierConfigsArgs(%+v)", *p) -} - -// Attributes: -// - Success -type ReadOnlySchedulerGetTierConfigsResult struct { - Success *Response `thrift:"success,0" json:"success,omitempty"` -} - -func NewReadOnlySchedulerGetTierConfigsResult() *ReadOnlySchedulerGetTierConfigsResult { - return &ReadOnlySchedulerGetTierConfigsResult{} -} - -var ReadOnlySchedulerGetTierConfigsResult_Success_DEFAULT *Response - -func (p *ReadOnlySchedulerGetTierConfigsResult) GetSuccess() *Response { - if !p.IsSetSuccess() { - return ReadOnlySchedulerGetTierConfigsResult_Success_DEFAULT - } - return p.Success -} -func (p *ReadOnlySchedulerGetTierConfigsResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *ReadOnlySchedulerGetTierConfigsResult) 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 0: - if err := p.readField0(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 *ReadOnlySchedulerGetTierConfigsResult) readField0(iprot thrift.TProtocol) error { - p.Success = &Response{} - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *ReadOnlySchedulerGetTierConfigsResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("getTierConfigs_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) - } - if err := p.writeField0(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 *ReadOnlySchedulerGetTierConfigsResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) - } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) - } - } - return err -} - -func (p *ReadOnlySchedulerGetTierConfigsResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("ReadOnlySchedulerGetTierConfigsResult(%+v)", *p) -} diff --git a/gen-go/apache/aurora/ttypes.go b/gen-go/apache/aurora/ttypes.go deleted file mode 100644 index 1f1d45c..0000000 --- a/gen-go/apache/aurora/ttypes.go +++ /dev/null @@ -1,16424 +0,0 @@ -// 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 "" -} - -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 "" -} - -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 "" -} - -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 "" -} - -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 - ScheduleStatus_PARTITIONED ScheduleStatus = 18 -) - -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" - case ScheduleStatus_PARTITIONED: - return "PARTITIONED" - } - return "" -} - -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 - case "PARTITIONED": - return ScheduleStatus_PARTITIONED, 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 "" -} - -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 "" -} - -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 "" -} - -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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - return fmt.Sprintf("Resource(%+v)", *p) -} - -// Attributes: -// - Reschedule -// - DelaySecs -type PartitionPolicy struct { - Reschedule bool `thrift:"reschedule,1" json:"reschedule"` - DelaySecs *int64 `thrift:"delaySecs,2" json:"delaySecs,omitempty"` -} - -func NewPartitionPolicy() *PartitionPolicy { - return &PartitionPolicy{} -} - -func (p *PartitionPolicy) GetReschedule() bool { - return p.Reschedule -} - -var PartitionPolicy_DelaySecs_DEFAULT int64 - -func (p *PartitionPolicy) GetDelaySecs() int64 { - if !p.IsSetDelaySecs() { - return PartitionPolicy_DelaySecs_DEFAULT - } - return *p.DelaySecs -} -func (p *PartitionPolicy) IsSetDelaySecs() bool { - return p.DelaySecs != nil -} - -func (p *PartitionPolicy) 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 *PartitionPolicy) readField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Reschedule = v - } - return nil -} - -func (p *PartitionPolicy) readField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.DelaySecs = &v - } - return nil -} - -func (p *PartitionPolicy) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("PartitionPolicy"); 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 *PartitionPolicy) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("reschedule", thrift.BOOL, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:reschedule: ", p), err) - } - if err := oprot.WriteBool(bool(p.Reschedule)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.reschedule (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:reschedule: ", p), err) - } - return err -} - -func (p *PartitionPolicy) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetDelaySecs() { - if err := oprot.WriteFieldBegin("delaySecs", thrift.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delaySecs: ", p), err) - } - if err := oprot.WriteI64(int64(*p.DelaySecs)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.delaySecs (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delaySecs: ", p), err) - } - } - return err -} - -func (p *PartitionPolicy) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PartitionPolicy(%+v)", *p) -} - -// SLA requirements expressed as the percentage of instances to be RUNNING every durationSecs -// -// Attributes: -// - Percentage -// - DurationSecs: Minimum time duration a task needs to be `RUNNING` to be treated as active -type PercentageSlaPolicy struct { - Percentage float64 `thrift:"percentage,1" json:"percentage"` - DurationSecs int64 `thrift:"durationSecs,2" json:"durationSecs"` -} - -func NewPercentageSlaPolicy() *PercentageSlaPolicy { - return &PercentageSlaPolicy{} -} - -func (p *PercentageSlaPolicy) GetPercentage() float64 { - return p.Percentage -} - -func (p *PercentageSlaPolicy) GetDurationSecs() int64 { - return p.DurationSecs -} -func (p *PercentageSlaPolicy) 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 *PercentageSlaPolicy) readField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Percentage = v - } - return nil -} - -func (p *PercentageSlaPolicy) readField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.DurationSecs = v - } - return nil -} - -func (p *PercentageSlaPolicy) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("PercentageSlaPolicy"); 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 *PercentageSlaPolicy) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("percentage", thrift.DOUBLE, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:percentage: ", p), err) - } - if err := oprot.WriteDouble(float64(p.Percentage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.percentage (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:percentage: ", p), err) - } - return err -} - -func (p *PercentageSlaPolicy) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("durationSecs", thrift.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:durationSecs: ", p), err) - } - if err := oprot.WriteI64(int64(p.DurationSecs)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.durationSecs (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:durationSecs: ", p), err) - } - return err -} - -func (p *PercentageSlaPolicy) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("PercentageSlaPolicy(%+v)", *p) -} - -// SLA requirements expressed as the number of instances to be RUNNING every durationSecs -// -// Attributes: -// - Count: The number of active instances required every `durationSecs` -// - DurationSecs: Minimum time duration a task needs to be `RUNNING` to be treated as active -type CountSlaPolicy struct { - Count int64 `thrift:"count,1" json:"count"` - DurationSecs int64 `thrift:"durationSecs,2" json:"durationSecs"` -} - -func NewCountSlaPolicy() *CountSlaPolicy { - return &CountSlaPolicy{} -} - -func (p *CountSlaPolicy) GetCount() int64 { - return p.Count -} - -func (p *CountSlaPolicy) GetDurationSecs() int64 { - return p.DurationSecs -} -func (p *CountSlaPolicy) 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 *CountSlaPolicy) readField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Count = v - } - return nil -} - -func (p *CountSlaPolicy) readField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.DurationSecs = v - } - return nil -} - -func (p *CountSlaPolicy) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("CountSlaPolicy"); 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 *CountSlaPolicy) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("count", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:count: ", p), err) - } - if err := oprot.WriteI64(int64(p.Count)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.count (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:count: ", p), err) - } - return err -} - -func (p *CountSlaPolicy) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("durationSecs", thrift.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:durationSecs: ", p), err) - } - if err := oprot.WriteI64(int64(p.DurationSecs)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.durationSecs (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:durationSecs: ", p), err) - } - return err -} - -func (p *CountSlaPolicy) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("CountSlaPolicy(%+v)", *p) -} - -// SLA requirements to be delegated to an external coordinator -// -// Attributes: -// - CoordinatorUrl: URL for the coordinator service that needs to be contacted for SLA checks -// - StatusKey: Field in the Coordinator response json indicating if the action is allowed or not -type CoordinatorSlaPolicy struct { - CoordinatorUrl string `thrift:"coordinatorUrl,1" json:"coordinatorUrl"` - StatusKey string `thrift:"statusKey,2" json:"statusKey"` -} - -func NewCoordinatorSlaPolicy() *CoordinatorSlaPolicy { - return &CoordinatorSlaPolicy{} -} - -func (p *CoordinatorSlaPolicy) GetCoordinatorUrl() string { - return p.CoordinatorUrl -} - -func (p *CoordinatorSlaPolicy) GetStatusKey() string { - return p.StatusKey -} -func (p *CoordinatorSlaPolicy) 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 *CoordinatorSlaPolicy) readField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.CoordinatorUrl = v - } - return nil -} - -func (p *CoordinatorSlaPolicy) readField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.StatusKey = v - } - return nil -} - -func (p *CoordinatorSlaPolicy) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("CoordinatorSlaPolicy"); 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 *CoordinatorSlaPolicy) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("coordinatorUrl", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:coordinatorUrl: ", p), err) - } - if err := oprot.WriteString(string(p.CoordinatorUrl)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.coordinatorUrl (1) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:coordinatorUrl: ", p), err) - } - return err -} - -func (p *CoordinatorSlaPolicy) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("statusKey", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statusKey: ", p), err) - } - if err := oprot.WriteString(string(p.StatusKey)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.statusKey (2) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statusKey: ", p), err) - } - return err -} - -func (p *CoordinatorSlaPolicy) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("CoordinatorSlaPolicy(%+v)", *p) -} - -// SLA requirements expressed in one of the many types -// -// Attributes: -// - PercentageSlaPolicy -// - CountSlaPolicy -// - CoordinatorSlaPolicy -type SlaPolicy struct { - PercentageSlaPolicy *PercentageSlaPolicy `thrift:"percentageSlaPolicy,1" json:"percentageSlaPolicy,omitempty"` - CountSlaPolicy *CountSlaPolicy `thrift:"countSlaPolicy,2" json:"countSlaPolicy,omitempty"` - CoordinatorSlaPolicy *CoordinatorSlaPolicy `thrift:"coordinatorSlaPolicy,3" json:"coordinatorSlaPolicy,omitempty"` -} - -func NewSlaPolicy() *SlaPolicy { - return &SlaPolicy{} -} - -var SlaPolicy_PercentageSlaPolicy_DEFAULT *PercentageSlaPolicy - -func (p *SlaPolicy) GetPercentageSlaPolicy() *PercentageSlaPolicy { - if !p.IsSetPercentageSlaPolicy() { - return SlaPolicy_PercentageSlaPolicy_DEFAULT - } - return p.PercentageSlaPolicy -} - -var SlaPolicy_CountSlaPolicy_DEFAULT *CountSlaPolicy - -func (p *SlaPolicy) GetCountSlaPolicy() *CountSlaPolicy { - if !p.IsSetCountSlaPolicy() { - return SlaPolicy_CountSlaPolicy_DEFAULT - } - return p.CountSlaPolicy -} - -var SlaPolicy_CoordinatorSlaPolicy_DEFAULT *CoordinatorSlaPolicy - -func (p *SlaPolicy) GetCoordinatorSlaPolicy() *CoordinatorSlaPolicy { - if !p.IsSetCoordinatorSlaPolicy() { - return SlaPolicy_CoordinatorSlaPolicy_DEFAULT - } - return p.CoordinatorSlaPolicy -} -func (p *SlaPolicy) CountSetFieldsSlaPolicy() int { - count := 0 - if p.IsSetPercentageSlaPolicy() { - count++ - } - if p.IsSetCountSlaPolicy() { - count++ - } - if p.IsSetCoordinatorSlaPolicy() { - count++ - } - return count - -} - -func (p *SlaPolicy) IsSetPercentageSlaPolicy() bool { - return p.PercentageSlaPolicy != nil -} - -func (p *SlaPolicy) IsSetCountSlaPolicy() bool { - return p.CountSlaPolicy != nil -} - -func (p *SlaPolicy) IsSetCoordinatorSlaPolicy() bool { - return p.CoordinatorSlaPolicy != nil -} - -func (p *SlaPolicy) 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 *SlaPolicy) readField1(iprot thrift.TProtocol) error { - p.PercentageSlaPolicy = &PercentageSlaPolicy{} - if err := p.PercentageSlaPolicy.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PercentageSlaPolicy), err) - } - return nil -} - -func (p *SlaPolicy) readField2(iprot thrift.TProtocol) error { - p.CountSlaPolicy = &CountSlaPolicy{} - if err := p.CountSlaPolicy.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CountSlaPolicy), err) - } - return nil -} - -func (p *SlaPolicy) readField3(iprot thrift.TProtocol) error { - p.CoordinatorSlaPolicy = &CoordinatorSlaPolicy{} - if err := p.CoordinatorSlaPolicy.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CoordinatorSlaPolicy), err) - } - return nil -} - -func (p *SlaPolicy) Write(oprot thrift.TProtocol) error { - if c := p.CountSetFieldsSlaPolicy(); c != 1 { - return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c) - } - if err := oprot.WriteStructBegin("SlaPolicy"); 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 *SlaPolicy) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetPercentageSlaPolicy() { - if err := oprot.WriteFieldBegin("percentageSlaPolicy", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:percentageSlaPolicy: ", p), err) - } - if err := p.PercentageSlaPolicy.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PercentageSlaPolicy), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:percentageSlaPolicy: ", p), err) - } - } - return err -} - -func (p *SlaPolicy) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetCountSlaPolicy() { - if err := oprot.WriteFieldBegin("countSlaPolicy", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:countSlaPolicy: ", p), err) - } - if err := p.CountSlaPolicy.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CountSlaPolicy), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:countSlaPolicy: ", p), err) - } - } - return err -} - -func (p *SlaPolicy) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetCoordinatorSlaPolicy() { - if err := oprot.WriteFieldBegin("coordinatorSlaPolicy", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:coordinatorSlaPolicy: ", p), err) - } - if err := p.CoordinatorSlaPolicy.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CoordinatorSlaPolicy), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:coordinatorSlaPolicy: ", p), err) - } - } - return err -} - -func (p *SlaPolicy) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("SlaPolicy(%+v)", *p) -} - -// Description of the tasks contained within a job. -// -// Attributes: -// - Job: Job task belongs to. -// - Owner: contains the role component of JobKey -// - IsService -// - 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 -// - 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. -// - PartitionPolicy: Policy for how to deal with task partitions -// - SlaPolicy: SLA requirements to be met during maintenance -// - Container: the container the task should use to execute -type TaskConfig struct { - // unused fields # 1 to 6 - IsService bool `thrift:"isService,7" json:"isService"` - // unused fields # 8 to 10 - 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"` - // unused field # 21 - 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"` - PartitionPolicy *PartitionPolicy `thrift:"partitionPolicy,34" json:"partitionPolicy,omitempty"` - SlaPolicy *SlaPolicy `thrift:"slaPolicy,35" json:"slaPolicy,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) 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 -} - -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_PartitionPolicy_DEFAULT *PartitionPolicy - -func (p *TaskConfig) GetPartitionPolicy() *PartitionPolicy { - if !p.IsSetPartitionPolicy() { - return TaskConfig_PartitionPolicy_DEFAULT - } - return p.PartitionPolicy -} - -var TaskConfig_SlaPolicy_DEFAULT *SlaPolicy - -func (p *TaskConfig) GetSlaPolicy() *SlaPolicy { - if !p.IsSetSlaPolicy() { - return TaskConfig_SlaPolicy_DEFAULT - } - return p.SlaPolicy -} - -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) IsSetPartitionPolicy() bool { - return p.PartitionPolicy != nil -} - -func (p *TaskConfig) IsSetSlaPolicy() bool { - return p.SlaPolicy != 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 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 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 34: - if err := p.readField34(iprot); err != nil { - return err - } - case 35: - if err := p.readField35(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) 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) 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++ { - _elem7 := &MesosFetcherURI{} - if err := _elem7.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) - } - p.MesosFetcherUris[_elem7] = 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 _key8 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key8 = v - } - var _val9 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _val9 = v - } - p.TaskLinks[_key8] = _val9 - } - 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++ { - _elem10 := &Metadata{} - if err := _elem10.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) - } - p.Metadata[_elem10] = true - } - if err := iprot.ReadSetEnd(); err != nil { - return thrift.PrependError("error reading set end: ", err) - } - return nil -} - -func (p *TaskConfig) readField34(iprot thrift.TProtocol) error { - p.PartitionPolicy = &PartitionPolicy{} - if err := p.PartitionPolicy.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PartitionPolicy), err) - } - return nil -} - -func (p *TaskConfig) readField35(iprot thrift.TProtocol) error { - p.SlaPolicy = &SlaPolicy{} - if err := p.SlaPolicy.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SlaPolicy), 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.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.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 := p.writeField34(oprot); err != nil { - return err - } - if err := p.writeField35(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) 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) 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) writeField34(oprot thrift.TProtocol) (err error) { - if p.IsSetPartitionPolicy() { - if err := oprot.WriteFieldBegin("partitionPolicy", thrift.STRUCT, 34); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 34:partitionPolicy: ", p), err) - } - if err := p.PartitionPolicy.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PartitionPolicy), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 34:partitionPolicy: ", p), err) - } - } - return err -} - -func (p *TaskConfig) writeField35(oprot thrift.TProtocol) (err error) { - if p.IsSetSlaPolicy() { - if err := oprot.WriteFieldBegin("slaPolicy", thrift.STRUCT, 35); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 35:slaPolicy: ", p), err) - } - if err := p.SlaPolicy.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SlaPolicy), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 35:slaPolicy: ", p), err) - } - } - return err -} - -func (p *TaskConfig) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TaskConfig(%+v)", *p) -} - -// Attributes: -// - Resources: Aggregated resource values. -type ResourceAggregate struct { - // unused fields # 1 to 3 - Resources map[*Resource]bool `thrift:"resources,4" json:"resources"` -} - -func NewResourceAggregate() *ResourceAggregate { - return &ResourceAggregate{} -} - -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 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) 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++ { - _elem11 := &Resource{} - if err := _elem11.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) - } - p.Resources[_elem11] = 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.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) 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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++ { - _elem12 := &Range{} - if err := _elem12.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) - } - p.Instances[_elem12] = 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 "" - } - 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++ { - _elem13 := &ConfigGroup{} - if err := _elem13.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) - } - p.Groups[_elem13] = 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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 _key14 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key14 = v - } - var _val15 int32 - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _val15 = v - } - p.AssignedPorts[_key14] = _val15 - } - 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 "" - } - 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. -// - TimesPartitioned: The number of partitions this task has accumulated over its lifetime. -// - 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"` - TimesPartitioned int32 `thrift:"timesPartitioned,6" json:"timesPartitioned"` -} - -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) GetTimesPartitioned() int32 { - return p.TimesPartitioned -} - -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 6: - if err := p.readField6(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) readField6(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 6: ", err) - } else { - p.TimesPartitioned = 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++ { - _elem16 := &TaskEvent{} - if err := _elem16.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem16), err) - } - p.TaskEvents = append(p.TaskEvents, _elem16) - } - 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 := 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 *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) writeField6(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("timesPartitioned", thrift.I32, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:timesPartitioned: ", p), err) - } - if err := oprot.WriteI32(int32(p.TimesPartitioned)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.timesPartitioned (6) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:timesPartitioned: ", p), err) - } - return err -} - -func (p *ScheduledTask) String() string { - if p == nil { - return "" - } - 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++ { - _elem17 := &ScheduledTask{} - if err := _elem17.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) - } - p.Tasks = append(p.Tasks, _elem17) - } - 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 "" - } - 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++ { - _elem18 := &JobConfiguration{} - if err := _elem18.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) - } - p.Configs[_elem18] = 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 "" - } - 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 _elem19 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem19 = v - } - p.TaskIds[_elem19] = 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 _elem20 ScheduleStatus - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := ScheduleStatus(v) - _elem20 = temp - } - p.Statuses[_elem20] = 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 _elem21 int32 - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem21 = v - } - p.InstanceIds[_elem21] = 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 _elem22 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem22 = v - } - p.SlaveHosts[_elem22] = 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++ { - _elem23 := &JobKey{} - if err := _elem23.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) - } - p.JobKeys[_elem23] = 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 "" - } - 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 "" - } - 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 "" - } - 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 _elem24 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem24 = v - } - p.HostNames[_elem24] = 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 "" - } - 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 "" - } - 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 "" - } - 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. -// - SlaAware: If true, updates will obey the SLA requirements of the tasks being updated. If the SLA policy -// differs between the old and new task configurations, updates will use the newest configuration. -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"` - SlaAware *bool `thrift:"slaAware,10" json:"slaAware,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 -} - -var JobUpdateSettings_SlaAware_DEFAULT bool - -func (p *JobUpdateSettings) GetSlaAware() bool { - if !p.IsSetSlaAware() { - return JobUpdateSettings_SlaAware_DEFAULT - } - return *p.SlaAware -} -func (p *JobUpdateSettings) IsSetBlockIfNoPulsesAfterMs() bool { - return p.BlockIfNoPulsesAfterMs != nil -} - -func (p *JobUpdateSettings) IsSetSlaAware() bool { - return p.SlaAware != 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 - } - case 10: - if err := p.readField10(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++ { - _elem25 := &Range{} - if err := _elem25.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) - } - p.UpdateOnlyTheseInstances[_elem25] = 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) readField10(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { - return thrift.PrependError("error reading field 10: ", err) - } else { - p.SlaAware = &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 := p.writeField10(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) writeField10(oprot thrift.TProtocol) (err error) { - if p.IsSetSlaAware() { - if err := oprot.WriteFieldBegin("slaAware", thrift.BOOL, 10); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:slaAware: ", p), err) - } - if err := oprot.WriteBool(bool(*p.SlaAware)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.slaAware (10) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 10:slaAware: ", p), err) - } - } - return err -} - -func (p *JobUpdateSettings) String() string { - if p == nil { - return "" - } - 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 "" - } - 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. -// - Message: Optional message explaining the instance update event. -type JobInstanceUpdateEvent struct { - InstanceId int32 `thrift:"instanceId,1" json:"instanceId"` - TimestampMs int64 `thrift:"timestampMs,2" json:"timestampMs"` - Action JobUpdateAction `thrift:"action,3" json:"action"` - Message *string `thrift:"message,4" json:"message,omitempty"` -} - -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 -} - -var JobInstanceUpdateEvent_Message_DEFAULT string - -func (p *JobInstanceUpdateEvent) GetMessage() string { - if !p.IsSetMessage() { - return JobInstanceUpdateEvent_Message_DEFAULT - } - return *p.Message -} -func (p *JobInstanceUpdateEvent) IsSetMessage() bool { - return p.Message != nil -} - -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 - } - 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 *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) 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 *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 := 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 *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) 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 *JobInstanceUpdateEvent) String() string { - if p == nil { - return "" - } - 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++ { - _elem26 := &Range{} - if err := _elem26.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) - } - p.Instances[_elem26] = 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 "" - } - 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 "" - } - 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++ { - _elem27 := &Metadata{} - if err := _elem27.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) - } - p.Metadata[_elem27] = 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 "" - } - 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++ { - _elem28 := &InstanceTaskConfig{} - if err := _elem28.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem28), err) - } - p.InitialState[_elem28] = 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 "" - } - 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 "" - } - 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++ { - _elem29 := &JobUpdateEvent{} - if err := _elem29.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) - } - p.UpdateEvents = append(p.UpdateEvents, _elem29) - } - 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++ { - _elem30 := &JobInstanceUpdateEvent{} - if err := _elem30.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) - } - p.InstanceEvents = append(p.InstanceEvents, _elem30) - } - 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 "" - } - 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++ { - _elem31 := &Metadata{} - if err := _elem31.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem31), err) - } - p.Metadata[_elem31] = 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 "" - } - 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 _elem32 JobUpdateStatus - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := JobUpdateStatus(v) - _elem32 = temp - } - p.UpdateStatuses[_elem32] = 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 "" - } - return fmt.Sprintf("JobUpdateQuery(%+v)", *p) -} - -// Attributes: -// - Host -// - DefaultSlaPolicy -// - TimeoutSecs -// - CreatedTimestampMs -type HostMaintenanceRequest struct { - Host string `thrift:"host,1" json:"host"` - DefaultSlaPolicy *SlaPolicy `thrift:"defaultSlaPolicy,2" json:"defaultSlaPolicy"` - TimeoutSecs int64 `thrift:"timeoutSecs,3" json:"timeoutSecs"` - CreatedTimestampMs int64 `thrift:"createdTimestampMs,4" json:"createdTimestampMs"` -} - -func NewHostMaintenanceRequest() *HostMaintenanceRequest { - return &HostMaintenanceRequest{} -} - -func (p *HostMaintenanceRequest) GetHost() string { - return p.Host -} - -var HostMaintenanceRequest_DefaultSlaPolicy_DEFAULT *SlaPolicy - -func (p *HostMaintenanceRequest) GetDefaultSlaPolicy() *SlaPolicy { - if !p.IsSetDefaultSlaPolicy() { - return HostMaintenanceRequest_DefaultSlaPolicy_DEFAULT - } - return p.DefaultSlaPolicy -} - -func (p *HostMaintenanceRequest) GetTimeoutSecs() int64 { - return p.TimeoutSecs -} - -func (p *HostMaintenanceRequest) GetCreatedTimestampMs() int64 { - return p.CreatedTimestampMs -} -func (p *HostMaintenanceRequest) IsSetDefaultSlaPolicy() bool { - return p.DefaultSlaPolicy != nil -} - -func (p *HostMaintenanceRequest) 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 *HostMaintenanceRequest) 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 *HostMaintenanceRequest) readField2(iprot thrift.TProtocol) error { - p.DefaultSlaPolicy = &SlaPolicy{} - if err := p.DefaultSlaPolicy.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DefaultSlaPolicy), err) - } - return nil -} - -func (p *HostMaintenanceRequest) readField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.TimeoutSecs = v - } - return nil -} - -func (p *HostMaintenanceRequest) readField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.CreatedTimestampMs = v - } - return nil -} - -func (p *HostMaintenanceRequest) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("HostMaintenanceRequest"); 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 *HostMaintenanceRequest) 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 *HostMaintenanceRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("defaultSlaPolicy", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:defaultSlaPolicy: ", p), err) - } - if err := p.DefaultSlaPolicy.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DefaultSlaPolicy), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:defaultSlaPolicy: ", p), err) - } - return err -} - -func (p *HostMaintenanceRequest) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("timeoutSecs", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:timeoutSecs: ", p), err) - } - if err := oprot.WriteI64(int64(p.TimeoutSecs)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.timeoutSecs (3) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:timeoutSecs: ", p), err) - } - return err -} - -func (p *HostMaintenanceRequest) writeField4(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("createdTimestampMs", thrift.I64, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:createdTimestampMs: ", p), err) - } - if err := oprot.WriteI64(int64(p.CreatedTimestampMs)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.createdTimestampMs (4) field write error: ", p), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:createdTimestampMs: ", p), err) - } - return err -} - -func (p *HostMaintenanceRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("HostMaintenanceRequest(%+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 _elem33 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem33 = v - } - p.Backups[_elem33] = 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 "" - } - 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++ { - _elem34 := &HostStatus{} - if err := _elem34.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem34), err) - } - p.Statuses[_elem34] = 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 "" - } - 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++ { - _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 *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 "" - } - 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++ { - _elem36 := &ScheduledTask{} - if err := _elem36.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem36), err) - } - p.Tasks[_elem36] = 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 "" - } - 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++ { - _elem37 := &HostStatus{} - if err := _elem37.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem37), err) - } - p.Statuses[_elem37] = 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 "" - } - 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++ { - _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 *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 "" - } - 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++ { - _elem39 := &RoleSummary{} - if err := _elem39.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem39), err) - } - p.Summaries[_elem39] = 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 "" - } - 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++ { - _elem40 := &JobSummary{} - 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 *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 "" - } - 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 "" - } - 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++ { - _elem41 := &PendingReason{} - if err := _elem41.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem41), err) - } - p.Reasons[_elem41] = 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 "" - } - 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 "" - } - 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++ { - _elem42 := &JobUpdateSummary{} - if err := _elem42.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem42), err) - } - p.UpdateSummaries = append(p.UpdateSummaries, _elem42) - } - 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 "" - } - 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++ { - _elem43 := &JobUpdateDetails{} - if err := _elem43.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem43), err) - } - p.DetailsList = append(p.DetailsList, _elem43) - } - 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 "" - } - 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 "" - } - 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++ { - _elem44 := &ConfigGroup{} - if err := _elem44.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem44), err) - } - p.Add[_elem44] = 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++ { - _elem45 := &ConfigGroup{} - if err := _elem45.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem45), err) - } - p.Remove[_elem45] = 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++ { - _elem46 := &ConfigGroup{} - if err := _elem46.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err) - } - p.Update[_elem46] = 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++ { - _elem47 := &ConfigGroup{} - if err := _elem47.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem47), err) - } - p.Unchanged[_elem47] = 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 "" - } - 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 _key48 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key48 = v - } - var _val49 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _val49 = v - } - p.Settings[_key48] = _val49 - } - 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 "" - } - 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++ { - _elem50 := &TierConfig{} - if err := _elem50.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem50), err) - } - p.Tiers[_elem50] = 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 "" - } - 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 "" - } - 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 "" - } - 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 "" - } - 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++ { - _elem51 := &ResponseDetail{} - if err := _elem51.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err) - } - p.Details = append(p.Details, _elem51) - } - 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 "" - } - 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 "" - } - return fmt.Sprintf("ExplicitReconciliationSettings(%+v)", *p) -}