Current section

Files

Jump to
open_api_oursky_api lib open_api_oursky_api api default.ex
Raw

lib/open_api_oursky_api/api/default.ex

# NOTE: This file is auto generated by OpenAPI Generator 7.0.0 (https://openapi-generator.tech).
# Do not edit this file manually.
defmodule OpenAPIOurskyApi.Api.Default do
@moduledoc """
API calls for all endpoints tagged `Default`.
"""
alias OpenAPIOurskyApi.Connection
import OpenAPIOurskyApi.RequestBuilder
@doc """
Request observations for a satellite target. By creating an organization target you are requesting for a specific target to be observed. The target will be observed best effort by the OurSky network. At the current time OurSky only supports observing satellite targets that are already registered with the platform. To see all possible satellite targets see the [satellite targets](#default/v1GetSatelliteTargets) endpoint. Organization targets also control which events are sent to your organization via webhooks. Webhooks are only sent for targets that you have an active \"organization target\" for.
### Parameters
- `connection` (OpenAPIOurskyApi.Connection): Connection to server
- `v1_organization_target` (V1OrganizationTarget): create organization target
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, OpenAPIOurskyApi.Model.EmptySuccess.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec v1_create_organization_target(Tesla.Env.client, OpenAPIOurskyApi.Model.V1OrganizationTarget.t, keyword()) :: {:ok, OpenAPIOurskyApi.Model.EmptySuccess.t} | {:error, Tesla.Env.t}
def v1_create_organization_target(connection, v1_organization_target, _opts \\ []) do
request =
%{}
|> method(:post)
|> url("/v1/organization-target")
|> add_param(:body, :body, v1_organization_target)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, OpenAPIOurskyApi.Model.EmptySuccess}
])
end
@doc """
delete an organization target
### Parameters
- `connection` (OpenAPIOurskyApi.Connection): Connection to server
- `satellite_target_id` (String.t):
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, OpenAPIOurskyApi.Model.EmptySuccess.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec v1_delete_organization_target(Tesla.Env.client, String.t, keyword()) :: {:ok, OpenAPIOurskyApi.Model.EmptySuccess.t} | {:error, Tesla.Env.t}
def v1_delete_organization_target(connection, satellite_target_id, _opts \\ []) do
request =
%{}
|> method(:delete)
|> url("/v1/organization-target")
|> add_param(:query, :satelliteTargetId, satellite_target_id)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, OpenAPIOurskyApi.Model.EmptySuccess}
])
end
@doc """
Delete an existing webhook configuration
### Parameters
- `connection` (OpenAPIOurskyApi.Connection): Connection to server
- `id` (String.t): webhook id
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, OpenAPIOurskyApi.Model.EmptySuccess.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec v1_delete_webhook_configuration(Tesla.Env.client, String.t, keyword()) :: {:ok, OpenAPIOurskyApi.Model.EmptySuccess.t} | {:error, Tesla.Env.t}
def v1_delete_webhook_configuration(connection, id, _opts \\ []) do
request =
%{}
|> method(:delete)
|> url("/v1/communications/webhook")
|> add_param(:query, :id, id)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, OpenAPIOurskyApi.Model.EmptySuccess}
])
end
@doc """
get an image
### Parameters
- `connection` (OpenAPIOurskyApi.Connection): Connection to server
- `image_id` (String.t):
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, OpenAPIOurskyApi.Model.V1GetImageSetImage.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec v1_get_image_set_image(Tesla.Env.client, String.t, keyword()) :: {:ok, OpenAPIOurskyApi.Model.V1GetImageSetImage.t} | {:error, Tesla.Env.t}
def v1_get_image_set_image(connection, image_id, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/v1/image-set-image")
|> add_param(:query, :imageId, image_id)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, OpenAPIOurskyApi.Model.V1GetImageSetImage}
])
end
@doc """
get organization targets see the [create](#default/v1CreateOrganizationTarget) endpoint for more details
### Parameters
- `connection` (OpenAPIOurskyApi.Connection): Connection to server
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, [%V1GetOrganizationTarget{}, ...]}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec v1_get_organization_targets(Tesla.Env.client, keyword()) :: {:ok, list(OpenAPIOurskyApi.Model.V1GetOrganizationTarget.t)} | {:error, Tesla.Env.t}
def v1_get_organization_targets(connection, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/v1/organization-targets")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, OpenAPIOurskyApi.Model.V1GetOrganizationTarget}
])
end
@doc """
The available satellite objects that the OurSky platform can currently track.
### Parameters
- `connection` (OpenAPIOurskyApi.Connection): Connection to server
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, OpenAPIOurskyApi.Model.V1GetSatelliteTargets.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec v1_get_satellite_targets(Tesla.Env.client, keyword()) :: {:ok, OpenAPIOurskyApi.Model.V1GetSatelliteTargets.t} | {:error, Tesla.Env.t}
def v1_get_satellite_targets(connection, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/v1/satellite-targets")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, OpenAPIOurskyApi.Model.V1GetSatelliteTargets}
])
end
@doc """
get tdm
### Parameters
- `connection` (OpenAPIOurskyApi.Connection): Connection to server
- `tdm_id` (String.t):
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, OpenAPIOurskyApi.Model.V1Tdm.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec v1_get_tdm(Tesla.Env.client, String.t, keyword()) :: {:ok, OpenAPIOurskyApi.Model.V1Tdm.t} | {:error, Tesla.Env.t}
def v1_get_tdm(connection, tdm_id, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/v1/tdm")
|> add_param(:query, :tdmId, tdm_id)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, OpenAPIOurskyApi.Model.V1Tdm}
])
end
@doc """
Get all TDMS or all TDMS for a specific target. This response is paginated. It will only return at most 20 TDMs at a time. To get the next page, pass in the `created_at` timestamp of the last TDM in the current page as the `after` query parameter. Omitting this field uses the current time as the `after` timestamp.
### Parameters
- `connection` (OpenAPIOurskyApi.Connection): Connection to server
- `opts` (keyword): Optional parameters
- `:targetId` (String.t):
- `:after` (DateTime.t):
### Returns
- `{:ok, [%V1Tdm{}, ...]}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec v1_get_tdms(Tesla.Env.client, keyword()) :: {:ok, list(OpenAPIOurskyApi.Model.V1Tdm.t)} | {:error, Tesla.Env.t}
def v1_get_tdms(connection, opts \\ []) do
optional_params = %{
:targetId => :query,
:after => :query
}
request =
%{}
|> method(:get)
|> url("/v1/tdms")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, OpenAPIOurskyApi.Model.V1Tdm}
])
end
@doc """
Get the currently configured webhooks
### Parameters
- `connection` (OpenAPIOurskyApi.Connection): Connection to server
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, [%V1WebhookConfiguration{}, ...]}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec v1_get_webhook_configurations(Tesla.Env.client, keyword()) :: {:ok, list(OpenAPIOurskyApi.Model.V1WebhookConfiguration.t)} | {:error, Tesla.Env.t}
def v1_get_webhook_configurations(connection, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/v1/communications/webhooks")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, OpenAPIOurskyApi.Model.V1WebhookConfiguration}
])
end
@doc """
Create an organization webhook. Organization webhooks are used to send specific events to a remote http endpoint. A webhook can be configured for a list of event type. Please see the webhook event types for the currently supported types. The schemas are considered stable and will match their corresponding GET response schema. \"V1_TDM_CREATED\" -> GET /v1/tdm?id={id} The payload sent to the webhook endpoint will include a header field \"X-OurSky-Signature\" which is an HMAC-SHA256 using the secret as the key and the payload as the message. The payload is the byte stream of the entire JSON payload The signature is base64 encoded.
### Parameters
- `connection` (OpenAPIOurskyApi.Connection): Connection to server
- `v1_put_webhook_configuration` (V1PutWebhookConfiguration): request to create an organization webhook
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, OpenAPIOurskyApi.Model.SuccessfulCreate.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec v1_post_webhook_configuration(Tesla.Env.client, OpenAPIOurskyApi.Model.V1PutWebhookConfiguration.t, keyword()) :: {:ok, OpenAPIOurskyApi.Model.SuccessfulCreate.t} | {:error, Tesla.Env.t}
def v1_post_webhook_configuration(connection, v1_put_webhook_configuration, _opts \\ []) do
request =
%{}
|> method(:post)
|> url("/v1/communications/webhook")
|> add_param(:body, :body, v1_put_webhook_configuration)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, OpenAPIOurskyApi.Model.SuccessfulCreate}
])
end
@doc """
Update your organization email communication preferences. This will overwrite any existing preferences. This communication preference is meant as an audit log, it is a fire hose of all events. The schemas are not considered stable and may change at any time. If you are looking for machine to machine communication, please use webhooks.
### Parameters
- `connection` (OpenAPIOurskyApi.Connection): Connection to server
- `v1_put_email_configuration` (V1PutEmailConfiguration): request to update an organization email preference
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, OpenAPIOurskyApi.Model.EmptySuccess.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec v1_put_email_configuration(Tesla.Env.client, OpenAPIOurskyApi.Model.V1PutEmailConfiguration.t, keyword()) :: {:ok, OpenAPIOurskyApi.Model.EmptySuccess.t} | {:error, Tesla.Env.t}
def v1_put_email_configuration(connection, v1_put_email_configuration, _opts \\ []) do
request =
%{}
|> method(:put)
|> url("/v1/communications/email")
|> add_param(:body, :body, v1_put_email_configuration)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, OpenAPIOurskyApi.Model.EmptySuccess}
])
end
end