Crescendo SDK
Loading...
Searching...
No Matches
CrescendoDLL.SDKCore.Result< T > Class Template Reference

Represents the outcome of an operation, which can either be successful or a failure. More...

Inheritance diagram for CrescendoDLL.SDKCore.Result< T >:

Static Public Member Functions

static Result< TCreate< T > (T? value)
 Creates a new CrescendoDLL.SDKCore.Result<T> based on the provided value. If the value is not null, a successful CrescendoDLL.SDKCore.Result<T> is created; otherwise, a failed CrescendoDLL.SDKCore.Result<T> with a null value error is created.
 
static Result Failure (Error error)
 Creates a new failed CrescendoDLL.SDKCore.Result with the specified error.
 
static Result< TFailure< T > (Error error)
 Creates a new failed CrescendoDLL.SDKCore.Result<T> with the specified error.
 
static implicit operator Result< T > (T? value)
 Implicitly converts a nullable value of type T to a CrescendoDLL.SDKCore.Result<T>. If the value is not null, a successful CrescendoDLL.SDKCore.Result<T> is created; otherwise, a failed CrescendoDLL.SDKCore.Result<T> with a null value error is created.
 
static Result Success ()
 Creates a new successful CrescendoDLL.SDKCore.Result.
 
static Result< TSuccess< T > (T value)
 Creates a new successful CrescendoDLL.SDKCore.Result<T> with the specified value.
 

Protected Member Functions

 Result (bool isSuccess, Error error)
 Initializes a new instance of the CrescendoDLL.SDKCore.Result class.
 

Properties

Error Error [get]
 Gets the error that occurred if the operation failed.
 
bool IsFailure [get]
 Gets a value indicating whether the operation failed.
 
bool IsSuccess [get]
 Gets a value indicating whether the operation was successful.
 
T Value [get]
 Gets the value of the result if it is successful.
 

Detailed Description

Represents the outcome of an operation, which can either be successful or a failure.

Represents the outcome of an operation with a value, which can either be successful or a failure.

Template Parameters
TThe type of the value.

Constructor & Destructor Documentation

◆ Result()

CrescendoDLL.SDKCore.Result< T >.Result ( bool  isSuccess,
Error  error 
)
inlineprotected

Initializes a new instance of the CrescendoDLL.SDKCore.Result class.

Parameters
isSuccessIndicates whether the operation was successful.
errorThe error that occurred if the operation failed.
Exceptions
InvalidOperationExceptionThrown if isSuccess is true and error is not Error.None, or if isSuccess is false and error is Error.None.

References CrescendoDLL.SDKCore.Result< T >.Error, and CrescendoDLL.SDKCore.Result< T >.IsSuccess.

Member Function Documentation

◆ Create< T >()

static Result< T > CrescendoDLL.SDKCore.Result< T >.Create< T > ( T value)
static

Creates a new CrescendoDLL.SDKCore.Result<T> based on the provided value. If the value is not null, a successful CrescendoDLL.SDKCore.Result<T> is created; otherwise, a failed CrescendoDLL.SDKCore.Result<T> with a null value error is created.

Template Parameters
TThe type of the value.
Parameters
valueThe value.
Returns
A CrescendoDLL.SDKCore.Result<T>.

◆ Failure()

static Result CrescendoDLL.SDKCore.Result< T >.Failure ( Error  error)
static

Creates a new failed CrescendoDLL.SDKCore.Result with the specified error.

Parameters
errorThe error that occurred.
Returns
A failed CrescendoDLL.SDKCore.Result.

