// deleteConversationLocal contains the functionality of
// DeleteConversationLocal split off for easier testing.
967415
func (h *Server) deleteConversationLocal(ctx context.Context, arg chat1.DeleteConversationLocalArg) (res chat1.DeleteConversationLocalRes, err error) {
	ui := h.getChatUI(arg.SessionID)
	confirmed := arg.Confirmed
	if !confirmed {
		confirmed, err = ui.ChatConfirmChannelDelete(ctx, chat1.ChatConfirmChannelDeleteArg{
			SessionID: arg.SessionID,
			Channel:   arg.ChannelName,
		})
		if err != nil {
			return res, err
		}
	}
	if !confirmed {
		return res, errors.New("channel delete unconfirmed")
	}

	_, err = h.remoteClient().DeleteConversation(ctx, arg.ConvID)
	if err != nil {
		return res, err
	}
	res.Offline = h.G().InboxSource.IsOffline(ctx)
	return res, nil
}
957873
func (c *ChannelsInfoCall) IncludeLocale(includeLocale bool) *ChannelsInfoCall {
	c.includeLocale = includeLocale
	return c
}
1216634
func (e *executor) mapperLocal(ctx context.Context, shards []uint64, mapFn mapFunc, reduceFn reduceFunc) (interface{}, error) {
	span, ctx := tracing.StartSpanFromContext(ctx, "Executor.mapperLocal")
	defer span.Finish()

	ch := make(chan mapResponse, len(shards))

	for _, shard := range shards {
		go func(shard uint64) {
			result, err := mapFn(shard)

			// Return response to the channel.
			select {
			case <-ctx.Done():
			case ch <- mapResponse{result: result, err: err}:
			}
		}(shard)
	}

	// Reduce results
	var maxShard int
	var result interface{}
	for {
		select {
		case <-ctx.Done():
			return nil, ctx.Err()
		case resp := <-ch:
			if resp.err != nil {
				return nil, resp.err
			}
			result = reduceFn(result, resp.result)
			maxShard++
		}

		// Exit once all shards are processed.
		if maxShard == len(shards) {
			return result, nil
		}
	}
}
288958
func (m *MockLambdaAPI) DeleteFunctionConcurrencyRequest(arg0 *lambda.DeleteFunctionConcurrencyInput) (*request.Request, *lambda.DeleteFunctionConcurrencyOutput) {
	ret := m.ctrl.Call(m, "DeleteFunctionConcurrencyRequest", arg0)
	ret0, _ := ret[0].(*request.Request)
	ret1, _ := ret[1].(*lambda.DeleteFunctionConcurrencyOutput)
	return ret0, ret1
}
557415
func (s *DescribeEventsInput) SetLocale(v string) *DescribeEventsInput {
	s.Locale = &v
	return s
}
269455
func (s *CombinedPrimitiveSlice) UpsertLocal(l interface{}) {
	v := s.upsert(l)
	v.local = l
	v.localSet = true
}
823598
func (u *User) CanImportLocal() bool {
	return setting.Repository.EnableLocalPathMigration && (u.IsAdmin || u.AllowImportLocal)
}
1314989
func DeleteGlobal(key string) error {
	collections.globalMutex.Lock()
	obj := collections.globals[key]
	collections.globalMutex.Unlock()
	if obj == nil {
		log.Errorf("global %s not found", key)
		return errors.New("global not found")
	}

	// Check if we handle this object
	if objCallbackHandler.GlobalCb == nil {
		log.Errorf("No callback registered for global object")
		return errors.New("Invalid object type")
	}

	// Perform callback
	err := objCallbackHandler.GlobalCb.GlobalDelete(obj)
	if err != nil {
		log.Errorf("GlobalDelete retruned error for: %+v. Err: %v", obj, err)
		return err
	}

	// delete it from modeldb
	collections.globalMutex.Lock()
	err = obj.Delete()
	collections.globalMutex.Unlock()
	if err != nil {
		log.Errorf("Error deleting global %s. Err: %v", obj.Key, err)
	}

	// delete it from cache
	collections.globalMutex.Lock()
	delete(collections.globals, key)
	collections.globalMutex.Unlock()

	return nil
}
524630
func DialTimeoutLocal(socket string, timeout time.Duration) (net.Conn, error) {
	// on unix, we dial a unix socket
	return net.DialTimeout("unix", socket, timeout)
}
1356247
func (s *PresenceService) GetLocalClusterName() (string, error) {
	item, err := s.Get(context.TODO(), backend.Key(localClusterPrefix, valPrefix))
	if err != nil {
		return "", trace.Wrap(err)
	}
	return string(item.Value), nil
}
35987
func (s *Ssml) SetLocale(v string) *Ssml {
	s.Locale = &v
	return s
}
225516
func (s *DescribeRulesPackagesInput) SetLocale(v string) *DescribeRulesPackagesInput {
	s.Locale = &v
	return s
}
1047227
func (c *JobValidateCommand) validateLocal(aj *api.Job) (*api.JobValidateResponse, error) {
	var out api.JobValidateResponse

	job := agent.ApiJobToStructJob(aj)
	canonicalizeWarnings := job.Canonicalize()

	if vErr := job.Validate(); vErr != nil {
		if merr, ok := vErr.(*multierror.Error); ok {
			for _, err := range merr.Errors {
				out.ValidationErrors = append(out.ValidationErrors, err.Error())
			}
			out.Error = merr.Error()
		} else {
			out.ValidationErrors = append(out.ValidationErrors, vErr.Error())
			out.Error = vErr.Error()
		}
	}

	warnings := job.Warnings()
	out.Warnings = structs.MergeMultierrorWarnings(warnings, canonicalizeWarnings)
	return &out, nil
}
450771
func (g *Cloud) DeleteGlobalAddress(name string) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newAddressMetricContext("delete", "")
	return mc.Observe(g.c.GlobalAddresses().Delete(ctx, meta.GlobalKey(name)))
}
1292502
func (m *MockLambdaAPI) DeleteFunctionConcurrency(arg0 *lambda.DeleteFunctionConcurrencyInput) (*lambda.DeleteFunctionConcurrencyOutput, error) {
	ret := m.ctrl.Call(m, "DeleteFunctionConcurrency", arg0)
	ret0, _ := ret[0].(*lambda.DeleteFunctionConcurrencyOutput)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
377370
func (s *IndicesGetService) Local(local bool) *IndicesGetService {
	s.local = &local
	return s
}
259318
func (r Network_Interconnect_Tenant) DeleteConnection(receivedObject *datatypes.Network_Interconnect_Tenant) (resp bool, err error) {
	params := []interface{}{
		receivedObject,
	}
	err = r.Session.DoRequest("SoftLayer_Network_Interconnect_Tenant", "deleteConnection", params, &r.Options, &resp)
	return
}