<commit_before># Models

You should not have to create model instances in order to use the client, however the following overview explains how the client models BadgeKit objects.

Models are created either from a simple identifier, or a full object describing the model instance. Model instances also require a parent, which will vary depending on the context. `Badges` require a `System`, `Issuer` or `Program`, for example, while `Applications` require a `Badge`, and `Reviews` require an `Application`.

As with client method calls, defining model objects involves JSON, which can be abbreviated:

```js
var item = new Model('item-slug', <parent>);
```

...is equivalent to:

```js
var item = new Model({
  slug: 'item-slug'
}, <parent>);
```

...alternatively, with a full context:

```js
var item = new Model({
  slug: 'item-slug',
  name: 'Item Name',
  description: 'Item Description',<commit_msg>Update models.md<commit_after># Models

You can access the full range of client functionality via the [client object methods](methods.md). However, you can also access model methods via the response objects returned from your client method calls, which you may find more convenient within your applications.

You should typically not have to create model instances, however the following overview explains how the client instantiates BadgeKit objects. See [Common Methods](#common-methods) below for functionality you can exploit in response data items.

## Instantiation

Models are created either from a simple identifier, or a full object describing the model instance. Model instances also require a parent, which will vary depending on the context. `Badges` require a `System`, `Issuer` or `Program`, for example, while `Applications` require a `Badge`, and `Reviews` require an `Application`.

As with client method calls, defining model objects involves JSON, which can be abbreviated:

```js
var item = new Model('item-slug', <parent>);
```

...is equivalent to:

```js
var item = new Model({
  slug: 'item-slug'
}, <parent>);
```

...alternatively, with a full context:

```js
var item = new Model({
  slug: 'item-slug',
  name: 'Item Name',
  description: 'Item Description',
{'fraction_non_alphanumeric': 0.09730470534490634, 'fraction_numerical': 0.0, 'mean_word_length': 4.824468085106383, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2075537', 'n_tokens_mistral': 581, 'n_tokens_neox': 561, 'n_words': 297}