// SetGroupTopicContext sets the group topic with a custom context
488148
func (api *Client) SetGroupTopicContext(ctx context.Context, group, topic string) (string, error) {
	values := url.Values{
		"token":   {api.token},
		"channel": {group},
		"topic":   {topic},
	}

	response, err := api.groupRequest(ctx, "groups.setTopic", values)
	if err != nil {
		return "", err
	}
	return response.Topic, nil
}
717324
func (s *ModifyOptionGroupOutput) SetOptionGroup(v *OptionGroup) *ModifyOptionGroupOutput {
	s.OptionGroup = v
	return s
}
71158
func SetContext(ctx context.Context, e Entry) context.Context {
	return context.WithValue(ctx, ctxIdent, e)
}
80346
func (l *Logger) SetContext(ctx Ctx) *Logger {
	l.ctx = ctx
	return l
}
1307507
func WithContext(ctx context.Context) ContextGroup {
	if ctx == nil {
		panic("nil Context")
	}
	return newContextGroup(ctx, nil)
}
489861
func (r *RoomService) SetTopic(id string, topic string) (*http.Response, error) {
	topicReq := &SetTopicRequest{Topic: topic}

	req, err := r.client.NewRequest("PUT", fmt.Sprintf("room/%s/topic", id), nil, topicReq)
	if err != nil {
		return nil, err
	}

	return r.client.Do(req, nil)
}
1284764
func (s *UpdateParameterGroupOutput) SetParameterGroup(v *ParameterGroup) *UpdateParameterGroupOutput {
	s.ParameterGroup = v
	return s
}
215598
func (s *InvokeInput) SetClientContext(v string) *InvokeInput {
	s.ClientContext = &v
	return s
}
848384
func (m *SchemaSource) SetContext(ctx *plan.Context) {
	m.ctx = ctx
	if m.session {
		m.rows = RowsForSession(ctx)
	}
}
705485
func SetContext(req *Request, region *metapb.Region, peer *metapb.Peer) error {
	ctx := &req.Context
	ctx.RegionId = region.Id
	ctx.RegionEpoch = region.RegionEpoch
	ctx.Peer = peer

	switch req.Type {
	case CmdGet:
		req.Get.Context = ctx
	case CmdScan:
		req.Scan.Context = ctx
	case CmdPrewrite:
		req.Prewrite.Context = ctx
	case CmdCommit:
		req.Commit.Context = ctx
	case CmdCleanup:
		req.Cleanup.Context = ctx
	case CmdBatchGet:
		req.BatchGet.Context = ctx
	case CmdBatchRollback:
		req.BatchRollback.Context = ctx
	case CmdScanLock:
		req.ScanLock.Context = ctx
	case CmdResolveLock:
		req.ResolveLock.Context = ctx
	case CmdGC:
		req.GC.Context = ctx
	case CmdDeleteRange:
		req.DeleteRange.Context = ctx
	case CmdRawGet:
		req.RawGet.Context = ctx
	case CmdRawBatchGet:
		req.RawBatchGet.Context = ctx
	case CmdRawPut:
		req.RawPut.Context = ctx
	case CmdRawBatchPut:
		req.RawBatchPut.Context = ctx
	case CmdRawDelete:
		req.RawDelete.Context = ctx
	case CmdRawBatchDelete:
		req.RawBatchDelete.Context = ctx
	case CmdRawDeleteRange:
		req.RawDeleteRange.Context = ctx
	case CmdRawScan:
		req.RawScan.Context = ctx
	case CmdUnsafeDestroyRange:
		req.UnsafeDestroyRange.Context = ctx
	case CmdCop:
		req.Cop.Context = ctx
	case CmdCopStream:
		req.Cop.Context = ctx
	case CmdMvccGetByKey:
		req.MvccGetByKey.Context = ctx
	case CmdMvccGetByStartTs:
		req.MvccGetByStartTs.Context = ctx
	case CmdSplitRegion:
		req.SplitRegion.Context = ctx
	default:
		return fmt.Errorf("invalid request type %v", req.Type)
	}
	return nil
}
811272
func (s *ListGroupCertificateAuthoritiesOutput) SetGroupCertificateAuthorities(v []*GroupCertificateAuthorityProperties) *ListGroupCertificateAuthoritiesOutput {
	s.GroupCertificateAuthorities = v
	return s
}
456384
func (s *UpdateDynamicThingGroupInput) SetThingGroupProperties(v *ThingGroupProperties) *UpdateDynamicThingGroupInput {
	s.ThingGroupProperties = v
	return s
}
1302390
func SetContext(err error, key string, value interface{}) {
	if e, ok := err.(withContext); ok {
		e.Set(key, value)
	}
}
1080343
func (s *GenerateDataKeyInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyInput {
	s.EncryptionContext = v
	return s
}
121380
func (s *DescribeThingGroupOutput) SetThingGroupProperties(v *ThingGroupProperties) *DescribeThingGroupOutput {
	s.ThingGroupProperties = v
	return s
}
318639
func (s *CreateDynamicThingGroupInput) SetThingGroupProperties(v *ThingGroupProperties) *CreateDynamicThingGroupInput {
	s.ThingGroupProperties = v
	return s
}
590810
func (api *Client) SetChannelTopicContext(ctx context.Context, channelID, topic string) (string, error) {
	values := url.Values{
		"token":   {api.token},
		"channel": {channelID},
		"topic":   {topic},
	}

	response, err := api.channelRequest(ctx, "channels.setTopic", values)
	if err != nil {
		return "", err
	}
	return response.Topic, nil
}