% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/st_filter.R
\name{st_filter}
\alias{st_filter}
\alias{print.st_filter}
\alias{format.st_filter}
\alias{as.character.st_filter}
\alias{c.st_filter}
\title{Create a Sensor Tower Filter Object}
\usage{
st_filter(
  date_from = NULL,
  date_to = NULL,
  genre = NULL,
  monetization = NULL,
  publisher = NULL,
  sdk = NULL,
  custom_fields = NULL,
  filter_id = NULL,
  combine = c("and", "or"),
  auth_token = NULL
)

\method{print}{st_filter}(x, ...)

\method{format}{st_filter}(x, ...)

\method{as.character}{st_filter}(x, ...)

\method{c}{st_filter}(..., recursive = FALSE, combine = c("and", "or"))
}
\arguments{
\item{date_from, date_to}{Optional date bounds for a release-date criterion.}

\item{genre}{Optional character vector of game genres.}

\item{monetization}{Optional monetization criteria. Accept either a character
vector such as `c("free", "iap")` or a named list like
`list(free = TRUE, iap = TRUE)`.}

\item{publisher}{Optional character vector of publisher names.}

\item{sdk}{Optional character vector of SDK names.}

\item{custom_fields}{Optional raw custom-fields specification. Can be a
list-of-lists already matching the legacy request format or a named list of
field names and values.}

\item{filter_id}{Optional existing 24-character Sensor Tower filter ID to
wrap.}

\item{combine}{Logical operator metadata for multi-criterion filters: `"and"`
or `"or"`.}

\item{auth_token}{Optional Sensor Tower API token.}

\item{x}{An `st_filter` object (S3 method argument).}

\item{...}{Additional arguments. For `c.st_filter()`, further `st_filter`
objects to combine; ignored by `print.st_filter()`, `format.st_filter()`,
and `as.character.st_filter()`.}

\item{recursive}{Unused; present for S3 method-signature compatibility with
[base::c()].}
}
\value{
An object of class `st_filter`, implemented as a list with elements:
  - `criteria`: normalized criteria supplied to `st_filter()`
  - `combine`: `"and"` or `"or"`
  - `filter_id`: the wrapped or created server-side filter ID
}
\description{
Thin v1.0.0 facade for building or wrapping Sensor Tower custom-field filter
IDs. When criteria are supplied, the function translates them into the legacy
custom-fields request structure and creates a server-side filter ID using the
existing implementation.
}
\examples{
\dontrun{
st_filter(genre = c("Puzzle", "Strategy"))

st_filter(
  date_from = "2024-01-01",
  date_to = "2024-12-31",
  monetization = c("free", "iap")
)

existing <- st_filter(filter_id = "687df26ac5a19ebcfe817d7f")
as.character(existing)
}

}
