Spatio.Api.Apps (spatio_sdk v0.0.2)

API calls for all endpoints tagged Apps.

Summary

Functions

Register a prototype app (project_path is the on-disk root).

Delete one file inside the app's project directory.

List files inside the app's project directory.

List the caller's prototype apps.

Read one file inside the app's project directory. Path is traversal-checked; returns 400 if it escapes project root.

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

Write one file inside the app's project directory.

Functions

create_app(connection, create_app_request, opts \\ [])

Register a prototype app (project_path is the on-disk root).

Parameters

  • connection (Spatio.Connection): Connection to server
  • create_app_request (CreateAppRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, Spatio.Model.App.t} on success
  • {:error, Tesla.Env.t} on failure

delete_app(connection, id, opts \\ [])

@spec delete_app(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}

Delete an app.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

delete_app_file(connection, id, path, opts \\ [])

@spec delete_app_file(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}

Delete one file inside the app's project directory.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • path (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

get_app(connection, id, opts \\ [])

@spec get_app(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, Spatio.Model.App.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Fetch an app.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, Spatio.Model.App.t} on success
  • {:error, Tesla.Env.t} on failure

list_app_files(connection, id, opts \\ [])

@spec list_app_files(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, Spatio.Model.AppFileListResponse.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List files inside the app's project directory.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • opts (keyword): Optional parameters
    • :path (String.t):

Returns

  • {:ok, Spatio.Model.AppFileListResponse.t} on success
  • {:error, Tesla.Env.t} on failure

list_apps(connection, opts \\ [])

@spec list_apps(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, Spatio.Model.AppListResponse.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List the caller's prototype apps.

Parameters

  • connection (Spatio.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, Spatio.Model.AppListResponse.t} on success
  • {:error, Tesla.Env.t} on failure

read_app_file(connection, id, path, opts \\ [])

@spec read_app_file(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, Spatio.Model.AppFileContentResponse.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Read one file inside the app's project directory. Path is traversal-checked; returns 400 if it escapes project root.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • path (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, Spatio.Model.AppFileContentResponse.t} on success
  • {:error, Tesla.Env.t} on failure

update_app(connection, id, update_app_request, opts \\ [])

@spec update_app(
  Tesla.Env.client(),
  String.t(),
  Spatio.Model.UpdateAppRequest.t(),
  keyword()
) ::
  {:ok, Spatio.Model.App.t()}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Update an app.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • update_app_request (UpdateAppRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, Spatio.Model.App.t} on success
  • {:error, Tesla.Env.t} on failure

workspace_create_app(connection, org, workspace, request_body, opts \\ [])

@spec workspace_create_app(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

workspace_delete_app(connection, org, workspace, id, opts \\ [])

@spec workspace_delete_app(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

workspace_get_app(connection, org, workspace, id, opts \\ [])

@spec workspace_get_app(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

workspace_list_apps(connection, org, workspace, opts \\ [])

@spec workspace_list_apps(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

workspace_update_app(connection, org, workspace, id, request_body, opts \\ [])

@spec workspace_update_app(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Parameters

  • connection (Spatio.Connection): Connection to server
  • org (String.t):
  • workspace (String.t):
  • id (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

  • {:ok, %{}} on success
  • {:error, Tesla.Env.t} on failure

write_app_file(connection, id, write_app_file_request, opts \\ [])

@spec write_app_file(
  Tesla.Env.client(),
  String.t(),
  Spatio.Model.WriteAppFileRequest.t(),
  keyword()
) ::
  {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}

Write one file inside the app's project directory.

Parameters

  • connection (Spatio.Connection): Connection to server
  • id (String.t):
  • write_app_file_request (WriteAppFileRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure