Contents

Unity Engine Reference

This reference provides the technical details regarding the foundational C# objects and their components available in the Twitch game engine plugin for Unity.

Twitch API Base

BaseDisposable

Syntax

public abstract class BaseDisposable : IDisposable

Methods

Dispose()

public void Dispose()

Dispose(Boolean)

protected virtual void Dispose(bool disposing)
Parameter Type Description
disposing System.Boolean  

DisposeManaged()

protected virtual void DisposeManaged()

DisposeUnmanaged()

protected virtual void DisposeUnmanaged()

Finalize()

protected void Finalize()

EventStream<T>

Represents an active EventSub subscription.

You can have multiple concurrent subscriptions to the same event type. In that case, each event will be delivered to every single subscription.

Use WaitForEvent() to be notified immediately when the next event arrives. Whenever an event arrives even though you are not currently waiting, that event is buffered. Hence, keeping an open subscription but never receiving events from it produces a memory leak.

Syntax

public class EventStream<T> : BaseDisposable, IDisposable

Methods

DisposeUnmanaged()

protected override void DisposeUnmanaged()

Overrides: BaseDisposable.DisposeUnmanaged()

TryGetNextEvent(out T)

Returns a potentially waiting event. If there’s no event waiting, this returns false, and no event.

public bool TryGetNextEvent(out T result)
Parameter Type Description
result T  

Returns: System.Boolean

WaitForEvent()

Wait for a new event to arrive.

Invoking this function concurrently, i.e., calling it before an earlier invocation returns, is allowed. In that case, an incoming event is always delivered to the oldest currently waiting WaitForEvent() call.

We recommend that you only use WaitForEvent() OR TryGetNextEvent(out T) for the same event stream, and not both. If you work in an Unity Update() function, using TryGetNextEvent(out T) may be easier.

This function waits until a matching event arrives, potentially forever. To cancel the the call, terminate your subscription using System.IDisposable.Dispose().

public GameTask<T> WaitForEvent()

Returns: GameTask<T>

GameTask

An awaitable Task suitable for games, where Result never blocks.

Syntax

public class GameTask

Constructors

GameTask(Task)

public GameTask(Task task)
Parameter Type Description
task System.Threading.Tasks.Task  

Properties

IsCompleted

Gets whether the underlying Task has completed.

public bool IsCompleted { get; }

Property Value: System.Boolean

Task

The underlying Task<T> object. Careful: properties and methods may block!

public Task Task { get; }

Property Value: System.Threading.Tasks.Task

Methods

GetAwaiter()

Returns an awaiter, so you can await this, if you really want to.

public TaskAwaiter GetAwaiter()

Returns: System.Runtime.CompilerServices.TaskAwaiter

Operators

Implicit(Task to GameTask)

public static implicit operator GameTask(Task task)
Parameter Type Description
task System.Threading.Tasks.Task  

Returns: GameTask

GameTask<T>

An awaitable Task suitable for games, where Result never blocks

Syntax

public class GameTask<T> : GameTask

Constructors

GameTask(Task<T>)

public GameTask(Task<T> task)
Parameter Type Description
task System.Threading.Tasks.Task<T>  

Properties

Exception

Gets the AggregateException that caused the underlying task to exit prematurely. If the task is not completed or has completed sucessfully, this will return null.

public AggregateException Exception { get; }

Property Value: System.AggregateException

MaybeResult

Gets the result of the underlying Task if it’s completed. Otherwise, it will return null.

public T MaybeResult { get; }

Property Value: T

Task

The underlying Task<T> object. Careful: properties and methods may block!

public Task<T> Task { get; }

Property Value: System.Threading.Tasks.Task<T>

Methods

GetAwaiter()

Returns an awaiter, so you can await this, if you really want to.

public TaskAwaiter<T> GetAwaiter()

Returns: System.Runtime.CompilerServices.TaskAwaiter<T>

Operators

Implicit(Task<T> to GameTask<T>)

public static implicit operator GameTask<T>(Task<T> task)
Parameter Type Description
task System.Threading.Tasks.Task<T>  

Returns: GameTask<T>

ManagedPAL

A standard PAL implementation for .NET environments. You may inherit from this. and override methods as needed.

Syntax

public class ManagedPAL : PlatformAbstractionLayer, IDisposable

Methods

CloseWebSocket(CloseWebSocketRequest)

protected override async Task CloseWebSocket(CloseWebSocketRequest req)
Parameter Type Description
req CloseWebSocketRequest  

Returns: System.Threading.Tasks.Task

Overrides: PlatformAbstractionLayer.CloseWebSocket(CloseWebSocketRequest)

CreateWebSocket(CreateWebSocketRequest)

protected override async Task<int> CreateWebSocket(CreateWebSocketRequest req)
Parameter Type Description
req CreateWebSocketRequest  

Returns: System.Threading.Tasks.Task<System.Int32>

Overrides: PlatformAbstractionLayer.CreateWebSocket(CreateWebSocketRequest)

DisposeManaged()

protected override void DisposeManaged()

Overrides: BaseDisposable.DisposeManaged()

GetFileIOBasePath(CancellationToken)

protected virtual Task<string> GetFileIOBasePath(CancellationToken _)
Parameter Type Description
_ System.Threading.CancellationToken  

Returns: System.Threading.Tasks.Task<System.String>

Log(LogRequest)

protected override Task Log(LogRequest req)
Parameter Type Description
req LogRequest  

Returns: System.Threading.Tasks.Task

Overrides: PlatformAbstractionLayer.Log(LogRequest)

ReadFile(ReadFileRequest)

protected override async Task<string> ReadFile(ReadFileRequest req)
Parameter Type Description
req ReadFileRequest  

Returns: System.Threading.Tasks.Task<System.String>

Overrides: PlatformAbstractionLayer.ReadFile(ReadFileRequest)

RecvWebSocketMessage(RecvWebSocketMessageRequest)

protected override async Task<string> RecvWebSocketMessage(RecvWebSocketMessageRequest req)
Parameter Type Description
req RecvWebSocketMessageRequest  

Returns: System.Threading.Tasks.Task<System.String>

Overrides: PlatformAbstractionLayer.RecvWebSocketMessage(RecvWebSocketMessageRequest)

SendWebSocketMessage(SendWebSocketMessageRequest)

protected override async Task SendWebSocketMessage(SendWebSocketMessageRequest req)
Parameter Type Description
req SendWebSocketMessageRequest  

Returns: System.Threading.Tasks.Task

Overrides: PlatformAbstractionLayer.SendWebSocketMessage(SendWebSocketMessageRequest)

Sleep(SleepRequest)

protected override Task Sleep(SleepRequest req)
Parameter Type Description
req SleepRequest  

Returns: System.Threading.Tasks.Task

Overrides: PlatformAbstractionLayer.Sleep(SleepRequest)

WebRequest(WebRequestRequest)

protected override async Task<WebRequestResult> WebRequest(WebRequestRequest request)
Parameter Type Description
request WebRequestRequest  

Returns: System.Threading.Tasks.Task<WebRequestResult>

Overrides: PlatformAbstractionLayer.WebRequest(WebRequestRequest)

WriteFile(WriteFileRequest)

protected override async Task WriteFile(WriteFileRequest req)
Parameter Type Description
req WriteFileRequest  

Returns: System.Threading.Tasks.Task

Overrides: PlatformAbstractionLayer.WriteFile(WriteFileRequest)

Poll

This object represents a Poll.

Use the Info property to obtain a snapshot of the current poll status.

For efficiency, invoke System.IDisposable.Dispose() if you don’t require the results of the poll. This stops the background worker that polls updates from the Core library.

Syntax

public class Poll : BaseDisposable, IDisposable

Properties

Info

The current poll status. This property is updated automatically to reflect the current state. Note that it will point to a new PollInfo object after each update, so keeping a reference to the returned object means that you will not see updated values.

public PollInfo Info { get; }

Property Value: PollInfo

PollEnded

This task resolves as soon as the poll has ended.

public GameTask PollEnded { get; }

Property Value: GameTask

Methods

DeletePoll()

Cancel a poll. This causes the poll to end immediately. No results are shown.

public async GameTask DeletePoll()

Returns: GameTask

DisposeUnmanaged()

protected override void DisposeUnmanaged()

Overrides: BaseDisposable.DisposeUnmanaged()

FinishPoll()

Finish a poll prematurely. This causes the poll to end immediately. Results are then shown to all viewers, as if the poll had timed out normally.

public async GameTask FinishPoll()

Returns: GameTask

WaitForUpdate()

Wait for the poll state to update.

public GameTask WaitForUpdate()

Returns: GameTask

Prediction

This object represents a Prediction.

Syntax

public class Prediction : BaseDisposable, IDisposable

Properties

Info

The current prediction status. This property is updated automatically to reflect the current state. Note that it will point to a new PredictionInfo object after each update, so keeping a reference to the returned object means that you will not see updated values.

public PredictionInfo Info { get; }

Property Value: PredictionInfo

PredictionLocked

This task resolves as soon as the prediction is locked. Once the prediction is locked, you should resolve it to one of its outcomes.

public GameTask PredictionLocked { get; }

Property Value: GameTask

Methods

Cancel()

Cancel a Prediction. This immediately ends the Prediction and does not show an outcome or any results to viewers.

public async GameTask Cancel()

Returns: GameTask

DisposeUnmanaged()

protected override void DisposeUnmanaged()

Overrides: BaseDisposable.DisposeUnmanaged()

Lock()

Lock a Prediction prematurely. This causes the Prediction to stop accepting votes immediately, as if the timer had expired.

public async GameTask Lock()

Returns: GameTask

Resolve(PredictionOutcome)

Resolve a Prediction. Resolving a prediction is allowed even if it’s not locked yet.

public async GameTask Resolve(PredictionOutcome outcome)
Parameter Type Description
outcome PredictionOutcome The winning outcome.

Returns: GameTask

WaitForUpdate()

Wait for the prediction status to update.

public GameTask WaitForUpdate()

Returns: GameTask

TwitchApi

The Twitch API.

Syntax

public class TwitchApi : BaseDisposable, IDisposable

Constructors

TwitchApi(String, String, Boolean)

Initialize the Twitch plugin.

public TwitchApi(string clientId, string clientSecret, bool useEventSubProxy = false)
Parameter Type Description
clientId System.String Your OAuth Client ID.
clientSecret System.String Your OAuth Client Secret.
useEventSubProxy System.Boolean Do not enable this in releases. This option instructs the plugin to connect to a local EventSubProxy instead of directly to Twitch.

Methods

AddStreamTag(String)

public GameTask AddStreamTag(string id)
Parameter Type Description
id System.String  

Returns: GameTask

CheckUserSubscription(String)

public GameTask<UserSubscriptionCheckResult> CheckUserSubscription(string broadcasterId)
Parameter Type Description
broadcasterId System.String  

Returns: GameTask<UserSubscriptionCheckResult>

CreateClip(Boolean)

public GameTask<ClipInfo> CreateClip(bool hasDelay)
Parameter Type Description
hasDelay System.Boolean  

Returns: GameTask<ClipInfo>

CreatePAL()

Override this in derived classes to use a custom PAL implementation.

protected virtual PlatformAbstractionLayer CreatePAL()

Returns: PlatformAbstractionLayer

CreateStreamMarker(String)

public GameTask<StreamMarkerInfo> CreateStreamMarker(string description)
Parameter Type Description
System.String description    

Returns: GameTask<StreamMarkerInfo>

DisposeManaged()

protected override void DisposeManaged()

Overrides: BaseDisposable.DisposeManaged()

GetAuthenticationInfo(TwitchOAuthScope[])

public GameTask<AuthenticationInfo> GetAuthenticationInfo(params TwitchOAuthScope[] scopes)
Parameter Type Description
scopes TwitchOAuthScope[]  

