Skip to content

Commit

Permalink
Fix casing for WorkOS namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraBeatris committed Oct 21, 2023
1 parent 9ea43d2 commit 4509003
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion config/dev.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Config

config :workos, WorkOs.Client,
config :workos, WorkOS.Client,
client_id: System.get_env("WORKOS_CLIENT_ID"),
api_key: System.get_env("WORKOS_API_KEY")
2 changes: 1 addition & 1 deletion config/prod.ex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# This empty module is for configuration purposes
# This empty module is for configuration purposes
4 changes: 2 additions & 2 deletions config/test.ex
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Config

if workos_api_key = System.get_env("WORKOS_API_KEY") do
config :workos, WorkOs.Client, api_key: workos_api_key
config :workos, WorkOS.Client, api_key: workos_api_key
else
config :tesla, adapter: Tesla.Mock
config :workos, WorkOs.Client, api_key: "re_123456789"
config :workos, WorkOS.Client, api_key: "re_123456789"
end
4 changes: 2 additions & 2 deletions lib/workos.ex
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
defmodule WorkOS do
@moduledoc """
Documentation for `WorkOs`.
Documentation for `WorkOS`.
"""

@config_module WorkOs.Client
@config_module WorkOS.Client

Check warning on line 6 in lib/workos.ex

View workflow job for this annotation

GitHub Actions / Build and test

module attribute @config_module was set but never used

def host, do: Application.get_env(:workos, :host)
def base_url, do: "https://" <> Application.get_env(:workos, :host)
Expand Down
2 changes: 1 addition & 1 deletion lib/workos/castable.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defmodule WorkOs.Castable do
defmodule WorkOS.Castable do
@moduledoc false

@type impl :: module() | {module(), module()} | :raw
Expand Down
16 changes: 8 additions & 8 deletions lib/workos/client.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule WorkOs.Client do
defmodule WorkOS.Client do
@moduledoc """
WorkOs API client.
WorkOS API client.
"""

require Logger
Expand All @@ -27,9 +27,9 @@ defmodule WorkOs.Client do
]

@doc """
Creates a new WorkOs client struct given a keyword list of config opts.
Creates a new WorkOS client struct given a keyword list of config opts.
"""
@spec new(WorkOs.config()) :: t()
@spec new(WorkOS.config()) :: t()
def new(config) do
config = Keyword.take(config, [:api_key, :base_url, :client])
struct!(__MODULE__, Keyword.merge(@default_opts, config))
Expand All @@ -38,7 +38,7 @@ defmodule WorkOs.Client do
@spec get(t(), Castable.impl(), String.t()) :: response(any())
@spec get(t(), Castable.impl(), String.t(), Keyword.t()) :: response(any())
def get(client, castable_module, path, opts \\ []) do
client_module = client.client || WorkOs.Client.TeslaClient
client_module = client.client || WorkOS.Client.TeslaClient

opts =
opts
Expand All @@ -53,7 +53,7 @@ defmodule WorkOs.Client do
@spec post(t(), Castable.impl(), String.t(), map()) :: response(any())
@spec post(t(), Castable.impl(), String.t(), map(), Keyword.t()) :: response(any())
def post(client, castable_module, path, body \\ %{}, opts \\ []) do
client_module = client.client || WorkOs.Client.TeslaClient
client_module = client.client || WorkOS.Client.TeslaClient

opts =
opts
Expand All @@ -69,7 +69,7 @@ defmodule WorkOs.Client do
@spec put(t(), Castable.impl(), String.t(), map()) :: response(any())
@spec put(t(), Castable.impl(), String.t(), map(), Keyword.t()) :: response(any())
def put(client, castable_module, path, body \\ %{}, opts \\ []) do
client_module = client.client || WorkOs.Client.TeslaClient
client_module = client.client || WorkOS.Client.TeslaClient

opts =
opts
Expand All @@ -85,7 +85,7 @@ defmodule WorkOs.Client do
@spec delete(t(), Castable.impl(), String.t(), map()) :: response(any())
@spec delete(t(), Castable.impl(), String.t(), map(), Keyword.t()) :: response(any())
def delete(client, castable_module, path, body \\ %{}, opts \\ []) do
client_module = client.client || WorkOs.Client.TeslaClient
client_module = client.client || WorkOS.Client.TeslaClient

opts =
opts
Expand Down
4 changes: 2 additions & 2 deletions lib/workos/client/tesla_client.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule WorkOs.Client.TeslaClient do
defmodule WorkOS.Client.TeslaClient do

Check warning on line 1 in lib/workos/client/tesla_client.ex

View workflow job for this annotation

GitHub Actions / Build and test

@behaviour WorkOs.Client does not exist (in module WorkOS.Client.TeslaClient)
@moduledoc """
Tesla client for WorkOs. This is the default HTTP client used.
Tesla client for WorkOS. This is the default HTTP client used.
"""
@behaviour WorkOs.Client

Expand Down

0 comments on commit 4509003

Please sign in to comment.