// CreateID creates and populates a WorklogID for the WorklogItem based on the
// given type and its subject.
178150
func (w *WorklogItem) CreateID(worklogType WorklogType) {
	h, err := blake2b.New(&blake2b.Config{Size: worklogIDLen - 1})
	if err != nil { // this only happens with a bad config
		panic(err)
	}

	h.Write([]byte{byte(worklogType)})
	h.Write([]byte(w.Details.Subject()))

	id := WorklogID{byte(worklogType)}
	copy(id[1:], h.Sum(nil))
	w.ID = &id
}
241758
func DefaultID(i interface{}) int {
	intVal, err := strconv.Atoi(fmt.Sprint(i))
	if err != nil {
		log.Fatalf(err.Error())
	}
	return intVal
}
644541
func NewID(id string) (*ID, error) {
	if strings.ContainsAny(id, "<>") {
		return nil, fmt.Errorf("node.NewID(%q) does not allow '<' or '>'", id)
	}
	if id == "" {
		return nil, fmt.Errorf("node.NewID(%q) cannot create empty ID", id)
	}
	nID := ID(id)
	return &nID, nil
}
948712
func (s *SignalExternalWorkflowExecutionDecisionAttributes) SetWorkflowId(v string) *SignalExternalWorkflowExecutionDecisionAttributes {
	s.WorkflowId = &v
	return s
}
457086
func (s *CreateBrokerRequest) SetCreatorRequestId(v string) *CreateBrokerRequest {
	s.CreatorRequestId = &v
	return s
}
1138798
func (f *contextFactory) newId(name string) string {
	return fmt.Sprintf("%s-%s-%d", f.unit.Name(), name, f.rand.Int63())
}
676354
func MakeTemporaryID() (ID, error) {
	var dh kbfshash.RawDefaultHash
	err := kbfscrypto.RandRead(dh[:])
	if err != nil {
		return ID{}, err
	}
	h, err := kbfshash.HashFromRaw(kbfshash.DefaultHashType, dh[:])
	if err != nil {
		return ID{}, err
	}
	return ID{h}, nil
}
331883
func (s *CreateResolverRuleInput) SetCreatorRequestId(v string) *CreateResolverRuleInput {
	s.CreatorRequestId = &v
	return s
}
454193
func (s *CompleteMultipartUploadInput) SetUploadId(v string) *CompleteMultipartUploadInput {
	s.UploadId = &v
	return s
}
399959
func (s *SelectionsListMember) SetCreatorRequestId(v string) *SelectionsListMember {
	s.CreatorRequestId = &v
	return s
}
1220406
func (s *CreateBackupSelectionInput) SetCreatorRequestId(v string) *CreateBackupSelectionInput {
	s.CreatorRequestId = &v
	return s
}
346597
func (s *UploadPartInput) SetUploadId(v string) *UploadPartInput {
	s.UploadId = &v
	return s
}
256547
func (r *GormWorkItemLinkRevisionRepository) Create(ctx context.Context, modifierID uuid.UUID, revisionType RevisionType, l WorkItemLink) error {
	log.Debug(nil, map[string]interface{}{
		"modifier_id":   modifierID,
		"revision_type": revisionType,
	}, "Storing a revision after operation on work item link.")
	tx := r.db
	revision := &Revision{
		ModifierIdentity:     modifierID,
		Time:                 time.Now(),
		Type:                 revisionType,
		WorkItemLinkID:       l.ID,
		WorkItemLinkVersion:  l.Version,
		WorkItemLinkSourceID: l.SourceID,
		WorkItemLinkTargetID: l.TargetID,
		WorkItemLinkTypeID:   l.LinkTypeID,
	}
	if err := tx.Create(&revision).Error; err != nil {
		return errors.NewInternalError(ctx, errs.Wrap(err, "failed to create new work item link revision"))
	}
	log.Debug(ctx, map[string]interface{}{"wil_id": l.ID}, "work item link revision occurrence created")
	return nil
}
386374
func (c *WorkItemLinkController) Create(ctx *app.CreateWorkItemLinkContext) error {
	currentUserIdentityID, err := login.ContextIdentity(ctx)
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, errors.NewUnauthorizedError(err.Error()))
	}
	modelLink, err := ConvertLinkToModel(app.WorkItemLinkSingle{
		Data: ctx.Payload.Data,
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	var createdModelLink *link.WorkItemLink
	err = application.Transactional(c.db, func(appl application.Application) error {
		var err error
		createdModelLink, err = appl.WorkItemLinks().Create(ctx.Context, modelLink.SourceID, modelLink.TargetID, modelLink.LinkTypeID, *currentUserIdentityID)
		return err
	})
	if err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	// convert from model to rest representation
	createdAppLink := ConvertLinkFromModel(ctx.Request, *createdModelLink)
	if err := enrichLinkSingle(ctx.Context, c.db, ctx.Request, &createdAppLink); err != nil {
		return jsonapi.JSONErrorResponse(ctx, err)
	}
	ctx.ResponseWriter.Header().Set("Location", app.WorkItemLinkHref(createdAppLink.Data.ID))
	return ctx.Created(&createdAppLink)
}
541446
func (s *StartChildWorkflowExecutionInitiatedEventAttributes) SetWorkflowId(v string) *StartChildWorkflowExecutionInitiatedEventAttributes {
	s.WorkflowId = &v
	return s
}
1336261
func (s *SignalExternalWorkflowExecutionInitiatedEventAttributes) SetWorkflowId(v string) *SignalExternalWorkflowExecutionInitiatedEventAttributes {
	s.WorkflowId = &v
	return s
}
978572
func (i *UnitInfo) EntityId() EntityId {
	return EntityId{
		Kind:      "unit",
		ModelUUID: i.ModelUUID,
		Id:        i.Name,
	}
}