Returns: GameTask<AuthenticationInfo>

GetAuthState()

public GameTask<AuthState> GetAuthState()

Returns: GameTask<AuthState>

GetBitsLeaderboard(Int32, String, String, String)

public GameTask<BitsLeaderboard> GetBitsLeaderboard(int count = -1, string period = null, string startedAt = null, string userId = null)
Parameter Type Description
count System.Int32  
period System.String  
startedAt System.String  
userId System.String  

Returns: GameTask<BitsLeaderboard>

GetMyStreamInfo()

public GameTask<StreamInfo> GetMyStreamInfo()

Returns: GameTask<StreamInfo>

GetMyUserInfo()

public GameTask<UserInfo> GetMyUserInfo()

Returns: GameTask<UserInfo>

GetStreamInfoById(String)

Gets information about a specific stream. Returns an object describing the stream, or null if the channel is offline or does not exist.

public async GameTask<StreamInfo> GetStreamInfoById(string id)
Parameter Type Description
id System.String The channel ID to query for.

Returns: GameTask<StreamInfo>

GetUserInfoById(String)

public GameTask<UserInfo> GetUserInfoById(string login)
Parameter Type Description
login System.String  

Returns: GameTask<UserInfo>

GetUserInfoByLoginName(String)

public GameTask<UserInfo> GetUserInfoByLoginName(string login)
Parameter Type Description
login System.String  

Returns: GameTask<UserInfo>

LogOut()

public GameTask LogOut()

Returns: GameTask

ModifyChannelInformation(String, String, String, Int32)

All parameters are optional, but at least one parameter must be provided.

public GameTask ModifyChannelInformation(string gameId = null, string language = null, string title = null, int delay = -1)
Parameter Type Description
gameId System.String  
language System.String  
title System.String  
delay System.Int32  

Returns: GameTask

NewPoll(PollDefinition)

public async GameTask<Poll> NewPoll(PollDefinition def)
Parameter Type Description
def PollDefinition  

Returns: GameTask<Poll>

NewPrediction(PredictionDefinition)

public async GameTask<Prediction> NewPrediction(PredictionDefinition def)
Parameter Type Description
def PredictionDefinition  

Returns: GameTask<Prediction>

QueryStreams(StreamQuery)

public GameTask<StreamQueryResult> QueryStreams(StreamQuery query)
Parameter Type Description
query StreamQuery  

Returns: GameTask<StreamQueryResult>

RemoveStreamTag(String)

public GameTask RemoveStreamTag(string id)
Parameter Type Description
id System.String  

Returns: GameTask

ReplaceCustomRewards(CustomRewardDefinition[])

public GameTask ReplaceCustomRewards(params CustomRewardDefinition[] rewards)
Parameter Type Description
rewards CustomRewardDefinition[]  

Returns: GameTask

ResolveCustomReward(CustomRewardEvent, CustomRewardRedemptionState)

public GameTask ResolveCustomReward(CustomRewardEvent e, CustomRewardRedemptionState resolution)
Parameter Type Description
e CustomRewardEvent  
resolution CustomRewardRedemptionState  

Returns: GameTask

ResolveCustomReward(CustomRewardResolveRequest)

public GameTask ResolveCustomReward(CustomRewardResolveRequest req)
Parameter Type Description
req CustomRewardResolveRequest  

Returns: GameTask

SubscribeToChannelCheerEvents()

public GameTask<EventStream<ChannelCheerEvent>> SubscribeToChannelCheerEvents()

Returns: GameTask<EventStream<ChannelCheerEvent»

SubscribeToChannelFollowEvents()

public GameTask<EventStream<ChannelFollowEvent>> SubscribeToChannelFollowEvents()

Returns: GameTask<EventStream<ChannelFollowEvent»

SubscribeToChannelRaidEvents()

public GameTask<EventStream<ChannelRaidEvent>> SubscribeToChannelRaidEvents()

Returns: GameTask<EventStream<ChannelRaidEvent»

SubscribeToChannelSubscribeEvents()

public GameTask<EventStream<ChannelSubscribeEvent>> SubscribeToChannelSubscribeEvents()

Returns: GameTask<EventStream<ChannelSubscribeEvent»

SubscribeToCustomRewardEvents()

public GameTask<EventStream<CustomRewardEvent>> SubscribeToCustomRewardEvents()

Returns: GameTask<EventStream<CustomRewardEvent»

SubscribeToHypeTrainEvents()

public GameTask<EventStream<HypeTrainEvent>> SubscribeToHypeTrainEvents()

Returns: GameTask<EventStream<HypeTrainEvent»

TwitchOAuthScope

Twitch OAuth Scopes.

Syntax

public class TwitchOAuthScope

Constructors

TwitchOAuthScope(String)

Construct a custom OAuth Scope from a string.

public TwitchOAuthScope(string scope)
Parameter Type Description
scope System.String  

Properties

Scope

public string Scope { get; }

Property Value: System.String

TwitchOAuthScope.Bits

Syntax

public static class Bits

Properties

Read

public static TwitchOAuthScope Read { get; }

Property Value: TwitchOAuthScope

TwitchOAuthScope.Channel

Syntax

public static class Channel

Properties

ManageBroadcast

public static TwitchOAuthScope ManageBroadcast { get; }

Property Value: TwitchOAuthScope

ManagePolls

public static TwitchOAuthScope ManagePolls { get; }

Property Value: TwitchOAuthScope

ManagePredictions

public static TwitchOAuthScope ManagePredictions { get; }

Property Value: TwitchOAuthScope

ManageRedemptions

public static TwitchOAuthScope ManageRedemptions { get; }

Property Value: TwitchOAuthScope

ReadHypeTrain

public static TwitchOAuthScope ReadHypeTrain { get; }

Property Value: TwitchOAuthScope

TwitchOAuthScope.Clips

Syntax

public static class Clips

Properties

Edit

public static TwitchOAuthScope Edit { get; }

Property Value: TwitchOAuthScope

TwitchOAuthScope.User

Syntax

public static class User

Properties

ReadSubscriptions

public static TwitchOAuthScope ReadSubscriptions { get; }

Property Value: TwitchOAuthScope

Game Task Method Builder

GameTaskMethodBuilder

Syntax

public struct GameTaskMethodBuilder

Properties

Task

public readonly GameTask Task { get; }

Property Value: GameTask

Methods

AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter, ref TStateMachine)

public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine)

    where TAwaiter : INotifyCompletion where TStateMachine : IAsyncStateMachine
Parameter Type Description
awaiter TAwaiter  
stateMachine TStateMachine  

AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter, ref TStateMachine)

public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine)

    where TAwaiter : ICriticalNotifyCompletion where TStateMachine : IAsyncStateMachine
Parameter Type Description
awaiter TAwaiter  
stateMachine TStateMachine  

Create()

public static GameTaskMethodBuilder Create()

Returns: GameTaskMethodBuilder

SetException(Exception)

public void SetException(Exception exception)
Parameter Type Description
exception System.Exception  

SetResult()

public void SetResult()

SetStateMachine(IAsyncStateMachine)

public void SetStateMachine(IAsyncStateMachine stateMachine)
Parameter Type Description
stateMachine System.Runtime.CompilerServices.IAsyncStateMachine  

Start<TStateMachine>(ref TStateMachine)

public void Start<TStateMachine>(ref TStateMachine stateMachine)

    where TStateMachine : IAsyncStateMachine
Parameter Type Description
stateMachine TStateMachine  

GameTaskMethodBuilder<T>

Syntax

public struct GameTaskMethodBuilder<T>

Properties

Task

public readonly GameTask<T> Task { get; }

Property Value: GameTask<T>

Methods

AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter, ref TStateMachine)

public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine)

    where TAwaiter : INotifyCompletion where TStateMachine : IAsyncStateMachine
Parameter Type Description
awaiter TAwaiter  
TStateMachine stateMachine  

Type Parameters: TAwaiter, TStateMachine

AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter, ref TStateMachine)

public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine)

    where TAwaiter : ICriticalNotifyCompletion where TStateMachine : IAsyncStateMachine
Parameter Type Description
awaiter TAwaiter  
stateMachine TStateMachine  

Type Parameters: TAwaiter, TStateMachine

Create()

public static GameTaskMethodBuilder<T> Create()

Returns: GameTaskMethodBuilder<T>

SetException(Exception)

public void SetException(Exception exception)
Parameter Type Description
exception System.Exception  

SetResult(T)

public void SetResult(T result)
Parameter Type Description
result T  

SetStateMachine(IAsyncStateMachine)

public void SetStateMachine(IAsyncStateMachine stateMachine)
Parameter Type Description
stateMachine System.Runtime.CompilerServices.IAsyncStateMachine  

Start<TStateMachine>(ref TStateMachine)

public void Start<TStateMachine>(ref TStateMachine stateMachine)

    where TStateMachine : IAsyncStateMachine
Parameter Type Description
stateMachine TStateMachine  

Type Parameters: TStateMachine

Twitch API Interop

AuthenticationInfo

Syntax

public class AuthenticationInfo : IMarshallable

Fields

Name Type Description
Uri System.String  
UserCode System.String  

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(AuthenticationInfo, AuthenticationInfo)

public static bool operator ==(AuthenticationInfo a, AuthenticationInfo b)
Parameter Type Description
a AuthenticationInfo  
b AuthenticationInfo  

Returns: System.Boolean

Inequality(AuthenticationInfo, AuthenticationInfo)

public static bool operator !=(AuthenticationInfo a, AuthenticationInfo b)
Parameter Type Description
a AuthenticationInfo  
b AuthenticationInfo  

Returns: System.Boolean

AuthState

The library’s user authentication state.

Syntax

public class AuthState : IMarshallable

Fields

Name Type Description
Scopes System.String[] If Status is AuthStatus.LoggedIn, this is the set of available OAuth scopes. This may be smaller than the set of scopes you passed to GetAuthenticationInfo if the user logged in with a previous version of your application.
Status AuthStatus The current authentication status.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(AuthState, AuthState)

public static bool operator ==(AuthState a, AuthState b)
Parameter Type Description
a AuthState  
b AuthState  

Returns: System.Boolean

Inequality(AuthState, AuthState)

public static bool operator !=(AuthState a, AuthState b)
Parameter Type Description
a AuthState  
b AuthState  

Returns: System.Boolean

AuthStatus Enum

The current user authentication status.

Syntax

public enum AuthStatus : byte

Fields

Name Description
Loading The status can not be determined because an operation affecting it is currently in progress.
LoggedIn We have valid OAuth credentials.
LoggedOut The core library is logged out.
WaitingForCode The authorization code flow is in progress and we are currently waiting for the user to authorize.

BitsLeaderboard

Syntax

public class BitsLeaderboard : IMarshallable

Fields

Name Type Description
Data BitsLeaderboardEntry[] Entries on the bits leaderboard, in no particular order.
EndedAt System.String End of the date range for the returned data.
StartedAt System.String Start of the date range for the returned data.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(BitsLeaderboard, BitsLeaderboard)

public static bool operator ==(BitsLeaderboard a, BitsLeaderboard b)
Parameter Type Description
a BitsLeaderboard  
b BitsLeaderboard  

Returns: System.Boolean

Inequality(BitsLeaderboard, BitsLeaderboard)

public static bool operator !=(BitsLeaderboard a, BitsLeaderboard b)
Parameter Type Description
a BitsLeaderboard  
b BitsLeaderboard  

Returns: System.Boolean

BitsLeaderboardEntry

Syntax

public class BitsLeaderboardEntry : IMarshallable

Fields

Name Type Description
Rank System.Int64 Leaderboard rank of the user.
Score System.Int64 Leaderboard score (number of Bits) of the user.
UserId System.String ID of the user (viewer) in the leaderboard entry.
UserName System.String Display name corresponding to UserId.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(BitsLeaderboardEntry, BitsLeaderboardEntry)