Referenced by CrescendoDLL.SDKCore.AuthenticateWithXAUTH(), CrescendoDLL.SDKCore.AuthenticatorGetInfo(), CrescendoDLL.SDKCore.AuthenticatorGetNextAssertion(), CrescendoDLL.SDKCore.ChangePIN(), CrescendoDLL.SDKCore.ChangeXAUTHMode(), CrescendoDLL.SDKCore.ConfigureOATHSlot(), CrescendoDLL.SDKCore.ConfigureOCRASlot(), CrescendoDLL.SDKCore.ConfigureStaticPassword(), CrescendoDLL.SDKCore.DeleteOATHSlot(), CrescendoDLL.SDKCore.EncryptKEKAndDataWithKEK(), CrescendoDLL.SDKCore.FIDOChangePIN(), CrescendoDLL.SDKCore.FIDOConfig(), CrescendoDLL.SDKCore.FIDOCredentialManagement(), CrescendoDLL.SDKCore.FIDOGetAssertion(), CrescendoDLL.SDKCore.FIDOMakeCredential(), CrescendoDLL.SDKCore.FIDOSetPIN(), CrescendoDLL.SDKCore.GenerateOTP(), CrescendoDLL.SDKCore.GetChallenge(), CrescendoDLL.SDKCore.GetSKITransportKey(), CrescendoDLL.SDKCore.ListFIDOProperties(), CrescendoDLL.SDKCore.ListOATHProperties(), CrescendoDLL.SDKCore.NewToken(), CrescendoDLL.SDKCore.OCRAAuthenticate(), CrescendoDLL.SDKCore.PIVAddDataToDataObject(), CrescendoDLL.SDKCore.PIVChangeDataObjectACR(), CrescendoDLL.SDKCore.PIVChangePKISlotACR(), CrescendoDLL.SDKCore.PIVDeleteCertificate(), CrescendoDLL.SDKCore.PIVDeleteDataFromDataObject(), CrescendoDLL.SDKCore.PIVDeleteKey(), CrescendoDLL.SDKCore.PIVGenerateKeyPair(), CrescendoDLL.SDKCore.PIVGetCertificate(), CrescendoDLL.SDKCore.PIVGetDataObjectContent(), CrescendoDLL.SDKCore.PIVGetPersonalInfo(), CrescendoDLL.SDKCore.PIVPutPKIData(), CrescendoDLL.SDKCore.PIVRawCryptoOperation(), CrescendoDLL.SDKCore.PIVSignData(), CrescendoDLL.SDKCore.PUKPut(), CrescendoDLL.SDKCore.PutXAUTHKey(), CrescendoDLL.SDKCore.ReadCacheFreshness(), CrescendoDLL.SDKCore.ResetPINTries(), and CrescendoDLL.SDKCore.UpdatePINProperties().

◆ Failure< T >()

static Result< T > CrescendoDLL.SDKCore.Result< T >.Failure< T > ( Error  error)
static

Creates a new failed CrescendoDLL.SDKCore.Result<T> with the specified error.

Template Parameters
TThe type of the value.
Parameters
errorThe error that occurred.
Returns
A failed CrescendoDLL.SDKCore.Result<T>.

◆ operator Result< T >()

static implicit CrescendoDLL.SDKCore.Result< T >.operator Result< T > ( T value)
static

Implicitly converts a nullable value of type T to a CrescendoDLL.SDKCore.Result<T>. If the value is not null, a successful CrescendoDLL.SDKCore.Result<T> is created; otherwise, a failed CrescendoDLL.SDKCore.Result<T> with a null value error is created.

Parameters
valueThe value to convert.
Returns
A CrescendoDLL.SDKCore.Result<T> containing either the provided value or an CrescendoDLL.SDKCore.Error.NullValue error.

◆ Success()

static Result CrescendoDLL.SDKCore.Result< T >.Success ( )
static

Creates a new successful CrescendoDLL.SDKCore.Result.

Returns
A successful CrescendoDLL.SDKCore.Result.

