starkbank v2.4.1 StarkBank.DictKey View Source

Groups DictKey related functions

Link to this section Summary

Functions

DictKey represents a PIX key registered in Bacen's DICT system.

Receive a single DictKey struct by passing its id

Same as get(), but it will unwrap the error tuple and raise in case of errors.

Receive a stream of DictKey structs associated with your Stark Bank Workspace

Same as query(), but it will unwrap the error tuple and raise in case of errors.

Link to this section Types

Link to this type

t()

View Source
t() :: %StarkBank.DictKey{
  account_created: term(),
  account_number: term(),
  account_type: term(),
  branch_code: term(),
  created: term(),
  id: term(),
  ispb: term(),
  name: term(),
  owned: term(),
  owner_type: term(),
  status: term(),
  tax_id: term(),
  type: term()
}

Link to this section Functions

Link to this function

%StarkBank.DictKey{}

View Source (struct)

DictKey represents a PIX key registered in Bacen's DICT system.

Parameters (optional):

  • :id [string]: DictKey object unique id and PIX key itself. ex: "tony@starkbank.com", "722.461.430-04", "20.018.183/0001-80", "+5511988887777", "b6295ee1-f054-47d1-9e90-ee57b74f60d9"

    Attributes (return-only):

  • :type [string, default nil]: DICT key type. ex: "email", "cpf", "cnpj", "phone" or "evp"

  • :name [string, default nil]: key owner full name. ex: "Tony Stark"

  • :tax_id [string, default nil]: key owner tax ID (CNPJ or masked CPF). ex: "*.345.678-" or "20.018.183/0001-80"

  • :owner_type [string, default nil]: DICT key owner type. ex "naturalPerson" or "legalPerson"

  • :ispb [string, default nil]: bank ISPB associated with the DICT key. ex: "20018183"

  • :branch_code [string, default nil]: bank account branch code associated with the DICT key. ex: "9585"

  • :account_number [string, default nil]: bank account number associated with the DICT key. ex: "9828282578010513"

  • :account_type [string, default nil]: bank account type associated with the DICT key. ex: "checking", "saving" e "salary"

  • :status [string, default nil]: current DICT key status. ex: "created", "registered", "canceled" or "failed"

  • :account_created [datetime.datetime, default nil]: creation datetime of the bank account associated with the DICT key. ex: datetime.date(2020, 1, 12, 11, 14, 8)

  • :owned [DateTime, default nil]: datetime since when the current owner hold this DICT key. ex: ~U[2020-11-26 17:31:45.482618Z]

  • :created [DateTime, default nil]: creation datetime for the DICT key. ex: ~U[2020-11-26 17:31:45.482618Z]

Link to this function

get(id, options \\ [])

View Source
get(binary(), [
  {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil}
]) ::
  {:ok, StarkBank.DictKey.t()}
  | {:error, [%StarkBank.Error{code: term(), message: term()}]}

Receive a single DictKey struct by passing its id

Parameters (required):

  • :id [string]: DictKey object unique id and PIX key itself. ex: "tony@starkbank.com", "722.461.430-04", "20.018.183/0001-80", "+5511988887777", "b6295ee1-f054-47d1-9e90-ee57b74f60d9"

Options:

  • :user [Organization/Project]: Organization or Project struct returned from StarkBank.project(). Only necessary if default project or organization has not been set in configs.

Return:

  • DictKey struct with updated attributes
Link to this function

get!(id, options \\ [])

View Source
get!(binary(), [
  {:user, StarkBank.User.Project.t() | StarkBank.User.Organization.t() | nil}
]) :: StarkBank.DictKey.t()

Same as get(), but it will unwrap the error tuple and raise in case of errors.

Link to this function

query(options \\ [])

View Source
query(
  limit: integer(),
  type: binary(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  ids: [binary()],
  status: binary(),
  user: StarkBank.User.Project.t() | StarkBank.User.Organization.t()
) ::
  ({:cont, {:ok, [StarkBank.DictKey.t()]}}
   | {:error, [StarkBank.Error.t()]}
   | {:halt, any()}
   | {:suspend, any()},
   any() ->
     any())

Receive a stream of DictKey structs associated with your Stark Bank Workspace

Options:

  • :limit [integer, default nil]: maximum number of structs to be retrieved. Unlimited if nil. ex: 35
  • :type [string, default nil]: DictKey type. ex: "cpf", "cnpj", "phone", "email" or "evp"
  • :after [Date or string, default nil]: date filter for structs created only after specified date. ex: ~D[2020-03-25]
  • :before [Date or string, default nil]: date filter for structs created only before specified date. ex: ~D[2020-03-25]
  • :ids [list of strings, default nil]: list of ids to filter retrieved objects. ex: ["5656565656565656", "4545454545454545"]
  • :status [string, default nil]: filter for status of retrieved structs. ex: "registered"
  • :user [Organization/Project]: Organization or Project struct returned from StarkBank.project(). Only necessary if default project or organization has not been set in configs.

Return:

  • stream of DictKey structs with updated attributes
Link to this function

query!(options \\ [])

View Source
query!(
  limit: integer(),
  type: binary(),
  after: Date.t() | binary(),
  before: Date.t() | binary(),
  ids: [binary()],
  status: binary(),
  user: StarkBank.User.Project.t() | StarkBank.User.Organization.t()
) ::
  ({:cont, [StarkBank.DictKey.t()]}
   | {:halt, any()}
   | {:suspend, any()},
   any() ->
     any())

Same as query(), but it will unwrap the error tuple and raise in case of errors.