OpenXbox / xcloud-python

21 stars 2 forks source link

Some enums, structs and class prototypes #7

Open tuxuser opened 3 years ago

tuxuser commented 3 years ago
using Windows.Foundation.Metadata;

namespace gamestreaming_sdk
{
  public enum ButtonState
  {
    Up,
    Down,
  }

  public enum ConsolePowerState
  {
    ConnectedStandby,
    On,
    Off,
    Unknown,
  }

  public enum ErrorCode
  {
    OperationPending = 0x8000000A,
    Bounds = 0x8000000B,
    IllegalMethodCall = 0x8000000E,
    ApplicationExiting = 0x8000001A,
    NotImplemented = 0x80004001,
    NoInterface = 0x80004002,
    InvalidPointer = 0x80004003,
    Aborted = 0x80004004,
    Failed = 0x80004005,
    Unexpected = 0x8000FFFF,
    IoFailure = 0x80028CA2,
    TransferTokenMicrosoftAccountProofUp = 0x8004884B,
    TransferTokenMicrosoftAccountUnfamiliarLocation = 0x800488FF,
    AccessDenied = 0x80070005,
    InvalidHandle = 0x80070006,
    OutOfMemory = 0x8007000E,
    BadLength = 0x80070018,
    Unsupported = 0x80070032,
    InvalidArgument = 0x80070057,
    InsufficientBuffer = 0x8007007A,
    Timeout = 0x80070102,
    ArithmeticOverflow = 0x80070216,
    FatalApplicationExit = 0x800702C9,
    ServiceSpecificError = 0x8007042A,
    NotFound = 0x80070490,
    NoNetwork = 0x800704C6,
    Cancelled = 0x800704C7,
    AbiVersionMismatch = 0x8007051A,
    NoSuchUser = 0x80070525,
    BadConfiguration = 0x8007064A,
    ResourceDataNotFound = 0x80070714,
    InvalidState = 0x8007139F,
    InternetNameNotResolved = 0x80072EE7,
    SSLException = 0x80072F17,
    UnknownString = 0x80073AB9,
    InvalidLocale = 0x80073AFF,
    GamePointOfPresenceViolated = 0x8015DBFF,
    SigninCountByDeviceTypeExceeded = 0x8015DC16,
    TitleSinglePointOfPresenceViolated = 0x8015DC1E,
    AuthUnauthorized = 0x80190191,
    Conflict = 0x80190199,
    Gone = 0x8019019A,
    NoEntitlement = 0x803F8001,
    GamePassExpired = 0x803F800E,
    OnlEActionRequired = 0x8086000C,
    BlockedByScreenTime = 0x80A20407,
    BlockedByParentalControls = 0x81C201C2,
    WebEUnexpectedContent = 0x83750005,
    InvalidJsonString = 0x83750007,
    JsonValueNotFound = 0x83750009,
    AuthInvalidOffering = 0x87DA0001,
    AuthBadToken = 0x87DA0002,
    TitleIdInUse = 0x87DA0003,
    InvalidServicesDomain = 0x87DA0004,
    UnsupportedMarketOrFlight = 0x87DA0005,
    SigninBlockedByPasswordPrompt = 0x87DA0006,
    ConsoleStreamingDisabled = 0x87DA0007,
    StreamingVersionNotRecognized = 0x87DA0008,
    StreamingVersionObsolete = 0x87DA0009,
    TitleOffline = 0x87DA000A,
    SessionResumedElsewhere = 0x87DA000B,
    AppOutsideCurfew = 0x87E10014,
    AppOutOfScreenTime = 0x87E10015,
    Unknown = 0x8FFFFFFF,
    Success = 0,
    NotReady = 0x00000015
  }

  public enum ExperimentalOrientation
  {
    Landscape,
    Portrait,
    OrientationCount,
  }

  public enum GamepadAnalogFlags
  {
    None = 0x0,
    LeftStick = 0x1,
    RightStick = 0x2,
    DirectionalPad = 0x4,
    LeftTrigger = 0x8,
    RightTrigger = 0x10,
    AllExceptDirectionalPad = 0xFB,
    All = 0xFF
  }

  public enum GamepadInput
  {
    DirectionalPadUp = 0x00,
    DirectionalPadDown = 0x01,
    DirectionalPadLeft = 0x02,
    DirectionalPadRight = 0x03,
    Start = 0x04,
    Back = 0x05,
    LeftStickButton = 0x06,
    RightStickButton = 0x07,
    LeftShoulder = 0x08,
    RightShoulder = 0x09,
    Guide = 0x0A,
    Misc = 0x0B,
    A = 0x0C,
    B = 0x0D,
    X = 0x0E,
    Y = 0x0F,
    LeftStickX = 0x11,
    LeftStickY = 0x12,
    RightStickX = 0x13,
    RightStickY = 0x14,
    DpadX = 0x15,
    DpadY = 0x16,
    LeftTrigger = 0x17,
    RightTrigger = 0x18,
  }