public static bool operator ==(BitsLeaderboardEntry a, BitsLeaderboardEntry b)
Parameter Type Description
a BitsLeaderboardEntry  
b BitsLeaderboardEntry  

Returns: System.Boolean

Inequality(BitsLeaderboardEntry, BitsLeaderboardEntry)

public static bool operator !=(BitsLeaderboardEntry a, BitsLeaderboardEntry b)
Parameter Type Description
a BitsLeaderboardEntry  
b BitsLeaderboardEntry  

Returns: System.Boolean

BitsLeaderboardRequest

Syntax

public class BitsLeaderboardRequest : IMarshallable

Fields

Name Type Description
Count System.Int32 Number of results to be returned. Maximum: 100. Default: 10.
Period System.String Time period over which data is aggregated (PST time zone). This parameter interacts with StartedAt. Default: all.
StartedAt System.String Timestamp for the period over which the returned data is aggregated. Must be in RFC 3339 format.

If this is not provided, data is aggregated over the current period; e.g., the current day/week/month/year. This value is ignored if Period is all. Currently, the HH:MM:SS part of this value is used only to identify a given day in PST and otherwise ignored. For example, if the StartedAt value resolves to 5PM PST yesterday and Period is day, data is returned for all of yesterday.
UserId System.String ID of the user whose results are returned; i.e., the person who paid for the Bits.

As long as Count is greater than 1, the returned data includes additional users, with Bits amounts above and below the user specified by UserId. If UserId is not provided, the endpoint returns the Bits leaderboard data across top users (subject to the value of Count).

Valid values for Period:

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(BitsLeaderboardRequest, BitsLeaderboardRequest)

public static bool operator ==(BitsLeaderboardRequest a, BitsLeaderboardRequest b)
Parameter Type Description
a BitsLeaderboardRequest  
b BitsLeaderboardRequest  

Returns: System.Boolean

Inequality(BitsLeaderboardRequest, BitsLeaderboardRequest)

public static bool operator !=(BitsLeaderboardRequest a, BitsLeaderboardRequest b)
Parameter Type Description
a BitsLeaderboardRequest  
b BitsLeaderboardRequest  

Returns: System.Boolean

ChannelCheerEvent

A user Cheers on the specified channel.

Syntax

public class ChannelCheerEvent : IMarshallable

Fields

Name Type Description
Bits System.Int64 The number of bits cheered.
IsAnonymous System.Boolean Whether the user cheered anonymously or not.
Message System.String The message sent with the cheer.
UserDisplayName System.String The user display name for the user who cheered on the specified channel. This is null if IsAnonymous is true.
UserId System.String The user ID for the user who cheered on the specified channel. This is null if IsAnonymous is true.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(ChannelCheerEvent, ChannelCheerEvent)

public static bool operator ==(ChannelCheerEvent a, ChannelCheerEvent b)
Parameter Type Description
a ChannelCheerEvent  
b ChannelCheerEvent  

Returns: System.Boolean

Inequality(ChannelCheerEvent, ChannelCheerEvent)

public static bool operator !=(ChannelCheerEvent a, ChannelCheerEvent b)
Parameter Type Description
a ChannelCheerEvent  
b ChannelCheerEvent  

Returns: System.Boolean

ChannelFollowEvent

A specified channel receives a follow.

Syntax

public class ChannelFollowEvent : IMarshallable

Fields

Name Type Description
FollowedAt System.String RFC3339 timestamp of when the follow occurred.
UserDisplayName System.String The user display name for the user now following the specified channel.
UserId System.String The user ID for the user now following the specified channel.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(ChannelFollowEvent, ChannelFollowEvent)

public static bool operator ==(ChannelFollowEvent a, ChannelFollowEvent b)
Parameter Type Description
a ChannelFollowEvent  
b ChannelFollowEvent  

Returns: System.Boolean

Inequality(ChannelFollowEvent, ChannelFollowEvent)

public static bool operator !=(ChannelFollowEvent a, ChannelFollowEvent b)
Parameter Type Description
a ChannelFollowEvent  
b ChannelFollowEvent  

Returns: System.Boolean

ChannelRaidEvent

A broadcaster raids another broadcaster’s channel.

Syntax

public class ChannelRaidEvent : IMarshallable

Fields

Name Type Description
FromBroadcasterId System.String The broadcaster ID that created the raid.
FromBroadcasterName System.String The broadcaster display name that created the raid.
ToBroadcasterId System.String The broadcaster ID that received the raid.
ToBroadcasterName System.String The broadcaster display name that received the raid.
Viewers System.Int64 The number of viewers in the raid.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(ChannelRaidEvent, ChannelRaidEvent)

public static bool operator ==(ChannelRaidEvent a, ChannelRaidEvent b)
Parameter Type Description
a ChannelRaidEvent  
b ChannelRaidEvent  

Returns: System.Boolean

Inequality(ChannelRaidEvent, ChannelRaidEvent)

public static bool operator !=(ChannelRaidEvent a, ChannelRaidEvent b)
Parameter Type Description
a ChannelRaidEvent  
b ChannelRaidEvent  

Returns: System.Boolean

ChannelSubscribeEvent

A notification when a specified channel receives a subscriber. This does not include resubscribes.

Syntax

public class ChannelSubscribeEvent : IMarshallable

Fields

Name Type Description
CumulativeMonths System.Int32 The total number of months the user has been subscribed to the channel. This is nonzero only for resubscriptions.
DurationMonths System.Int32 The month duration of the subscription. This is nonzero only for resubscriptions.
IsGift System.Boolean Whether the subscription is a gift.
StreakMonths System.Int32 The number of consecutive months the user’s current subscription has been active. This value is -1 if the user has opted out of sharing this information. This is nonzero only for resubscriptions.
Tier System.String The tier of the subscription. Valid values are 1000, 2000, and 3000.
UserDisplayName System.String The user display name for the user who subscribed to the specified channel.
UserId System.String The user ID for the user who subscribed to the specified channel.
UserLogin System.String The user login for the user who subscribed to the specified channel.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(ChannelSubscribeEvent, ChannelSubscribeEvent)

public static bool operator ==(ChannelSubscribeEvent a, ChannelSubscribeEvent b)
Parameter Type Description
a ChannelSubscribeEvent  
b ChannelSubscribeEvent  

Returns: System.Boolean

Inequality(ChannelSubscribeEvent, ChannelSubscribeEvent)

public static bool operator !=(ChannelSubscribeEvent a, ChannelSubscribeEvent b)
Parameter Type Description
a ChannelSubscribeEvent  
b ChannelSubscribeEvent  

Returns: System.Boolean

ClipInfo

Describes a Clip.

Syntax

public class ClipInfo : IMarshallable

Fields

Name Type Description
CreatedAt System.String Date when the clip was created.
Duration System.Int32 Duration of the Clip in seconds.
EmbedUrl System.String URL to embed the clip.
Id System.String ID of the clip being queried.
ThumbnailUrl System.String URL of the clip thumbnail.
Url System.String URL where the clip can be viewed.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(ClipInfo, ClipInfo)

public static bool operator ==(ClipInfo a, ClipInfo b)
Parameter Type Description
a ClipInfo  
b ClipInfo  

Returns: System.Boolean

Inequality(ClipInfo, ClipInfo)

public static bool operator !=(ClipInfo a, ClipInfo b)
Parameter Type Description
a ClipInfo  
b ClipInfo  

Returns: System.Boolean

CloseWebSocketRequest

Syntax

public class CloseWebSocketRequest : IMarshallableStartAsync, IMarshallable

Fields

Name Type Description
Handle System.Int32  

Properties

TaskCallback

public GenericTaskCallback TaskCallback { get; set; }

Property Value: GenericTaskCallback

TaskCallbackPayload

public IntPtr TaskCallbackPayload { get; set; }

Property Value: System.IntPtr

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(CloseWebSocketRequest, CloseWebSocketRequest)

public static bool operator ==(CloseWebSocketRequest a, CloseWebSocketRequest b)
Parameter Type Description
a CloseWebSocketRequest  
b CloseWebSocketRequest  

Returns: System.Boolean

Inequality(CloseWebSocketRequest, CloseWebSocketRequest)

public static bool operator !=(CloseWebSocketRequest a, CloseWebSocketRequest b)
Parameter Type Description
a CloseWebSocketRequest  
b CloseWebSocketRequest  

Returns: System.Boolean

Extension Methods

Types.ReturnTask<T>(T, Func<T, Task>)
Types.ReturnTask<T>(T, Func<T, Task<String>>)
Types.ReturnTask<T>(T, Func<T, Task<Int32>>)
Types.ReturnTask<T, R>(T, Func<T, Task<R>>)

CoreLibrary

This class holds a reference to the C++ Core Library.

Syntax

public class CoreLibrary : BaseDisposable, IDisposable

Constructors

CoreLibrary(PlatformAbstractionLayer, String, String, Boolean)

public CoreLibrary(PlatformAbstractionLayer pal, string clientId, string clientSecret, bool useEventSubProxy)
Parameter Type Description
pal PlatformAbstractionLayer  
clientId System.String  
clientSecret System.String  
useEventSubProxy System.Boolean  

Methods

AddStreamTag(String)

Adds a specified tag to the user’s stream. Not implemented in this Beta version.

Required scope: channel:manage:broadcast

Tags expire 72 hours after they are applied, unless the stream is live within that time period. If the stream is live within the 72-hour window, the 72-hour clock restarts when the stream goes offline. The expiration period is subject to change.

public GameTask AddStreamTag(string id)
Parameter Type Description
id System.String ID of the tag to be added to the stream.

Returns: GameTask

CheckUserSubscription(String)

Checks if the currently logged-in user is subscribed to a specific channel.

Required scope: user:read:subscriptions

public GameTask<UserSubscriptionCheckResult> CheckUserSubscription(string broadcaster)
Parameter Type Description
broadcaster System.String ID of the broadcaster to check for.

Returns: GameTask<UserSubscriptionCheckResult>

CloseEventStream(EventStreamDesc)

Close a Twitch EventSub subscription. After the subscription is closed, trying to receive events from it is an error.

public GameTask CloseEventStream(EventStreamDesc desc)
Parameter Type Description
desc EventStreamDesc An object describing the subscription.

Returns: GameTask

CreateClip(Boolean)

Creates a clip programmatically. This returns both an ID and an edit URL for the new clip.

Required scope: clips:edit

Creating a clip can take up to 15 seconds.

If hasDelay is false, the clip is captured from the live stream when the API is called; otherwise, a delay is added before the clip is captured (to account for the brief delay between the broadcaster’s stream and the viewer’s experience of that stream).

public GameTask<ClipInfo> CreateClip(bool hasDelay)
Parameter Type Description
hasDelay System.Boolean Whether stream delay should be added before capturing the clip.

Returns: GameTask<ClipInfo>

CreatePoll(PollDefinition)

Create a poll on the user’s Twitch channel.

Required scope: channel:manage:polls

Creating a poll automatically subscribes to updates for this poll. Avoid unnecessary traffic by invoking UnsubscribeFromPoll(String) at some point for every poll you create.

public GameTask<PollInfo> CreatePoll(PollDefinition p)
Parameter Type Description
p PollDefinition  

Returns: GameTask<PollInfo>

CreatePrediction(PredictionDefinition)

Create a Channel Points Prediction on the user’s Twitch channel.

Required scope: channel:manage:predictions

Creating a prediction automatically subscribes to updates for this prediction. Avoid unnecessary traffic by invoking UnsubscribeFromPrediction(String) at some point for every poll you create.

public GameTask<PredictionInfo> CreatePrediction(PredictionDefinition p)
Parameter Type Description
p PredictionDefinition  

