Table of Contents

Class SessionDate

Namespace
Auth0.ManagementApi
Assembly
Auth0.ManagementApi.dll
[JsonConverter(typeof(SessionDate.JsonConverter))]
[Serializable]
public class SessionDate
Inheritance
SessionDate
Inherited Members
Extension Methods

Properties

Type

Type discriminator

[JsonIgnore]
public string Type { get; }

Property Value

string

Value

Union value

[JsonIgnore]
public object? Value { get; }

Property Value

object

Methods

AsDateTime()

Returns the value as a DateTime if Type is 'dateTime', otherwise throws an exception.

public DateTime AsDateTime()

Returns

DateTime

Exceptions

ManagementException

Thrown when Type is not 'dateTime'.

AsMapOfStringToUnknown()

public Dictionary<string, object?> AsMapOfStringToUnknown()

Returns

Dictionary<string, object>

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

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

FromDateTime(DateTime)

Factory method to create a union from a DateTime value.

public static SessionDate FromDateTime(DateTime value)

Parameters

value DateTime

Returns

SessionDate

FromMapOfStringToUnknown(Dictionary<string, object?>)

public static SessionDate FromMapOfStringToUnknown(Dictionary<string, object?> value)

Parameters

value Dictionary<string, object>

Returns

SessionDate

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

IsDateTime()

Returns true if Type is "dateTime"

public bool IsDateTime()

Returns

bool

IsMapOfStringToUnknown()

Returns true if Type is "map"

public bool IsMapOfStringToUnknown()

Returns

bool

Match<T>(Func<DateTime, T>, Func<Dictionary<string, object?>, T>)

public T Match<T>(Func<DateTime, T> onDateTime, Func<Dictionary<string, object?>, T> onMapOfStringToUnknown)

Parameters

onDateTime Func<DateTime, T>
onMapOfStringToUnknown Func<Dictionary<string, object>, T>

Returns

T

Type Parameters

T

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

TryGetDateTime(out DateTime?)

Attempts to cast the value to a DateTime and returns true if successful.

public bool TryGetDateTime(out DateTime? value)

Parameters

value DateTime?

Returns

bool

TryGetMapOfStringToUnknown(out Dictionary<string, object?>?)

public bool TryGetMapOfStringToUnknown(out Dictionary<string, object?>? value)

Parameters

value Dictionary<string, object>

Returns

bool

Visit(Action<DateTime>, Action<Dictionary<string, object?>>)

public void Visit(Action<DateTime> onDateTime, Action<Dictionary<string, object?>> onMapOfStringToUnknown)

Parameters

onDateTime Action<DateTime>
onMapOfStringToUnknown Action<Dictionary<string, object>>

Operators

implicit operator SessionDate(DateTime)

public static implicit operator SessionDate(DateTime value)

Parameters

value DateTime

Returns

SessionDate