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

# EntitlementShape

> How an entitlement field's values name entitlements: the object kind they are on, the relation and scope kind the field pins, and the item property holding eac…

How an entitlement field's values name entitlements: the object kind they are on, the relation and scope kind the field pins, and the item property holding each part.

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

**Implements:** `IEquatable<EntitlementShape>`

## Constructors

```csharp
public EntitlementShape(string Field, string Kind, string? Relation, string? Scope, IReadOnlyDictionary<EntitlementPart, string> Parts)
```

How an entitlement field's values name entitlements: the object kind they are on, the relation and scope kind the field pins, and the item property holding each part.

### Parameters

**Field** `string` *required*

The field's key.

**Kind** `string` *required*

The object or resource kind its entitlements are on.

**Relation** `string` *required*

The relation a value that names none is, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null).

**Scope** `string` *required*

The resource kind a role it grants is held at, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null).

**Parts** `IReadOnlyDictionary\<EntitlementPart,String\>` *required*

**Type:** `IReadOnlyDictionary<EntitlementPart,String>`

The item property holding each part, for a field whose values are records.

## Properties

**Field** `string` *required*

The field's key.

**Kind** `string` *required*

The object or resource kind its entitlements are on.

**Parts** `IReadOnlyDictionary\<EntitlementPart,String\>` *required*

**Type:** `IReadOnlyDictionary<EntitlementPart,String>`

The item property holding each part, for a field whose values are records.

**Relation** `string`

The relation a value that names none is, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null).

**Scope** `string`

The resource kind a role it grants is held at, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null).

## Methods

### Deconstruct()

```csharp
public void Deconstruct(out string Field, out string Kind, out string? Relation, out string? Scope, out IReadOnlyDictionary<EntitlementPart, string> Parts)
```

#### Parameters

**Field** `string` *required*

**Kind** `string` *required*

**Relation** `string` *required*

**Scope** `string` *required*

**Parts** `IReadOnlyDictionary\<EntitlementPart,String\>` *required*

**Type:** `IReadOnlyDictionary<EntitlementPart,String>`

### Equals()

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

#### Parameters

**other** `EntitlementShape` *required*

#### Returns

`bool`

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

#### Parameters

**obj** `object` *required*

#### Returns

`bool`

### GetHashCode()

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

#### Returns

`int`

### GrantOf()

```csharp
public Grant GrantOf(PrincipalRef holder, string value)
```

Reads one value of the field as the grant of it a holder has.

#### Parameters

**holder** `PrincipalRef` *required*

**value** `string` *required*

#### Returns

`Grant`

### KeyOf()

```csharp
public string KeyOf(string value)
```

Names the entitlement a value grants and how it is held, so two values that grant the same one the same way have the same key whatever their spelling. A value that cannot be read keys as its text.

#### Parameters

**value** `string` *required*

#### Returns

`string`

### ObjectIdOf()

```csharp
public string ObjectIdOf(string value)
```

Names the object a value is on, as the catalog lists it: its ID, or the value itself when it cannot be read.

#### Parameters

**value** `string` *required*

#### Returns

`string`

### Of()

```csharp
public static EntitlementShape Of(EntitlementsFieldManifest field)
```

#### Parameters

**field** `EntitlementsFieldManifest` *required*

#### Returns

`EntitlementShape`

### operator !=()

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

#### Parameters

**left** `EntitlementShape` *required*

**right** `EntitlementShape` *required*

#### Returns

`bool`

### operator ==()

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

#### Parameters

**left** `EntitlementShape` *required*

**right** `EntitlementShape` *required*

#### Returns

`bool`

### RelationOf()

```csharp
public string? RelationOf(string value)
```

Names the relation a value is, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when it cannot be read.

#### Parameters

**value** `string` *required*

#### Returns

`string`

### ToString()

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

#### Returns

`string`

### ValueOf()

```csharp
public string ValueOf(Grant grant)
```

Writes a grant as a value of the field: the entitlement's ID, or for a field whose values are records, a record of its parts and properties in ordinal key order.

#### Parameters

**grant** `Grant` *required*

#### Returns

`string`


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