Returns: GameTask<PredictionInfo>

CreateStreamMarker(String)

Creates a marker in the stream of a user.

Required scope: channel:manage:broadcast

A marker is an arbitrary point in a stream that the broadcaster wants to mark; e.g., to easily return to later. The marker is created at the current timestamp in the live broadcast when the request is processed. Markers can be created by the stream owner or editors.

Markers cannot be created in some cases (an error will occur):

public GameTask<StreamMarkerInfo> CreateStreamMarker(string description)
Parameter Type Description
description System.String Optional. Description of or comments on the marker. Max length is 140 characters.

Returns: GameTask<StreamMarkerInfo>

DisposeUnmanaged()

protected override void DisposeUnmanaged()

Overrides: BaseDisposable.DisposeUnmanaged()

EndPoll(EndPollRequest)

End a poll prematurely.

Required scope: channel:manage:predictions

public GameTask<PollInfo> EndPoll(EndPollRequest req)
Parameter Type Description
req EndPollRequest  

Returns: GameTask<PollInfo>

EndPrediction(EndPredictionRequest)

Lock, resolve, or cancel a Channel Points Prediction.

public GameTask<PredictionInfo> EndPrediction(EndPredictionRequest req)
Parameter Type Description
req EndPredictionRequest  

Returns: GameTask<PredictionInfo>

GetAuthenticationInfo(String)

Start the authorization code flow. If a user is currently logged in, this does nothing. After a successfull call to GetAuthenticationInfo, subsequent calls will return the same AuthenticationInfo until the login is either completed or timed out.

Credentials are stored persistently, so after loggin in successfully and restarting your application, the library remains in the LoggedIn state.

See also GetAuthState() and LogOut().

public GameTask<AuthenticationInfo> GetAuthenticationInfo(string scopes)
Parameter Type Description
scopes System.String The set of OAuth scopes you would like to request.

Returns: GameTask<AuthenticationInfo>

GetAuthState()

Query the current authentication state. This call always returns immediately.

See also GetAuthenticationInfo(String).

public GameTask<AuthState> GetAuthState()

Returns: GameTask<AuthState>

GetBitsLeaderboard(BitsLeaderboardRequest)

Gets a ranked list of Bits leaderboard information for an authorized broadcaster.

Required scope: bits:read

public GameTask<BitsLeaderboard> GetBitsLeaderboard(BitsLeaderboardRequest req)
Parameter Type Description
req BitsLeaderboardRequest  

Returns: GameTask<BitsLeaderboard>

GetMyStreamInfo()

Gets information about the currently logged-in user’s stream.

If the user is not logged in, this also waits for a successful login. Returns null if the user is currently not live.

public GameTask<StreamInfo> GetMyStreamInfo()

Returns: GameTask<StreamInfo>

GetMyUserInfo()

Gets information about the currently logged-in user’s account.

If the user is not logged in, this also waits for a successful login.

public GameTask<UserInfo> GetMyUserInfo()

Returns: GameTask<UserInfo>

GetUserInfoById(String)

Gets information about a specific Twitch user account. Returns an empty object if no such user could be found.

public GameTask<UserInfo> GetUserInfoById(string id)
Parameter Type Description
id System.String The account ID to query for.

Returns: GameTask<UserInfo>

GetUserInfoByLoginName(String)

Gets information about a specific Twitch user account. Returns an empty object if no such user could be found.

public GameTask<UserInfo> GetUserInfoByLoginName(string login)
Parameter Type Description
login System.String The login name to query for.

Returns: GameTask<UserInfo>

LogOut()

Log out. This call always returns immediately.

public GameTask LogOut()

Returns: GameTask

ModifyChannelInformation(ModifyChannelInfoRequest)

Modifies channel information for the currently logged-in user.

Required scope: channel:manage:broadcast

public GameTask ModifyChannelInformation(ModifyChannelInfoRequest req)
Parameter Type Description
req ModifyChannelInfoRequest  

Returns: GameTask

QueryStreams(StreamQuery)

Gets information about active streams. Streams are returned sorted by number of current viewers, in descending order.

Submitting an empty query is valid and fetches the top streams currently on Twitch. Across multiple pages of results, there may be duplicate or missing streams, as viewers join and leave streams.

Returns an object containing the matching streams and optionally a pagination token to fetch more results.

public GameTask<StreamQueryResult> QueryStreams(StreamQuery query)
Parameter Type Description
query StreamQuery The query to submit to the API.

Returns: GameTask<StreamQueryResult>

RemoveStreamTag(String)

Removes a specified tag from the user’s stream. Not implemented in this Beta version.

Required scope: channel:manage:broadcast

public GameTask RemoveStreamTag(string id)
Parameter Type Description
id System.String ID of the tag to be removed from the stream.

Returns: GameTask

ReplaceCustomRewards(CustomRewardList)

Updates the set of available custom channel points rewards on a channel.

Required scope: channel:manage:redemptions

If you enable any custom rewards, please clear them by invoking this function with an empty rewards list when the game terminates.

Note that removing rewards that still have pending redemptions will set those redemptions to Fulfilled.

public GameTask ReplaceCustomRewards(CustomRewardList req)
Parameter Type Description
req CustomRewardList  

Returns: GameTask

ResolveCustomReward(CustomRewardResolveRequest)

Updates the status of Custom Reward Redemption objects on a channel that are in the Unfulfilled status.

Required scope: channel:manage:redemptions

See also SubscribeToEventStream(EventStreamRequest) and WaitForCustomRewardEvent(EventStreamDesc).

public GameTask ResolveCustomReward(CustomRewardResolveRequest req)
Parameter Type Description
req CustomRewardResolveRequest  

Returns: GameTask

SubscribeToEventStream(EventStreamRequest)

Subscribe to a Twitch EventSub stream.

You must periodically receive events from your event stream. You must call CloseEventStream(EventStreamDesc) once you are done.

To avoid leaking memory indefinitely in this case, there is an internal limit of 512 buffered events per event stream subscription, as well as an internal limit of 64 subscription per event type in total. When the internal buffer of a subscription is full, incoming events will be discarded silently. When the subscriptions limit is reached, an arbitrary subscription of the same type will be closed, and a warning message will be logged.

See also:
WaitForChannelSubscribeEvent(EventStreamDesc)
WaitForChannelFollowEvent(EventStreamDesc)
WaitForChannelCheerEvent(EventStreamDesc)
WaitForCustomRewardEvent(EventStreamDesc)
WaitForHypeTrainEvent(EventStreamDesc)
WaitForChannelRaidEvent(EventStreamDesc)

public GameTask<EventStreamDesc> SubscribeToEventStream(EventStreamRequest req)
Parameter Type Description
req EventStreamRequest  

Returns: GameTask<EventStreamDesc>

UnsubscribeFromPoll(String)

Unsubscribe from updates for a specific poll.

You must not invoke this function multiple times for the same poll. Unsubscribing from polls is optional. Failing to do so results in unnecessary traffic, but will not cause any malfunction or memory leak.

public GameTask UnsubscribeFromPoll(string id)
Parameter Type Description
id System.String Id of the poll to unsubscribe from.

Returns: GameTask

UnsubscribeFromPrediction(String)

Unsubscribe from updates for a specific prediction.

You must not invoke this function multiple times for the same prediction. Unsubscribing from predictions is optional. Failing to do so results in unnecessary traffic, but will not cause any malfunction or memory leak.

public GameTask UnsubscribeFromPrediction(string id)
Parameter Type Description
id System.String Id of the prediction to unsubscribe from.

Returns: GameTask

WaitForChannelCheerEvent(EventStreamDesc)

A user cheers on the specified channel.

You may only call this with a subscription for the correct event type.

See also SubscribeToEventStream(EventStreamRequest).

public GameTask<ChannelCheerEvent> WaitForChannelCheerEvent(EventStreamDesc desc)
Parameter Type Description
desc EventStreamDesc An object describing the subscription.

Returns: GameTask<ChannelCheerEvent>

WaitForChannelFollowEvent(EventStreamDesc)

A specified channel receives a follow. You may only call this with a subscription for the correct event type.

See alse SubscribeToEventStream(EventStreamRequest).

public GameTask<ChannelFollowEvent> WaitForChannelFollowEvent(EventStreamDesc desc)
Parameter Type Description
desc EventStreamDesc An object describing the subscription.

Returns: GameTask<ChannelFollowEvent>

WaitForChannelRaidEvent(EventStreamDesc)

A broadcaster raids another broadcaster’s channel. You may only call this with a subscription for the correct event type.

See alse SubscribeToEventStream(EventStreamRequest).

public GameTask<ChannelRaidEvent> WaitForChannelRaidEvent(EventStreamDesc desc)
Parameter Type Description
desc EventStreamDesc An object describing the subscription.

Returns: GameTask<ChannelRaidEvent>

WaitForChannelSubscribeEvent(EventStreamDesc)

A notification when a specified channel receives a subscriber. This does not include resubscribes.

You may only call this with a subscription for the correct event type.

See also SubscribeToEventStream(EventStreamRequest).

public GameTask<ChannelSubscribeEvent> WaitForChannelSubscribeEvent(EventStreamDesc desc)
Parameter Type Description
desc EventStreamDesc An object describing the subscription.

Returns: GameTask<ChannelSubscribeEvent>

WaitForCustomRewardEvent(EventStreamDesc)

A viewer has redeemed a custom channel points reward on the specified channel or the redemption has been updated (i.e., fulfilled or cancelled). You may only call this with a subscription for the correct event type.

See also SubscribeToEventStream(EventStreamRequest) and ReplaceCustomRewards(CustomRewardList).

public GameTask<CustomRewardEvent> WaitForCustomRewardEvent(EventStreamDesc desc)
Parameter Type Description
desc EventStreamDesc An object describing the subscription.

Returns: GameTask<CustomRewardEvent>

WaitForHypeTrainEvent(EventStreamDesc)

A Hype Train makes progress on the user’s channel. Requires the channel:read:hype_train scope. You may only call this with a subscription for the correct event type.

See alse SubscribeToEventStream(EventStreamRequest).

public GameTask<HypeTrainEvent> WaitForHypeTrainEvent(EventStreamDesc desc)
Parameter Type Description
desc EventStreamDesc An object describing the subscription.

Returns: GameTask<HypeTrainEvent>

WaitForPollUpdate(String)

Wait for updates to a specified poll. Updates occur when users submit votes, and finally, when the poll ends.

Avoid calling this function on polls after they have ended, as they will no longer recieve updates at that point.

public GameTask<PollInfo> WaitForPollUpdate(string poll)
Parameter Type Description
poll System.String Id of the poll to wait for.

Returns: GameTask<PollInfo>

WaitForPredictionUpdate(String)

Wait for updates to a specified prediction. Updates occur when users submit votes, and finally, when the prediction ends.

Avoid calling this function on predictions after they have ended, as they will no longer recieve updates at that point.

public GameTask<PredictionInfo> WaitForPredictionUpdate(string prediction)
Parameter Type Description
prediction System.String Id of the prediction to wait for.

Returns: GameTask<PredictionInfo>

CoreLibraryException

Wrapper type for all exceptions thrown by the C++ Core Library.

Syntax

[Serializable]
public class CoreLibraryException : Exception, ISerializable

Constructors

CoreLibraryException()

public CoreLibraryException()

CoreLibraryException(SerializationInfo, StreamingContext)

protected CoreLibraryException(SerializationInfo info, StreamingContext context)
Parameter Type Description
info System.Runtime.Serialization.SerializationInfo  
context System.Runtime.Serialization.StreamingContext  

CoreLibraryException(String)

public CoreLibraryException(string message)
Parameter Type Description
message System.String  

CoreLibraryException(String, Exception)

public CoreLibraryException(string message, Exception inner)
Parameter Type Description
message System.String  
inner System.Exception  

