# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). # https://openapi-generator.tech # Do not edit the class manually. defmodule MailSlurpAPI.Api.TrackingController do @moduledoc """ API calls for all endpoints tagged `TrackingController`. """ alias MailSlurpAPI.Connection import MailSlurpAPI.RequestBuilder @doc """ Create tracking pixel Create a tracking pixel. A tracking pixel is an image that can be embedded in an email. When the email is viewed and the image is seen MailSlurp will mark the pixel as seen. Use tracking pixels to monitor email open events. You can receive open notifications via webhook or by fetching the pixel. ## Parameters - connection (MailSlurpAPI.Connection): Connection to server - create_tracking_pixel_options (CreateTrackingPixelOptions): createTrackingPixelOptions - opts (KeywordList): [optional] Optional parameters ## Returns {:ok, %MailSlurpAPI.Model.TrackingPixelDto{}} on success {:error, info} on failure """ @spec create_tracking_pixel(Tesla.Env.client, MailSlurpAPI.Model.CreateTrackingPixelOptions.t, keyword()) :: {:ok, MailSlurpAPI.Model.TrackingPixelDto.t} | {:error, Tesla.Env.t} def create_tracking_pixel(connection, create_tracking_pixel_options, _opts \\ []) do %{} |> method(:post) |> url("/tracking/pixels") |> add_param(:body, :body, create_tracking_pixel_options) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ { 201, %MailSlurpAPI.Model.TrackingPixelDto{}}, { 401, false}, { 403, false}, { 404, false} ]) end @doc """ Get tracking pixels List tracking pixels in paginated form ## Parameters - connection (MailSlurpAPI.Connection): Connection to server - opts (KeywordList): [optional] Optional parameters - :before (DateTime.t): Filter by created at before the given timestamp - :page (integer()): Optional page index in list pagination - :search_filter (String.t): Optional search filter - :since (DateTime.t): Filter by created at after the given timestamp - :size (integer()): Optional page size in list pagination - :sort (String.t): Optional createdAt sort direction ASC or DESC ## Returns {:ok, %MailSlurpAPI.Model.PageTrackingPixelProjection{}} on success {:error, info} on failure """ @spec get_all_tracking_pixels(Tesla.Env.client, keyword()) :: {:ok, MailSlurpAPI.Model.PageTrackingPixelProjection.t} | {:error, Tesla.Env.t} def get_all_tracking_pixels(connection, opts \\ []) do optional_params = %{ :"before" => :query, :"page" => :query, :"searchFilter" => :query, :"since" => :query, :"size" => :query, :"sort" => :query } %{} |> method(:get) |> url("/tracking/pixels") |> add_optional_params(optional_params, opts) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ { 200, %MailSlurpAPI.Model.PageTrackingPixelProjection{}}, { 401, false}, { 403, false}, { 404, false} ]) end @doc """ Get pixel ## Parameters - connection (MailSlurpAPI.Connection): Connection to server - id (String.t): id - opts (KeywordList): [optional] Optional parameters ## Returns {:ok, %MailSlurpAPI.Model.TrackingPixelDto{}} on success {:error, info} on failure """ @spec get_tracking_pixel(Tesla.Env.client, String.t, keyword()) :: {:ok, MailSlurpAPI.Model.TrackingPixelDto.t} | {:error, Tesla.Env.t} def get_tracking_pixel(connection, id, _opts \\ []) do %{} |> method(:get) |> url("/tracking/pixels/#{id}") |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> evaluate_response([ { 200, %MailSlurpAPI.Model.TrackingPixelDto{}}, { 401, false}, { 403, false}, { 404, false} ]) end end