func NewOperation()

in pkg/asyncapi/v2/v2.go [319:331]


func NewOperation(operationType asyncapi.OperationType, msgs ...*Message) *Operation {
	op := &Operation{
		OperationType: operationType,
	}

	if len(msgs) == 0 {
		return op
	}

	op.MessageField = *NewMessages(msgs)

	return op
}