// GetTargetByID returns a single target by ID.
772150
func (s *ScraperService) GetTargetByID(ctx context.Context, id platform.ID) (*platform.ScraperTarget, error) {
	url, err := newURL(s.Addr, targetIDPath(id))
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("GET", url.String(), nil)
	if err != nil {
		return nil, err
	}
	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 targetResp targetResponse
	if err := json.NewDecoder(resp.Body).Decode(&targetResp); err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	return &targetResp.ScraperTarget, nil
}
502017
func (s *GetMaintenanceWindowExecutionTaskInvocationOutput) SetWindowTargetId(v string) *GetMaintenanceWindowExecutionTaskInvocationOutput {
	s.WindowTargetId = &v
	return s
}
731717
func (s *MaintenanceWindowTarget) SetWindowTargetId(v string) *MaintenanceWindowTarget {
	s.WindowTargetId = &v
	return s
}
1276476
func (s *BatchGetDeploymentTargetsInput) SetTargetIds(v []*string) *BatchGetDeploymentTargetsInput {
	s.TargetIds = v
	return s
}
1370151
func FindById(i interface{}, id string) error {
	return Find(i, bson.M{"_id": bson.ObjectIdHex(id)})
}
1332166
func (info Info) GetIMByID(imID string) *IM {
	for _, im := range info.IMs {
		if im.ID == imID {
			return &im
		}
	}
	return nil
}
257140
func (s *RemediationConfiguration) SetTargetId(v string) *RemediationConfiguration {
	s.TargetId = &v
	return s
}
829155
func (db UserDB) GetByID(id string) (u *models.User, ok bool) {
	u, ok = db.ids[id]
	return
}
1346758
func (s *Service) GetTargetByID(ctx context.Context, id influxdb.ID) (*influxdb.ScraperTarget, error) {
	var target *influxdb.ScraperTarget
	err := s.kv.View(ctx, func(tx Tx) error {
		var err error
		target, err = s.findTargetByID(ctx, tx, id)
		return err
	})

	return target, err
}
724741
func (s *RemoveTargetsResultEntry) SetTargetId(v string) *RemoveTargetsResultEntry {
	s.TargetId = &v
	return s
}
1351827
func (s *RegisterTargetWithMaintenanceWindowOutput) SetWindowTargetId(v string) *RegisterTargetWithMaintenanceWindowOutput {
	s.WindowTargetId = &v
	return s
}
1040347
func (c *Target) ActivateTarget(targetId string) (*gcdmessage.ChromeResponse, error) {
	var v TargetActivateTargetParams
	v.TargetId = targetId
	return c.ActivateTargetWithParams(&v)
}
1269711
func (stages Stages) ByTarget(target string) (Stages, bool) {
	if len(target) == 0 {
		return stages, true
	}
	for i, stage := range stages {
		if stage.Name == target {
			return stages[i : i+1], true
		}
	}
	return nil, false
}
901344
func (r *repository) GetTargetByName(name string, roles ...data.RoleName) (*TargetWithRole, error) {
	if err := r.updateTUF(false); err != nil {
		return nil, err
	}
	return NewReadOnly(r.tufRepo).GetTargetByName(name, roles...)
}
803319
func (r *RepoStatus) GetTargetURL() string {
	if r == nil || r.TargetURL == nil {
		return ""
	}
	return *r.TargetURL
}
1228669
func (s *LambdaTarget) SetTargetId(v string) *LambdaTarget {
	s.TargetId = &v
	return s
}
612627
func (s *userService) GetByID(id int64) (datamodels.User, bool) {
	return s.repo.Select(func(m datamodels.User) bool {
		return m.ID == id
	})
}