# NOTE: This file is auto generated by OpenAPI Generator 7.22.0 (https://openapi-generator.tech). # Do not edit this file manually. defmodule HookSniffAPI.Api.Billing do @moduledoc """ API calls for all endpoints tagged `Billing`. """ alias HookSniffAPI.Connection import HookSniffAPI.RequestBuilder @doc """ List invoices ### Parameters - `connection` (HookSniffAPI.Connection): Connection to server - `opts` (keyword): Optional parameters ### Returns - `{:ok, [%InvoiceResponse{}, ...]}` on success - `{:error, Tesla.Env.t}` on failure """ @spec billing_invoices_get(Tesla.Env.client, keyword()) :: {:ok, [HookSniffAPI.Model.InvoiceResponse.t]} | {:error, Tesla.Env.t} def billing_invoices_get(connection, _opts \\ []) do request = %{} |> method(:get) |> url("/billing/invoices") |> Enum.into([]) connection |> Connection.request(request) |> evaluate_response([ {200, HookSniffAPI.Model.InvoiceResponse} ]) end @doc """ Open customer billing portal ### Parameters - `connection` (HookSniffAPI.Connection): Connection to server - `opts` (keyword): Optional parameters ### Returns - `{:ok, HookSniffAPI.Model.BillingPortalPost200Response.t}` on success - `{:error, Tesla.Env.t}` on failure """ @spec billing_portal_post(Tesla.Env.client, keyword()) :: {:ok, HookSniffAPI.Model.BillingPortalPost200Response.t} | {:error, Tesla.Env.t} def billing_portal_post(connection, _opts \\ []) do request = %{} |> method(:post) |> url("/billing/portal") |> ensure_body() |> Enum.into([]) connection |> Connection.request(request) |> evaluate_response([ {200, HookSniffAPI.Model.BillingPortalPost200Response} ]) end @doc """ Get current subscription ### Parameters - `connection` (HookSniffAPI.Connection): Connection to server - `opts` (keyword): Optional parameters ### Returns - `{:ok, HookSniffAPI.Model.SubscriptionResponse.t}` on success - `{:error, Tesla.Env.t}` on failure """ @spec billing_subscription_get(Tesla.Env.client, keyword()) :: {:ok, HookSniffAPI.Model.SubscriptionResponse.t} | {:error, Tesla.Env.t} def billing_subscription_get(connection, _opts \\ []) do request = %{} |> method(:get) |> url("/billing/subscription") |> Enum.into([]) connection |> Connection.request(request) |> evaluate_response([ {200, HookSniffAPI.Model.SubscriptionResponse} ]) end @doc """ Upgrade plan ### Parameters - `connection` (HookSniffAPI.Connection): Connection to server - `upgrade_request` (UpgradeRequest): - `opts` (keyword): Optional parameters ### Returns - `{:ok, HookSniffAPI.Model.UpgradeResponse.t}` on success - `{:error, Tesla.Env.t}` on failure """ @spec billing_upgrade_post(Tesla.Env.client, HookSniffAPI.Model.UpgradeRequest.t, keyword()) :: {:ok, HookSniffAPI.Model.UpgradeResponse.t} | {:error, Tesla.Env.t} def billing_upgrade_post(connection, upgrade_request, _opts \\ []) do request = %{} |> method(:post) |> url("/billing/upgrade") |> add_param(:body, :body, upgrade_request) |> Enum.into([]) connection |> Connection.request(request) |> evaluate_response([ {200, HookSniffAPI.Model.UpgradeResponse} ]) end @doc """ Get current usage ### Parameters - `connection` (HookSniffAPI.Connection): Connection to server - `opts` (keyword): Optional parameters ### Returns - `{:ok, HookSniffAPI.Model.UsageResponse.t}` on success - `{:error, Tesla.Env.t}` on failure """ @spec billing_usage_get(Tesla.Env.client, keyword()) :: {:ok, HookSniffAPI.Model.UsageResponse.t} | {:error, Tesla.Env.t} def billing_usage_get(connection, _opts \\ []) do request = %{} |> method(:get) |> url("/billing/usage") |> Enum.into([]) connection |> Connection.request(request) |> evaluate_response([ {200, HookSniffAPI.Model.UsageResponse} ]) end @doc """ iyzico webhook receiver ### Parameters - `connection` (HookSniffAPI.Connection): Connection to server - `body` (map()): - `opts` (keyword): Optional parameters ### Returns - `{:ok, nil}` on success - `{:error, Tesla.Env.t}` on failure """ @spec billing_webhook_iyzico_post(Tesla.Env.client, %{optional(String.t) => any()}, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def billing_webhook_iyzico_post(connection, body, _opts \\ []) do request = %{} |> method(:post) |> url("/billing/webhook/iyzico") |> add_param(:body, :body, body) |> Enum.into([]) connection |> Connection.request(request) |> evaluate_response([ {200, false} ]) end @doc """ Polar.sh webhook receiver ### Parameters - `connection` (HookSniffAPI.Connection): Connection to server - `body` (map()): - `opts` (keyword): Optional parameters ### Returns - `{:ok, nil}` on success - `{:error, Tesla.Env.t}` on failure """ @spec billing_webhook_polar_post(Tesla.Env.client, %{optional(String.t) => any()}, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def billing_webhook_polar_post(connection, body, _opts \\ []) do request = %{} |> method(:post) |> url("/billing/webhook/polar") |> add_param(:body, :body, body) |> Enum.into([]) connection |> Connection.request(request) |> evaluate_response([ {200, false} ]) end @doc """ Stripe webhook receiver ### Parameters - `connection` (HookSniffAPI.Connection): Connection to server - `body` (map()): - `opts` (keyword): Optional parameters ### Returns - `{:ok, nil}` on success - `{:error, Tesla.Env.t}` on failure """ @spec billing_webhook_post(Tesla.Env.client, %{optional(String.t) => any()}, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t} def billing_webhook_post(connection, body, _opts \\ []) do request = %{} |> method(:post) |> url("/billing/webhook") |> add_param(:body, :body, body) |> Enum.into([]) connection |> Connection.request(request) |> evaluate_response([ {200, false} ]) end end