  public enum LogLevel
  {
    Error,
    Warning,
    Info,
    Verbose,
  }

  public enum NetworkTestProgress
  {
    Started,
    FinishedRtt,
    FinishedDownstream,
  }

  public enum StreamSessionDisconnectReason
  {
    NetworkError,
    ClientInitiatedCleanDisconnect,
    ClientInitiatedCleanShutdown,
    ServerInitiatedKickByNewSession,
    ServerInitiatedKickForClosedGame,
    ServerInitiatedKickForBeingIdle,
    ServerInitiatedKickForSignOut,
    ServerInitiatedKickForServerShutdown,
    ServerInitiatedKickForStopCommand,
    ServerInitiatedKickForAppError,
  }

  public enum StreamSessionQualityLevel
  {
    Excellent,
    Good,
    Ok,
    Poor,
    Unknown,
  }

  public enum StreamSessionRequestState
  {
    NotStarted,
    Queued,
    Launching,
    Ready,
    Cancelled,
    Failed,
  }

  public enum SystemUiType
  {
    ShowAchievements,
    ShowRecentPlayers,
    ShowGameInvite,
    ShowPlayerPicker,
    ShowProfileCard,
    ShowChangeFriendRelationship,
    ShowTitleAchievements,
    ShowCustomizeUserProfile,
    ShowSendInvites,
    ShowAccountPicker,
    ShowVirtualKeyboard,
    ShowComposeMessage,
    ShowAddRemoveFriend,
    ShowPeoplePicker,
    ShowSendGameInvites,
    ShowLaunchParty,
    ShowPartyAndSendPartyInvites,
    ShowCreateLookingForGroup,
    ShowUserLookingForGroups,
    ShowMessageDialog,
    ShowSystemError,
    ShowCheckGamingPrivilege,
    ShowSpeechToTextString,
    CheckPrivileges,
    SetNotificationPositionHint,
    SetSpeechToTextPositionHint,
    ShowMarketplace,
    ShowPurchase,
    ShowDetails,
    ShowRedeemCode,
    ShowSubscription,
    ShowApplication,
    ShowTimerExtension,
  }

  public enum TouchType
  {
    OutOfRange,
    Hovering,
    InContact,
  }

  public struct ActiveTitleInfo
  {
    public string Id;
  }

  public struct AudioConfigurationOptions
  {
    public uint SampleRateInHertz;
    public uint BufferSizeInFrames;
    public bool EnableMicrophone;
  }

  public struct BandwidthTestResult
  {
    public double JitterMs;
    public uint PacketsLost;
    public uint PacketsSent;
    public double BandwidthMbps;
  }

  public struct ConsoleInfo
  {
    public string Id;
    public string Name;
    public string Type;
    public ConsolePowerState PowerState;
    public bool FailedOutOfHomeRequirements;
    public bool WirelessConnection;
  }

  public struct GamepadAnalogState
  {
    public float LeftStickX;
    public float LeftStickY;
    public float RightStickX;
    public float RightStickY;
    public float DirectionalPadX;
    public float DirectionalPadY;
    public float LeftTrigger;
    public float RightTrigger;
    public GamepadAnalogFlags ValidInputs;
  }

  public struct NetworkTestResult
  {
    public RttTestResult Rtt;
    public BandwidthTestResult Downstream;
    public BandwidthTestResult Upstream;
  }

  public struct Offering
  {
    public string Id;
    public string Name;
    public string DnsName;
  }

  public struct RttTestResult
  {
    public double AverageMs;
    public double MinMs;
    public double MaxMs;
  }

  public struct TitleInfo
  {
    public string Id;
    public string Details;
  }

  public struct TitleWaitTime
  {
    public uint EstimatedProvisioningTimeInSeconds;
    public uint EstimatedAllocationTimeInSeconds;
    public uint EstimatedTotalWaitTimeInSeconds;
  }

  public struct TouchBundleMetadataDetails
  {
    public string Version;
    public string VersionName;
  }

  public struct TouchState
  {
    public TouchType Type;
    public uint PointerId;
    public float X;
    public float Y;
    public uint Pressure;
    public uint Orientation;
    public float Diameter;
  }

  public struct UserToken
  {
    public string Token;
    public string Data;
  }

