code: func createMachine(orgID, teamID, creatorID *identity.ID, name string) (
  	*envelope.Machine, []envelope.Membership, error) {
  
  	machineBody := &primitive.Machine{
  		Name:        name,
  		OrgID:       orgID,
  		CreatedBy:   creatorID,
  		Created:     time.Now().UTC(),
  		DestroyedBy: nil,
  		Destroyed:   nil,
  		State:       primitive.MachineActiveState,
  	}
  	machineID, err := identity.NewMutable(machineBody)
  	if err != nil {
  		return nil, nil, err
  	}
  	machine := envelope.Machine{
  		ID:      &machineID,
  		Version: 1,
  		Body:    machineBody,
  	}
  
  	machineTeamID := identity.DeriveMutable(&primitive.Team{}, orgID, primitive.DerivableMachineTeamSymbol)
  	teamIDList := []*identity.ID{&machineTeamID, teamID}
  	var memberships []envelope.Membership
  	for _, curTeamID := range teamIDList {
  		body := primitive.Membership{
  			OwnerID: &machineID,
  			OrgID:   orgID,
  			TeamID:  curTeamID,
  		}
  
  		ID, err := identity.NewMutable(&body)
  		if err != nil {
  			return nil, nil, err
  		}
  
  		membership := envelope.Membership{
  			ID:      &ID,
  			Version: 1,
  			Body:    &body,
  		}
  		memberships = append(memberships, membership)
  	}
  
  	return &machine, memberships, nil
  }
docs: // createMachine generates a Machine object and associated Membership objects
  // to be uploaded to the registry in the future.