# PendingApproval

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.pendingapproval/
> Summary: PendingApproval: The pending tool approval request of a run that executes from the queue.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

The pending tool approval request of a run that executes from the queue.

```csharp
public sealed record PendingApproval : IEquatable<PendingApproval>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.pendingapproval/">PendingApproval</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;PendingApproval&gt;</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

This record is a **projection**, not the owner: the single source of
truth is the session state of MAF (`ToolApprovalRequestContent`, which lives in
the session history). While the decision is applied the session is read, not this table.

The run that owns the pending request closes with
[RunStatus.AwaitingApproval](/api/tracon.runstatus/) and never changes again. Once the
decision is made the SAME run does not continue; a **new** run is put on
the queue (the same [PendingApproval.SessionId](/api/tracon.pendingapproval/#Tracon_PendingApproval_SessionId), a new `RunId`).

## Constructors

### <a id="Tracon_PendingApproval__ctor"></a> PendingApproval\(\)

```csharp
public PendingApproval()
```

## Properties

### <a id="Tracon_PendingApproval_Arguments"></a> Arguments

Gets the arguments of the tool call as `key=value` pairs (reflection-based
JSON serialization is not USED, to stay AOT compatible). It stays
[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when `RecordToolPayloads` is turned off in the
recording settings.

```csharp
public string? Arguments { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_PendingApproval_CreatedAt"></a> CreatedAt

Gets the creation time.

```csharp
public required DateTimeOffset CreatedAt { get; init; }
```

#### Property Value

 [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset)

### <a id="Tracon_PendingApproval_DecidedAt"></a> DecidedAt

Gets the time of the decision, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when no decision was made.

```csharp
public DateTimeOffset? DecidedAt { get; init; }
```

#### Property Value

 [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset)?

### <a id="Tracon_PendingApproval_DecidedBy"></a> DecidedBy

Gets the actor that made the decision, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when no decision was made.

```csharp
public string? DecidedBy { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?

### <a id="Tracon_PendingApproval_ExpiresAt"></a> ExpiresAt

Gets the time after which the request counts as [ApprovalStatus.Expired](/api/tracon.approvalstatus/).

```csharp
public required DateTimeOffset ExpiresAt { get; init; }
```

#### Property Value

 [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset)

#### Remarks

It is required: an approval request that waits forever is a leak.

### <a id="Tracon_PendingApproval_Id"></a> Id

Gets the record id.

```csharp
public required Guid Id { get; init; }
```

#### Property Value

 [Guid](https://learn.microsoft.com/dotnet/api/system.guid)

### <a id="Tracon_PendingApproval_Presentation"></a> Presentation

Gets the human-readable presentation an [IToolApprovalPresenter](/api/tracon.itoolapprovalpresenter/)
resolved for this request, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when no presenter is
registered, none resolved anything, or the resolution failed or timed out.

```csharp
public ToolApprovalPresentation? Presentation { get; init; }
```

#### Property Value

 [ToolApprovalPresentation](/api/tracon.toolapprovalpresentation/)?

#### Remarks

Resolved once, when the request is first written, not on every read: the
presenter's own source (a database row, say) can change or disappear later, and
re-resolving on each `GET` would let the same request describe itself
differently from one poll to the next. [PendingApproval.Arguments](/api/tracon.pendingapproval/#Tracon_PendingApproval_Arguments) stays populated
alongside this field — a presentation never replaces the raw call an operator
reviews.

### <a id="Tracon_PendingApproval_RequestId"></a> RequestId

Gets the `ToolApprovalRequestContent.RequestId` value produced by MAF.

```csharp
public required string RequestId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_PendingApproval_RunId"></a> RunId

Gets the run that produced this request and closed with [RunStatus.AwaitingApproval](/api/tracon.runstatus/).

```csharp
public required Guid RunId { get; init; }
```

#### Property Value

 [Guid](https://learn.microsoft.com/dotnet/api/system.guid)

### <a id="Tracon_PendingApproval_SessionId"></a> SessionId

Gets the session of the run. While the decision is applied, the continuing run is
put on the queue with this session.

```csharp
public required string SessionId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_PendingApproval_Status"></a> Status

Gets the status of the request.

```csharp
public required ApprovalStatus Status { get; init; }
```

#### Property Value

 [ApprovalStatus](/api/tracon.approvalstatus/)

### <a id="Tracon_PendingApproval_TenantId"></a> TenantId

Gets the tenant id.

```csharp
public required string TenantId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

### <a id="Tracon_PendingApproval_ToolName"></a> ToolName

Gets the name of the tool that asks for approval.

```csharp
public required string ToolName { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Methods

### <a id="Tracon_PendingApproval_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_PendingApproval_Equals_Tracon_PendingApproval_"></a> Equals\(PendingApproval?\)

```csharp
public bool Equals(PendingApproval? other)
```

#### Parameters

`other` [PendingApproval](/api/tracon.pendingapproval/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_PendingApproval_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_PendingApproval_ToString"></a> ToString\(\)

```csharp
public override string ToString()
```

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Operators

### <a id="Tracon_PendingApproval_op_Equality_Tracon_PendingApproval_Tracon_PendingApproval_"></a> operator ==\(PendingApproval?, PendingApproval?\)

```csharp
public static bool operator ==(PendingApproval? left, PendingApproval? right)
```

#### Parameters

`left` [PendingApproval](/api/tracon.pendingapproval/)?

`right` [PendingApproval](/api/tracon.pendingapproval/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_PendingApproval_op_Inequality_Tracon_PendingApproval_Tracon_PendingApproval_"></a> operator \!=\(PendingApproval?, PendingApproval?\)

```csharp
public static bool operator !=(PendingApproval? left, PendingApproval? right)
```

#### Parameters

`left` [PendingApproval](/api/tracon.pendingapproval/)?

`right` [PendingApproval](/api/tracon.pendingapproval/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
