Current section
Files
Jump to
Current section
Files
lib/byauth/client/api/owner.ex
# (C) 2018 Bycrates AS
# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.
defmodule Byauth.Client.Api.Owner do
@moduledoc """
API calls for all endpoints tagged `Owner`.
"""
alias Byauth.Client.Connection
import Byauth.Client.RequestBuilder
@doc """
Get current user
## Parameters
- connection (Byauth.Client.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, %Byauth.Client.Model.User{}} on success
{:error, info} on failure
"""
@spec get_current_user(Tesla.Env.client, keyword()) :: {:ok, Byauth.Client.Model.User.t} | {:error, Tesla.Env.t}
def get_current_user(connection, _opts \\ []) do
%{}
|> method(:get)
|> url("/me")
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> decode(%Byauth.Client.Model.User{})
end
end