# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). # https://openapi-generator.tech # Do not edit the class manually. defmodule FoyerAPI.Api.Office do @moduledoc """ API calls for all endpoints tagged `Office`. """ alias FoyerAPI.Connection import FoyerAPI.RequestBuilder @doc """ Delete Office by Id Delete a specific Office with unique id ## Parameters - connection (FoyerAPI.Connection): Connection to server - id (integer()): - opts (KeywordList): [optional] Optional parameters ## Returns {:ok, nil} on success {:error, Tesla.Env.t} on failure """ @spec delete_office_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def delete_office_by_id(connection, id, _opts \\ []) do %{} |> method(:delete) |> url("/Office/#{id}") |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ { 204, false}, { 401, false} ]) end @doc """ Find One Office Fine one Office according to defined filter criteria ## Parameters - connection (FoyerAPI.Connection): Connection to server - filter (String.t): - opts (KeywordList): [optional] Optional parameters ## Returns {:ok, FoyerAPI.Model.Office.t} on success {:error, Tesla.Env.t} on failure """ @spec find_one_office(Tesla.Env.client, String.t, keyword()) :: {:ok, nil} | {:ok, FoyerAPI.Model.Office.t} | {:error, Tesla.Env.t} def find_one_office(connection, filter, _opts \\ []) do %{} |> method(:get) |> url("/Office/findOne") |> add_param(:headers, :filter, filter) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ { 200, %FoyerAPI.Model.Office{}}, { 401, false} ]) end @doc """ Get Office by Id Get a specific Office with unique id ## Parameters - connection (FoyerAPI.Connection): Connection to server - id (integer()): - opts (KeywordList): [optional] Optional parameters - :filter (String.t): ## Returns {:ok, FoyerAPI.Model.Office.t} on success {:error, Tesla.Env.t} on failure """ @spec get_office_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:ok, FoyerAPI.Model.Office.t} | {:error, Tesla.Env.t} def get_office_by_id(connection, id, opts \\ []) do optional_params = %{ :filter => :headers } %{} |> method(:get) |> url("/Office/#{id}") |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ { 200, %FoyerAPI.Model.Office{}}, { 401, false} ]) end @doc """ Patch Office by Id Patch a specific Office with unique id ## Parameters - connection (FoyerAPI.Connection): Connection to server - id (integer()): - opts (KeywordList): [optional] Optional parameters - :body ([FoyerAPI.Model.PatchDocument.t]): ## Returns {:ok, FoyerAPI.Model.Office.t} on success {:error, Tesla.Env.t} on failure """ @spec patch_office_by_id(Tesla.Env.client, integer(), keyword()) :: {:ok, nil} | {:ok, FoyerAPI.Model.Office.t} | {:error, Tesla.Env.t} def patch_office_by_id(connection, id, opts \\ []) do optional_params = %{ :body => :body } %{} |> method(:patch) |> url("/Office/#{id}") |> add_optional_params(optional_params, opts) |> ensure_body() |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ { 200, %FoyerAPI.Model.Office{}}, { 401, false} ]) end end