  public struct VideoConfigurationOptions
  {
    public uint HeightInPixels;
    public uint WidthInPixels;
    public ulong MaxStreamCaptureSizeInBytes;
    public uint HeightInMillimeters;
    public uint WidthInMillimeters;
    public ExperimentalOrientation ExperimentalOrientation;
  }

  internal interface IAudioConfiguration
  {
    AudioConfigurationOptions Options { get; }
  }

  internal interface IAudioConfigurationFactory
  {
    AudioConfiguration CreateInstance(AudioConfigurationOptions options);
  }

  internal interface IConsoleEnumerationResult
  {
    IVectorView<ConsoleInfo> Consoles { get; }

    ConsoleEnumerationState CurrentState { get; }

    uint TotalItems { get; }
  }

  internal interface IConsoleEnumerationState
  {
  }

  internal interface IConsoleManager
  {
    IAsyncOperation<ConsoleEnumerationResult> EnumerateConsolesAsync(
      uint itemsToReturn,
      ConsoleEnumerationState state);
  }

  internal interface IInputConfiguration
  {
    InputConfigurationOptions Options { get; }
  }

  internal interface IInputConfigurationFactory
  {
    InputConfiguration CreateInstance(InputConfigurationOptions options);
  }

  internal interface IInputConfigurationOptions
  {
    bool EnableGamepadInput { get; set; }

    bool EnableMouseInput { get; set; }

    bool EnableKeyboardInput { get; set; }

    bool EnableTouchInput { get; set; }

    bool EnableSensorInput { get; set; }

    IVectorView<int> IgnoredKeys { get; set; }
  }

  internal interface IInputConfigurationOptionsFactory
  {
    InputConfigurationOptions CreateInstance(
      bool enableGamepadInput,
      bool enableMouseInput,
      bool enableKeyboardInput,
      bool enableTouchInput,
      bool enableSensorInput,
      IVectorView<int> ignoredKeys);
  }

  public interface ILogHandler
  {
    void LogMessage(LogLevel level, ulong processId, ulong threadId, string message);
  }

  internal interface INetworkTestProgressEventArgs
  {
    NetworkTestProgress GetProgress { get; }
  }

  internal interface INetworkTestRunner
  {
    IAsyncOperation<NetworkTestResult> RunTestAsync(
      bool userInitiated);

    event TypedEventHandler<NetworkTestRunner, NetworkTestProgressEventArgs> TestProgressUpdated;
  }

  internal interface IPatchTouchControlStateEventArgs
  {
    string Patch { get; }
  }

  internal interface IShowTouchControlLayoutEventArgs
  {
    string Layout { get; }

    string Patch { get; }
  }

  internal interface IStreamClient
  {
    string GetStreamProtocolVersion();

    IAsyncOperation<User> LoginAsync(UserToken token, Offering offering);

    IAsyncOperation<IVectorView<Offering>> GetOfferingsForUser(
      UserToken token);

    TitleManager GetTitleManagerForUser(User user);

    [DefaultOverload]
    [Overload("CreateSessionRequestAsync")]
    IAsyncOperation<StreamSessionRequest> CreateSessionRequestAsync(
      User user,
      StreamSessionConfiguration configuration,
      TitleInfo titleInfo);

    ConsoleManager GetConsoleManagerForUser(User user);

    [Overload("CreateSessionRequestAsync2")]
    IAsyncOperation<StreamSessionRequest> CreateSessionRequestAsync(
      User user,
      StreamSessionConfiguration configuration,
      ConsoleInfo consoleInfo);

    StreamSession DirectConnect(
      StreamSessionConfiguration configuration,
      ISystemUiHandler systemUiHandler);

    IAsyncOperation<string> FetchTouchAdaptationBundleForUserAsync(
      User user,
      string takxId,
      string destination);

    string GetCorrelationVector();

    bool IsGamepadSupported(int vendorId, int productId);

    NetworkTestRunner CreateNetworkTestRunner(User user);

    void SetLocale(string locale);

    void TraceEvent(string eventName, IMapView<string, string> properties);
  }

  internal interface IStreamClientConfiguration
  {
    string ApplicationDataDirectory { get; set; }

    string Locale { get; set; }

    ILogHandler LogHandler { get; set; }

    HttpEnvironment HttpEnvironment { get; set; }
  }

  internal interface IStreamClientFactory
  {
    StreamClient CreateInstance(StreamClientConfiguration configuration);
  }

  internal interface IStreamClientStatics
  {
    void Log(LogLevel level, string message);
  }

  internal interface IStreamingRegion
  {
    string FriendlyName { get; }

