// SendDocument full function to send document, uses the reply markup interface.
497385
func (bot TgBot) SendDocument(cid int, document interface{}, rmi *int, rm *ReplyMarkupInt) ResultWithMessage {
	payload, err := bot.documentInterfaceToType(cid, document, rmi, rm)
	if err != nil {
		errc := 500
		errs := err.Error()
		return ResultWithMessage{ResultBase{false, &errc, &errs}, nil}
	}
	// var payload interface{} = SendDocumentIDQuery{cid, document, rmi, rm}
	// if looksLikePath(document) {
	// 	payload = SendDocumentPathQuery{cid, document, rmi, rm}
	// }
	return bot.SendDocumentQuery(payload)
}
40290
func (bot *BotAPI) sendFile(config Fileable) (Message, error) {
	if config.useExistingFile() {
		return bot.sendExisting(config.method(), config)
	}

	return bot.uploadAndSend(config.method(), config)
}
1030195
func SendResponse(w io.Writer, data []byte) (int, error) {
	err := binary.Write(w, binary.BigEndian, int32(len(data)))
	if err != nil {
		return 0, err
	}

	n, err := w.Write(data)
	if err != nil {
		return 0, err
	}

	return (n + 4), nil
}
344093
func (c *Client) SendText(data string) (err error) {
	return c.Conn.WriteMessage(websocket.TextMessage, []byte(data))
}
969233
func (m *MockSentPacketHandler) SendMode() ackhandler.SendMode {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "SendMode")
	ret0, _ := ret[0].(ackhandler.SendMode)
	return ret0
}
1133790
func sendResponse(rw http.ResponseWriter, code int, resp interface{}) {
	enc, err := json.Marshal(resp)
	if err != nil {
		log.Errorf("Failed JSON-encoding HTTP response: %v", err)
		rw.WriteHeader(http.StatusInternalServerError)
		return
	}

	rw.Header().Set("Content-Type", "application/json")
	rw.WriteHeader(code)

	_, err = rw.Write(enc)
	if err != nil {
		log.Errorf("Failed sending HTTP response body: %v", err)
	}
}
136533
func (c *Client) Send(ctx context.Context, msg interface{}) error {
	return c.asynchronous.Send(ctx, msg)
}
924156
func (qs *queryResponseStream) sendResponse(from string, payload []byte) error {
	header := responseHeader{
		Seq:   qs.seq,
		Error: "",
	}
	rec := queryRecord{
		Type:    queryRecordResponse,
		From:    from,
		Payload: payload,
	}
	return qs.client.Send(&header, &rec)
}
121017
func (gr *GoReq) SendFile(paramName, filePath string) *GoReq {
	gr.FileParam = paramName
	gr.FilePath = filePath
	return gr
}
641075
func (s *GetJobDocumentOutput) SetDocument(v string) *GetJobDocumentOutput {
	s.Document = &v
	return s
}
271220
func (this *Response) Sendfile(filename string, opt ...interface{}) {
	http.ServeFile(this.Writer, this.req.Request.Request, filename)
}
407880
func (writer *messageWriter) SendRecord(payload []byte) error {
	select {
	case writer.payloadCh <- payload:
		return nil
	case <-writer.doneCh:
		return fmt.Errorf("messageWriter is done")
	}
}
1169551
func (es *EventSource) SendEvent(id uint64, event string, data interface{}) error {
	switch data.(type) {
	case string:
		es.conn.Write(generateMessage(id, event, data.(string)))
	case []byte:
		es.conn.Write(generateMessage(id, event, string(data.([]byte))))
	case EventData:
		content, err := data.(EventData).Encode()
		if err != nil {
			return err
		}
		es.conn.Write(generateMessage(id, event, string(content)))
	}
	return nil
}
744611
func (c *Client) SendMailSMTP(info *InfoSMTP) error {
	return c.smtpClient.SendMail(
		info.From,
		info.Recipients,
		buildMessage(info.Header, info.Content))
}
582260
func (s *PutSchemaFromJsonInput) SetDocument(v string) *PutSchemaFromJsonInput {
	s.Document = &v
	return s
}
31769
func (s *CreateTrafficPolicyInput) SetDocument(v string) *CreateTrafficPolicyInput {
	s.Document = &v
	return s
}
27388
func sendFile(content_type string, hr HandlerReq) error {
	w, r := hr.w, hr.r
	req_file := path.Join(hr.Dir, hr.File)

	f, err := os.Stat(req_file)
	if err != nil {
		return err
	}

	w.Header().Set("Content-Type", content_type)
	w.Header().Set("Content-Length", fmt.Sprintf("%d", f.Size()))
	w.Header().Set("Last-Modified", f.ModTime().Format(http.TimeFormat))
	http.ServeFile(w, r, req_file)

	return nil
}