public static async Task InviteMultipleMembersAsync(SignalRClient signalRClient, Guid channelId, Guid memberId)
        {
            // Invite member test
            var inviteMultipleMembersRequest = new InviteMultipleMembersRequest
            {
                ChannelId         = channelId,
                InvitedMembersIds = new List <Guid> {
                    memberId
                },
                RequestId = Guid.NewGuid().ToString()
            };

            Console.WriteLine("Inviting members.");
            await signalRClient.InviteMultipleMembersAsync(inviteMultipleMembersRequest);

            Console.WriteLine("Members were invited.");
            Console.WriteLine();
        }
        public static async Task UpdateMessageAsync(SignalRClient signalRClient, Guid messageId)
        {
            // Update the message called test
            var updateMessageRequest = new UpdateMessageRequest
            {
                MessageId   = messageId,
                Body        = Guid.NewGuid() + "test",
                HtmlContent = Guid.NewGuid() + "test",
                HtmlEncoded = false,
                RequestId   = Guid.NewGuid().ToString()
            };

            Console.WriteLine("Updating the message");
            await signalRClient.UpdateMessageAsync(updateMessageRequest);

            Console.WriteLine("Message was updated.");
            Console.WriteLine();
        }
        public static async Task <ChannelSummaryResponse> CreateDirectChannelAsync(SignalRClient client, Guid memberId)
        {
            string groupName = Guid.NewGuid() + "test";

            // Create a direct channel called test
            var createDirectChannelRequest = new CreateDirectChannelRequest
            {
                MemberId  = memberId,
                RequestId = Guid.NewGuid().ToString(),
            };

            Console.WriteLine("Creating a direct channel.");
            var createdChannel = await client.CreateDirectChannelAsync(createDirectChannelRequest);

            Console.WriteLine("Direct channel was created.");
            Console.WriteLine();

            return(createdChannel);
        }
        public static async Task <MessageResponse> AddMessageAsync(SignalRClient signalRClient, Guid channelId)
        {
            // Create the message called test
            var createMessageRequest = new AddMessageRequest
            {
                ChannelId = channelId,
                Body      = "test",
                Type      = MessageType.Default,
                RequestId = Guid.NewGuid().ToString()
            };

            Console.WriteLine("Creating the message");
            var createdMessage = await signalRClient.AddMessageAsync(createMessageRequest);

            Console.WriteLine("Message was created.");
            Console.WriteLine();

            return(createdMessage);
        }
        public static async Task <ChannelSummaryResponse> UpdateChannelAsync(SignalRClient signalRClient, Guid channelId)
        {
            // Update the channel called test
            var updateChannelRequest = new UpdateChannelRequest
            {
                ChannelId      = channelId,
                Name           = Guid.NewGuid() + "test",
                Topic          = "test",
                WelcomeMessage = "test",
                Type           = ChannelType.Public,
                AllowedMembers = new List <Guid>(),
                RequestId      = Guid.NewGuid().ToString(),
                PhotoUrl       = "https://softeqnonamemessaging.blob.core.windows.net/temp/1000_abf08299411.jpg"
            };

            Console.WriteLine("Updating the channel.");
            var updatedChannel = await signalRClient.UpdateChannelAsync(updateChannelRequest);

            Console.WriteLine("Channel was updated.");
            Console.WriteLine();

            return(updatedChannel);
        }
        public static async Task <ChannelSummaryResponse> CreateChannelAsync(SignalRClient client)
        {
            string groupName = Guid.NewGuid() + "test";

            // Create the channel called test
            var createChannelRequest = new CreateChannelRequest
            {
                Closed         = false,
                Name           = groupName,
                Topic          = "test",
                WelcomeMessage = "test",
                Type           = ChannelType.Public,
                RequestId      = Guid.NewGuid().ToString(),
                PhotoUrl       = "https://softeqnonamemessaging.blob.core.windows.net/temp/1000_abf08299411.jpg"
            };

            Console.WriteLine("Creating the channel.");
            var createdChannel = await client.CreateChannelAsync(createChannelRequest);

            Console.WriteLine("Channel was created.");
            Console.WriteLine();

            return(createdChannel);
        }
 public static async Task <ClientResponse> GetClientAsync(SignalRClient signalRClient)
 {
     Console.WriteLine("Getting the client");
     return(await signalRClient.GetClientAsync());
 }