// SendItems writes an RLP with the given code and data elements.
// For a call such as:
//
//    SendItems(w, code, e1, e2, e3)
//
// the message payload will be an RLP list containing the items:
//
//    [e1, e2, e3]
//
510882
func SendItems(w MsgWriter, msgcode uint64, elems ...interface{}) error {
	return Send(w, msgcode, elems)
}
546834
func (s *ContentTypeProfiles) SetItems(v []*ContentTypeProfile) *ContentTypeProfiles {
	s.Items = v
	return s
}
538258
func MapItemListToSlice(l MapItemList) []MapItem {
	items := make([]MapItem, 0, l.Size())
	// explicitly ignoring since we know there will not be an error
	_ = l.ForEach(func(v MapItem) error {
		items = append(items, v)
		return nil
	})
	return items
}
870704
func (c *Client) SendPACK(data interface{}) (err error) {
	w, err := c.NextWriter(websocket.BinaryMessage)
	if err != nil {
		return err
	}
	if data != nil {
		codec.NewEncoder(w, &mh).Encode(data)
	}
	return w.Close()
}
71942
func (f *Formatter) FormatItem(c, fd string) (string, error) {
	archetype := proto.MessageType(fd)
	if archetype == nil {
		return "", errors.Reason("unknown proto.Message type %q in formatter data", fd).Err()
	}
	msg := archetypeMessage(archetype)

	// Convert from config to protobuf.
	if err := luciProto.UnmarshalTextML(c, msg); err != nil {
		return "", errors.Annotate(err, "failed to unmarshal text protobuf content").Err()
	}

	// Binary format.
	bc, err := makeBinaryContent(msg)
	if err != nil {
		return "", errors.Annotate(err, "").Err()
	}
	return bc, nil
}
1253588
func (t *tree) itemList(until ...itemType) *ast.ListNode {
	var list *ast.ListNode
	for {
		var token = t.next()
		if list == nil {
			list = &ast.ListNode{token.pos, nil}
		}
		var node, halt = t.textOrTag(token, until)
		if halt {
			return list
		}
		if node != nil {
			list.Nodes = append(list.Nodes, node)
		}
	}
}
779991
func (a *customAdapter) sendMessage(ctx *customAdapterWorkerContext, req interface{}) error {
	b, err := json.Marshal(req)
	if err != nil {
		return err
	}
	a.Trace("xfer: Custom adapter worker %d sending message: %v", ctx.workerNum, string(b))
	// Line oriented JSON
	b = append(b, '\n')
	_, err = ctx.stdin.Write(b)
	return err
}
1251105
func (c *rollbarClient) send(item map[string]interface{}) (uuid string, err error) {
	if len(c.token) == 0 || len(Endpoint) == 0 {
		return "", nil
	}

	jsonBody, err := json.Marshal(item)
	if err != nil {
		return "", err
	}

	resp, err := http.Post(Endpoint, "application/json", bytes.NewReader(jsonBody))
	if err != nil {
		return "", err
	}
	defer func() {
		io.Copy(ioutil.Discard, resp.Body)
		resp.Body.Close()
	}()

	if resp.StatusCode != http.StatusOK {
		return "", fmt.Errorf("Rollbar returned %s", resp.Status)
	}

	// Extract UUID from JSON response
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return "", nil
	}
	success := rollbarSuccess{}
	json.Unmarshal(body, &success)

	return success.Result["uuid"], nil
}
1236922
func getItemsPtr(list runtime.Object) (interface{}, error) {
	v, err := conversion.EnforcePtr(list)
	if err != nil {
		return nil, err
	}

	items := v.FieldByName("Items")
	if !items.IsValid() {
		return nil, errExpectFieldItems
	}
	switch items.Kind() {
	case reflect.Interface, reflect.Ptr:
		target := reflect.TypeOf(items.Interface()).Elem()
		if target.Kind() != reflect.Slice {
			return nil, errExpectSliceItems
		}
		return items.Interface(), nil
	case reflect.Slice:
		return items.Addr().Interface(), nil
	default:
		return nil, errExpectSliceItems
	}
}
575211
func (s *GetApiKeysOutput) SetItems(v []*ApiKey) *GetApiKeysOutput {
	s.Items = v
	return s
}
769731
func (c *Client) SendMessages(m []models.Message, handler func(ack string) error) error {
	_, err := c.conn.SendRequest("msg.send", m, func(ctx *neptulon.ResCtx) error {
		var ack string
		if err := ctx.Result(&ack); err != nil {
			return fmt.Errorf("client: msg.send: error reading response: %v", err)
		}
		return handler(ack)
	})

	if err != nil {
		return fmt.Errorf("client: msg.send: error sending request: %v", err)
	}

	return nil
}
723999
func (s *AllowedMethods) SetItems(v []*string) *AllowedMethods {
	s.Items = v
	return s
}
1276851
func (nc *Conn) flushReconnectPendingItems() {
	if nc.pending == nil {
		return
	}
	if nc.pending.Len() > 0 {
		nc.bw.Write(nc.pending.Bytes())
	}
}
229639
func (gr *GoReq) SendRawBytes(content []byte) *GoReq {
	if gr.Header["Content-Type"] == "" {
		gr.Header["Content-Type"] = "application/octet-stream"
	}
	gr.RawBytesData = content
	return gr
}
216278
func (c *Client) SendEvents(events []Event, opts ...interface{}) (res StatusMessageRes, err error) {
	body := newSendEventsReq(events)
	err = c.transport.Request(&res, http.MethodPost, "/1/events", body, call.Write, opts...)
	return
}
837754
func (q *TransmitLimitedQueue) addItem(cur *limitedBroadcast) {
	_ = q.tq.ReplaceOrInsert(cur)
	if cur.name != "" {
		q.tm[cur.name] = cur
	}
}
574196
func (s *DistributionList) SetItems(v []*DistributionSummary) *DistributionList {
	s.Items = v
	return s
}