    string ToString();

    IVectorView<string> SystemUpdateGroups { get; }
  }

  internal interface IStreamSession
  {
    IAsyncAction ConnectAsync(ulong renderTarget);

    IAsyncAction ConnectWithSwapChainPanelAsync(SwapChainPanel renderTarget);

    IAsyncOperation<bool> PauseAsync();

    IAsyncOperation<bool> ResumeAsync();

    IAsyncAction DisconnectAsync();

    IAsyncAction ShutdownAsync();

    event TypedEventHandler<StreamSession, StreamSessionDisconnectedEventArgs> Disconnected;

    event TypedEventHandler<StreamSession, StreamSessionQualityChangedEventArgs> QualityChanged;

    event TypedEventHandler<StreamSession, StreamSessionStatisticsChangedEventArgs> StatisticsChanged;

    event TypedEventHandler<StreamSession, StreamSessionIdleWarningEventArgs> IdleWarning;

    event TypedEventHandler<StreamSession, StreamSessionDisconnectWarningEventArgs> DisconnectWarning;

    event TypedEventHandler<StreamSession, StreamSessionGamepadDisconnectedEventArgs> GamepadDisconnected;

    event TypedEventHandler<StreamSession, StreamSessionTitleChangedEventArgs> TitleChanged;

    VirtualInputManager GetVirtualInputManager();

    IAsyncAction UpdateVideoConfigurationAsync(VideoConfiguration videoConfiguration);

    IAsyncAction UpdateAudioConfigurationAsync(AudioConfiguration audioConfiguration);

    IAsyncAction UpdateInputConfigurationAsync(InputConfiguration inputConfiguration);

    IAsyncAction UpdateTouchBundleMetadataAsync(TouchBundleMetadata metadata);

    IAsyncAction FlushLogFilesAsync();

    IAsyncAction FileABugAsync(string alias, string description);

    void ToggleDisplayPerformanceOverlay();

    string GetCorrelationVector();

    IAsyncAction AcceptGameInviteAsync(string titleId, string json);

    IAsyncAction ConnectWithMediaPlayerElementAsync(
      UIElement renderTarget,
      UIElement inputPanel);
  }

  internal interface IStreamSessionConfiguration
  {
    string DirectIpAddress { get; set; }

    string AccessKey { get; set; }

    string SystemUpdateGroup { get; set; }

    bool EnableNarrator { get; set; }

    long TimezoneOffsetMinutes { get; set; }

    bool IceLocalOnly { get; set; }
  }

  internal interface IStreamSessionConfigurationFactory
  {
    StreamSessionConfiguration CreateInstance(
      AudioConfiguration audioConfiguration,
      VideoConfiguration videoConfiguration,
      InputConfiguration inputConfiguration);
  }

  internal interface IStreamSessionDisconnectedEventArgs
  {
    StreamSessionDisconnectReason Reason { get; }

    HResult ErrorInfo { get; }

    bool IsRecoverable { get; }
  }

  internal interface IStreamSessionDisconnectWarningEventArgs
  {
    uint SecondsUntilDisconnect { get; }
  }

  internal interface IStreamSessionGamepadDisconnectedEventArgs
  {
  }

  internal interface IStreamSessionIdleWarningEventArgs
  {
    uint SecondsUntilDisconnect { get; }
  }

  internal interface IStreamSessionQualityChangedEventArgs
  {
    StreamSessionQualityLevel QualityLevel { get; }
  }

  internal interface IStreamSessionRequest
  {
    IAsyncOperation<StreamSession> CreateSessionAsync(
      string transferToken,
      ISystemUiHandler systemUiHandler);

    event TypedEventHandler<StreamSessionRequest, StreamSessionRequestStateChangedEventArgs> StateChanged;

    StreamSessionRequestState State { get; }

    TitleInfo TitleInfo { get; }
  }

  internal interface IStreamSessionRequestStateChangedEventArgs
  {
    StreamSessionRequestState State { get; }
  }

  internal interface IStreamSessionStatisticsChangedEventArgs
  {
    string GetStatisticsJson();
  }

  internal interface IStreamSessionTitleChangedEventArgs
  {
    string GetTitleId();
  }

  public interface ISystemUiHandler
  {
    void ShowUiAsync(
      SystemUiType requestType,
      string requestMessage,
      AsyncStringCompletion resultCompletion);

    IVectorView<SystemUiType> HandledSystemUiTypes { get; }

    void CancelUi(SystemUiType requestType);
  }

  internal interface ITitleEnumerationResult
  {
    IVectorView<TitleInfo> Titles { get; }

    TitleEnumerationState CurrentState { get; }

