func NewWithdrawPermissionID(id string) GrapheneObject {
	gid := new(WithdrawPermissionID)
	if err := gid.Parse(id); err != nil {
		logging.Errorf(
			"WithdrawPermissionID parser error %v",
			errors.Annotate(err, "Parse"),
		)
		return nil
	}
	if gid.ObjectType() != ObjectTypeWithdrawPermission {
		logging.Errorf(
			"WithdrawPermissionID parser error %s",
			fmt.Sprintf("%q has no ObjectType 'ObjectTypeWithdrawPermission'", id),
		)
		return nil
	}
	return gid
}
NewWithdrawPermissionID creates an new WithdrawPermissionID object
package types
import (
	"fmt"
	"github.com/denkhaus/bitshares/util"
	"github.com/denkhaus/logging"
	"github.com/juju/errors"
)
type WithdrawPermissionID struct {
	ObjectID
}
func (p WithdrawPermissionID) Marshal(enc *util.TypeEncoder) error {
	if err := enc.EncodeUVarint(uint64(p.Instance())); err != nil {
		return errors.Annotate(err, "encode instance")
	}
	return nil
}
func (p *WithdrawPermissionID) Unmarshal(dec *util.TypeDecoder) error {
	var instance uint64
	if err := dec.DecodeUVarint(&instance); err != nil {
		return errors.Annotate(err, "decode instance")
	}
	p.number = UInt64((uint64(SpaceTypeProtocol) << 56) | (uint64(ObjectTypeWithdrawPermission) << 48) | instance)
	return nil
}
type WithdrawPermissionIDs []WithdrawPermissionID
func (p WithdrawPermissionIDs) Marshal(enc *util.TypeEncoder) error {
	if err := enc.EncodeUVarint(uint64(len(p))); err != nil {
		return errors.Annotate(err, "encode length")
	}
	for _, ex := range p {
		if err := enc.Encode(ex); err != nil {
			return errors.Annotate(err, "encode WithdrawPermissionID")
		}
	}
	return nil
}
func WithdrawPermissionIDFromObject(ob GrapheneObject) WithdrawPermissionID {
	id, ok := ob.(*WithdrawPermissionID)
	if ok {
		return *id
	}
	p := WithdrawPermissionID{}
	p.MustFromObject(ob)
	if p.ObjectType() != ObjectTypeWithdrawPermission {
		panic(fmt.Sprintf("invalid ObjectType: %q has no ObjectType 'ObjectTypeWithdrawPermission'", p.ID()))
	}
	return p
}