> ## Documentation Index
> Fetch the complete documentation index at: https://klef.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# TargetPayload

> Typed reads and writes over a catalog-shaped target field payload ( ).

Typed reads and writes over a catalog-shaped target field payload (`JsonObject`).

```csharp
public static class TargetPayload
```

## Methods

### Bool()

```csharp
public static bool? Bool(JsonObject payload, string key)
```

#### Parameters

**payload** `JsonObject` *required*

**key** `string` *required*

#### Returns

`bool?`

### Link()

```csharp
public static ObjectLink? Link(JsonObject payload, string key)
```

Reads a link field's value, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the field holds no link.

#### Parameters

**payload** `JsonObject` *required*

**key** `string` *required*

#### Returns

`ObjectLink`

### LinkNode()

```csharp
public static JsonObject LinkNode(ObjectLink link)
```

#### Parameters

**link** `ObjectLink` *required*

#### Returns

`JsonObject`

### LinkOf()

```csharp
public static ObjectLink? LinkOf(JsonNode? node)
```

Reads a link, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the node holds no `{ object, id }`.

#### Parameters

**node** `JsonNode` *required*

#### Returns

`ObjectLink`

### Put()

```csharp
public static void Put(JsonObject fields, string key, string? value)
```

#### Parameters

**fields** `JsonObject` *required*

**key** `string` *required*

**value** `string` *required*

### PutLink()

```csharp
public static void PutLink(JsonObject fields, string key, string linked, string? id)
```

Writes a link to the object `id` names, when it names one.

#### Parameters

**fields** `JsonObject` *required*

**key** `string` *required*

**linked** `string` *required*

**id** `string` *required*

### Read()

```csharp
public static FieldWrite Read(JsonObject payload, string key)
```

#### Parameters

**payload** `JsonObject` *required*

**key** `string` *required*

#### Returns

`FieldWrite`

### Str()

```csharp
public static string? Str(JsonObject payload, string key)
```

#### Parameters

**payload** `JsonObject` *required*

**key** `string` *required*

#### Returns

`string`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.