    uint TotalItems { get; }
  }

  internal interface ITitleEnumerationState
  {
    string GetToken();
  }

  internal interface ITitleEnumerationStateFactory
  {
    TitleEnumerationState CreateInstance(string token);
  }

  internal interface ITitleManager
  {
    IAsyncOperation<TitleEnumerationResult> EnumerateTitlesAsync(
      uint itemsToReturn,
      TitleEnumerationState state);

    IAsyncOperation<TitleEnumerationResult> EnumerateMruTitlesAsync(
      uint itemsToReturn,
      TitleEnumerationState state);

    IAsyncOperation<IVectorView<ActiveTitleInfo>> GetActiveTitlesForUserAsync(
      User user);

    IAsyncOperation<TitleWaitTime> GetTitleWaitTimeAsync(
      User user,
      string titleId);
  }

  internal interface ITouchBundleMetadata
  {
    TouchBundleMetadataDetails Details { get; }
  }

  internal interface ITouchBundleMetadataFactory
  {
    TouchBundleMetadata CreateInstance(TouchBundleMetadataDetails options);
  }

  internal interface IUser
  {
    uint Id { get; }

    event TypedEventHandler<User, UserTokenInvalidatedEventArgs> TokenInvalidated;

    IAsyncAction UpdateTokenAsync(UserToken newToken);

    IVectorView<StreamingRegion> StreamingRegions { get; }

    void SetStreamingRegion(StreamingRegion region);

    IAsyncOperation<string> GetSettingsAsync();

    string Market { get; }
  }

  internal interface IUserTokenInvalidatedEventArgs
  {
    HResult Reason { get; }
  }

  internal interface IVideoConfiguration
  {
    VideoConfigurationOptions Options { get; }
  }

  internal interface IVideoConfigurationFactory
  {
    VideoConfiguration CreateInstance(VideoConfigurationOptions options);
  }

  internal interface IVirtualGamepad
  {
    void SendButtonState(ButtonState state, GamepadInput input);

    void SendAnalogState(GamepadAnalogState state);

    event TouchControlCallback PhysicalGamepadInput;

    event TouchControlCallback HideTouchControls;

    event TouchControlCallback ShowTouchControls;

    event TouchControlCallback ShowTitleDefaultTouchControlLayout;

    event PatchTouchControlStateCallback PatchTouchControlState;

    event ShowTouchControlLayoutCallback ShowTouchControlLayout;
  }

  internal interface IVirtualInputManager
  {
    VirtualGamepad GetGamepad();

    VirtualTouchSurface GetTouchSurface();

    VirtualKeyboard GetKeyboard();

    VirtualMouse GetMouse();
  }

  internal interface IVirtualKeyboard
  {
  }

  internal interface IVirtualMouse
  {
    void SendRelativeMouseEvent(int deltaX, int deltaY);
  }

  internal interface IVirtualTouchSurface
  {
    void SendTouchSurfaceState(IVector<TouchState> states);

    void SendIsEnabled(bool isEnabled);
  }

  public sealed class AudioConfiguration : IAudioConfiguration
  {
    public extern AudioConfiguration(AudioConfigurationOptions options);

    public extern AudioConfigurationOptions Options { get; }
  }

  public sealed class ConsoleEnumerationResult : IConsoleEnumerationResult
  {
    public extern IVectorView<ConsoleInfo> Consoles { [MethodImpl] get; }

    public extern ConsoleEnumerationState CurrentState { [MethodImpl] get; }

    public extern uint TotalItems { [MethodImpl] get; }
  }

  public sealed class ConsoleEnumerationState : IConsoleEnumerationState
  {
    [MethodImpl]
    public extern ConsoleEnumerationState();
  }

  public sealed class ConsoleManager : IConsoleManager
  {
    [MethodImpl]
    public extern IAsyncOperation<ConsoleEnumerationResult> EnumerateConsolesAsync(
      uint itemsToReturn,
      ConsoleEnumerationState state);
  }

  public sealed class InputConfiguration : IInputConfiguration
  {
    [MethodImpl]
    public extern InputConfiguration(InputConfigurationOptions options);

    public extern InputConfigurationOptions Options { [MethodImpl] get; }
  }

  public sealed class InputConfigurationOptions : IInputConfigurationOptions
  {
    [MethodImpl]
    public extern InputConfigurationOptions(
      bool enableGamepadInput,
      bool enableMouseInput,
      bool enableKeyboardInput,
      bool enableTouchInput,
      bool enableSensorInput,
      IVectorView<int> ignoredKeys);

