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

package admin

import (
	"bytes"
	"context"
	"fmt"
	"github.com/apache/incubator-pegasus/go-client/idl/base"
	"github.com/apache/incubator-pegasus/go-client/idl/replication"
	"github.com/apache/thrift/lib/go/thrift"
	"reflect"
)

// (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

var _ = base.GoUnusedProtection__
var _ = replication.GoUnusedProtection__

// Attributes:
//  - PolicyName
//  - BackupProviderType
type PolicyInfo struct {
	PolicyName         string `thrift:"policy_name,1" db:"policy_name" json:"policy_name"`
	BackupProviderType string `thrift:"backup_provider_type,2" db:"backup_provider_type" json:"backup_provider_type"`
}

func NewPolicyInfo() *PolicyInfo {
	return &PolicyInfo{}
}

func (p *PolicyInfo) GetPolicyName() string {
	return p.PolicyName
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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 *PolicyInfo) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.PolicyName = v
	}
	return nil
}

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

func (p *PolicyInfo) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("policy_info"); 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 *PolicyInfo) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("policy_name", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:policy_name: ", p), err)
	}
	if err := oprot.WriteString(string(p.PolicyName)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.policy_name (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:policy_name: ", p), err)
	}
	return err
}

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

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

// Attributes:
//  - ClusterName
//  - PolicyName
//  - TimeStamp
//  - AppName
//  - AppID
//  - NewAppName_
//  - BackupProviderName
//  - SkipBadPartition
//  - RestorePath
type ConfigurationRestoreRequest struct {
	ClusterName        string  `thrift:"cluster_name,1" db:"cluster_name" json:"cluster_name"`
	PolicyName         string  `thrift:"policy_name,2" db:"policy_name" json:"policy_name"`
	TimeStamp          int64   `thrift:"time_stamp,3" db:"time_stamp" json:"time_stamp"`
	AppName            string  `thrift:"app_name,4" db:"app_name" json:"app_name"`
	AppID              int32   `thrift:"app_id,5" db:"app_id" json:"app_id"`
	NewAppName_        string  `thrift:"new_app_name,6" db:"new_app_name" json:"new_app_name"`
	BackupProviderName string  `thrift:"backup_provider_name,7" db:"backup_provider_name" json:"backup_provider_name"`
	SkipBadPartition   bool    `thrift:"skip_bad_partition,8" db:"skip_bad_partition" json:"skip_bad_partition"`
	RestorePath        *string `thrift:"restore_path,9" db:"restore_path" json:"restore_path,omitempty"`
}

func NewConfigurationRestoreRequest() *ConfigurationRestoreRequest {
	return &ConfigurationRestoreRequest{}
}

func (p *ConfigurationRestoreRequest) GetClusterName() string {
	return p.ClusterName
}

func (p *ConfigurationRestoreRequest) GetPolicyName() string {
	return p.PolicyName
}

func (p *ConfigurationRestoreRequest) GetTimeStamp() int64 {
	return p.TimeStamp
}

func (p *ConfigurationRestoreRequest) GetAppName() string {
	return p.AppName
}

func (p *ConfigurationRestoreRequest) GetAppID() int32 {
	return p.AppID
}

func (p *ConfigurationRestoreRequest) GetNewAppName_() string {
	return p.NewAppName_
}

func (p *ConfigurationRestoreRequest) GetBackupProviderName() string {
	return p.BackupProviderName
}

func (p *ConfigurationRestoreRequest) GetSkipBadPartition() bool {
	return p.SkipBadPartition
}

var ConfigurationRestoreRequest_RestorePath_DEFAULT string

func (p *ConfigurationRestoreRequest) GetRestorePath() string {
	if !p.IsSetRestorePath() {
		return ConfigurationRestoreRequest_RestorePath_DEFAULT
	}
	return *p.RestorePath
}
func (p *ConfigurationRestoreRequest) IsSetRestorePath() bool {
	return p.RestorePath != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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.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.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.STRING {
				if err := p.ReadField6(iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(fieldTypeId); err != nil {
					return err
				}
			}
		case 7:
			if fieldTypeId == thrift.STRING {
				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.STRING {
				if err := p.ReadField9(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 *ConfigurationRestoreRequest) 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 *ConfigurationRestoreRequest) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 2: ", err)
	} else {
		p.PolicyName = v
	}
	return nil
}

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

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

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

func (p *ConfigurationRestoreRequest) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.NewAppName_ = v
	}
	return nil
}

func (p *ConfigurationRestoreRequest) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 7: ", err)
	} else {
		p.BackupProviderName = v
	}
	return nil
}

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

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

func (p *ConfigurationRestoreRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("configuration_restore_request"); 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 := 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 *ConfigurationRestoreRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("cluster_name", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:cluster_name: ", p), err)
	}
	if err := oprot.WriteString(string(p.ClusterName)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.cluster_name (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:cluster_name: ", p), err)
	}
	return err
}

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

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

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

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

func (p *ConfigurationRestoreRequest) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("new_app_name", thrift.STRING, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:new_app_name: ", p), err)
	}
	if err := oprot.WriteString(string(p.NewAppName_)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.new_app_name (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:new_app_name: ", p), err)
	}
	return err
}

func (p *ConfigurationRestoreRequest) writeField7(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("backup_provider_name", thrift.STRING, 7); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:backup_provider_name: ", p), err)
	}
	if err := oprot.WriteString(string(p.BackupProviderName)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.backup_provider_name (7) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 7:backup_provider_name: ", p), err)
	}
	return err
}

func (p *ConfigurationRestoreRequest) writeField8(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("skip_bad_partition", thrift.BOOL, 8); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:skip_bad_partition: ", p), err)
	}
	if err := oprot.WriteBool(bool(p.SkipBadPartition)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.skip_bad_partition (8) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 8:skip_bad_partition: ", p), err)
	}
	return err
}

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

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

// Attributes:
//  - Pid
//  - Policy
//  - AppName
//  - BackupID
//  - BackupPath
type BackupRequest struct {
	Pid        *base.Gpid  `thrift:"pid,1" db:"pid" json:"pid"`
	Policy     *PolicyInfo `thrift:"policy,2" db:"policy" json:"policy"`
	AppName    string      `thrift:"app_name,3" db:"app_name" json:"app_name"`
	BackupID   int64       `thrift:"backup_id,4" db:"backup_id" json:"backup_id"`
	BackupPath *string     `thrift:"backup_path,5" db:"backup_path" json:"backup_path,omitempty"`
}

func NewBackupRequest() *BackupRequest {
	return &BackupRequest{}
}

var BackupRequest_Pid_DEFAULT *base.Gpid

