> ## 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.

# DesiredPrincipal

> A principal the policy says ought to exist.

```csharp
public sealed record DesiredPrincipal : IEquatable<DesiredPrincipal>
```

**Implements:** `IEquatable<DesiredPrincipal>`

## Constructors

```csharp
public DesiredPrincipal()
```

## Properties

**Credentials** `IReadOnlyList\<DesiredCredential\>` *required*

**Type:** `IReadOnlyList<DesiredCredential>`

The credentials the write issues or revokes beside the fields.

**EffectiveOn** `LocalDate` *required*

The date the state takes effect.

**Id** `string`

The vendor's id, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) before creation.

**Kind** `string` *required*

The manifest object it belongs to.

**OperationId** `string` *required*

The change it carries out, the same on every re-run of its plan operation.

**Payload** `JsonObject` *required*

The fields it ought to have.

**Status** `Nullable\<PrincipalStatus\>`

**Type:** `Nullable<PrincipalStatus>`

The status it ought to have, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the policy leaves it as it is.

## Methods

### Credential()

```csharp
public DesiredCredential? Credential(string key)
```

Gets the credential the write issues or revokes under `key`, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when it leaves that credential alone.

#### Parameters

**key** `string` *required*

#### Returns

`DesiredCredential`

### Equals()

```csharp
public bool Equals(DesiredPrincipal? other)
```

#### Parameters

**other** `DesiredPrincipal` *required*

#### Returns

`bool`

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

#### Parameters

**obj** `object` *required*

#### Returns

`bool`

### GetHashCode()

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

#### Returns

`int`

### operator !=()

```csharp
public static bool operator !=(DesiredPrincipal? left, DesiredPrincipal? right)
```

#### Parameters

**left** `DesiredPrincipal` *required*

**right** `DesiredPrincipal` *required*

#### Returns

`bool`

### operator ==()

```csharp
public static bool operator ==(DesiredPrincipal? left, DesiredPrincipal? right)
```

#### Parameters

**left** `DesiredPrincipal` *required*

**right** `DesiredPrincipal` *required*

#### Returns

`bool`

### ToString()

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

#### Returns

`string`


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