    public extern bool EnableGamepadInput { [MethodImpl] get; [MethodImpl] set; }

    public extern bool EnableMouseInput { [MethodImpl] get; [MethodImpl] set; }

    public extern bool EnableKeyboardInput { [MethodImpl] get; [MethodImpl] set; }

    public extern bool EnableTouchInput { [MethodImpl] get; [MethodImpl] set; }

    public extern bool EnableSensorInput { [MethodImpl] get; [MethodImpl] set; }

    public extern IVectorView<int> IgnoredKeys { [MethodImpl] get; [MethodImpl] set; }
  }

  public sealed class NetworkTestProgressEventArgs : INetworkTestProgressEventArgs
  {
    public extern NetworkTestProgress GetProgress { [MethodImpl] get; }
  }

  public sealed class NetworkTestRunner : INetworkTestRunner
  {
    [MethodImpl]
    public extern IAsyncOperation<NetworkTestResult> RunTestAsync(
      bool userInitiated);

    public extern event TypedEventHandler<NetworkTestRunner, NetworkTestProgressEventArgs> TestProgressUpdated;
  }

  public sealed class StreamClient : IStreamClient
  {
    [MethodImpl]
    public extern StreamClient(StreamClientConfiguration configuration);

    [MethodImpl]
    public extern string GetStreamProtocolVersion();

    [MethodImpl]
    public extern IAsyncOperation<User> LoginAsync(
      UserToken token,
      Offering offering);

    [MethodImpl]
    public extern IAsyncOperation<IVectorView<Offering>> GetOfferingsForUser(
      UserToken token);

    [MethodImpl]
    public extern TitleManager GetTitleManagerForUser(User user);

    [Overload("CreateSessionRequestAsync")]
    [DefaultOverload]
    [MethodImpl]
    public extern IAsyncOperation<StreamSessionRequest> CreateSessionRequestAsync(
      User user,
      StreamSessionConfiguration configuration,
      TitleInfo titleInfo);

    [MethodImpl]
    public extern ConsoleManager GetConsoleManagerForUser(User user);

    [Overload("CreateSessionRequestAsync2")]
    [MethodImpl]
    public extern IAsyncOperation<StreamSessionRequest> CreateSessionRequestAsync(
      User user,
      StreamSessionConfiguration configuration,
      ConsoleInfo consoleInfo);

    [MethodImpl]
    public extern StreamSession DirectConnect(
      StreamSessionConfiguration configuration,
      ISystemUiHandler systemUiHandler);

    [MethodImpl]
    public extern IAsyncOperation<string> FetchTouchAdaptationBundleForUserAsync(
      User user,
      string takxId,
      string destination);

    [MethodImpl]
    public extern string GetCorrelationVector();

    [MethodImpl]
    public extern bool IsGamepadSupported(int vendorId, int productId);

    [MethodImpl]
    public extern NetworkTestRunner CreateNetworkTestRunner(User user);

    [MethodImpl]
    public extern void SetLocale(string locale);

    [MethodImpl]
    public extern void TraceEvent(string eventName, IMapView<string, string> properties);

    [MethodImpl]
    public static extern void Log(LogLevel level, string message);
  }

  public sealed class StreamClientConfiguration : IStreamClientConfiguration
  {
    [MethodImpl]
    public extern StreamClientConfiguration();

    public extern string ApplicationDataDirectory { [MethodImpl] get; [MethodImpl] set; }

    public extern string Locale { [MethodImpl] get; [MethodImpl] set; }

    public extern ILogHandler LogHandler { [MethodImpl] get; [MethodImpl] set; }

    public extern HttpEnvironment HttpEnvironment { [MethodImpl] get; [MethodImpl] set; }
  }

  public sealed class StreamingRegion : IStreamingRegion
  {
    public extern string FriendlyName { [MethodImpl] get; }

    [MethodImpl]
    public new extern string ToString();

    public extern IVectorView<string> SystemUpdateGroups { [MethodImpl] get; }
  }

  public sealed class StreamSession : IStreamSession
  {
    [MethodImpl]
    public extern IAsyncAction ConnectAsync(ulong renderTarget);

    [MethodImpl]
    public extern IAsyncAction ConnectWithSwapChainPanelAsync(
      SwapChainPanel renderTarget);

    [MethodImpl]
    public extern IAsyncOperation<bool> PauseAsync();

    [MethodImpl]
    public extern IAsyncOperation<bool> ResumeAsync();

    [MethodImpl]
    public extern IAsyncAction DisconnectAsync();

    [MethodImpl]
    public extern IAsyncAction ShutdownAsync();