func (p *BackupRequest) GetPid() *base.Gpid {
	if !p.IsSetPid() {
		return BackupRequest_Pid_DEFAULT
	}
	return p.Pid
}

var BackupRequest_Policy_DEFAULT *PolicyInfo

func (p *BackupRequest) GetPolicy() *PolicyInfo {
	if !p.IsSetPolicy() {
		return BackupRequest_Policy_DEFAULT
	}
	return p.Policy
}

func (p *BackupRequest) GetAppName() string {
	return p.AppName
}

func (p *BackupRequest) GetBackupID() int64 {
	return p.BackupID
}

var BackupRequest_BackupPath_DEFAULT string

func (p *BackupRequest) GetBackupPath() string {
	if !p.IsSetBackupPath() {
		return BackupRequest_BackupPath_DEFAULT
	}
	return *p.BackupPath
}
func (p *BackupRequest) IsSetPid() bool {
	return p.Pid != nil
}

func (p *BackupRequest) IsSetPolicy() bool {
	return p.Policy != nil
}

func (p *BackupRequest) IsSetBackupPath() bool {
	return p.BackupPath != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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.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 *BackupRequest) ReadField1(iprot thrift.TProtocol) error {
	p.Pid = &base.Gpid{}
	if err := p.Pid.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err)
	}
	return nil
}

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

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

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

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

func (p *BackupRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("backup_request"); 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 *BackupRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pid: ", p), err)
	}
	if err := p.Pid.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pid: ", p), err)
	}
	return err
}

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

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

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

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

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

// Attributes:
//  - Err
//  - Pid
//  - Progress
//  - PolicyName
//  - BackupID
//  - CheckpointTotalSize
type BackupResponse struct {
	Err                 *base.ErrorCode `thrift:"err,1" db:"err" json:"err"`
	Pid                 *base.Gpid      `thrift:"pid,2" db:"pid" json:"pid"`
	Progress            int32           `thrift:"progress,3" db:"progress" json:"progress"`
	PolicyName          string          `thrift:"policy_name,4" db:"policy_name" json:"policy_name"`
	BackupID            int64           `thrift:"backup_id,5" db:"backup_id" json:"backup_id"`
	CheckpointTotalSize int64           `thrift:"checkpoint_total_size,6" db:"checkpoint_total_size" json:"checkpoint_total_size"`
}

func NewBackupResponse() *BackupResponse {
	return &BackupResponse{}
}

var BackupResponse_Err_DEFAULT *base.ErrorCode

func (p *BackupResponse) GetErr() *base.ErrorCode {
	if !p.IsSetErr() {
		return BackupResponse_Err_DEFAULT
	}
	return p.Err
}

var BackupResponse_Pid_DEFAULT *base.Gpid

func (p *BackupResponse) GetPid() *base.Gpid {
	if !p.IsSetPid() {
		return BackupResponse_Pid_DEFAULT
	}
	return p.Pid
}

func (p *BackupResponse) GetProgress() int32 {
	return p.Progress
}

func (p *BackupResponse) GetPolicyName() string {
	return p.PolicyName
}

func (p *BackupResponse) GetBackupID() int64 {
	return p.BackupID
}

func (p *BackupResponse) GetCheckpointTotalSize() int64 {
	return p.CheckpointTotalSize
}
func (p *BackupResponse) IsSetErr() bool {
	return p.Err != nil
}

func (p *BackupResponse) IsSetPid() bool {
	return p.Pid != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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.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
				}
			}
		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
				}
			}
		case 6:
			if fieldTypeId == thrift.I64 {
				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 *BackupResponse) ReadField1(iprot thrift.TProtocol) error {
	p.Err = &base.ErrorCode{}
	if err := p.Err.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err)
	}
	return nil
}

func (p *BackupResponse) ReadField2(iprot thrift.TProtocol) error {
	p.Pid = &base.Gpid{}
	if err := p.Pid.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err)
	}
	return nil
}

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

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

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

func (p *BackupResponse) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.CheckpointTotalSize = v
	}
	return nil
}

func (p *BackupResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("backup_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.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 *BackupResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err)
	}
	if err := p.Err.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err)
	}
	return err
}

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

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

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

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

func (p *BackupResponse) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("checkpoint_total_size", thrift.I64, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:checkpoint_total_size: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.CheckpointTotalSize)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.checkpoint_total_size (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:checkpoint_total_size: ", p), err)
	}
	return err
}

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

// Attributes:
//  - Pid
//  - PolicyName
type BackupClearRequest struct {
	Pid        *base.Gpid `thrift:"pid,1" db:"pid" json:"pid"`
	PolicyName string     `thrift:"policy_name,2" db:"policy_name" json:"policy_name"`
}

func NewBackupClearRequest() *BackupClearRequest {
	return &BackupClearRequest{}
}

var BackupClearRequest_Pid_DEFAULT *base.Gpid

func (p *BackupClearRequest) GetPid() *base.Gpid {
	if !p.IsSetPid() {
		return BackupClearRequest_Pid_DEFAULT
	}
	return p.Pid
}

func (p *BackupClearRequest) GetPolicyName() string {
	return p.PolicyName
}
func (p *BackupClearRequest) IsSetPid() bool {
	return p.Pid != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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 *BackupClearRequest) ReadField1(iprot thrift.TProtocol) error {
	p.Pid = &base.Gpid{}
	if err := p.Pid.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err)
	}
	return nil
}

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

func (p *BackupClearRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("backup_clear_request"); 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 *BackupClearRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pid: ", p), err)
	}
	if err := p.Pid.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pid: ", p), err)
	}
	return err
}

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

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

// Attributes:
//  - PolicyName
//  - AddAppids
//  - RemovalAppids
//  - NewBackupIntervalSec_
//  - BackupHistoryCountToKeep
//  - IsDisable
//  - StartTime
//  - ForceDisable
type ConfigurationModifyBackupPolicyRequest struct {
	PolicyName               string  `thrift:"policy_name,1" db:"policy_name" json:"policy_name"`
	AddAppids                []int32 `thrift:"add_appids,2" db:"add_appids" json:"add_appids,omitempty"`
	RemovalAppids            []int32 `thrift:"removal_appids,3" db:"removal_appids" json:"removal_appids,omitempty"`
	NewBackupIntervalSec_    *int64  `thrift:"new_backup_interval_sec,4" db:"new_backup_interval_sec" json:"new_backup_interval_sec,omitempty"`
	BackupHistoryCountToKeep *int32  `thrift:"backup_history_count_to_keep,5" db:"backup_history_count_to_keep" json:"backup_history_count_to_keep,omitempty"`
	IsDisable                *bool   `thrift:"is_disable,6" db:"is_disable" json:"is_disable,omitempty"`
	StartTime                *string `thrift:"start_time,7" db:"start_time" json:"start_time,omitempty"`
	ForceDisable             *bool   `thrift:"force_disable,8" db:"force_disable" json:"force_disable,omitempty"`
}