Referenced by CrescendoDLL.SDKCore.AuthenticatorCredentialManagement(), CrescendoDLL.SDKCore.AuthenticatorGetAssertion(), CrescendoDLL.SDKCore.AuthenticatorMakeCredential(), CrescendoDLL.SDKCore.ChangePIN(), CrescendoDLL.SDKCore.ChangeXAUTHMode(), CrescendoDLL.SDKCore.ConfigureOATHSlot(), CrescendoDLL.SDKCore.ConfigureOCRASlot(), CrescendoDLL.SDKCore.ConfigureStaticPassword(), CrescendoDLL.SDKCore.DeleteOATHSlot(), CrescendoDLL.SDKCore.DeleteXAUTHKey(), CrescendoDLL.SDKCore.EncryptKEKAndDataWithKEK(), CrescendoDLL.SDKCore.FIDOChangePIN(), CrescendoDLL.SDKCore.FIDOSetPIN(), CrescendoDLL.SDKCore.GenerateOTP(), CrescendoDLL.SDKCore.GetChallenge(), CrescendoDLL.SDKCore.ListACAProperties(), CrescendoDLL.SDKCore.ListFIDOProperties(), CrescendoDLL.SDKCore.ListOATHProperties(), CrescendoDLL.SDKCore.ListPIVProperties(), CrescendoDLL.SDKCore.Logout(), CrescendoDLL.SDKCore.NewToken(), CrescendoDLL.SDKCore.OCRAAuthenticate(), CrescendoDLL.SDKCore.PIVAddDataToDataObject(), CrescendoDLL.SDKCore.PIVChangeDataObjectACR(), CrescendoDLL.SDKCore.PIVChangePKISlotACR(), CrescendoDLL.SDKCore.PIVDeleteCertificate(), CrescendoDLL.SDKCore.PIVDeleteDataFromDataObject(), CrescendoDLL.SDKCore.PIVDeleteKey(), CrescendoDLL.SDKCore.PIVGenerateKeyPair(), CrescendoDLL.SDKCore.PIVGetCertificate(), CrescendoDLL.SDKCore.PIVGetDataObjectContent(), CrescendoDLL.SDKCore.PIVGetPersonalInfo(), CrescendoDLL.SDKCore.PIVPutPKIData(), CrescendoDLL.SDKCore.PIVRawCryptoOperation(), CrescendoDLL.SDKCore.PIVSignData(), CrescendoDLL.SDKCore.PUKPut(), CrescendoDLL.SDKCore.ReadCacheFreshness(), CrescendoDLL.SDKCore.ResetPINTries(), CrescendoDLL.SDKCore.ResetToken(), and CrescendoDLL.SDKCore.UpdatePINProperties().

◆ Success< T >()

static Result< T > CrescendoDLL.SDKCore.Result< T >.Success< T > ( T  value)
static

Creates a new successful CrescendoDLL.SDKCore.Result<T> with the specified value.

Template Parameters
TThe type of the value.
Parameters
valueThe value.
Returns
A successful CrescendoDLL.SDKCore.Result<T>.

Property Documentation

◆ Error

Error CrescendoDLL.SDKCore.Result< T >.Error
get

Gets the error that occurred if the operation failed.

