// ChannelTyping broadcasts to all members that authenticated user is typing in
// the given channel.
// channelID  : The ID of a Channel
2903
func (s *Session) ChannelTyping(channelID string) (err error) {

	_, err = s.RequestWithBucketID("POST", EndpointChannelTyping(channelID), nil, EndpointChannelTyping(channelID))
	return
}
826150
func DetectChannelType(channelID string) ChannelType {
	// intentionally ignore the error and just default to CTypeUnknown
	switch r, _ := utf8.DecodeRuneInString(channelID); r {
	case 'C':
		return CTypeChannel
	case 'G':
		return CTypeGroup
	case 'D':
		return CTypeDM
	default:
		return CTypeUnknown
	}
}
1041392
func (c *GroupDeleteCall) ChannelId(channelId string) *GroupDeleteCall {
	c.urlParams_.Set("channelId", channelId)
	return c
}
1217103
func (n *Network) ProfileForChannel(channelName string) string {
	for _, ch := range n.Channels {
		if ch.Name == channelName {
			return ch.Profile
		}
	}
	return ""
}
13976
func (r *ChannelRouter) GetChannelByID(chanID lnwire.ShortChannelID) (
	*channeldb.ChannelEdgeInfo,
	*channeldb.ChannelEdgePolicy,
	*channeldb.ChannelEdgePolicy, error) {

	return r.cfg.Graph.FetchChannelEdgesByID(chanID.ToUint64())
}
1004604
func (cp *MockChannelProvider) ChannelService(ctx fab.ClientContext, channelID string) (fab.ChannelService, error) {

	if cp.customChannelService != nil {
		return cp.customChannelService, nil
	}

	cs := MockChannelService{
		provider:   cp,
		channelID:  channelID,
		transactor: &MockTransactor{},
		discovery:  NewMockDiscoveryService(nil),
		selection:  NewMockSelectionService(nil),
	}
	return &cs, nil
}
212045
func (s *DescribeScheduleInput) SetChannelId(v string) *DescribeScheduleInput {
	s.ChannelId = &v
	return s
}
1219421
func (s *DescribeChannelInput) SetChannelId(v string) *DescribeChannelInput {
	s.ChannelId = &v
	return s
}
226259
func (s *PublicEndpoint) SetChannelType(v string) *PublicEndpoint {
	s.ChannelType = &v
	return s
}
637514
func (info Info) GetChannelByID(channelID string) *Channel {
	for _, channel := range info.Channels {
		if channel.ID == channelID {
			return &channel
		}
	}
	return nil
}
851942
func (api *Client) SetChannelPurpose(channelID, purpose string) (string, error) {
	return api.SetChannelPurposeContext(context.Background(), channelID, purpose)
}
1029389
func ChannelID(env *cb.Envelope) (string, error) {
	chdr, err := ChannelHeader(env)
	if err != nil {
		return "", errors.WithMessage(err, "error retrieving channel header")
	}

	return chdr.ChannelId, nil
}
424465
func (s *Settings) SetChannelIdentification(v bool) *Settings {
	s.ChannelIdentification = &v
	return s
}
10057
func RegisterSubChannel(c Channel, pid int64, ref string) int64 {
	if pid == 0 {
		grpclog.Error("a SubChannel's parent id cannot be 0")
		return 0
	}
	id := idGen.genID()
	sc := &subChannel{
		refName: ref,
		c:       c,
		sockets: make(map[int64]string),
		id:      id,
		pid:     pid,
		trace:   &channelTrace{createdTime: time.Now(), events: make([]*TraceEvent, 0, getMaxTraceEntry())},
	}
	db.get().addSubChannel(id, sc, pid, ref)
	return id
}
622990
func AddChannel(ident, channelName, user, organization string) error {
	query := utils.M{
		"org":   organization,
		"user":  user,
		"ident": ident,
	}

	spec := utils.M{
		"$addToSet": utils.M{
			"channels": db.Channel{Name: channelName, Enabled: true},
		},
	}

	result := utils.M{}

	_, err := db.Conn.FindAndUpdate(db.TopicCollection, query, spec, &result)
	return err
}
1272396
func (s *UpdateOriginEndpointOutput) SetChannelId(v string) *UpdateOriginEndpointOutput {
	s.ChannelId = &v
	return s
}
227332
func (c *channelCache) insert(chanid uint64, channel ChannelEdge) {
	// If entry exists, replace it.
	if _, ok := c.channels[chanid]; ok {
		c.channels[chanid] = channel
		return
	}

	// Otherwise, evict an entry at random and insert.
	if len(c.channels) == c.n {
		for id := range c.channels {
			delete(c.channels, id)
			break
		}
	}
	c.channels[chanid] = channel
}