func NewConfigurationModifyBackupPolicyRequest() *ConfigurationModifyBackupPolicyRequest {
	return &ConfigurationModifyBackupPolicyRequest{}
}

func (p *ConfigurationModifyBackupPolicyRequest) GetPolicyName() string {
	return p.PolicyName
}

var ConfigurationModifyBackupPolicyRequest_AddAppids_DEFAULT []int32

func (p *ConfigurationModifyBackupPolicyRequest) GetAddAppids() []int32 {
	return p.AddAppids
}

var ConfigurationModifyBackupPolicyRequest_RemovalAppids_DEFAULT []int32

func (p *ConfigurationModifyBackupPolicyRequest) GetRemovalAppids() []int32 {
	return p.RemovalAppids
}

var ConfigurationModifyBackupPolicyRequest_NewBackupIntervalSec__DEFAULT int64

func (p *ConfigurationModifyBackupPolicyRequest) GetNewBackupIntervalSec_() int64 {
	if !p.IsSetNewBackupIntervalSec_() {
		return ConfigurationModifyBackupPolicyRequest_NewBackupIntervalSec__DEFAULT
	}
	return *p.NewBackupIntervalSec_
}

var ConfigurationModifyBackupPolicyRequest_BackupHistoryCountToKeep_DEFAULT int32

func (p *ConfigurationModifyBackupPolicyRequest) GetBackupHistoryCountToKeep() int32 {
	if !p.IsSetBackupHistoryCountToKeep() {
		return ConfigurationModifyBackupPolicyRequest_BackupHistoryCountToKeep_DEFAULT
	}
	return *p.BackupHistoryCountToKeep
}

var ConfigurationModifyBackupPolicyRequest_IsDisable_DEFAULT bool

func (p *ConfigurationModifyBackupPolicyRequest) GetIsDisable() bool {
	if !p.IsSetIsDisable() {
		return ConfigurationModifyBackupPolicyRequest_IsDisable_DEFAULT
	}
	return *p.IsDisable
}

var ConfigurationModifyBackupPolicyRequest_StartTime_DEFAULT string

func (p *ConfigurationModifyBackupPolicyRequest) GetStartTime() string {
	if !p.IsSetStartTime() {
		return ConfigurationModifyBackupPolicyRequest_StartTime_DEFAULT
	}
	return *p.StartTime
}

var ConfigurationModifyBackupPolicyRequest_ForceDisable_DEFAULT bool

func (p *ConfigurationModifyBackupPolicyRequest) GetForceDisable() bool {
	if !p.IsSetForceDisable() {
		return ConfigurationModifyBackupPolicyRequest_ForceDisable_DEFAULT
	}
	return *p.ForceDisable
}
func (p *ConfigurationModifyBackupPolicyRequest) IsSetAddAppids() bool {
	return p.AddAppids != nil
}

func (p *ConfigurationModifyBackupPolicyRequest) IsSetRemovalAppids() bool {
	return p.RemovalAppids != nil
}

func (p *ConfigurationModifyBackupPolicyRequest) IsSetNewBackupIntervalSec_() bool {
	return p.NewBackupIntervalSec_ != nil
}

func (p *ConfigurationModifyBackupPolicyRequest) IsSetBackupHistoryCountToKeep() bool {
	return p.BackupHistoryCountToKeep != nil
}

func (p *ConfigurationModifyBackupPolicyRequest) IsSetIsDisable() bool {
	return p.IsDisable != nil
}

func (p *ConfigurationModifyBackupPolicyRequest) IsSetStartTime() bool {
	return p.StartTime != nil
}

func (p *ConfigurationModifyBackupPolicyRequest) IsSetForceDisable() bool {
	return p.ForceDisable != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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
				}
			}
		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
				}
			}
		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.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.STRING {
				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
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

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

func (p *ConfigurationModifyBackupPolicyRequest) ReadField2(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]int32, 0, size)
	p.AddAppids = tSlice
	for i := 0; i < size; i++ {
		var _elem0 int32
		if v, err := iprot.ReadI32(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem0 = v
		}
		p.AddAppids = append(p.AddAppids, _elem0)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *ConfigurationModifyBackupPolicyRequest) ReadField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]int32, 0, size)
	p.RemovalAppids = tSlice
	for i := 0; i < size; i++ {
		var _elem1 int32
		if v, err := iprot.ReadI32(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem1 = v
		}
		p.RemovalAppids = append(p.RemovalAppids, _elem1)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

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

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

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

func (p *ConfigurationModifyBackupPolicyRequest) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 7: ", err)
	} else {
		p.StartTime = &v
	}
	return nil
}

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

func (p *ConfigurationModifyBackupPolicyRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("configuration_modify_backup_policy_request"); 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 := 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 *ConfigurationModifyBackupPolicyRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("policy_name", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:policy_name: ", p), err)
	}
	if err := oprot.WriteString(string(p.PolicyName)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.policy_name (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:policy_name: ", p), err)
	}
	return err
}

func (p *ConfigurationModifyBackupPolicyRequest) writeField2(oprot thrift.TProtocol) (err error) {
	if p.IsSetAddAppids() {
		if err := oprot.WriteFieldBegin("add_appids", thrift.LIST, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:add_appids: ", p), err)
		}
		if err := oprot.WriteListBegin(thrift.I32, len(p.AddAppids)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.AddAppids {
			if err := oprot.WriteI32(int32(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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:add_appids: ", p), err)
		}
	}
	return err
}

func (p *ConfigurationModifyBackupPolicyRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetRemovalAppids() {
		if err := oprot.WriteFieldBegin("removal_appids", thrift.LIST, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:removal_appids: ", p), err)
		}
		if err := oprot.WriteListBegin(thrift.I32, len(p.RemovalAppids)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.RemovalAppids {
			if err := oprot.WriteI32(int32(v)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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:removal_appids: ", p), err)
		}
	}
	return err
}

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

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

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

func (p *ConfigurationModifyBackupPolicyRequest) writeField7(oprot thrift.TProtocol) (err error) {
	if p.IsSetStartTime() {
		if err := oprot.WriteFieldBegin("start_time", thrift.STRING, 7); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:start_time: ", p), err)
		}
		if err := oprot.WriteString(string(*p.StartTime)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.start_time (7) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 7:start_time: ", p), err)
		}
	}
	return err
}

func (p *ConfigurationModifyBackupPolicyRequest) writeField8(oprot thrift.TProtocol) (err error) {
	if p.IsSetForceDisable() {
		if err := oprot.WriteFieldBegin("force_disable", thrift.BOOL, 8); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:force_disable: ", p), err)
		}
		if err := oprot.WriteBool(bool(*p.ForceDisable)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.force_disable (8) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 8:force_disable: ", p), err)
		}
	}
	return err
}

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

// Attributes:
//  - Err
//  - HintMessage
type ConfigurationModifyBackupPolicyResponse struct {
	Err         *base.ErrorCode `thrift:"err,1" db:"err" json:"err"`
	HintMessage string          `thrift:"hint_message,2" db:"hint_message" json:"hint_message"`
}

func NewConfigurationModifyBackupPolicyResponse() *ConfigurationModifyBackupPolicyResponse {
	return &ConfigurationModifyBackupPolicyResponse{}
}

var ConfigurationModifyBackupPolicyResponse_Err_DEFAULT *base.ErrorCode

func (p *ConfigurationModifyBackupPolicyResponse) GetErr() *base.ErrorCode {
	if !p.IsSetErr() {
		return ConfigurationModifyBackupPolicyResponse_Err_DEFAULT
	}
	return p.Err
}

func (p *ConfigurationModifyBackupPolicyResponse) GetHintMessage() string {
	return p.HintMessage
}
func (p *ConfigurationModifyBackupPolicyResponse) IsSetErr() bool {
	return p.Err != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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 *ConfigurationModifyBackupPolicyResponse) ReadField1(iprot thrift.TProtocol) error {
	p.Err = &base.ErrorCode{}
	if err := p.Err.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err)
	}
	return nil
}

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

func (p *ConfigurationModifyBackupPolicyResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("configuration_modify_backup_policy_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.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 *ConfigurationModifyBackupPolicyResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err)
	}
	if err := p.Err.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err)
	}
	return err
}

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

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