CreateWebSocketRequest

Syntax

public class CreateWebSocketRequest : IMarshallableStartAsync, IMarshallable

Fields

Name Type Description
Protocol System.String  
Url System.String  

Properties

TaskCallback

public GenericTaskCallback TaskCallback { get; set; }

Property Value: GenericTaskCallback

TaskCallbackPayload

public IntPtr TaskCallbackPayload { get; set; }

Property Value: System.IntPtr

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(CreateWebSocketRequest, CreateWebSocketRequest)

public static bool operator ==(CreateWebSocketRequest a, CreateWebSocketRequest b)
Parameter Type Description
a CreateWebSocketRequest  
b CreateWebSocketRequest  

Returns: System.Boolean

Inequality(CreateWebSocketRequest, CreateWebSocketRequest)

public static bool operator !=(CreateWebSocketRequest a, CreateWebSocketRequest b)
Parameter Type Description
a CreateWebSocketRequest  
b CreateWebSocketRequest  

Returns: System.Boolean

Extension Methods

Types.ReturnTask<T>(T, Func<T, Task>)
Types.ReturnTask<T>(T, Func<T, Task<String>>)
Types.ReturnTask<T>(T, Func<T, Task<Int32>>)
Types.ReturnTask<T, R>(T, Func<T, Task<R>>)

CustomRewardDefinition

Syntax

public class CustomRewardDefinition : IMarshallable

Fields

Name Type Description
BackgroundColor System.String Optional. Custom background color for the reward. Format: Hex with # prefix. Example: #00E5CB.
Cost System.Int64 The cost of the reward.
GlobalCooldownSeconds System.Int32 Optional. The cooldown in seconds if enabled.
IsEnabled System.Boolean Optional. Is the reward currently enabled, if false the reward won’t show up to viewers.
IsGlobalCooldownEnabled System.Boolean Optional. Whether a cooldown is enabled.
IsMaxPerStreamEnabled System.Boolean Optional. Whether a maximum per stream is enabled.
IsMaxPerUserPerStreamEnabled System.Boolean Optional. Whether a maximum per user per stream is enabled.
IsUserInputRequired System.Boolean Optional. Does the user need to enter information when redeeming the reward.
MaxPerStream System.Int32 Optional. The maximum number per stream if enabled.
MaxPerUserPerStream System.Int32 Optional. The maximum number per user per stream if enabled.
Prompt System.String Optional. The prompt for the viewer when redeeming the reward.
ShouldRedemptionsSkipRequestQueue System.Boolean Optional. Should redemptions be set to Fulfilled status immediately when redeemed and skip the request queue instead of the normal Unfulfilled status.
Title System.String The title of the reward.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(CustomRewardDefinition, CustomRewardDefinition)

public static bool operator ==(CustomRewardDefinition a, CustomRewardDefinition b)
Parameter Type Description
a CustomRewardDefinition  
b CustomRewardDefinition  

Returns: System.Boolean

Inequality(CustomRewardDefinition, CustomRewardDefinition)

public static bool operator !=(CustomRewardDefinition a, CustomRewardDefinition b)
Parameter Type Description
a CustomRewardDefinition  
b CustomRewardDefinition  

Returns: System.Boolean

CustomRewardEvent

A viewer has redeemed a custom channel points reward on the specified channel or the redemption has been updated (i.e., fulfilled or cancelled).

Syntax

public class CustomRewardEvent : IMarshallable

Fields

Name Type Description
BroadcasterId System.String The requested broadcaster ID.
BroadcasterName System.String The requested broadcaster display name.
CustomRewardCost System.Int64 The reward cost.
CustomRewardId System.String The reward identifier.
CustomRewardPrompt System.String The reward description.
CustomRewardTitle System.String The reward name.
RedeemedAt System.String RFC3339 timestamp of when the reward was redeemed.
RedeemerId System.String User ID of the user that redeemed the reward.
RedeemerName System.String Display name of the user that redeemed the reward.
RedemptionId System.String The redemption identifier.
Status CustomRewardRedemptionState Status of the redemption. If you resolve or cancel all redemptions from your code, you should discard all events of this type with a status other than Unfulfilled.
UserInput System.String The user input provided. Empty string if not provided.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(CustomRewardEvent, CustomRewardEvent)

public static bool operator ==(CustomRewardEvent a, CustomRewardEvent b)
Parameter Type Description
a CustomRewardEvent  
b CustomRewardEvent  

Returns: System.Boolean

Inequality(CustomRewardEvent, CustomRewardEvent)

public static bool operator !=(CustomRewardEvent a, CustomRewardEvent b)
Parameter Type Description
a CustomRewardEvent  
b CustomRewardEvent  

Returns: System.Boolean

CustomRewardList

Syntax

public class CustomRewardList : IMarshallable

Fields

Name Type Description
Declaration CustomRewardDefinition[]  

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(CustomRewardList, CustomRewardList)

public static bool operator ==(CustomRewardList a, CustomRewardList b)
Parameter Type Description
a CustomRewardList  
b CustomRewardList  

Returns: System.Boolean

Inequality(CustomRewardList, CustomRewardList)

public static bool operator !=(CustomRewardList a, CustomRewardList b)
Parameter Type Description
a CustomRewardList  
b CustomRewardList  

Returns: System.Boolean

CustomRewardRedemptionState Enum

Syntax

public enum CustomRewardRedemptionState : byte

Fields

Name Description
Canceled The channel points reward has been canceled, and the channel points have been refunded.
Fulfilled The channel points reward has been fulfilled.
Unfulfilled The channel points reward has been redeemed and is now waiting to be fulfilled.
Unknown There was an error determining the state of the redemption.

CustomRewardResolveRequest

Syntax

public class CustomRewardResolveRequest : IMarshallable

Fields

Name Type Description
BroadcasterId System.String  
CustomRewardId System.String ID of the Custom Reward the redemptions to be updated are for.
RedemptionId System.String ID of the Custom Reward Redemption to update.
Resolution CustomRewardRedemptionState The new status to set redemptions to. Can be either Fulfilled or Canceled. Specifying Canceled will refund the user their Channel Points.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(CustomRewardResolveRequest, CustomRewardResolveRequest)

public static bool operator ==(CustomRewardResolveRequest a, CustomRewardResolveRequest b)
Parameter Type Description
a CustomRewardResolveRequest  
b CustomRewardResolveRequest  

Returns: System.Boolean

Inequality(CustomRewardResolveRequest, CustomRewardResolveRequest)

public static bool operator !=(CustomRewardResolveRequest a, CustomRewardResolveRequest b)
Parameter Type Description
a CustomRewardResolveRequest  
b CustomRewardResolveRequest  

Returns: System.Boolean

EndPollRequest

Syntax

public class EndPollRequest : IMarshallable

Fields

Name Type Description
BroadcasterId System.String ID of the broadcaster.
PollId System.String ID of the poll.
ShowResults System.Boolean If true, sets the poll status to Terminated so that results are shown. If false, sets the poll status to Archived so that the poll is canceled immediately and no results are shown.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(EndPollRequest, EndPollRequest)

public static bool operator ==(EndPollRequest a, EndPollRequest b)
Parameter Type Description
a EndPollRequest  
b EndPollRequest  

Returns: System.Boolean

Inequality(EndPollRequest, EndPollRequest)

public static bool operator !=(EndPollRequest a, EndPollRequest b)
Parameter Type Description
a EndPollRequest  
b EndPollRequest  

Returns: System.Boolean

EndPredictionRequest

Syntax

public class EndPredictionRequest : IMarshallable

Fields

Name Type Description
BroadcasterId System.String The broadcaster running prediction events.
PredictionId System.String ID of the Prediction.
Status PredictionStatus The Prediction status to be set. Valid values: Locked, Resolved, Canceled
WinningOutcomeId System.String ID of the winning outcome for the Prediction, if Status is being set to Resolved.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(EndPredictionRequest, EndPredictionRequest)

public static bool operator ==(EndPredictionRequest a, EndPredictionRequest b)
Parameter Type Description
a EndPredictionRequest  
b EndPredictionRequest  

Returns: System.Boolean

Inequality(EndPredictionRequest, EndPredictionRequest)

public static bool operator !=(EndPredictionRequest a, EndPredictionRequest b)
Parameter Type Description
a EndPredictionRequest  
b EndPredictionRequest  

Returns: System.Boolean

EventStreamDesc

Syntax

public class EventStreamDesc : IMarshallable

Fields

Name Type Description
Kind EventStreamKind  
Token System.Int32 Opaque token identifying the subscription. Do not touch.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(EventStreamDesc, EventStreamDesc)

public static bool operator ==(EventStreamDesc a, EventStreamDesc b)
Parameter Type Description
a EventStreamDesc  
b EventStreamDesc  

Returns: System.Boolean

Inequality(EventStreamDesc, EventStreamDesc)

public static bool operator !=(EventStreamDesc a, EventStreamDesc b)
Parameter Type Description
a EventStreamDesc  
b EventStreamDesc  

Returns: System.Boolean

EventStreamKind Enum

The type of an EventSub subscription.

Syntax

public enum EventStreamKind : byte

Fields

Name Description
ChannelRaid A broadcaster raids another broadcaster’s channel.
Cheer A user cheers on the specified channel.
CustomRewardRedemption A viewer has redeemed a custom channel points reward on the specified channel or the redemption has been updated (i.e., fulfilled or cancelled).
Follower A specified channel receives a follow.
HypeTrain A Hype Train makes progress on the user’s channel. Requires the channel:read:hype_train scope.
Subscription A notification when a specified channel receives a subscriber. This does not include resubscribes.

EventStreamRequest

Syntax

public class EventStreamRequest : IMarshallable

Fields

Name Type Description
Kind EventStreamKind  

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

GenericTaskCallback

Syntax

public delegate void GenericTaskCallback(IntPtr payload, IntPtr result);
Name Type Description
playload System.IntPtr  
result System.IntPtr  

HttpMethod

Syntax

public enum HttpMethod : byte

Fields

Name Description
Delete  
Get  
Patch  
Post  
Put  

HypeTrainContribution

Describes a contribution to a Hype Train.

Syntax

public class HypeTrainContribution : IMarshallable

Fields

Name Type Description
Total System.Int64 The total contributed.
Type HypeTrainCo Type of contribution.ntributionType
UserId System.String The ID of the user who contributed to the Hype Train.
UserName System.String The display name of the user who contributed to the Hype Train.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(HypeTrainContribution, HypeTrainContribution)

public static bool operator ==(HypeTrainContribution a, HypeTrainContribution b)
Parameter Type Description
a HypeTrainContribution  
b HypeTrainContribution  

Returns: System.Boolean

Inequality(HypeTrainContribution, HypeTrainContribution)

public static bool operator !=(HypeTrainContribution a, HypeTrainContribution b)
Parameter Type Description
a HypeTrainContribution  
b HypeTrainContribution  

Returns: System.Boolean

HypeTrainContributionType Enum

Syntax

public enum HypeTrainContributionType : byte

Fields

Name Description
Bits  
Subscription  

HypeTrainEvent

A Hype Train makes progress on the user’s channel. Requires the channel:read:hype_train scope.

Syntax

public class HypeTrainEvent : IMarshallable

Fields

