Table of Contents

Class UnreadCountResult

Represents the result of fetching the unread count for messages, encapsulating both success and failure information.

public class UnreadCountResult : ZendeskResult<UnreadCountError>
Inheritance
UnreadCountResult
Inherited Members

Properties

UnreadCount

Gets the number of unread messages. Valid only if the operation was successful.

public int UnreadCount { get; }

Property Value

int

Methods

Failure(UnreadCountError)

Creates a failure result for the operation of fetching unread messages count with the specified error.

public static UnreadCountResult Failure(UnreadCountError error)

Parameters

error UnreadCountError

The specific UnreadCountError that caused the failure.

Returns

UnreadCountResult

An UnreadCountResult indicating a failed operation along with the error.

Success(int)

Creates a success result for the operation of fetching unread messages count.

public static UnreadCountResult Success(int unreadCount)

Parameters

unreadCount int

The number of unread messages.

Returns

UnreadCountResult

An UnreadCountResult indicating a successful operation with the amount of unread messages.

Operators

implicit operator UnreadCountResult(UnreadCountError)

Implicitly converts an UnreadCountError to a failed UnreadCountResult with the corresponding error.

public static implicit operator UnreadCountResult(UnreadCountError error)

Parameters

error UnreadCountError

The error to convert to a failed UnreadCountResult.

Returns

UnreadCountResult