// Attributes:
//  - BackupProviderType
//  - PolicyName
//  - AppIds
//  - BackupIntervalSeconds
//  - BackupHistoryCountToKeep
//  - StartTime
type ConfigurationAddBackupPolicyRequest struct {
	BackupProviderType       string  `thrift:"backup_provider_type,1" db:"backup_provider_type" json:"backup_provider_type"`
	PolicyName               string  `thrift:"policy_name,2" db:"policy_name" json:"policy_name"`
	AppIds                   []int32 `thrift:"app_ids,3" db:"app_ids" json:"app_ids"`
	BackupIntervalSeconds    int64   `thrift:"backup_interval_seconds,4" db:"backup_interval_seconds" json:"backup_interval_seconds"`
	BackupHistoryCountToKeep int32   `thrift:"backup_history_count_to_keep,5" db:"backup_history_count_to_keep" json:"backup_history_count_to_keep"`
	StartTime                string  `thrift:"start_time,6" db:"start_time" json:"start_time"`
}

func NewConfigurationAddBackupPolicyRequest() *ConfigurationAddBackupPolicyRequest {
	return &ConfigurationAddBackupPolicyRequest{}
}

func (p *ConfigurationAddBackupPolicyRequest) GetBackupProviderType() string {
	return p.BackupProviderType
}

func (p *ConfigurationAddBackupPolicyRequest) GetPolicyName() string {
	return p.PolicyName
}

func (p *ConfigurationAddBackupPolicyRequest) GetAppIds() []int32 {
	return p.AppIds
}

func (p *ConfigurationAddBackupPolicyRequest) GetBackupIntervalSeconds() int64 {
	return p.BackupIntervalSeconds
}

func (p *ConfigurationAddBackupPolicyRequest) GetBackupHistoryCountToKeep() int32 {
	return p.BackupHistoryCountToKeep
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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.LIST {
				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.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.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 *ConfigurationAddBackupPolicyRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.BackupProviderType = v
	}
	return nil
}

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

func (p *ConfigurationAddBackupPolicyRequest) ReadField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]int32, 0, size)
	p.AppIds = tSlice
	for i := 0; i < size; i++ {
		var _elem2 int32
		if v, err := iprot.ReadI32(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem2 = v
		}
		p.AppIds = append(p.AppIds, _elem2)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

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

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

func (p *ConfigurationAddBackupPolicyRequest) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.StartTime = v
	}
	return nil
}

func (p *ConfigurationAddBackupPolicyRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("configuration_add_backup_policy_request"); 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 *ConfigurationAddBackupPolicyRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("backup_provider_type", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backup_provider_type: ", p), err)
	}
	if err := oprot.WriteString(string(p.BackupProviderType)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.backup_provider_type (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backup_provider_type: ", p), err)
	}
	return err
}

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

func (p *ConfigurationAddBackupPolicyRequest) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_ids", thrift.LIST, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:app_ids: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.I32, len(p.AppIds)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.AppIds {
		if err := oprot.WriteI32(int32(v)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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:app_ids: ", p), err)
	}
	return err
}

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

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

func (p *ConfigurationAddBackupPolicyRequest) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("start_time", thrift.STRING, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_time: ", p), err)
	}
	if err := oprot.WriteString(string(p.StartTime)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err)
	}
	return err
}

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

// Attributes:
//  - Err
//  - HintMessage
type ConfigurationAddBackupPolicyResponse struct {
	Err         *base.ErrorCode `thrift:"err,1" db:"err" json:"err"`
	HintMessage string          `thrift:"hint_message,2" db:"hint_message" json:"hint_message"`
}

func NewConfigurationAddBackupPolicyResponse() *ConfigurationAddBackupPolicyResponse {
	return &ConfigurationAddBackupPolicyResponse{}
}

var ConfigurationAddBackupPolicyResponse_Err_DEFAULT *base.ErrorCode

func (p *ConfigurationAddBackupPolicyResponse) GetErr() *base.ErrorCode {
	if !p.IsSetErr() {
		return ConfigurationAddBackupPolicyResponse_Err_DEFAULT
	}
	return p.Err
}

func (p *ConfigurationAddBackupPolicyResponse) GetHintMessage() string {
	return p.HintMessage
}
func (p *ConfigurationAddBackupPolicyResponse) IsSetErr() bool {
	return p.Err != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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 *ConfigurationAddBackupPolicyResponse) ReadField1(iprot thrift.TProtocol) error {
	p.Err = &base.ErrorCode{}
	if err := p.Err.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err)
	}
	return nil
}

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

func (p *ConfigurationAddBackupPolicyResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("configuration_add_backup_policy_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.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 *ConfigurationAddBackupPolicyResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err)
	}
	if err := p.Err.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err)
	}
	return err
}

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

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