    public extern event TypedEventHandler<StreamSession, StreamSessionDisconnectedEventArgs> Disconnected;

    public extern event TypedEventHandler<StreamSession, StreamSessionQualityChangedEventArgs> QualityChanged;

    public extern event TypedEventHandler<StreamSession, StreamSessionStatisticsChangedEventArgs> StatisticsChanged;

    public extern event TypedEventHandler<StreamSession, StreamSessionIdleWarningEventArgs> IdleWarning;

    public extern event TypedEventHandler<StreamSession, StreamSessionDisconnectWarningEventArgs> DisconnectWarning;

    public extern event TypedEventHandler<StreamSession, StreamSessionGamepadDisconnectedEventArgs> GamepadDisconnected;

    public extern event TypedEventHandler<StreamSession, StreamSessionTitleChangedEventArgs> TitleChanged;

    [MethodImpl]
    public extern VirtualInputManager GetVirtualInputManager();

    [MethodImpl]
    public extern IAsyncAction UpdateVideoConfigurationAsync(
      VideoConfiguration videoConfiguration);

    [MethodImpl]
    public extern IAsyncAction UpdateAudioConfigurationAsync(
      AudioConfiguration audioConfiguration);

    [MethodImpl]
    public extern IAsyncAction UpdateInputConfigurationAsync(
      InputConfiguration inputConfiguration);

    [MethodImpl]
    public extern IAsyncAction UpdateTouchBundleMetadataAsync(
      TouchBundleMetadata metadata);

    [MethodImpl]
    public extern IAsyncAction FlushLogFilesAsync();

    [MethodImpl]
    public extern IAsyncAction FileABugAsync(string alias, string description);

    [MethodImpl]
    public extern void ToggleDisplayPerformanceOverlay();

    [MethodImpl]
    public extern string GetCorrelationVector();

    [MethodImpl]
    public extern IAsyncAction AcceptGameInviteAsync(string titleId, string json);

    [MethodImpl]
    public extern IAsyncAction ConnectWithMediaPlayerElementAsync(
      UIElement renderTarget,
      UIElement inputPanel);
  }

  public sealed class StreamSessionConfiguration : IStreamSessionConfiguration
  {
    [MethodImpl]
    public extern StreamSessionConfiguration(
      AudioConfiguration audioConfiguration,
      VideoConfiguration videoConfiguration,
      InputConfiguration inputConfiguration);

    public extern string DirectIpAddress { [MethodImpl] get; [MethodImpl] set; }

    public extern string AccessKey { [MethodImpl] get; [MethodImpl] set; }

    public extern string SystemUpdateGroup { [MethodImpl] get; [MethodImpl] set; }

    public extern bool EnableNarrator { [MethodImpl] get; [MethodImpl] set; }

    public extern long TimezoneOffsetMinutes { [MethodImpl] get; [MethodImpl] set; }

    public extern bool IceLocalOnly { [MethodImpl] get; [MethodImpl] set; }
  }

  public sealed class StreamSessionDisconnectedEventArgs : IStreamSessionDisconnectedEventArgs
  {
    public extern StreamSessionDisconnectReason Reason { [MethodImpl] get; }

    public extern HResult ErrorInfo { [MethodImpl] get; }

    public extern bool IsRecoverable { [MethodImpl] get; }
  }

  public sealed class StreamSessionDisconnectWarningEventArgs : IStreamSessionDisconnectWarningEventArgs
  {
    public extern uint SecondsUntilDisconnect { [MethodImpl] get; }
  }

  public sealed class StreamSessionGamepadDisconnectedEventArgs : IStreamSessionGamepadDisconnectedEventArgs
  {
  }

  public sealed class StreamSessionIdleWarningEventArgs : IStreamSessionIdleWarningEventArgs
  {
    public extern uint SecondsUntilDisconnect { [MethodImpl] get; }
  }

  public sealed class StreamSessionQualityChangedEventArgs : IStreamSessionQualityChangedEventArgs
  {
    public extern StreamSessionQualityLevel QualityLevel { [MethodImpl] get; }
  }

  public sealed class StreamSessionRequest : IStreamSessionRequest
  {
    [MethodImpl]
    public extern IAsyncOperation<StreamSession> CreateSessionAsync(
      string transferToken,
      ISystemUiHandler systemUiHandler);

    public extern event TypedEventHandler<StreamSessionRequest, StreamSessionRequestStateChangedEventArgs> StateChanged;

    public extern StreamSessionRequestState State { [MethodImpl] get; }

    public extern TitleInfo TitleInfo { [MethodImpl] get; }
  }

