Table of Contents

Struct AirIdentifier

Namespace
CivitaiSharp.Sdk.Air
Assembly
CivitaiSharp.Sdk.dll

Represents an AIR (Artificial Intelligence Resource) identifier for Civitai models and assets. Format: urn:air:{ecosystem}:{type}:{source}:{modelId}@{versionId} (e.g., urn:air:sdxl:checkpoint:civitai:4201@130072)

public readonly struct AirIdentifier : IEquatable<AirIdentifier>, IParsable<AirIdentifier>
Implements
Inherited Members

Constructors

AirIdentifier(AirEcosystem, AirAssetType, AirSource, long, long)

Initializes a new instance of the AirIdentifier struct.

public AirIdentifier(AirEcosystem ecosystem, AirAssetType assetType, AirSource source, long modelId, long versionId)

Parameters

ecosystem AirEcosystem

The model ecosystem.

assetType AirAssetType

The asset type.

source AirSource

The source platform.

modelId long

The model ID.

versionId long

The version ID.

Exceptions

ArgumentOutOfRangeException

Thrown when modelId or versionId is less than 1.

Fields

DefaultSource

The default source for Civitai assets.

public const AirSource DefaultSource = Civitai

Field Value

AirSource

Properties

AssetType

Gets the asset type (e.g., checkpoint, lora).

public AirAssetType AssetType { get; }

Property Value

AirAssetType

Ecosystem

Gets the model ecosystem (e.g., sd1, sdxl, flux1).

public AirEcosystem Ecosystem { get; }

Property Value

AirEcosystem

ModelId

Gets the model ID on Civitai.

public long ModelId { get; }

Property Value

long

Source

Gets the source platform of the asset.

public AirSource Source { get; }

Property Value

AirSource

VersionId

Gets the model version ID on Civitai.

public long VersionId { get; }

Property Value

long

Methods

Create(AirEcosystem, AirAssetType, long, long)

Creates an AIR identifier for a Civitai model.

public static AirIdentifier Create(AirEcosystem ecosystem, AirAssetType assetType, long modelId, long versionId)

Parameters

ecosystem AirEcosystem

The model ecosystem.

assetType AirAssetType

The asset type.

modelId long

The Civitai model ID.

versionId long

The Civitai version ID.

Returns

AirIdentifier

A new AirIdentifier instance.

Equals(AirIdentifier)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(AirIdentifier other)

Parameters

other AirIdentifier

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Parse(string)

Parses a string as an AIR identifier.

public static AirIdentifier Parse(string value)

Parameters

value string

The string to parse.

Returns

AirIdentifier

The parsed AirIdentifier.

Exceptions

ArgumentNullException

Thrown when value is null.

ArgumentException

Thrown when value is empty or whitespace.

FormatException

Thrown when value is not a valid AIR identifier.

ToString()

Returns the string representation of this AIR identifier.

public override string ToString()

Returns

string

The AIR identifier string in the format urn:air:{ecosystem}:{type}:{source}:{modelId}@{versionId}.

TryParse(string?, out AirIdentifier)

Attempts to parse a string as an AIR identifier.

public static bool TryParse(string? value, out AirIdentifier result)

Parameters

value string

The string to parse.

result AirIdentifier

When this method returns, contains the parsed identifier if successful.

Returns

bool

True if parsing succeeded; otherwise, false.

Operators

operator ==(AirIdentifier, AirIdentifier)

Determines whether two AIR identifiers are equal.

public static bool operator ==(AirIdentifier left, AirIdentifier right)

Parameters

left AirIdentifier
right AirIdentifier

Returns

bool

implicit operator string(AirIdentifier)

Implicitly converts an AIR identifier to its string representation.

public static implicit operator string(AirIdentifier air)

Parameters

air AirIdentifier

Returns

string

operator !=(AirIdentifier, AirIdentifier)

Determines whether two AIR identifiers are not equal.

public static bool operator !=(AirIdentifier left, AirIdentifier right)

Parameters

left AirIdentifier
right AirIdentifier

Returns

bool