code: func (m *mockApplies) create(cvID, workspaceID string) (*tfe.Apply, error) {
  	c, ok := m.client.ConfigurationVersions.configVersions[cvID]
  	if !ok {
  		return nil, tfe.ErrResourceNotFound
  	}
  	if c.Speculative {
  		// Speculative means its plan-only so we don't create a Apply.
  		return nil, nil
  	}
  
  	id := generateID("apply-")
  	url := fmt.Sprintf("https://app.terraform.io/_archivist/%s", id)
  
  	a := &tfe.Apply{
  		ID:         id,
  		LogReadURL: url,
  		Status:     tfe.ApplyPending,
  	}
  
  	w, ok := m.client.Workspaces.workspaceIDs[workspaceID]
  	if !ok {
  		return nil, tfe.ErrResourceNotFound
  	}
  
  	if w.AutoApply {
  		a.Status = tfe.ApplyRunning
  	}
  
  	m.logs[url] = filepath.Join(
  		m.client.ConfigurationVersions.uploadPaths[cvID],
  		w.WorkingDirectory,
  		"apply.log",
  	)
  	m.applies[a.ID] = a
  
  	return a, nil
  }
docs: // create is a helper function to create a mock apply that uses the configured
  // working directory to find the logfile.