  public sealed class StreamSessionRequestStateChangedEventArgs : IStreamSessionRequestStateChangedEventArgs
  {
    public extern StreamSessionRequestState State { [MethodImpl] get; }
  }

  public sealed class StreamSessionStatisticsChangedEventArgs : IStreamSessionStatisticsChangedEventArgs
  {
    [MethodImpl]
    public extern string GetStatisticsJson();
  }

  public sealed class StreamSessionTitleChangedEventArgs : IStreamSessionTitleChangedEventArgs
  {
    [MethodImpl]
    public extern string GetTitleId();
  }

  public sealed class TitleEnumerationResult : ITitleEnumerationResult
  {
    public extern IVectorView<TitleInfo> Titles { [MethodImpl] get; }

    public extern TitleEnumerationState CurrentState { [MethodImpl] get; }

    public extern uint TotalItems { [MethodImpl] get; }
  }

  public sealed class TitleEnumerationState : ITitleEnumerationState
  {
    [MethodImpl]
    public extern TitleEnumerationState(string token);

    [MethodImpl]
    public extern TitleEnumerationState();

    [MethodImpl]
    public extern string GetToken();
  }

  public sealed class TitleManager : ITitleManager
  {
    [MethodImpl]
    public extern IAsyncOperation<TitleEnumerationResult> EnumerateTitlesAsync(
      uint itemsToReturn,
      TitleEnumerationState state);

    [MethodImpl]
    public extern IAsyncOperation<TitleEnumerationResult> EnumerateMruTitlesAsync(
      uint itemsToReturn,
      TitleEnumerationState state);

    [MethodImpl]
    public extern IAsyncOperation<IVectorView<ActiveTitleInfo>> GetActiveTitlesForUserAsync(
      User user);

    [MethodImpl]
    public extern IAsyncOperation<TitleWaitTime> GetTitleWaitTimeAsync(
      User user,
      string titleId);
  }

  public sealed class TouchBundleMetadata : ITouchBundleMetadata
  {
    [MethodImpl]
    public extern TouchBundleMetadata(TouchBundleMetadataDetails options);

    public extern TouchBundleMetadataDetails Details { [MethodImpl] get; }
  }

  public sealed class User : IUser
  {
    public extern uint Id { [MethodImpl] get; }

    public extern event TypedEventHandler<User, UserTokenInvalidatedEventArgs> TokenInvalidated;

    [MethodImpl]
    public extern IAsyncAction UpdateTokenAsync(UserToken newToken);

    public extern IVectorView<StreamingRegion> StreamingRegions { [MethodImpl] get; }

    [MethodImpl]
    public extern void SetStreamingRegion(StreamingRegion region);

    [MethodImpl]
    public extern IAsyncOperation<string> GetSettingsAsync();

    public extern string Market { [MethodImpl] get; }
  }

  public sealed class VideoConfiguration : IVideoConfiguration
  {
    [MethodImpl]
    public extern VideoConfiguration(VideoConfigurationOptions options);

    public extern VideoConfigurationOptions Options { [MethodImpl] get; }
  }

  public sealed class VirtualGamepad : IVirtualGamepad
  {
    [MethodImpl]
    public extern void SendButtonState(ButtonState state, GamepadInput input);

    [MethodImpl]
    public extern void SendAnalogState(GamepadAnalogState state);

    public extern event TouchControlCallback PhysicalGamepadInput;

    public extern event TouchControlCallback HideTouchControls;

    public extern event TouchControlCallback ShowTouchControls;

    public extern event TouchControlCallback ShowTitleDefaultTouchControlLayout;

    public extern event PatchTouchControlStateCallback PatchTouchControlState;

    public extern event ShowTouchControlLayoutCallback ShowTouchControlLayout;
  }

  public sealed class VirtualInputManager : IVirtualInputManager
  {
    [MethodImpl]
    public extern VirtualGamepad GetGamepad();

    [MethodImpl]
    public extern VirtualTouchSurface GetTouchSurface();

    [MethodImpl]
    public extern VirtualKeyboard GetKeyboard();

    [MethodImpl]
    public extern VirtualMouse GetMouse();
  }

  public sealed class VirtualKeyboard : IVirtualKeyboard
  {
  }

  public sealed class VirtualMouse : IVirtualMouse
  {
    [MethodImpl]
    public extern void SendRelativeMouseEvent(int deltaX, int deltaY);
  }

  public sealed class VirtualTouchSurface : IVirtualTouchSurface
  {
    [MethodImpl]
    public extern void SendTouchSurfaceState(IVector<TouchState> states);

    [MethodImpl]
    public extern void SendIsEnabled(bool isEnabled);
  }
}