# ApiKeyCreationResult

> 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.apikeycreationresult/
> Summary: ApiKeyCreationResult: The result of a key creation operation.

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

The result of a key creation operation.

```csharp
public sealed record ApiKeyCreationResult : IEquatable<ApiKeyCreationResult>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.apikeycreationresult/">ApiKeyCreationResult</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;ApiKeyCreationResult&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

The raw key is returned ONLY here, at creation time.

## Constructors

### <a id="Tracon_ApiKeyCreationResult__ctor"></a> ApiKeyCreationResult\(\)

```csharp
public ApiKeyCreationResult()
```

## Properties

### <a id="Tracon_ApiKeyCreationResult_PlaintextKey"></a> PlaintextKey

The raw key value. Cannot be produced again after this call; the
consumer must show it immediately and not store it.

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

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

The saved view, which carries no raw value.

```csharp
public required ApiKeyRecord Record { get; init; }
```

#### Property Value

 [ApiKeyRecord](/api/tracon.apikeyrecord/)

## Methods

### <a id="Tracon_ApiKeyCreationResult_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_ApiKeyCreationResult_Equals_Tracon_ApiKeyCreationResult_"></a> Equals\(ApiKeyCreationResult?\)

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

`other` [ApiKeyCreationResult](/api/tracon.apikeycreationresult/)?

#### Returns

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

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

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

Returns a description that carries no raw key.

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

 [string](https://learn.microsoft.com/dotnet/api/system.string)

The type name and the saved record; never the raw value.

#### Remarks

A record's compiler-generated `ToString` prints every property, and
this one holds the only copy of the raw key that will ever exist.

## Operators

### <a id="Tracon_ApiKeyCreationResult_op_Equality_Tracon_ApiKeyCreationResult_Tracon_ApiKeyCreationResult_"></a> operator ==\(ApiKeyCreationResult?, ApiKeyCreationResult?\)

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

`left` [ApiKeyCreationResult](/api/tracon.apikeycreationresult/)?

`right` [ApiKeyCreationResult](/api/tracon.apikeycreationresult/)?

#### Returns

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

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

`left` [ApiKeyCreationResult](/api/tracon.apikeycreationresult/)?

`right` [ApiKeyCreationResult](/api/tracon.apikeycreationresult/)?

#### Returns

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