func (c *Client) ListPage(args *ListPageArgs) (*ListPageResult, error) {
	result, err := c.ddcClient.ListPage(args)
	return result, err
}
ListPage - list all instances with page
RETURNS:
- *ListRdsResult: the result of list instances with page
- error: nil if success otherwise the specific error
package ddcrds
import (
	"encoding/json"
	"fmt"
	"strconv"
	"strings"
	"github.com/baidubce/bce-sdk-go/services/ddc/ddc_util"
	"github.com/baidubce/bce-sdk-go/services/rds"
)
func Int(value string) *int {
	if len(value) < 1 {
		return nil
	}
	intPtr, err := strconv.Atoi(value)
	if err != nil {
		panic("please pass valid int value ")
	}
	return &intPtr
}
func Json(v interface{}) string {
	jsonStr, err := json.Marshal(v)
	if err != nil {
		panic("convert to json faild")
	}
	return string(jsonStr)
}
func isDDC(productType string) bool {
	return productType == "ddc" || productType == "DDC"
}
func isDDCId(instanceId string) bool {
	if strings.HasPrefix(instanceId, "rds") {
		return false
	}
	return true
}
func getDDCAndRDSIds(instanceIds string) (string, string) {
	instanceIdArr := strings.Split(instanceIds, ",")
	ddcIds, rdsIds := "", ""
	if len(instanceIdArr) > 0 {
		for _, id := range instanceIdArr {
			if isDDCId(id) {
				ddcIds += id + ","
			} else {
				rdsIds += id + ","
			}
		}
	}
	if strings.HasSuffix(ddcIds, ",") {
		ddcIds = ddcIds[:len(ddcIds)-1]
	}
	if strings.HasSuffix(rdsIds, ",") {
		rdsIds = rdsIds[:len(rdsIds)-1]
	}
	return ddcIds, rdsIds
}
func (c *Client) CreateRds(args *CreateRdsArgs, productType string) (*CreateResult, error) {
	if args == nil {
		return nil, fmt.Errorf("unset args")
	}
	if strings.Contains(args.InstanceName, ".") {
		return nil, fmt.Errorf("invalid InstanceName:. not support")
	}
	var result *CreateResult
	var err error
	if isDDC(productType) {
		result, err = c.ddcClient.CreateRds(args)
	} else {
		rdsArgs := &rds.CreateRdsArgs{}
		err = ddc_util.SimpleCopyProperties(rdsArgs, args)
		if err != nil {
			return nil, err
		}
		var rdsRes *rds.CreateResult
		rdsRes, err = c.rdsClient.CreateRds(rdsArgs)
		if rdsRes != nil {
			result = &CreateResult{InstanceIds: rdsRes.InstanceIds}
		}
	}
	return result, err
}
func (c *Client) CreateReadReplica(args *CreateReadReplicaArgs) (*CreateResult, error) {
	if args == nil {
		return nil, fmt.Errorf("unset args")
	}
	if len(args.SourceInstanceId) < 1 {
		return nil, fmt.Errorf("unset SourceInstanceId")
	}
	if args.PurchaseCount < 1 {
		args.PurchaseCount = 1
	}
	var result *CreateResult
	var err error
	if isDDCId(args.SourceInstanceId) {
		result, err = c.ddcClient.CreateReadReplica(args)
	} else {
		rdsArgs := &rds.CreateReadReplicaArgs{}
		err = ddc_util.SimpleCopyProperties(rdsArgs, args)
		if err != nil {
			return nil, err
		}
		var rdsRes *rds.CreateResult
		rdsRes, err = c.rdsClient.CreateReadReplica(rdsArgs)
		if rdsRes != nil {
			result = &CreateResult{InstanceIds: rdsRes.InstanceIds}
		}
	}
	return result, err
}
func (c *Client) UpdateRoGroup(roGroupId string, args *UpdateRoGroupArgs, productType string) error {
	if isDDC(productType) {
		return c.ddcClient.UpdateRoGroup(roGroupId, args)
	}
	return RDSNotSupportError()
}
func (c *Client) UpdateRoGroupReplicaWeight(roGroupId string, args *UpdateRoGroupWeightArgs, productType string) error {
	if isDDC(productType) {
		return c.ddcClient.UpdateRoGroupReplicaWeight(roGroupId, args)
	}
	return RDSNotSupportError()
}
func (c *Client) ReBalanceRoGroup(roGroupId, productType string) error {
	if len(roGroupId) < 1 {
		return fmt.Errorf("unset roGroupId")
	}
	if isDDC(productType) {
		return c.ddcClient.ReBalanceRoGroup(roGroupId)
	}
	return RDSNotSupportError()
}
func (c *Client) CreateRdsProxy(args *CreateRdsProxyArgs) (*CreateResult, error) {
	if args == nil {
		return nil, fmt.Errorf("unset args")
	}
	if len(args.SourceInstanceId) < 1 {
		return nil, fmt.Errorf("unset SourceInstanceId")
	}
	if isDDCId(args.SourceInstanceId) {
		return nil, DDCNotSupportError()
	}
	rdsArgs := &rds.CreateRdsProxyArgs{}
	err := ddc_util.SimpleCopyProperties(rdsArgs, args)
	if err != nil {
		return nil, err
	}
	rdsRes, err := c.rdsClient.CreateRdsProxy(rdsArgs)
	if err != nil {
		return nil, err
	}
	result := &CreateResult{InstanceIds: rdsRes.InstanceIds}
	return result, err
}
func (c *Client) listRdsInstance(marker *ListRdsArgs) (*ListRdsResult, error) {
	rdsArgs := &rds.ListRdsArgs{}
	err := ddc_util.SimpleCopyProperties(rdsArgs, marker)
	if err != nil {
		return nil, err
	}
	var rdsRes *rds.ListRdsResult
	rdsRes, err = c.rdsClient.ListRds(rdsArgs)
	result := &ListRdsResult{}
	if rdsRes != nil {
		err = ddc_util.SimpleCopyProperties(result, rdsRes)
	}
	if result.Instances != nil &&
		len(result.Instances) > 0 {
		for i := range result.Instances {
			err = convertRdsInstance(&result.Instances[i])
		}
	}
	return result, err
}