<commit_before>package lifecycle

import (
	"github.com/lxc/lxd/shared/api"
	"github.com/lxc/lxd/shared/version"
)

// StoragePoolAction represents a lifecycle event action for storage pools.
type StoragePoolAction string

// All supported lifecycle events for storage pools.
const (
	StoragePoolCreated = StoragePoolAction(api.EventLifecycleStoragePoolCreated)
	StoragePoolDeleted = StoragePoolAction(api.EventLifecycleStoragePoolDeleted)
	StoragePoolUpdated = StoragePoolAction(api.EventLifecycleStoragePoolUpdated)
)

// Event creates the lifecycle event for an action on an storage pool.
func (a StoragePoolAction) Event(name string, projectName string, requestor *api.EventLifecycleRequestor, ctx map[string]any) api.EventLifecycle {
	u := api.NewURL().Path(version.APIVersion, "storage-pools", name).Project(projectName)

	return api.EventLifecycle{
		Action:    string(a),
		Source:    u.String(),
		Context:   ctx,
		Requestor: requestor,
	}
}<commit_msg>lxd/lifecycle/storage/pool: Remove projectName arg from StoragePoolAction.Event<commit_after>package lifecycle

import (
	"github.com/lxc/lxd/shared/api"
	"github.com/lxc/lxd/shared/version"
)

// StoragePoolAction represents a lifecycle event action for storage pools.
type StoragePoolAction string

// All supported lifecycle events for storage pools.
const (
	StoragePoolCreated = StoragePoolAction(api.EventLifecycleStoragePoolCreated)
	StoragePoolDeleted = StoragePoolAction(api.EventLifecycleStoragePoolDeleted)
	StoragePoolUpdated = StoragePoolAction(api.EventLifecycleStoragePoolUpdated)
)

// Event creates the lifecycle event for an action on an storage pool.
func (a StoragePoolAction) Event(name string, requestor *api.EventLifecycleRequestor, ctx map[string]any) api.EventLifecycle {
	u := api.NewURL().Path(version.APIVersion, "storage-pools", name)

	return api.EventLifecycle{
		Action:    string(a),
		Source:    u.String(),
		Context:   ctx,
		Requestor: requestor,
	}
}
{'fraction_non_alphanumeric': 0.09174782162993336, 'fraction_numerical': 0.0, 'mean_word_length': 5.707903780068729, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7222661', 'n_tokens_mistral': 587, 'n_tokens_neox': 577, 'n_words': 141}