# JobLeaseRequest

> 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.jobleaserequest/
> Summary: JobLeaseRequest: What a worker asks of IJobStore.LeaseAsync: who it is, how long the lease lasts, which lanes it serves and, optionally, a per-tenant ceiling.

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

What a worker asks of [IJobStore.LeaseAsync](/api/tracon.ijobstore/#Tracon_IJobStore_LeaseAsync_Tracon_JobLeaseRequest_System_Threading_CancellationToken_): who it is, how long the lease
lasts, which lanes it serves and, optionally, a per-tenant ceiling.

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

A record, so a new option is a new property with a default and not a new parameter on
the interface method that every [IJobStore](/api/tracon.ijobstore/) implementation overrides.

## Constructors

### <a id="Tracon_JobLeaseRequest__ctor"></a> JobLeaseRequest\(\)

```csharp
public JobLeaseRequest()
```

## Properties

### <a id="Tracon_JobLeaseRequest_Lanes"></a> Lanes

Gets the lanes the lease is restricted to (see [JobLanes](/api/tracon.joblanes/)).
[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) or empty applies no filter: a job from any lane may be leased.

```csharp
public IReadOnlyList<string>? Lanes { get; init; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\>?

### <a id="Tracon_JobLeaseRequest_LeaseDuration"></a> LeaseDuration

Gets the lease's validity duration.

```csharp
public required TimeSpan LeaseDuration { get; init; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)

### <a id="Tracon_JobLeaseRequest_Owner"></a> Owner

Gets the leasing worker's identifier.

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

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

Gets the per-tenant ceiling, or [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) (the default) for none: the
oldest ready job is leased whichever tenant it belongs to.

```csharp
public JobTenantCap? TenantCap { get; init; }
```

#### Property Value

 [JobTenantCap](/api/tracon.jobtenantcap/)?

## Methods

### <a id="Tracon_JobLeaseRequest_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_JobLeaseRequest_Equals_Tracon_JobLeaseRequest_"></a> Equals\(JobLeaseRequest?\)

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

`other` [JobLeaseRequest](/api/tracon.jobleaserequest/)?

#### Returns

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

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

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

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

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

### <a id="Tracon_JobLeaseRequest_op_Equality_Tracon_JobLeaseRequest_Tracon_JobLeaseRequest_"></a> operator ==\(JobLeaseRequest?, JobLeaseRequest?\)

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

`left` [JobLeaseRequest](/api/tracon.jobleaserequest/)?

`right` [JobLeaseRequest](/api/tracon.jobleaserequest/)?

#### Returns

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

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

`left` [JobLeaseRequest](/api/tracon.jobleaserequest/)?

`right` [JobLeaseRequest](/api/tracon.jobleaserequest/)?

#### Returns

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