#nullable enable
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Pipes;
using System.Threading;
using System.Threading.Tasks;

using IGP.UnitySDK.Models;
using Newtonsoft.Json;

namespace IGP.UnitySDK
{
    public sealed partial class IGPDesktopSessionClient
    {

        public async Task<IGPDesktopSessionCommandResult> LyingBottleForwardAsync(
            string contentJson,
            CancellationToken cancellationToken = default)
        {
            return await SendCommandAsync(
                IGPDesktopSessionCommandType.LyingBottleForward,
                cancellationToken,
                contentJson: contentJson,
                throwOnFailure: false);
        }

        public async Task<IGPDesktopSessionCommandResult> CloudArchiveForwardAsync(
            string contentJson,
            CancellationToken cancellationToken = default)
        {
            return await SendCommandAsync(
                IGPDesktopSessionCommandType.CloudArchiveForward,
                cancellationToken,
                contentJson: contentJson,
                throwOnFailure: false);
        }

        public async Task<IGPDesktopSessionCommandResult> LeaderboardForwardAsync(
            string contentJson,
            CancellationToken cancellationToken = default)
        {
            return await SendCommandAsync(
                IGPDesktopSessionCommandType.LeaderboardForward,
                cancellationToken,
                contentJson: contentJson,
                throwOnFailure: false);
        }

        public async Task<IGPDesktopSessionCommandResult> RequestDesktopShareAsync(
            string contentJson,
            byte[]? contentBytes = null,
            CancellationToken cancellationToken = default)
        {
            return await SendCommandAsync(
                IGPDesktopSessionCommandType.RequestDesktopShare,
                cancellationToken,
                contentJson: contentJson,
                contentBytes: contentBytes,
                throwOnFailure: false);
        }

        public async Task<IGPDesktopSessionCommandResult> ShareForwardAsync(
            string contentJson,
            byte[]? contentBytes = null,
            CancellationToken cancellationToken = default)
        {
            return await RequestDesktopShareAsync(
                contentJson,
                contentBytes,
                cancellationToken);
        }
    }
}