Name Type Description
BroadcasterId System.String The requested broadcaster ID.
BroadcasterName System.String The requested broadcaster display name.
CooldownEndsAt System.String The time when the Hype Train cooldown ends so that the next Hype Train can start. Empty if the Hype Train has not ended yet.
EndedAt System.String The time when the Hype Train ended. Empty if the Hype Train has not ended yet.
ExpiresAt System.String The time when the Hype Train expires. The expiration is extended when the Hype Train reaches a new level. Empty when the Hype Train is over.
Goal System.Int64 The number of points required to reach the next level. Set to -1 when the hype train is over.
HypeTrainId System.String The Hype Train ID.
LastContribution HypeTrainContribution The most recent contribution. Empty when the Hype Train is over.
Level System.Int32 The current level of the Hype Train.
Progress System.Int64 The number of points contributed to the Hype Train at the current level. Set to -1 when the hype train is over.
StartedAt System.String The time when the Hype Train started.
TopContributions HypeTrainContribution[] The contributors with the most points contributed. Contains a maximum of two objects: one for the top bits contributor and one for the top subscriptions contributor (this includes gifted subscriptions).
TotalPoints System.Int64 Total points contributed to the Hype Train.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(HypeTrainEvent, HypeTrainEvent)

public static bool operator ==(HypeTrainEvent a, HypeTrainEvent b)
Parameter Type Description
a HypeTrainEvent  
b HypeTrainEvent  

Returns: System.Boolean

Inequality(HypeTrainEvent, HypeTrainEvent)

public static bool operator !=(HypeTrainEvent a, HypeTrainEvent b)
Parameter Type Description
a HypeTrainEvent  
b HypeTrainEvent  

Returns: System.Boolean

IMarshallable

Syntax

public interface IMarshallable

IMarshallableStartAsync

Syntax

public interface IMarshallableStartAsync : IMarshallable

Properties

TaskCallback

GenericTaskCallback TaskCallback { get; }

Property Value: GenericTaskCallback

TaskCallbackPayload

IntPtr TaskCallbackPayload { get; }

Property Value: System.IntPtr

Extension Methods

Types.ReturnTask<T>(T, Func<T, Task>)
Types.ReturnTask<T>(T, Func<T, Task<String>>)
Types.ReturnTask<T>(T, Func<T, Task<Int32>>)
Types.ReturnTask<T, R>(T, Func<T, Task<R>>)

LogLevel Enum

Syntax

public enum LogLevel : byte

Fields

Name Description
Debug  
Error  
Info  
Warning  

LogRequest

Syntax

public class LogRequest : IMarshallableStartAsync, IMarshallable

Fields

Name Type Description
Level LogLevel  
Message System.String  

Properties

TaskCallback

public GenericTaskCallback TaskCallback { get; set; }

Property Value: GenericTaskCallback

TaskCallbackPayload

public IntPtr TaskCallbackPayload { get; set; }

Property Value: System.IntPtr

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(LogRequest, LogRequest)

public static bool operator ==(LogRequest a, LogRequest b)
Parameter Type Description
a LogRequest  
b LogRequest  

Returns: System.Boolean

Inequality(LogRequest, LogRequest)

public static bool operator !=(LogRequest a, LogRequest b)
Parameter Type Description
a LogRequest  
b LogRequest  

Returns: System.Boolean

Extension Methods

Types.ReturnTask<T>(T, Func<T, Task>)
Types.ReturnTask<T>(T, Func<T, Task<String>>)
Types.ReturnTask<T>(T, Func<T, Task<Int32>>)
Types.ReturnTask<T, R>(T, Func<T, Task<R>>)

MarshalException

Syntax

public class MarshalException : IMarshallable

Fields

Name Type Description
What System.String  

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(MarshalException, MarshalException)

public static bool operator ==(MarshalException a, MarshalException b)
Parameter Type Description
a MarshalException  
b MarshalException  

Returns: System.Boolean

Inequality(MarshalException, MarshalException)

public static bool operator !=(MarshalException a, MarshalException b)
Parameter Type Description
a MarshalException  
b MarshalException  

Returns: System.Boolean

ModifyChannelInfoRequest

Syntax

public class ModifyChannelInfoRequest : IMarshallable

Fields

Name Type Description
Delay System.Int32 Stream delay in seconds. Stream delay is a Twitch Partner feature; trying to set this value for other account types will return a 400 error.
GameId System.String The current game ID being played on the channel. Use “0” to unset the game.
Language System.String The language of the channel. A language value must be either the ISO 639-1 two-letter code for a supported stream language or “other”.
Title System.String The title of the stream.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(ModifyChannelInfoRequest, ModifyChannelInfoRequest)

public static bool operator ==(ModifyChannelInfoRequest a, ModifyChannelInfoRequest b)
Parameter Type Description
a ModifyChannelInfoRequest  
b ModifyChannelInfoRequest  

Returns: System.Boolean

Inequality(ModifyChannelInfoRequest, ModifyChannelInfoRequest)

public static bool operator !=(ModifyChannelInfoRequest a, ModifyChannelInfoRequest b)
Parameter Type Description
a ModifyChannelInfoRequest  
b ModifyChannelInfoRequest  

Returns: System.Boolean

None

Syntax

public class None : IMarshallable

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(None, None)

public static bool operator ==(None a, None b)
Parameter Type Description
a None  
b None  

Returns: System.Boolean

Inequality(None, None)

public static bool operator !=(None a, None b)
Parameter Type Description
a None  
b None  

Returns: System.Boolean

PlainBool

Syntax

public class PlainBool : IMarshallable

Fields

Name Type Description
Data System.Boolean  

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(PlainBool, PlainBool)

public static bool operator ==(PlainBool a, PlainBool b)
Parameter Type Description
a PlainBool  
b PlainBool  

Returns: System.Boolean

Inequality(PlainBool, PlainBool)

public static bool operator !=(PlainBool a, PlainBool b)
Parameter Type Description
a PlainBool  
b PlainBool  

Returns: System.Boolean

PlainInt

Syntax

public class PlainInt : IMarshallable

Fields

Name Type Description
Data System.Int32  

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(PlainInt, PlainInt)

public static bool operator ==(PlainInt a, PlainInt b)
Parameter Type Description
a PlainInt  
b PlainInt  

Returns: System.Boolean

Inequality(PlainInt, PlainInt)

public static bool operator !=(PlainInt a, PlainInt b)
Parameter Type Description
a PlainInt  
b PlainInt  

Returns: System.Boolean

PlainString

Syntax

public class PlainString : IMarshallable

Fields

Name Type Description
Data System.String  

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(PlainString, PlainString)

public static bool operator ==(PlainString a, PlainString b)
Parameter Type Description
a PlainString  
b PlainString  

Returns: System.Boolean

Inequality(PlainString, PlainString)

public static bool operator !=(PlainString a, PlainString b)
Parameter Type Description
a PlainString  
b PlainString  

Returns: System.Boolean

PlatformAbstractionLayer

The Platform Abstraction Layer (PAL) implements platform-specific API calls, e.g. file I/O.

Syntax

public abstract class PlatformAbstractionLayer : BaseDisposable, IDisposable

Constructors

public PlatformAbstractionLayer()

Methods

CloseWebSocket(CloseWebSocketRequest)

protected abstract Task CloseWebSocket(CloseWebSocketRequest req)
Parameter Type Description
req CloseWebSocketRequest  

Returns: System.Threading.Tasks.Task

CreateWebSocket(CreateWebSocketRequest)

protected abstract Task<int> CreateWebSocket(CreateWebSocketRequest req)
Parameter Type Description
req CreateWebSocketRequest  

Returns: System.Threading.Tasks.Task<System.Int32>

DisposeUnmanaged()

protected override void DisposeUnmanaged()

Overrides: BaseDisposable.DisposeUnmanaged()

Log(LogRequest)

protected abstract Task Log(LogRequest req)
Parameter Type Description
req LogRequest  

Returns: System.Threading.Tasks.Task

ReadFile(ReadFileRequest)

protected abstract Task<string> ReadFile(ReadFileRequest req)
Parameter Type Description
req ReadFileRequest  

Returns: System.Threading.Tasks.Task<System.String>

RecvWebSocketMessage(RecvWebSocketMessageRequest)

protected abstract Task<string> RecvWebSocketMessage(RecvWebSocketMessageRequest req)
Parameter Type Description
req RecvWebSocketMessageRequest  

Returns: System.Threading.Tasks.Task<System.String>

SendWebSocketMessage(SendWebSocketMessageRequest)

protected abstract Task SendWebSocketMessage(SendWebSocketMessageRequest req)
Parameter Type Description
req SendWebSocketMessageRequest  

Returns: System.Threading.Tasks.Task

Sleep(SleepRequest)

protected abstract Task Sleep(SleepRequest req)
Parameter Type Description
req SleepRequest  

Returns: System.Threading.Tasks.Task

WebRequest(WebRequestRequest)

protected abstract Task<WebRequestResult> WebRequest(WebRequestRequest req)
Parameter Type Description
req WebRequestRequest  

Returns: System.Threading.Tasks.Task<WebRequestResult>

WriteFile(WriteFileRequest)

protected abstract Task WriteFile(WriteFileRequest req)
Parameter Type Description
req WriteFileRequest  

Returns: System.Threading.Tasks.Task

####

PlatformAbstractionLayer.PALCall

Syntax

public delegate void PALCall(IntPtr thisPtr, int call, IntPtr payload);
Parameter Type Description
thisPtr System.IntPtr  
call System.Int32  
payload System.IntPtr  

PollChoiceInfo

Syntax

public class PollChoiceInfo : IMarshallable

Fields

Name Type Description
BitsVotes System.Int64 Number of votes received via Bits.
ChannelPointsVotes System.Int64 Number of votes received via Channel Points.
Id System.String ID for the choice.
Title System.String Text displayed for the choice.
Votes System.Int64 Total number of votes received for the choice across all methods of voting.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(PollChoiceInfo, PollChoiceInfo)

public static bool operator ==(PollChoiceInfo a, PollChoiceInfo b)
Parameter Type Description
a PollChoiceInfo  
b PollChoiceInfo  

Returns: System.Boolean

Inequality(PollChoiceInfo, PollChoiceInfo)

public static bool operator !=(PollChoiceInfo a, PollChoiceInfo b)
Parameter Type Description
a PollChoiceInfo  
b PollChoiceInfo  

Returns: System.Boolean

PollDefinition

Contains the information necessary to create a new poll.

Syntax

public class PollDefinition : IMarshallable

Fields

Name Type Description
BitsPerVote System.Int32 Number of Bits required to vote once with Bits.
BitsVotingEnabled System.Boolean Indicates if Bits can be used for voting.
ChannelPointsPerVote System.Int32 Number of Channel Points required to vote once with Channel Points.
ChannelPointsVotingEnabled System.Boolean Indicates if Channel Points can be used for voting.
Choices System.String[] Array of the poll choices.
Duration System.Int64 Total duration for the poll (in seconds).
Title System.String Question displayed for the poll.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(PollDefinition, PollDefinition)

public static bool operator ==(PollDefinition a, PollDefinition b)
Parameter Type Description
a PollDefinition  
b PollDefinition  

Returns: System.Boolean

Inequality(PollDefinition, PollDefinition)

public static bool operator !=(PollDefinition a, PollDefinition b)
Parameter Type Description
a PollDefinition  
b PollDefinition  

Returns: System.Boolean

PollInfo

Describes a Poll on a Twitch channel.

Syntax

public class PollInfo : IMarshallable

Fields

Name Type Description
BitsPerVote System.Int32 Number of Bits required to vote once with Bits.
BitsVotingEnabled System.Boolean Indicates if Bits can be used for voting.
BroadcasterId System.String ID of the broadcaster.
ChannelPointsPerVote System.Int32 Number of Channel Points required to vote once with Channel Points.
ChannelPointsVotingEnabled System.Boolean Indicates if Channel Points can be used for voting.
Choices PollChoiceInfo[] Array of the poll choices.
EndedAt System.String UTC timestamp for the poll’s end time. Set to null if the poll is still Active.
Id System.String ID of the poll.
StartedAt System.String UTC timestamp for the poll’s start time.
Status PollStatus Poll status.
Title System.String Question displayed for the poll.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(PollInfo, PollInfo)

public static bool operator ==(PollInfo a, PollInfo b)
Parameter Type Description
a PollInfo  
b PollInfo  