// Attributes:
//  - PolicyName
//  - BackupProviderType
//  - BackupIntervalSeconds
//  - AppIds
//  - BackupHistoryCountToKeep
//  - StartTime
//  - IsDisable
type PolicyEntry struct {
	PolicyName               string  `thrift:"policy_name,1" db:"policy_name" json:"policy_name"`
	BackupProviderType       string  `thrift:"backup_provider_type,2" db:"backup_provider_type" json:"backup_provider_type"`
	BackupIntervalSeconds    string  `thrift:"backup_interval_seconds,3" db:"backup_interval_seconds" json:"backup_interval_seconds"`
	AppIds                   []int32 `thrift:"app_ids,4" db:"app_ids" json:"app_ids"`
	BackupHistoryCountToKeep int32   `thrift:"backup_history_count_to_keep,5" db:"backup_history_count_to_keep" json:"backup_history_count_to_keep"`
	StartTime                string  `thrift:"start_time,6" db:"start_time" json:"start_time"`
	IsDisable                bool    `thrift:"is_disable,7" db:"is_disable" json:"is_disable"`
}

func NewPolicyEntry() *PolicyEntry {
	return &PolicyEntry{}
}

func (p *PolicyEntry) GetPolicyName() string {
	return p.PolicyName
}

func (p *PolicyEntry) GetBackupProviderType() string {
	return p.BackupProviderType
}

func (p *PolicyEntry) GetBackupIntervalSeconds() string {
	return p.BackupIntervalSeconds
}

func (p *PolicyEntry) GetAppIds() []int32 {
	return p.AppIds
}

func (p *PolicyEntry) GetBackupHistoryCountToKeep() int32 {
	return p.BackupHistoryCountToKeep
}

func (p *PolicyEntry) GetStartTime() string {
	return p.StartTime
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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.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.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.STRING {
				if err := p.ReadField6(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
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

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

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

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

func (p *PolicyEntry) ReadField4(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.AppIds = tSet
	for i := 0; i < size; i++ {
		var _elem3 int32
		if v, err := iprot.ReadI32(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem3 = v
		}
		p.AppIds = append(p.AppIds, _elem3)
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

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

func (p *PolicyEntry) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.StartTime = v
	}
	return nil
}

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

func (p *PolicyEntry) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("policy_entry"); 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 := p.writeField7(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

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

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

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

func (p *PolicyEntry) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_ids", thrift.SET, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:app_ids: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.I32, len(p.AppIds)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for i := 0; i < len(p.AppIds); i++ {
		for j := i + 1; j < len(p.AppIds); j++ {
			if reflect.DeepEqual(p.AppIds[i], p.AppIds[j]) {
				return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.AppIds[i]))
			}
		}
	}
	for _, v := range p.AppIds {
		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 4:app_ids: ", p), err)
	}
	return err
}

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

func (p *PolicyEntry) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("start_time", thrift.STRING, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:start_time: ", p), err)
	}
	if err := oprot.WriteString(string(p.StartTime)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err)
	}
	return err
}

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

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

// Attributes:
//  - BackupID
//  - StartTimeMs
//  - EndTimeMs
//  - AppIds
type BackupEntry struct {
	BackupID    int64   `thrift:"backup_id,1" db:"backup_id" json:"backup_id"`
	StartTimeMs int64   `thrift:"start_time_ms,2" db:"start_time_ms" json:"start_time_ms"`
	EndTimeMs   int64   `thrift:"end_time_ms,3" db:"end_time_ms" json:"end_time_ms"`
	AppIds      []int32 `thrift:"app_ids,4" db:"app_ids" json:"app_ids"`
}

func NewBackupEntry() *BackupEntry {
	return &BackupEntry{}
}

func (p *BackupEntry) GetBackupID() int64 {
	return p.BackupID
}

func (p *BackupEntry) GetStartTimeMs() int64 {
	return p.StartTimeMs
}

func (p *BackupEntry) GetEndTimeMs() int64 {
	return p.EndTimeMs
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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
				}
			}
		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.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 *BackupEntry) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.BackupID = v
	}
	return nil
}

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

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

func (p *BackupEntry) ReadField4(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.AppIds = tSet
	for i := 0; i < size; i++ {
		var _elem4 int32
		if v, err := iprot.ReadI32(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem4 = v
		}
		p.AppIds = append(p.AppIds, _elem4)
	}
	if err := iprot.ReadSetEnd(); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *BackupEntry) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("backup_entry"); 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 *BackupEntry) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("backup_id", thrift.I64, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backup_id: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.BackupID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.backup_id (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backup_id: ", p), err)
	}
	return err
}

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

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

func (p *BackupEntry) writeField4(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_ids", thrift.SET, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:app_ids: ", p), err)
	}
	if err := oprot.WriteSetBegin(thrift.I32, len(p.AppIds)); err != nil {
		return thrift.PrependError("error writing set begin: ", err)
	}
	for i := 0; i < len(p.AppIds); i++ {
		for j := i + 1; j < len(p.AppIds); j++ {
			if reflect.DeepEqual(p.AppIds[i], p.AppIds[j]) {
				return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.AppIds[i]))
			}
		}
	}
	for _, v := range p.AppIds {
		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 4:app_ids: ", p), err)
	}
	return err
}

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

// Attributes:
//  - PolicyNames
//  - BackupInfoCount
type ConfigurationQueryBackupPolicyRequest struct {
	PolicyNames     []string `thrift:"policy_names,1" db:"policy_names" json:"policy_names"`
	BackupInfoCount int32    `thrift:"backup_info_count,2" db:"backup_info_count" json:"backup_info_count"`
}

func NewConfigurationQueryBackupPolicyRequest() *ConfigurationQueryBackupPolicyRequest {
	return &ConfigurationQueryBackupPolicyRequest{}
}

