func (o *Set) Key() string {
	return o.key
}
Key returns the key of this operation.
package operation
import (
	"github.com/yorkie-team/yorkie/pkg/document/json"
	"github.com/yorkie-team/yorkie/pkg/document/time"
)
type Set struct {
	parentCreatedAt *time.Ticket
	key string
	value json.Element
	executedAt *time.Ticket
}
func NewSet(
	parentCreatedAt *time.Ticket,
	key string,
	value json.Element,
	executedAt *time.Ticket,
) *Set {
	return &Set{
		key:             key,
		value:           value,
		parentCreatedAt: parentCreatedAt,
		executedAt:      executedAt,
	}
}
func (o *Set) Execute(root *json.Root) error {
	parent := root.FindByCreatedAt(o.parentCreatedAt)
	obj, ok := parent.(*json.Object)
	if !ok {
		return ErrNotApplicableDataType
	}
	value := o.value.DeepCopy()
	removed := obj.Set(o.key, value)
	root.RegisterElement(value)
	if removed != nil {
		root.RegisterRemovedElementPair(obj, removed)
	}
	return nil
}
func (o *Set) ParentCreatedAt() *time.Ticket {
	return o.parentCreatedAt
}
func (o *Set) ExecutedAt() *time.Ticket {
	return o.executedAt
}
func (o *Set) SetActor(actorID *time.ActorID) {
	o.executedAt = o.executedAt.SetActorID(actorID)
}