public Task <EditChannelResponse> EditChannel(string channelId, string name = null, string topic = null) { if (channelId == null) { throw new ArgumentNullException(nameof(channelId)); } var request = new EditChannelRequest { Name = name, Topic = topic }; return(_rest.Patch <EditChannelResponse>(Endpoints.Channel(channelId), request)); }
public EditChannelRequestHandler( Request request, ClientConnection clientConnection, INodeNoticeService nodeNoticeService, IConversationsNoticeService conversationsNoticeService, ILoadChannelsService loadChannelsService, IUpdateChannelsService updateChannelsService, ISystemMessagesService systemMessagesService) { this.request = (EditChannelRequest)request; this.clientConnection = clientConnection; this.nodeNoticeService = nodeNoticeService; this.conversationsNoticeService = conversationsNoticeService; this.loadChannelsService = loadChannelsService; this.updateChannelsService = updateChannelsService; this.systemMessagesService = systemMessagesService; }
public async Task <ActionResult <ChannelResponse> > Edit([FromBody] EditChannelRequest request) { var channel = await _channelManager.CreateOrUpdateAsync(request.ToDomain(), Cancel); return(Ok(new ChannelResponse(channel))); }