func (p *ConfigurationQueryBackupPolicyRequest) GetPolicyNames() []string {
	return p.PolicyNames
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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
				}
			}
		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 *ConfigurationQueryBackupPolicyRequest) ReadField1(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]string, 0, size)
	p.PolicyNames = tSlice
	for i := 0; i < size; i++ {
		var _elem5 string
		if v, err := iprot.ReadString(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem5 = v
		}
		p.PolicyNames = append(p.PolicyNames, _elem5)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

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

func (p *ConfigurationQueryBackupPolicyRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("configuration_query_backup_policy_request"); 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 *ConfigurationQueryBackupPolicyRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("policy_names", thrift.LIST, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:policy_names: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRING, len(p.PolicyNames)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.PolicyNames {
		if err := oprot.WriteString(string(v)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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:policy_names: ", p), err)
	}
	return err
}

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

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

// Attributes:
//  - Err
//  - Policys
//  - BackupInfos
//  - HintMsg
type ConfigurationQueryBackupPolicyResponse struct {
	Err         *base.ErrorCode  `thrift:"err,1" db:"err" json:"err"`
	Policys     []*PolicyEntry   `thrift:"policys,2" db:"policys" json:"policys"`
	BackupInfos [][]*BackupEntry `thrift:"backup_infos,3" db:"backup_infos" json:"backup_infos"`
	HintMsg     *string          `thrift:"hint_msg,4" db:"hint_msg" json:"hint_msg,omitempty"`
}

func NewConfigurationQueryBackupPolicyResponse() *ConfigurationQueryBackupPolicyResponse {
	return &ConfigurationQueryBackupPolicyResponse{}
}

var ConfigurationQueryBackupPolicyResponse_Err_DEFAULT *base.ErrorCode

func (p *ConfigurationQueryBackupPolicyResponse) GetErr() *base.ErrorCode {
	if !p.IsSetErr() {
		return ConfigurationQueryBackupPolicyResponse_Err_DEFAULT
	}
	return p.Err
}

func (p *ConfigurationQueryBackupPolicyResponse) GetPolicys() []*PolicyEntry {
	return p.Policys
}

func (p *ConfigurationQueryBackupPolicyResponse) GetBackupInfos() [][]*BackupEntry {
	return p.BackupInfos
}

var ConfigurationQueryBackupPolicyResponse_HintMsg_DEFAULT string

func (p *ConfigurationQueryBackupPolicyResponse) GetHintMsg() string {
	if !p.IsSetHintMsg() {
		return ConfigurationQueryBackupPolicyResponse_HintMsg_DEFAULT
	}
	return *p.HintMsg
}
func (p *ConfigurationQueryBackupPolicyResponse) IsSetErr() bool {
	return p.Err != nil
}

func (p *ConfigurationQueryBackupPolicyResponse) IsSetHintMsg() bool {
	return p.HintMsg != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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
				}
			}
		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 *ConfigurationQueryBackupPolicyResponse) ReadField1(iprot thrift.TProtocol) error {
	p.Err = &base.ErrorCode{}
	if err := p.Err.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err)
	}
	return nil
}

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

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

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

func (p *ConfigurationQueryBackupPolicyResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("configuration_query_backup_policy_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.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 *ConfigurationQueryBackupPolicyResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err)
	}
	if err := p.Err.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err)
	}
	return err
}

func (p *ConfigurationQueryBackupPolicyResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("policys", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:policys: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Policys)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Policys {
		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:policys: ", p), err)
	}
	return err
}

func (p *ConfigurationQueryBackupPolicyResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("backup_infos", thrift.LIST, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:backup_infos: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.LIST, len(p.BackupInfos)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.BackupInfos {
		if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range v {
			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.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:backup_infos: ", p), err)
	}
	return err
}

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

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

// Attributes:
//  - Pid
//  - RestoreStatus
//  - Progress
//  - Reason
type ConfigurationReportRestoreStatusRequest struct {
	Pid           *base.Gpid      `thrift:"pid,1" db:"pid" json:"pid"`
	RestoreStatus *base.ErrorCode `thrift:"restore_status,2" db:"restore_status" json:"restore_status"`
	Progress      int32           `thrift:"progress,3" db:"progress" json:"progress"`
	Reason        *string         `thrift:"reason,4" db:"reason" json:"reason,omitempty"`
}

func NewConfigurationReportRestoreStatusRequest() *ConfigurationReportRestoreStatusRequest {
	return &ConfigurationReportRestoreStatusRequest{}
}

var ConfigurationReportRestoreStatusRequest_Pid_DEFAULT *base.Gpid

func (p *ConfigurationReportRestoreStatusRequest) GetPid() *base.Gpid {
	if !p.IsSetPid() {
		return ConfigurationReportRestoreStatusRequest_Pid_DEFAULT
	}
	return p.Pid
}

var ConfigurationReportRestoreStatusRequest_RestoreStatus_DEFAULT *base.ErrorCode

func (p *ConfigurationReportRestoreStatusRequest) GetRestoreStatus() *base.ErrorCode {
	if !p.IsSetRestoreStatus() {
		return ConfigurationReportRestoreStatusRequest_RestoreStatus_DEFAULT
	}
	return p.RestoreStatus
}

func (p *ConfigurationReportRestoreStatusRequest) GetProgress() int32 {
	return p.Progress
}

var ConfigurationReportRestoreStatusRequest_Reason_DEFAULT string

func (p *ConfigurationReportRestoreStatusRequest) GetReason() string {
	if !p.IsSetReason() {
		return ConfigurationReportRestoreStatusRequest_Reason_DEFAULT
	}
	return *p.Reason
}
func (p *ConfigurationReportRestoreStatusRequest) IsSetPid() bool {
	return p.Pid != nil
}

func (p *ConfigurationReportRestoreStatusRequest) IsSetRestoreStatus() bool {
	return p.RestoreStatus != nil
}

func (p *ConfigurationReportRestoreStatusRequest) IsSetReason() bool {
	return p.Reason != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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.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 *ConfigurationReportRestoreStatusRequest) ReadField1(iprot thrift.TProtocol) error {
	p.Pid = &base.Gpid{}
	if err := p.Pid.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Pid), err)
	}
	return nil
}

func (p *ConfigurationReportRestoreStatusRequest) ReadField2(iprot thrift.TProtocol) error {
	p.RestoreStatus = &base.ErrorCode{}
	if err := p.RestoreStatus.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RestoreStatus), err)
	}
	return nil
}

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

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

func (p *ConfigurationReportRestoreStatusRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("configuration_report_restore_status_request"); 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 *ConfigurationReportRestoreStatusRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("pid", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pid: ", p), err)
	}
	if err := p.Pid.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Pid), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pid: ", p), err)
	}
	return err
}

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

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

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

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

// Attributes:
//  - Err
type ConfigurationReportRestoreStatusResponse struct {
	Err *base.ErrorCode `thrift:"err,1" db:"err" json:"err"`
}

func NewConfigurationReportRestoreStatusResponse() *ConfigurationReportRestoreStatusResponse {
	return &ConfigurationReportRestoreStatusResponse{}
}

var ConfigurationReportRestoreStatusResponse_Err_DEFAULT *base.ErrorCode

func (p *ConfigurationReportRestoreStatusResponse) GetErr() *base.ErrorCode {
	if !p.IsSetErr() {
		return ConfigurationReportRestoreStatusResponse_Err_DEFAULT
	}
	return p.Err
}
func (p *ConfigurationReportRestoreStatusResponse) IsSetErr() bool {
	return p.Err != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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 *ConfigurationReportRestoreStatusResponse) ReadField1(iprot thrift.TProtocol) error {
	p.Err = &base.ErrorCode{}
	if err := p.Err.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err)
	}
	return nil
}

func (p *ConfigurationReportRestoreStatusResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("configuration_report_restore_status_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 := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

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

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

// Attributes:
//  - RestoreAppID
type ConfigurationQueryRestoreRequest struct {
	RestoreAppID int32 `thrift:"restore_app_id,1" db:"restore_app_id" json:"restore_app_id"`
}

func NewConfigurationQueryRestoreRequest() *ConfigurationQueryRestoreRequest {
	return &ConfigurationQueryRestoreRequest{}
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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 *ConfigurationQueryRestoreRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.RestoreAppID = v
	}
	return nil
}

func (p *ConfigurationQueryRestoreRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("configuration_query_restore_request"); 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 *ConfigurationQueryRestoreRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("restore_app_id", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:restore_app_id: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.RestoreAppID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.restore_app_id (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:restore_app_id: ", p), err)
	}
	return err
}

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

// Attributes:
//  - Err
//  - RestoreStatus
//  - RestoreProgress
type ConfigurationQueryRestoreResponse struct {
	Err             *base.ErrorCode   `thrift:"err,1" db:"err" json:"err"`
	RestoreStatus   []*base.ErrorCode `thrift:"restore_status,2" db:"restore_status" json:"restore_status"`
	RestoreProgress []int32           `thrift:"restore_progress,3" db:"restore_progress" json:"restore_progress"`
}

func NewConfigurationQueryRestoreResponse() *ConfigurationQueryRestoreResponse {
	return &ConfigurationQueryRestoreResponse{}
}

var ConfigurationQueryRestoreResponse_Err_DEFAULT *base.ErrorCode

func (p *ConfigurationQueryRestoreResponse) GetErr() *base.ErrorCode {
	if !p.IsSetErr() {
		return ConfigurationQueryRestoreResponse_Err_DEFAULT
	}
	return p.Err
}

func (p *ConfigurationQueryRestoreResponse) GetRestoreStatus() []*base.ErrorCode {
	return p.RestoreStatus
}

func (p *ConfigurationQueryRestoreResponse) GetRestoreProgress() []int32 {
	return p.RestoreProgress
}
func (p *ConfigurationQueryRestoreResponse) IsSetErr() bool {
	return p.Err != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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 *ConfigurationQueryRestoreResponse) ReadField1(iprot thrift.TProtocol) error {
	p.Err = &base.ErrorCode{}
	if err := p.Err.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err)
	}
	return nil
}

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

func (p *ConfigurationQueryRestoreResponse) ReadField3(iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadListBegin()
	if err != nil {
		return thrift.PrependError("error reading list begin: ", err)
	}
	tSlice := make([]int32, 0, size)
	p.RestoreProgress = tSlice
	for i := 0; i < size; i++ {
		var _elem10 int32
		if v, err := iprot.ReadI32(); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem10 = v
		}
		p.RestoreProgress = append(p.RestoreProgress, _elem10)
	}
	if err := iprot.ReadListEnd(); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *ConfigurationQueryRestoreResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("configuration_query_restore_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.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 *ConfigurationQueryRestoreResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err)
	}
	if err := p.Err.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err)
	}
	return err
}

func (p *ConfigurationQueryRestoreResponse) writeField2(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("restore_status", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:restore_status: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.STRUCT, len(p.RestoreStatus)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.RestoreStatus {
		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:restore_status: ", p), err)
	}
	return err
}

func (p *ConfigurationQueryRestoreResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("restore_progress", thrift.LIST, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:restore_progress: ", p), err)
	}
	if err := oprot.WriteListBegin(thrift.I32, len(p.RestoreProgress)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.RestoreProgress {
		if err := oprot.WriteI32(int32(v)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), 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:restore_progress: ", p), err)
	}
	return err
}

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

// Attributes:
//  - BackupProviderType
//  - AppID
//  - BackupPath
type StartBackupAppRequest struct {
	BackupProviderType string  `thrift:"backup_provider_type,1" db:"backup_provider_type" json:"backup_provider_type"`
	AppID              int32   `thrift:"app_id,2" db:"app_id" json:"app_id"`
	BackupPath         *string `thrift:"backup_path,3" db:"backup_path" json:"backup_path,omitempty"`
}

func NewStartBackupAppRequest() *StartBackupAppRequest {
	return &StartBackupAppRequest{}
}

func (p *StartBackupAppRequest) GetBackupProviderType() string {
	return p.BackupProviderType
}

func (p *StartBackupAppRequest) GetAppID() int32 {
	return p.AppID
}

var StartBackupAppRequest_BackupPath_DEFAULT string

func (p *StartBackupAppRequest) GetBackupPath() string {
	if !p.IsSetBackupPath() {
		return StartBackupAppRequest_BackupPath_DEFAULT
	}
	return *p.BackupPath
}
func (p *StartBackupAppRequest) IsSetBackupPath() bool {
	return p.BackupPath != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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.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 *StartBackupAppRequest) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.BackupProviderType = v
	}
	return nil
}

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

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

func (p *StartBackupAppRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("start_backup_app_request"); 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 *StartBackupAppRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("backup_provider_type", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:backup_provider_type: ", p), err)
	}
	if err := oprot.WriteString(string(p.BackupProviderType)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.backup_provider_type (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:backup_provider_type: ", p), err)
	}
	return err
}

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

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

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

// Attributes:
//  - Err
//  - HintMessage
//  - BackupID
type StartBackupAppResponse struct {
	Err         *base.ErrorCode `thrift:"err,1" db:"err" json:"err"`
	HintMessage string          `thrift:"hint_message,2" db:"hint_message" json:"hint_message"`
	BackupID    *int64          `thrift:"backup_id,3" db:"backup_id" json:"backup_id,omitempty"`
}

func NewStartBackupAppResponse() *StartBackupAppResponse {
	return &StartBackupAppResponse{}
}

var StartBackupAppResponse_Err_DEFAULT *base.ErrorCode

func (p *StartBackupAppResponse) GetErr() *base.ErrorCode {
	if !p.IsSetErr() {
		return StartBackupAppResponse_Err_DEFAULT
	}
	return p.Err
}

func (p *StartBackupAppResponse) GetHintMessage() string {
	return p.HintMessage
}

var StartBackupAppResponse_BackupID_DEFAULT int64

func (p *StartBackupAppResponse) GetBackupID() int64 {
	if !p.IsSetBackupID() {
		return StartBackupAppResponse_BackupID_DEFAULT
	}
	return *p.BackupID
}
func (p *StartBackupAppResponse) IsSetErr() bool {
	return p.Err != nil
}

func (p *StartBackupAppResponse) IsSetBackupID() bool {
	return p.BackupID != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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.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 *StartBackupAppResponse) ReadField1(iprot thrift.TProtocol) error {
	p.Err = &base.ErrorCode{}
	if err := p.Err.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err)
	}
	return nil
}

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

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

