# `AppBlockList.App`
[🔗](https://github.com/explainableaixai/appblocklist-elixir/blob/v1.0.0/lib/appblocklist/app.ex#L1)

One answer from the App Lookup API.

A 200 answer gives `found: true`. A 404 answer gives `found: false`; for a
Google Play app that is not yet categorized, `android_package` is set and
`pending_android?/1` returns true.

# `t`

```elixir
@type t() :: %AppBlockList.App{
  age_rating: String.t(),
  android_package: String.t(),
  app_store_genre: String.t(),
  app_store_id: String.t(),
  bundle_id: String.t(),
  developer: String.t(),
  developer_domain: String.t(),
  error: String.t() | nil,
  filtering_categories: [String.t()],
  found: boolean(),
  iab_category: String.t(),
  name: String.t(),
  raw: map()
}
```

# `blocked_by?`

```elixir
@spec blocked_by?(t(), Enumerable.t()) :: boolean()
```

True when at least one category of the app is in `blocked`.

# `from_map`

```elixir
@spec from_map(map()) :: t()
```

Builds a struct from a decoded JSON map (string keys).

# `has_category?`

```elixir
@spec has_category?(t(), String.t()) :: boolean()
```

Case-insensitive test for one category.

# `matching_categories`

```elixir
@spec matching_categories(t(), Enumerable.t()) :: [String.t()]
```

Categories of the app that appear in `blocked`, in ranked order.

# `minimum_age`

```elixir
@spec minimum_age(t()) :: non_neg_integer() | nil
```

The numeric part of the age rating: 12 for "12+", nil when missing.

# `pending_android?`

```elixir
@spec pending_android?(t()) :: boolean()
```

Listed on Google Play but not yet in the categorized database.

# `primary_category`

```elixir
@spec primary_category(t()) :: String.t() | nil
```

The most descriptive filtering category, or nil.

# `to_map`

```elixir
@spec to_map(t()) :: map()
```

Map with the API field names, ready for Jason.encode!/1.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
