Current section
Files
Jump to
Current section
Files
lib/open_xchange_client/api/user_me.ex
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# https://openapi-generator.tech
# Do not edit the class manually.
defmodule OpenXchangeClient.Api.UserMe do
@moduledoc """
API calls for all endpoints tagged `UserMe`.
"""
alias OpenXchangeClient.Connection
import OpenXchangeClient.RequestBuilder
@doc """
Gets information about current user.
## Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- opts (KeywordList): [optional] Optional parameters
## Returns
{:ok, OpenXchangeClient.Model.CurrentUserResponse.t} on success
{:error, Tesla.Env.t} on failure
"""
@spec get_current_user(Tesla.Env.client(), String.t(), keyword()) ::
{:ok, OpenXchangeClient.Model.CurrentUserResponse.t()} | {:error, Tesla.Env.t()}
def get_current_user(connection, session, _opts \\ []) do
%{}
|> method(:get)
|> url("/user/me")
|> add_param(:query, :session, session)
|> Enum.into([])
|> (&Connection.request(connection, &1)).()
|> evaluate_response([
{200, %OpenXchangeClient.Model.CurrentUserResponse{}}
])
end
end