Returns: System.Boolean

Inequality(PollInfo, PollInfo)

public static bool operator !=(PollInfo a, PollInfo b)
Parameter Type Description
a PollInfo  
b PollInfo  

Returns: System.Boolean

PollStatus Enum

Status of a poll.

Syntax

public enum PollStatus : byte

Fields

Name Description
Active Poll is currently in progress.
Archived Poll is no longer visible on the channel.
Completed Poll has reached its EndedAt time.
Invalid Something went wrong determining the state.
Moderated Poll is no longer visible to any user on Twitch.
Terminated Poll has been manually terminated before its EndedAt time.

PredictionDefinition

Contains the information necessary to create a new prediction.

Syntax

public class PredictionDefinition : IMarshallable

Fields

Name Type Description
Duration System.Int32 Total duration for the Prediction (in seconds). Minimum: 1. Maximum: 1800.
Outcomes System.String[] Array of outcome titles for the Prediction. Array size must be 2. The first outcome object is the “blue” outcome and the second outcome object is the “pink” outcome when viewing the Prediction on Twitch.
Title System.String Title for the Prediction.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(PredictionDefinition, PredictionDefinition)

public static bool operator ==(PredictionDefinition a, PredictionDefinition b)
Parameter Type Description
a PredictionDefinition  
b PredictionDefinition  

Returns: System.Boolean

Inequality(PredictionDefinition, PredictionDefinition)

public static bool operator !=(PredictionDefinition a, PredictionDefinition b)
Parameter Type Description
a PredictionDefinition  
b PredictionDefinition  

Returns: System.Boolean

PredictionInfo

Describes a Channel Points Predictions on a Twitch channel.

Syntax

public class PredictionInfo : IMarshallable

Fields

Name Type Description
BroadcasterId System.String ID of the broadcaster.
CreatedAt System.String UTC timestamp for the Prediction’s start time.
EndedAt System.String UTC timestamp for when the Prediction ended. If Status is Active, this is set to null.
Id System.String ID of the Prediction.
LockedAt System.String UTC timestamp for when the Prediction was locked. If Status is Active, this is set to null.
Outcomes PredictionOutcome[] Array of possible outcomes for the Prediction.
Status PredictionStatus Status of the Prediction.
Title System.String Title for the Prediction.
WinningOutcomeId System.String ID of the winning outcome. If Status is Active, this is set to null.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(PredictionInfo, PredictionInfo)

public static bool operator ==(PredictionInfo a, PredictionInfo b)
Parameter Type Description
a PredictionInfo  
b PredictionInfo  

Returns: System.Boolean

Inequality(PredictionInfo, PredictionInfo)

public static bool operator !=(PredictionInfo a, PredictionInfo b)
Parameter Type Description
a PredictionInfo  
b PredictionInfo  

Returns: System.Boolean

PredictionOutcome

Syntax

public class PredictionOutcome : IMarshallable

Fields

Name Type Description
ChannelPoints System.Int64 Number of Channel Points used for the outcome.
Color System.String Color for the outcome. Valid values: BLUE, PINK
Id System.String ID for the outcome.
Title System.String Text displayed for outcome.
Users System.Int64 Number of unique users that chose the outcome.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(PredictionOutcome, PredictionOutcome)

public static bool operator ==(PredictionOutcome a, PredictionOutcome b)
Parameter Type Description
a PredictionOutcome  
b PredictionOutcome  

Returns: System.Boolean

Inequality(PredictionOutcome, PredictionOutcome)

public static bool operator !=(PredictionOutcome a, PredictionOutcome b)
Parameter Type Description
a PredictionOutcome  
b PredictionOutcome  

Returns: System.Boolean

PredictionStatus Enum

Status of a Prediction.

Syntax

public enum PredictionStatus : byte

Fields

Name Description
Active The Prediction is active and viewers can make predictions.
Canceled The Prediction has been canceled and the Channel Points have been refunded to participants.
Locked The Prediction has been locked and viewers can no longer make predictions.
Resolved A winning outcome has been chosen and the Channel Points have been distributed to the users who guessed the correct outcome.

ReadFileRequest

Syntax

public class ReadFileRequest : IMarshallableStartAsync, IMarshallable

Fields

Name Type Description
Path System.String  

Properties

TaskCallback

public GenericTaskCallback TaskCallback { get; set; }

Property Value: GenericTaskCallback

TaskCallbackPayload

public IntPtr TaskCallbackPayload { get; set; }

Property Value: System.IntPtr

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(ReadFileRequest, ReadFileRequest)

public static bool operator ==(ReadFileRequest a, ReadFileRequest b)
Parameter Type Description
a ReadFileRequest  
b ReadFileRequest  

Returns: System.Boolean

Inequality(ReadFileRequest, ReadFileRequest)

public static bool operator !=(ReadFileRequest a, ReadFileRequest b)
Parameter Type Description
a ReadFileRequest  
b ReadFileRequest  

Returns: System.Boolean

RecvWebSocketMessageRequest

Syntax

public class RecvWebSocketMessageRequest : IMarshallableStartAsync, IMarshallable

Fields

Name Type Description
Handle System.Int32  
TimeoutSeconds System.Int32  

Properties

TaskCallback

public GenericTaskCallback TaskCallback { get; set; }

Property Value: GenericTaskCallback

TaskCallbackPayload

public IntPtr TaskCallbackPayload { get; set; }

Property Value: System.IntPtr

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(RecvWebSocketMessageRequest, RecvWebSocketMessageRequest)

public static bool operator ==(RecvWebSocketMessageRequest a, RecvWebSocketMessageRequest b)
Parameter Type Description
a RecvWebSocketMessageRequest  
b RecvWebSocketMessageRequest  

Returns: System.Boolean

Inequality(RecvWebSocketMessageRequest, RecvWebSocketMessageRequest)

public static bool operator !=(RecvWebSocketMessageRequest a, RecvWebSocketMessageRequest b)
Parameter Type Description
a RecvWebSocketMessageRequest  
b RecvWebSocketMessageRequest  

Returns: System.Boolean

Extension Methods

Types.ReturnTask<T>(T, Func<T, Task>)
Types.ReturnTask<T>(T, Func<T, Task<String>>)
Types.ReturnTask<T>(T, Func<T, Task<Int32>>)
Types.ReturnTask<T, R>(T, Func<T, Task<R>>)

SendWebSocketMessageRequest

Syntax

public class SendWebSocketMessageRequest : IMarshallableStartAsync, IMarshallable

Fields

Name Type Description
Handle System.Int32  
Message System.String  

Properties

TaskCallback

public GenericTaskCallback TaskCallback { get; set; }

Property Value: GenericTaskCallback

TaskCallbackPayload

public IntPtr TaskCallbackPayload { get; set; }

Property Value: System.IntPtr

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(SendWebSocketMessageRequest, SendWebSocketMessageRequest)

public static bool operator ==(SendWebSocketMessageRequest a, SendWebSocketMessageRequest b)
Parameter Type Description
a SendWebSocketMessageRequest  
b SendWebSocketMessageRequest  

Returns: System.Boolean

Inequality(SendWebSocketMessageRequest, SendWebSocketMessageRequest)

public static bool operator !=(SendWebSocketMessageRequest a, SendWebSocketMessageRequest b)
Parameter Type Description
a SendWebSocketMessageRequest  
b SendWebSocketMessageRequest  

Returns: System.Boolean

Extension Methods

Types.ReturnTask<T>(T, Func<T, Task>)
Types.ReturnTask<T>(T, Func<T, Task<String>>)
Types.ReturnTask<T>(T, Func<T, Task<Int32>>)
Types.ReturnTask<T, R>(T, Func<T, Task<R>>)

SleepRequest

Syntax

public class SleepRequest : IMarshallableStartAsync, IMarshallable

Fields

Name Type Description
Milliseconds System.Int32  

Properties

TaskCallback

public GenericTaskCallback TaskCallback { get; set; }

Property Value: GenericTaskCallback

TaskCallbackPayload

public IntPtr TaskCallbackPayload { get; set; }

Property Value: System.IntPtr

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(SleepRequest, SleepRequest)

public static bool operator ==(SleepRequest a, SleepRequest b)
Parameter Type Description
a SleepRequest  
b SleepRequest  

Returns: System.Boolean

Inequality(SleepRequest, SleepRequest)

public static bool operator !=(SleepRequest a, SleepRequest b)
Parameter Type Description
a SleepRequest  
b SleepRequest  

Returns: System.Boolean

Extension Methods

Types.ReturnTask<T>(T, Func<T, Task>)
Types.ReturnTask<T>(T, Func<T, Task<String>>)
Types.ReturnTask<T>(T, Func<T, Task<Int32>>)
Types.ReturnTask<T, R>(T, Func<T, Task<R>>)

StreamInfo

Describes an active stream on Twitch.

Syntax

public class StreamInfo : IMarshallable

Fields

Name Type Description
GameId System.String ID of the game being played on the stream.
GameName System.String Name of the game being played.
Id System.String Stream ID.
IsMature System.Boolean Indicates if the broadcaster has specified their channel contains mature content that may be inappropriate for younger audiences.
Language System.String Stream language. A language value is either the ISO 639-1 two-letter code for a supported stream language or “other”.
StartedAt System.String UTC timestamp.
TagIds System.String[] Shows tag IDs that apply to the stream.
ThumbnailUrl System.String Thumbnail URL of the stream. All image URLs have variable width and height. You can replace {width} and {height} with any values to get that size image
Title System.String Stream title.
Type System.String Stream type: “live” or “” (in case of error).
UserId System.String ID of the user who is streaming.
UserLogin System.String Login of the user who is streaming.
UserName System.String Display name of the user who is streaming.
ViewerCount System.Int64 Number of viewers watching the stream at the time of the query.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(StreamInfo, StreamInfo)

public static bool operator ==(StreamInfo a, StreamInfo b)
Parameter Type Description
a StreamInfo  
b StreamInfo  

Returns: System.Boolean

Inequality(StreamInfo, StreamInfo)

public static bool operator !=(StreamInfo a, StreamInfo b)
Parameter Type Description
a StreamInfo  
b StreamInfo  

Returns: System.Boolean

StreamMarkerInfo

Describes a Stream Marker.

Syntax

public class StreamMarkerInfo : IMarshallable

Fields

Name Type Description
CreatedAt System.String RFC3339 timestamp of the marker.
Description System.String Description of the marker.
Id System.String Unique ID of the marker.
PositionSeconds System.Int64 Relative offset (in seconds) of the marker, from the beginning of the stream.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(StreamMarkerInfo, StreamMarkerInfo)

public static bool operator ==(StreamMarkerInfo a, StreamMarkerInfo b)
Parameter Type Description
a StreamMarkerInfo  
b StreamMarkerInfo  

Returns: System.Boolean

Inequality(StreamMarkerInfo, StreamMarkerInfo)

public static bool operator !=(StreamMarkerInfo a, StreamMarkerInfo b)
Parameter Type Description
a StreamMarkerInfo  
b StreamMarkerInfo  

Returns: System.Boolean

StreamQuery

Describes a query for streams. All fields are optional.

Syntax

public class StreamQuery : IMarshallable

Fields

Name Type Description
After System.String Cursor for forward pagination: tells the server where to start fetching the next set of results, in a multi-page response. The cursor value specified here is from the PaginationCursor response field of a prior query.
First System.Int32 Maximum number of objects to return. Maximum: 100. Default: 20.
GameIds System.String[] Returns streams broadcasting a specified game ID. You can specify up to 100 IDs.
Languages System.String[] Stream language. You can specify up to 100 languages. A language value must be either the ISO 639-1 two-letter code for a supported stream language or “other”.
UserIds System.String[] Returns streams broadcast by one or more specified user IDs. You can specify up to 100 IDs.
UserLogins System.String[] Returns streams broadcast by one or more specified user login names. You can specify up to 100 names.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(StreamQuery, StreamQuery)