Referenced by CrescendoDLL.SDKCore.AuthenticatorGetInfo(), CrescendoDLL.SDKCore.AuthenticatorGetNextAssertion(), CrescendoDLL.SDKCore.ChangePIN(), CrescendoDLL.SDKCore.ConfigureOATHSlot(), CrescendoDLL.SDKCore.ConfigureOCRASlot(), CrescendoDLL.SDKCore.ConfigureStaticPassword(), CrescendoDLL.SDKCore.DeleteOATHSlot(), CrescendoDLL.SDKCore.FIDOChangePIN(), CrescendoDLL.SDKCore.FIDOConfig(), CrescendoDLL.SDKCore.FIDOCredentialManagement(), CrescendoDLL.SDKCore.FIDOGetAssertion(), CrescendoDLL.SDKCore.FIDOMakeCredential(), CrescendoDLL.SDKCore.FIDOSetPIN(), CrescendoDLL.SDKCore.GenerateOTP(), CrescendoDLL.SDKCore.GetChallenge(), CrescendoDLL.SDKCore.GetSKITransportKey(), CrescendoDLL.SDKCore.ListFIDOProperties(), CrescendoDLL.SDKCore.NewToken(), CrescendoDLL.SDKCore.OCRAAuthenticate(), CrescendoDLL.SDKCore.PIVAddDataToDataObject(), CrescendoDLL.SDKCore.PIVChangeDataObjectACR(), CrescendoDLL.SDKCore.PIVChangePKISlotACR(), CrescendoDLL.SDKCore.PIVDeleteCertificate(), CrescendoDLL.SDKCore.PIVDeleteDataFromDataObject(), CrescendoDLL.SDKCore.PIVDeleteKey(), CrescendoDLL.SDKCore.PIVGenerateKeyPair(), CrescendoDLL.SDKCore.PIVGetCertificate(), CrescendoDLL.SDKCore.PIVGetDataObjectContent(), CrescendoDLL.SDKCore.PIVGetPersonalInfo(), CrescendoDLL.SDKCore.PIVPutPKIData(), CrescendoDLL.SDKCore.PIVRawCryptoOperation(), CrescendoDLL.SDKCore.PIVSignData(), CrescendoDLL.SDKCore.PUKPut(), CrescendoDLL.SDKCore.PutXAUTHKey(), CrescendoDLL.SDKCore.ReadCacheFreshness(), CrescendoDLL.SDKCore.Result< T >.Result(), and CrescendoDLL.SDKCore.UpdatePINProperties().

◆ IsFailure

Gets a value indicating whether the operation failed.

Referenced by CrescendoDLL.SDKCore.AuthenticateWithXAUTH(), CrescendoDLL.SDKCore.AuthenticatorClientPIN(), CrescendoDLL.SDKCore.AuthenticatorConfig(), CrescendoDLL.SDKCore.AuthenticatorCredentialManagement(), CrescendoDLL.SDKCore.AuthenticatorGetAssertion(), CrescendoDLL.SDKCore.AuthenticatorGetInfo(), CrescendoDLL.SDKCore.AuthenticatorGetNextAssertion(), CrescendoDLL.SDKCore.AuthenticatorMakeCredential(), CrescendoDLL.SDKCore.AuthenticatorReset(), CrescendoDLL.SDKCore.ChangePIN(), CrescendoDLL.SDKCore.ChangeXAUTHMode(), CrescendoDLL.SDKCore.ConfigureOATHSlot(), CrescendoDLL.SDKCore.ConfigureOCRASlot(), CrescendoDLL.SDKCore.ConfigureStaticPassword(), CrescendoDLL.SDKCore.DeleteOATHSlot(), CrescendoDLL.SDKCore.DeleteXAUTHKey(), CrescendoDLL.SDKCore.FIDOChangePIN(), CrescendoDLL.SDKCore.FIDOConfig(), CrescendoDLL.SDKCore.FIDOCredentialManagement(), CrescendoDLL.SDKCore.FIDOGetAssertion(), CrescendoDLL.SDKCore.FIDOMakeCredential(), CrescendoDLL.SDKCore.FIDOSetPIN(), CrescendoDLL.SDKCore.GenerateOTP(), CrescendoDLL.SDKCore.GetChallenge(), CrescendoDLL.SDKCore.GetSKITransportKey(), CrescendoDLL.SDKCore.ListFIDOProperties(), CrescendoDLL.SDKCore.Logout(), CrescendoDLL.SDKCore.NewToken(), CrescendoDLL.SDKCore.OCRAAuthenticate(), CrescendoDLL.SDKCore.PIVAddDataToDataObject(), CrescendoDLL.SDKCore.PIVChangeDataObjectACR(), CrescendoDLL.SDKCore.PIVChangePKISlotACR(), CrescendoDLL.SDKCore.PIVDeleteCertificate(), CrescendoDLL.SDKCore.PIVDeleteDataFromDataObject(), CrescendoDLL.SDKCore.PIVDeleteKey(), CrescendoDLL.SDKCore.PIVGenerateKeyPair(), CrescendoDLL.SDKCore.PIVGetCertificate(), CrescendoDLL.SDKCore.PIVGetDataObjectContent(), CrescendoDLL.SDKCore.PIVGetPersonalInfo(), CrescendoDLL.SDKCore.PIVPutPKIData(), CrescendoDLL.SDKCore.PIVRawCryptoOperation(), CrescendoDLL.SDKCore.PIVSignData(), CrescendoDLL.SDKCore.PUKPut(), CrescendoDLL.SDKCore.PutXAUTHKey(), CrescendoDLL.SDKCore.ReadCacheFreshness(), CrescendoDLL.SDKCore.ResetPINTries(), CrescendoDLL.SDKCore.ResetToken(), CrescendoDLL.SDKCore.U2FAuthentication(), CrescendoDLL.SDKCore.U2FGetVersion(), CrescendoDLL.SDKCore.U2FRegistration(), and CrescendoDLL.SDKCore.UpdatePINProperties().

