// RemoveTarget deletes a scraper target.
552582
func (s *ScraperTargetStoreService) RemoveTarget(ctx context.Context, id platform.ID) error {
	return s.RemoveTargetF(ctx, id)
}
321481
func (g *Cloud) DeleteTargetHTTPProxy(name string) error {
	ctx, cancel := cloud.ContextWithCallTimeout()
	defer cancel()

	mc := newTargetProxyMetricContext("delete")
	return mc.Observe(g.c.TargetHttpProxies().Delete(ctx, meta.GlobalKey(name)))
}
21940
func (s *SecurityProfileTargetMapping) SetTarget(v *SecurityProfileTarget) *SecurityProfileTargetMapping {
	s.Target = v
	return s
}
691627
func (launcher *Launcher) SetTarget(target string) {
	launcher.Mutex.Lock()
	launcher.target = target
	launcher.Mutex.Unlock()
}
10980
func (s *Service) UpdateTarget(ctx context.Context, update *influxdb.ScraperTarget, userID influxdb.ID) (*influxdb.ScraperTarget, error) {
	var target *influxdb.ScraperTarget
	err := s.kv.Update(ctx, func(tx Tx) error {
		var err error
		target, err = s.updateTarget(ctx, tx, update, userID)
		return err
	})

	return target, err
}
876858
func (s *ScraperTargetStoreService) AddTarget(ctx context.Context, st *influxdb.ScraperTarget, userID influxdb.ID) error {
	p, err := influxdb.NewPermission(influxdb.WriteAction, influxdb.ScraperResourceType, st.OrgID)
	if err != nil {
		return err
	}

	if err := IsAllowed(ctx, *p); err != nil {
		return err
	}

	return s.s.AddTarget(ctx, st, userID)
}
426695
func (s *GetConnectionStatusInput) SetTarget(v string) *GetConnectionStatusInput {
	s.Target = &v
	return s
}
746599
func (idx *ListIndex) RemoveID(targetID []byte) error {
	value := idx.IDs.Get(targetID)
	if value == nil {
		return nil
	}

	err := idx.IndexBucket.Delete(value)
	if err != nil {
		return err
	}

	return idx.IDs.Remove(targetID)
}
1068395
func (a *RemoveEventListenerBreakpointArgs) SetTargetName(targetName string) *RemoveEventListenerBreakpointArgs {
	a.TargetName = &targetName
	return a
}
782603
func (s *Service) AddTarget(ctx context.Context, target *platform.ScraperTarget) (err error) {
	target.ID = s.IDGenerator.ID()
	if err := s.PutTarget(ctx, target); err != nil {
		return &platform.Error{
			Op:  OpPrefix + platform.OpAddTarget,
			Err: err,
		}
	}
	return nil
}
59584
func (s *MappingEntry) SetTargetTable(v string) *MappingEntry {
	s.TargetTable = &v
	return s
}
446517
func (s *ScraperService) ListTargets(ctx context.Context) ([]platform.ScraperTarget, error) {
	url, err := newURL(s.Addr, targetPath)
	if err != nil {
		return nil, err
	}

	query := url.Query()

	req, err := http.NewRequest("GET", url.String(), nil)
	if err != nil {
		return nil, err
	}

	req.URL.RawQuery = query.Encode()
	SetToken(s.Token, req)

	hc := newClient(url.Scheme, s.InsecureSkipVerify)
	resp, err := hc.Do(req)
	if err != nil {
		return nil, err
	}
	if err := CheckError(resp, true); err != nil {
		return nil, err
	}

	var targetsResp getTargetsResponse
	if err := json.NewDecoder(resp.Body).Decode(&targetsResp); err != nil {
		return nil, err
	}

	targets := make([]platform.ScraperTarget, len(targetsResp.Targets))
	for k, v := range targetsResp.Targets {
		targets[k] = v.ScraperTarget
	}

	return targets, nil
}
269328
func (s *DeleteV2LoggingLevelInput) SetTargetType(v string) *DeleteV2LoggingLevelInput {
	s.TargetType = &v
	return s
}
1315754
func (s *UpdateRouteOutput) SetTarget(v string) *UpdateRouteOutput {
	s.Target = &v
	return s
}
855359
func (s *ResourceChangeDetail) SetTarget(v *ResourceTargetDefinition) *ResourceChangeDetail {
	s.Target = v
	return s
}
246100
func (c *Target) DetachFromTarget(sessionId string, targetId string) (*gcdmessage.ChromeResponse, error) {
	var v TargetDetachFromTargetParams
	v.SessionId = sessionId
	v.TargetId = targetId
	return c.DetachFromTargetWithParams(&v)
}
1286849
func (s *Service) ListTargets(ctx context.Context) (list []platform.ScraperTarget, err error) {
	list = make([]platform.ScraperTarget, 0)
	s.scraperTargetKV.Range(func(_, v interface{}) bool {
		b, ok := v.(platform.ScraperTarget)
		if !ok {
			err = &platform.Error{
				Code: platform.EInvalid,
				Msg:  fmt.Sprintf("type %T is not a scraper target", v),
			}
			return false
		}
		list = append(list, b)
		return true
	})
	return list, err
}