public static bool operator ==(StreamQuery a, StreamQuery b)
Parameter Type Description
a StreamQuery  
b StreamQuery  

Returns: System.Boolean

Inequality(StreamQuery, StreamQuery)

public static bool operator !=(StreamQuery a, StreamQuery b)
Parameter Type Description
a StreamQuery  
b StreamQuery  

Returns: System.Boolean

StreamQueryResult

Syntax

public class StreamQueryResult : IMarshallable

Fields

Name Type Description
PaginationCursor string Pagination cursor to fetch the next page of results. May be empty if there are no further results.
Streams StreamInfo[] List of streams matching the query.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32
Overrides: System.Object.GetHashCode()

Operators

Equality(StreamQueryResult, StreamQueryResult)

public static bool operator ==(StreamQueryResult a, StreamQueryResult b)
Parameter Type Description
a StreamQueryResult  
b StreamQueryResult  

Returns: System.Boolean Inequality(StreamQueryResult, StreamQueryResult)

public static bool operator !=(StreamQueryResult a, StreamQueryResult b)
Parameter Type Description
a StreamQueryResult  
b StreamQueryResult  

Returns: System.Boolean

Types

Syntax

public static class Types

Methods

InvokeMarshallable(Action<IntPtr, IntPtr, Types.MarshallableTaskCallback, IntPtr>, IntPtr)

public static Task<R> InvokeMarshallable<R>(Action<IntPtr, IntPtr, Types.MarshallableTaskCallback, IntPtr> func, IntPtr self)

where R : IMarshallable
Parameter Type Description
func System.Action<System.IntPtr, System.IntPtr, Types.MarshallableTaskCallback, System.IntPtr>  
self System.IntPtr  

Returns: System.Threading.Tasks.Task

Parameter Type Description
R    

InvokeMarshallable<P, R>(Action<IntPtr, IntPtr, Types.MarshallableTaskCallback, IntPtr>, IntPtr, P)

public static async Task<R> InvokeMarshallable<P, R>(Action<IntPtr, IntPtr, Types.MarshallableTaskCallback, IntPtr> func, IntPtr self, P p)

where P : IMarshallable where R : IMarshallable
Parameter Type Description
func System.Action<System.IntPtr, System.IntPtr, Types.MarshallableTaskCallback, System.IntPtr>  
self System.IntPtr  
P p  

Returns: System.Threading.Tasks.Task | `P` | | | | `R` | | |

ReturnTask(T, Func<T, Task>)

public static void ReturnTask<T>(this T msa, Func<T, Task<int>> run)
where T : IMarshallableStartAsync
Parameter Type Description
T msa  
run System.Func<T, System.Threading.Tasks.Task>  

ReturnTask(T, Func<T, Task>)

public static void ReturnTask<T>(this T msa, Func<T, Task<string>> run)
where T : IMarshallableStartAsync
Parameter Type Description
T msa  
run System.Func<T, System.Threading.Tasks.Task>  

ReturnTask(T, Func<T, Task>)

public static void ReturnTask<T>(this T msa, Func<T, Task> run)
    where T : IMarshallableStartAsync
Parameter Type Description
T msa  
run System.Func<T, System.Threading.Tasks.Task>  

ReturnTask<T, R>(T, Func<T, Task>)

public static async void ReturnTask<T, R>(this T msa, Func<T, Task<R>> run)
    where T : IMarshallableStartAsync where R : IMarshallable
Parameter Type Description
T msa  
run System.Func<T, System.Threading.Tasks.Task>  

Unmarshal(IntPtr)

public static IMarshallable Unmarshal(IntPtr payload)

| Parameter | Type | Description | | — | — | — | | payload | System.IntPtr | | Returns: IMarshallable

Types.MarshallableTaskCallback

Syntax

public delegate void MarshallableTaskCallback(IntPtr ret, IntPtr completion);
Parameter Type Description
ret System.IntPtr  
completion System.IntPtr  

Types.PropMarshallingInfo

Syntax

public class PropMarshallingInfo

Properties

IsEnum

public bool IsEnum { get; set; }

IsPlain

public bool IsPlain { get; set; }

Offset

public int Offset { get; set; }

PropInfo

public FieldInfo PropInfo { get; set; }

Type

public Type Type { get; set; }

Methods

ToString()

public override string ToString()

Returns: System.String
Overrides: System.Object.ToString()

Types.StructHolder<T>

Syntax

public class StructHolder<T> : BaseDisposable, IDisposable where T : IMarshallable

Constructors

StructHolder(T)

public StructHolder(T value)
Parameter Type Description
value T  

Fields

MarshalInfo

public static readonly Types.TypeMarshallingInfo MarshalInfo

Properties

Data

public IntPtr Data { get; }

Methods

DisposeUnmanaged()

protected override void DisposeUnmanaged()

Overrides: BaseDisposable.DisposeUnmanaged()

Types.TypeMarshallingInfo

Syntax

public class TypeMarshallingInfo

Constructors

TypeMarshallingInfo(Type)

public TypeMarshallingInfo(Type type)
Parameter Type Description
type System.Type  

Properties

Properties

public Types.PropMarshallingInfo[] Properties { get; }

Size

public int Size { get; }

Methods

Deserialize(IntPtr, Type)

public object Deserialize(IntPtr ptr, Type type)
Parameter Type Description
ptr System.IntPtr  
type System.Type  

Returns: System.Object

Deserialize(IntPtr)

public T Deserialize<T>(IntPtr ptr)
Parameter Type Description
ptr System.IntPtr  

Returns: T

Free(IntPtr, Boolean)

public void Free(IntPtr ptr, bool isOwned = true)
Parameter Type Description
ptr System.IntPtr  
isOwned System.Boolean  

Serialize(IntPtr, Object)

public void Serialize(IntPtr data, object value)
Parameter Type Description
data System.IntPtr  
value System.Object  

Serialize(Object)

public IntPtr Serialize(object value)
Parameter Type Description
value System.Object  

Returns: System.IntPtr

UserInfo

Syntax

public class UserInfo : IMarshallable

Fields

Name Type Description
BroadcasterType string User’s broadcaster type: “partner”, “affiliate”, or “”.
ChannelId string User’s ID
CreatedAt string Date when the user was created.
Description string User’s channel description.
DisplayName string User’s display name.
Email string User’s verified email address. Only available if you have the user:read:email scope.
LoginName string User’s login name.
OfflineImageUrl string URL of the user’s offline image.
ProfileImageUrl string URL of the user’s profile image.
UserType string User’s type: “staff”, “admin”, “global_mod”, or “”.
ViewCount long Total number of views of the user’s channel.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32
Overrides: System.Object.GetHashCode()

Operators

Equality(UserInfo, UserInfo)

public static bool operator ==(UserInfo a, UserInfo b)
Parameter Type Description
a UserInfo  
b UserInfo  

Returns: System.Boolean Inequality(UserInfo, UserInfo)

public static bool operator !=(UserInfo a, UserInfo b)
Parameter Type Description
a UserInfo  
b UserInfo  

Returns: System.Boolean

UserSubscriptionCheckResult

Describes a user’s subscription to a specified channel.

Syntax

public class UserSubscriptionCheckResult : IMarshallable

Fields

Name Type Description
GifterLogin string Login of the gifter (if IsGift is true).
GifterName string Display name of the gifter (if IsGift is true).
IsGift bool Indicates if the subscription is a gift.
IsSubscribed bool Indicates if the user is subscribed at all. If this is false, all other fields are empty.
Tier string Subscription tier. 1000 is tier 1, 2000 is tier 2, and 3000 is tier 3.

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32
Overrides: System.Object.GetHashCode()

Operators

Equality(UserSubscriptionCheckResult, UserSubscriptionCheckResult)

public static bool operator ==(UserSubscriptionCheckResult a, UserSubscriptionCheckResult b)
Parameter Type Description
a UserSubscriptionCheckResult  
b UserSubscriptionCheckResult  

Returns: System.Boolean

Inequality(UserSubscriptionCheckResult, UserSubscriptionCheckResult)

public static bool operator !=(UserSubscriptionCheckResult a, UserSubscriptionCheckResult b)
Parameter Type Description
a UserSubscriptionCheckResult  
b UserSubscriptionCheckResult  

Returns: System.Boolean

WebRequestRequest

Syntax

public class WebRequestRequest : IMarshallableStartAsync, IMarshallable

Fields

Name Type Description
Authorization string  
ClientId string  
ContentType string  
Method HttpMethod  
RequestBody string  
Uri string  

Properties

TaskCallback

public GenericTaskCallback TaskCallback { get; set; }

TaskCallbackPayload

public IntPtr TaskCallbackPayload { get; set; }

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32
Overrides: System.Object.GetHashCode()

Operators

Equality(WebRequestRequest, WebRequestRequest)

public static bool operator ==(WebRequestRequest a, WebRequestRequest b)
Parameter Type Description
a WebRequestRequest  
b WebRequestRequest  

Returns: System.Boolean

Inequality(WebRequestRequest, WebRequestRequest)

public static bool operator !=(WebRequestRequest a, WebRequestRequest b)
Parameter Type Description
a WebRequestRequest  
b WebRequestRequest  

Returns: System.Boolean

Implements

IMarshallableStartAsync
IMarshallable

Extension Methods

Types.ReturnTask<T>(T, Func<T, Task>)
Types.ReturnTask<T>(T, Func<T, Task<String>>)
Types.ReturnTask<T>(T, Func<T, Task<Int32>>)
Types.ReturnTask<T, R>(T, Func<T, Task<R>>)

WebRequestResult

Syntax

public class WebRequestResult : IMarshallable

Fields

Name Type Description
HttpStatus int  
ResponseBody string  

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32

Overrides: System.Object.GetHashCode()

Operators

Equality(WebRequestResult, WebRequestResult)

public static bool operator ==(WebRequestResult a, WebRequestResult b)
Parameter Type Description
a WebRequestResult  
b WebRequestResult  

Returns: System.Boolean

Inequality(WebRequestResult, WebRequestResult)

public static bool operator !=(WebRequestResult a, WebRequestResult b)
Parameter Type Description
a WebRequestResult  
b WebRequestResult  

Returns: System.Boolean

WriteFileRequest

Syntax

public class WriteFileRequest : IMarshallableStartAsync, IMarshallable

Fields

Name Type Description
Data string  
Path string  

Properties

TaskCallback

public GenericTaskCallback TaskCallback { get; set; }

TaskCallbackPayload

public IntPtr TaskCallbackPayload { get; set; }

Methods

Equals(Object)

public override bool Equals(object obj)
Parameter Type Description
obj System.Object  

Returns: System.Boolean

Overrides: System.Object.Equals(System.Object)

GetHashCode()

public override int GetHashCode()

Returns: System.Int32
Overrides: System.Object.GetHashCode()

Operators

Equality(WriteFileRequest, WriteFileRequest)

public static bool operator ==(WriteFileRequest a, WriteFileRequest b)
Parameter Type Description
a WriteFileRequest  
b WriteFileRequest  

Returns: System.Boolean

Inequality(WriteFileRequest, WriteFileRequest)

public static bool operator !=(WriteFileRequest a, WriteFileRequest b)
Parameter Type Description
a WriteFileRequest  
b WriteFileRequest  

Returns: System.Boolean

Implements

IMarshallableStartAsync
IMarshallable

Extension Methods

Types.ReturnTask<T>(T, Func<T, Task>)
Types.ReturnTask<T>(T, Func<T, Task<String>>)
Types.ReturnTask<T>(T, Func<T, Task<Int32>>)
Types.ReturnTask<T, R>(T, Func<T, Task<R>>)