Guardsix.Core.UserDefinedList (guardsix v1.2.2)

Copy Markdown View Source

Manage user-defined lists in Guardsix.

Wraps the User Defined Lists API.

For session-based operations (extract, update_static, delete), see Guardsix.Core.UserDefinedListBySession.

Summary

Functions

Import a static list from CSV or TXT content.

List user defined lists.

Validate a list name against LogPoint's naming rules.

Functions

import_static(client, name, content)

@spec import_static(Guardsix.Data.Client.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, term()}

Import a static list from CSV or TXT content.

list(client, params \\ %{})

@spec list(Guardsix.Data.Client.t(), map()) :: {:ok, map()} | {:error, term()}

List user defined lists.

Supported keys in params:

  • :limit - maximum number of lists to return
  • :page - page number for pagination
  • :return_all_data - when true, returns all list data

Examples

UserDefinedList.list(client)
UserDefinedList.list(client, %{limit: 25, page: 2})

validate_name(name)

@spec validate_name(String.t()) :: :ok | {:error, String.t()}

Validate a list name against LogPoint's naming rules.

Names must be 2-100 characters, alphanumeric with hyphens and underscores, and must not begin or end with whitespace, hyphens, or underscores. Names are automatically uppercased by LogPoint.

Examples

:ok = UserDefinedList.validate_name("MY_LIST")
{:error, _} = UserDefinedList.validate_name("_invalid")