Class EndpointMetadata

Namespace
Cratis.Arc.Http
Assembly
Cratis.Arc.Core.dll

Represents metadata for an endpoint.

public record EndpointMetadata : IEquatable<EndpointMetadata>
Inheritance
EndpointMetadata
Implements
Inherited Members
Extension Methods

Constructors

EndpointMetadata(EndpointMetadata)

protected EndpointMetadata(EndpointMetadata original)

Parameters

original EndpointMetadata

EndpointMetadata(string, string?, IEnumerable<string>?, bool, Type?, Type?, bool)

Represents metadata for an endpoint.

public EndpointMetadata(string Name, string? Summary = null, IEnumerable<string>? Tags = null, bool AllowAnonymous = false, Type? RequestBodyType = null, Type? ResponseType = null, bool ExcludeFromApiDescription = false)

Parameters

Name string

The unique name of the endpoint.

Summary string

A summary description of what the endpoint does.

Tags IEnumerable<string>

Tags for grouping endpoints.

AllowAnonymous bool

Whether anonymous access is allowed.

RequestBodyType Type

The type of the request body, if any.

ResponseType Type

The type of the response body, if any.

ExcludeFromApiDescription bool

Whether the endpoint should be excluded from the generated API description (e.g. OpenAPI).

Properties

AllowAnonymous

Whether anonymous access is allowed.

public bool AllowAnonymous { get; init; }

Property Value

bool

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

ExcludeFromApiDescription

Whether the endpoint should be excluded from the generated API description (e.g. OpenAPI).

public bool ExcludeFromApiDescription { get; init; }

Property Value

bool

Name

The unique name of the endpoint.

public string Name { get; init; }

Property Value

string

RequestBodyType

The type of the request body, if any.

public Type? RequestBodyType { get; init; }

Property Value

Type

RequireAuthentication

Gets whether this endpoint explicitly requires an authenticated caller.

public bool RequireAuthentication { get; init; }

Property Value

bool

ResponseType

The type of the response body, if any.

public Type? ResponseType { get; init; }

Property Value

Type

Roles

Gets comma-separated roles, any one of which grants access to an authenticated caller.

public string? Roles { get; init; }

Property Value

string

Summary

A summary description of what the endpoint does.

public string? Summary { get; init; }

Property Value

string

Tags

Tags for grouping endpoints.

public IEnumerable<string>? Tags { get; init; }

Property Value

IEnumerable<string>

Methods

Deconstruct(out string, out string?, out IEnumerable<string>?, out bool, out Type?, out Type?, out bool)

public void Deconstruct(out string Name, out string? Summary, out IEnumerable<string>? Tags, out bool AllowAnonymous, out Type? RequestBodyType, out Type? ResponseType, out bool ExcludeFromApiDescription)

Parameters

Name string
Summary string
Tags IEnumerable<string>
AllowAnonymous bool
RequestBodyType Type
ResponseType Type
ExcludeFromApiDescription bool

Equals(EndpointMetadata?)

public virtual bool Equals(EndpointMetadata? other)

Parameters

other EndpointMetadata

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(EndpointMetadata?, EndpointMetadata?)

public static bool operator ==(EndpointMetadata? left, EndpointMetadata? right)

Parameters

left EndpointMetadata
right EndpointMetadata

Returns

bool

operator !=(EndpointMetadata?, EndpointMetadata?)

public static bool operator !=(EndpointMetadata? left, EndpointMetadata? right)

Parameters

left EndpointMetadata
right EndpointMetadata

Returns

bool