View Source ExPipedrive.SearchResult (ex_pipedrive v0.1.0)

One hit from Pipedrive GET /api/v2/itemSearch.

Pipedrive nests the entity under items[].item and tags it with type. This struct unwraps that shape and decodes known types into entity structs (Deal, Person, Organization, Product). Unknown types keep the raw item map.

Summary

Functions

Builds a search result from an items[] entry (result_score + item).

Types

@type t() :: %ExPipedrive.SearchResult{
  item:
    (ExPipedrive.Deal.t()
     | ExPipedrive.Person.t()
     | ExPipedrive.Organization.t()
     | ExPipedrive.Product.t()
     | map())
    | nil,
  original_object: map() | nil,
  result_score: float() | nil,
  type: String.t() | nil
}

Functions

@spec new(map()) :: t()

Builds a search result from an items[] entry (result_score + item).