func (p *StartBackupAppResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("start_backup_app_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.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 *StartBackupAppResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err)
	}
	if err := p.Err.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err)
	}
	return err
}

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

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

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

// Attributes:
//  - BackupID
//  - AppName
//  - BackupProviderType
//  - BackupPath
//  - StartTimeMs
//  - EndTimeMs
//  - IsBackupFailed
type BackupItem struct {
	BackupID           int64  `thrift:"backup_id,1" db:"backup_id" json:"backup_id"`
	AppName            string `thrift:"app_name,2" db:"app_name" json:"app_name"`
	BackupProviderType string `thrift:"backup_provider_type,3" db:"backup_provider_type" json:"backup_provider_type"`
	BackupPath         string `thrift:"backup_path,4" db:"backup_path" json:"backup_path"`
	StartTimeMs        int64  `thrift:"start_time_ms,5" db:"start_time_ms" json:"start_time_ms"`
	EndTimeMs          int64  `thrift:"end_time_ms,6" db:"end_time_ms" json:"end_time_ms"`
	IsBackupFailed     bool   `thrift:"is_backup_failed,7" db:"is_backup_failed" json:"is_backup_failed"`
}

func NewBackupItem() *BackupItem {
	return &BackupItem{}
}

func (p *BackupItem) GetBackupID() int64 {
	return p.BackupID
}

func (p *BackupItem) GetAppName() string {
	return p.AppName
}

func (p *BackupItem) GetBackupProviderType() string {
	return p.BackupProviderType
}

func (p *BackupItem) GetBackupPath() string {
	return p.BackupPath
}

func (p *BackupItem) GetStartTimeMs() int64 {
	return p.StartTimeMs
}

func (p *BackupItem) GetEndTimeMs() int64 {
	return p.EndTimeMs
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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.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.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
				}
			}
		case 6:
			if fieldTypeId == thrift.I64 {
				if err := p.ReadField6(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
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

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

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

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

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

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

func (p *BackupItem) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return thrift.PrependError("error reading field 6: ", err)
	} else {
		p.EndTimeMs = v
	}
	return nil
}

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

func (p *BackupItem) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("backup_item"); 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 := p.writeField7(oprot); err != nil {
			return err
		}
	}
	if err := oprot.WriteFieldStop(); err != nil {
		return thrift.PrependError("write field stop error: ", err)
	}
	if err := oprot.WriteStructEnd(); err != nil {
		return thrift.PrependError("write struct stop error: ", err)
	}
	return nil
}

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

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

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

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

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

func (p *BackupItem) writeField6(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("end_time_ms", thrift.I64, 6); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:end_time_ms: ", p), err)
	}
	if err := oprot.WriteI64(int64(p.EndTimeMs)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.end_time_ms (6) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 6:end_time_ms: ", p), err)
	}
	return err
}

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

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

// Attributes:
//  - AppID
//  - BackupID
type QueryBackupStatusRequest struct {
	AppID    int32  `thrift:"app_id,1" db:"app_id" json:"app_id"`
	BackupID *int64 `thrift:"backup_id,2" db:"backup_id" json:"backup_id,omitempty"`
}

func NewQueryBackupStatusRequest() *QueryBackupStatusRequest {
	return &QueryBackupStatusRequest{}
}

func (p *QueryBackupStatusRequest) GetAppID() int32 {
	return p.AppID
}

var QueryBackupStatusRequest_BackupID_DEFAULT int64

func (p *QueryBackupStatusRequest) GetBackupID() int64 {
	if !p.IsSetBackupID() {
		return QueryBackupStatusRequest_BackupID_DEFAULT
	}
	return *p.BackupID
}
func (p *QueryBackupStatusRequest) IsSetBackupID() bool {
	return p.BackupID != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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
				}
			}
		default:
			if err := iprot.Skip(fieldTypeId); err != nil {
				return err
			}
		}
		if err := iprot.ReadFieldEnd(); err != nil {
			return err
		}
	}
	if err := iprot.ReadStructEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
	}
	return nil
}

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

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

func (p *QueryBackupStatusRequest) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("query_backup_status_request"); 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 *QueryBackupStatusRequest) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("app_id", thrift.I32, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:app_id: ", p), err)
	}
	if err := oprot.WriteI32(int32(p.AppID)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.app_id (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:app_id: ", p), err)
	}
	return err
}

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

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

// Attributes:
//  - Err
//  - HintMessage
//  - BackupItems
type QueryBackupStatusResponse struct {
	Err         *base.ErrorCode `thrift:"err,1" db:"err" json:"err"`
	HintMessage string          `thrift:"hint_message,2" db:"hint_message" json:"hint_message"`
	BackupItems []*BackupItem   `thrift:"backup_items,3" db:"backup_items" json:"backup_items,omitempty"`
}

func NewQueryBackupStatusResponse() *QueryBackupStatusResponse {
	return &QueryBackupStatusResponse{}
}

var QueryBackupStatusResponse_Err_DEFAULT *base.ErrorCode

func (p *QueryBackupStatusResponse) GetErr() *base.ErrorCode {
	if !p.IsSetErr() {
		return QueryBackupStatusResponse_Err_DEFAULT
	}
	return p.Err
}

func (p *QueryBackupStatusResponse) GetHintMessage() string {
	return p.HintMessage
}

var QueryBackupStatusResponse_BackupItems_DEFAULT []*BackupItem

func (p *QueryBackupStatusResponse) GetBackupItems() []*BackupItem {
	return p.BackupItems
}
func (p *QueryBackupStatusResponse) IsSetErr() bool {
	return p.Err != nil
}

func (p *QueryBackupStatusResponse) IsSetBackupItems() bool {
	return p.BackupItems != nil
}

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

	for {
		_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
		if err != 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.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 *QueryBackupStatusResponse) ReadField1(iprot thrift.TProtocol) error {
	p.Err = &base.ErrorCode{}
	if err := p.Err.Read(iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Err), err)
	}
	return nil
}

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

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

func (p *QueryBackupStatusResponse) Write(oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin("query_backup_status_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.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 *QueryBackupStatusResponse) writeField1(oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin("err", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:err: ", p), err)
	}
	if err := p.Err.Write(oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Err), err)
	}
	if err := oprot.WriteFieldEnd(); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:err: ", p), err)
	}
	return err
}

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

func (p *QueryBackupStatusResponse) writeField3(oprot thrift.TProtocol) (err error) {
	if p.IsSetBackupItems() {
		if err := oprot.WriteFieldBegin("backup_items", thrift.LIST, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:backup_items: ", p), err)
		}
		if err := oprot.WriteListBegin(thrift.STRUCT, len(p.BackupItems)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.BackupItems {
			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:backup_items: ", p), err)
		}
	}
	return err
}

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