View Source ExPipedrive.DealLabels (ex_pipedrive v0.2.0)
Deal label definitions via the system label_ids field.
Pipedrive does not expose a dedicated dealLabels endpoint — deal labels
are option values on the label_ids field returned by GET /api/v2/dealFields. This module wraps the API v2 bulk field-options
endpoints (POST / PATCH / DELETE /api/v2/dealFields/label_ids/options) so label definitions can be listed
and managed without hand-rolling ExPipedrive.Raw calls.
Assigning or clearing labels on a deal is done through
ExPipedrive.Deals.update/3 with a label_ids attribute (a list of label
ids) — there is no separate assign/clear endpoint.
Summary
Functions
Adds a deal label via POST /api/v2/dealFields/label_ids/options.
Deletes a deal label via DELETE /api/v2/dealFields/label_ids/options.
Lists deal label definitions via GET /api/v2/dealFields/label_ids.
Updates a deal label via PATCH /api/v2/dealFields/label_ids/options.
Functions
@spec create(Tesla.Client.t(), term()) :: {:ok, ExPipedrive.Label.t()} | {:error, ExPipedrive.Error.t()}
Adds a deal label via POST /api/v2/dealFields/label_ids/options.
Accepts a map (preferred) or %Label{} with :label and optional
:color. Returns the created %Label{}.
@spec delete(Tesla.Client.t(), term()) :: {:ok, ExPipedrive.Label.t()} | {:error, ExPipedrive.Error.t()}
Deletes a deal label via DELETE /api/v2/dealFields/label_ids/options.
Returns the deleted %Label{}.
@spec list(Tesla.Client.t()) :: {:ok, [ExPipedrive.Label.t()]} | {:error, ExPipedrive.Error.t()}
Lists deal label definitions via GET /api/v2/dealFields/label_ids.
@spec update(Tesla.Client.t(), term(), term()) :: {:ok, ExPipedrive.Label.t()} | {:error, ExPipedrive.Error.t()}
Updates a deal label via PATCH /api/v2/dealFields/label_ids/options.