starkbank v2.3.0 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 section Functions
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 null]: datetime since when the current owner hold this DICT key. ex: ~U[2020-11-26 17:31:45.482618Z]:created
[DateTime, default null]: creation datetime for the DICT key. ex: ~U[2020-11-26 17:31:45.482618Z]
get(id, options \\ [])
View Sourceget(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
get!(id, options \\ [])
View Sourceget!(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.
query(options \\ [])
View Sourcequery( 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 null]: 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
Same as query(), but it will unwrap the error tuple and raise in case of errors.