◆ IsSuccess

Gets a value indicating whether the operation was successful.

Referenced by CrescendoDLL.SDKCore.ListFIDOProperties(), and CrescendoDLL.SDKCore.Result< T >.Result().

◆ Value

Gets the value of the result if it is successful.

Exceptions
InvalidOperationExceptionThrown if the result is not successful.

Referenced by CrescendoDLL.SDKCore.AuthenticateWithXAUTH(), CrescendoDLL.SDKCore.AuthenticatorCredentialManagement(), CrescendoDLL.SDKCore.AuthenticatorGetAssertion(), CrescendoDLL.SDKCore.AuthenticatorGetInfo(), CrescendoDLL.SDKCore.AuthenticatorMakeCredential(), CrescendoDLL.SDKCore.ConfigureOATHSlot(), CrescendoDLL.SDKCore.ConfigureOCRASlot(), CrescendoDLL.SDKCore.ConfigureStaticPassword(), CrescendoDLL.SDKCore.FIDOChangePIN(), CrescendoDLL.SDKCore.FIDOConfig(), CrescendoDLL.SDKCore.FIDOCredentialManagement(), CrescendoDLL.SDKCore.FIDOGetAssertion(), CrescendoDLL.SDKCore.FIDOMakeCredential(), CrescendoDLL.SDKCore.FIDOSetPIN(), CrescendoDLL.SDKCore.GenerateOTP(), CrescendoDLL.SDKCore.GetChallenge(), CrescendoDLL.SDKCore.ListFIDOProperties(), CrescendoDLL.SDKCore.NewToken(), CrescendoDLL.SDKCore.OCRAAuthenticate(), CrescendoDLL.SDKCore.PIVAddDataToDataObject(), CrescendoDLL.SDKCore.PIVChangeDataObjectACR(), CrescendoDLL.SDKCore.PIVChangePKISlotACR(), CrescendoDLL.SDKCore.PIVDeleteCertificate(), CrescendoDLL.SDKCore.PIVDeleteDataFromDataObject(), CrescendoDLL.SDKCore.PIVDeleteKey(), CrescendoDLL.SDKCore.PIVGenerateKeyPair(), CrescendoDLL.SDKCore.PIVGetCertificate(), CrescendoDLL.SDKCore.PIVGetDataObjectContent(), CrescendoDLL.SDKCore.PIVGetPersonalInfo(), CrescendoDLL.SDKCore.PIVPutPKIData(), CrescendoDLL.SDKCore.PIVRawCryptoOperation(), CrescendoDLL.SDKCore.PIVSignData(), CrescendoDLL.SDKCore.PutXAUTHKey(), and CrescendoDLL.SDKCore.ReadCacheFreshness().