// ------------- ChaincodeEvent API ----------------------
// SetEvent documentation can be found in interfaces.go
333257
func (stub *ChaincodeStub) SetEvent(name string, payload []byte) error {
	if name == "" {
		return errors.New("event name can not be nil string")
	}
	stub.chaincodeEvent = &pb.ChaincodeEvent{EventName: name, Payload: payload}
	return nil
}
1018384
func (s *SelectObjectContentOutput) SetEventStream(v *SelectObjectContentEventStream) *SelectObjectContentOutput {
	s.EventStream = v
	return s
}
327313
func (s *EventSubscription) SetEvent(v string) *EventSubscription {
	s.Event = &v
	return s
}
1028482
func (il *ILertNotifier) sendEvent(event iLertEvent) error {
	body, err := json.Marshal(event)
	if err != nil {
		return err
	}

	res, err := http.Post(apiEndpoint, "application/json", bytes.NewBuffer(body))
	if err != nil {
		return err
	}

	defer res.Body.Close()

	if res.StatusCode != 200 {
		body, _ := ioutil.ReadAll(res.Body)
		return errors.New(fmt.Sprintf("Unexpected HTTP status code: %d (%s)", res.StatusCode, string(body)))
	}

	return nil
}
345257
func WaitEvent() Event {
	var cevent CEvent
	_event := (*C.SDL_Event)(unsafe.Pointer(&cevent))
	ok := int(C.SDL_WaitEvent(_event))
	if ok == 0 {
		return nil
	}
	return goEvent(&cevent)
}
163739
func NewChaincodeEvent(chaincodeID, eventName, txID string, payload []byte, blockNum uint64, sourceURL string) *fab.CCEvent {
	return &fab.CCEvent{
		ChaincodeID: chaincodeID,
		EventName:   eventName,
		TxID:        txID,
		Payload:     payload,
		BlockNumber: blockNum,
		SourceURL:   sourceURL,
	}
}
1245624
func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response {
	var event string // Indicates whether event has happened. Initially 0
	var eventVal int // State of event
	var err error
	_, args := stub.GetFunctionAndParameters()
	if len(args) != 2 {
		return shim.Error("Incorrect number of arguments. Expecting 2")
	}

	// Initialize the chaincode
	event = args[0]
	eventVal, err = strconv.Atoi(args[1])
	if err != nil {
		return shim.Error("Expecting integer value for event status")
	}
	fmt.Printf("eventVal = %d\n", eventVal)

	err = stub.PutState(event, []byte(strconv.Itoa(eventVal)))
	if err != nil {
		return shim.Error(err.Error())
	}

	return shim.Success(nil)
}
920187
func (s *MsSmoothGroupSettings) SetEventId(v string) *MsSmoothGroupSettings {
	s.EventId = &v
	return s
}
1342357
func (c *Callbacks) OnCUserMessageAchievementEvent(fn func(*dota.CUserMessageAchievementEvent) error) {
	c.onCUserMessageAchievementEvent = append(c.onCUserMessageAchievementEvent, fn)
}
700035
func (s *LookupEventsOutput) SetEvents(v []*Event) *LookupEventsOutput {
	s.Events = v
	return s
}
921438
func (s *Event) SetEventTypeCode(v string) *Event {
	s.EventTypeCode = &v
	return s
}
26171
func (s *CloudFunctionConfiguration) SetEvent(v string) *CloudFunctionConfiguration {
	s.Event = &v
	return s
}
1047647
func (s *SubscribeToEventInput) SetEvent(v string) *SubscribeToEventInput {
	s.Event = &v
	return s
}
1174626
func (s *MetricFilterMatchRecord) SetEventMessage(v string) *MetricFilterMatchRecord {
	s.EventMessage = &v
	return s
}
947367
func (remote *RemoteDebugger) CallbackEvent(method string, cb EventCallback) {
	remote.Lock()
	remote.callbacks[method] = cb
	remote.Unlock()
}
288788
func GetBytesChaincodeEvent(event *peer.ChaincodeEvent) ([]byte, error) {
	eventBytes, err := proto.Marshal(event)
	return eventBytes, errors.Wrap(err, "error marshaling ChaincodeEvent")
}
869731
func (w *Webhook) UpdateEvent() error {
	data, err := jsoniter.Marshal(w.HookEvent)
	w.Events = string(data)
	return err
}