# Interface IChannelService | EchoHub Documentation

# Interface IChannelService

Namespace
  EchoHub.Core.Contracts

Assembly
  EchoHub.Core.dll

    public interface IChannelService

## Methods

### CreateChannelAsync(Guid, string, string?, bool, string?, string?, string?)

    Task<ChannelOperationResult> CreateChannelAsync(Guid creatorUserId, string name, string? topic, bool isPublic, string? password = null, string? encryptionSalt = null, string? wrappedRoomKey = null)

#### Parameters

`creatorUserId` Guid
`name` string
`topic` string
`isPublic` bool
`password` string
`encryptionSalt` string
`wrappedRoomKey` string

#### Returns

Task<ChannelOperationResult>

### DeleteChannelAsync(Guid, string)

    Task<ChannelOperationResult> DeleteChannelAsync(Guid callerUserId, string channelName)

#### Parameters

`callerUserId` Guid
`channelName` string

#### Returns

Task<ChannelOperationResult>

### EnsureChannelMembershipAsync(Guid, string, string?)

    Task<(bool Success, string? Error, bool PasswordRequired)> EnsureChannelMembershipAsync(Guid userId, string channelName, string? password = null)

#### Parameters

`userId` Guid
`channelName` string
`password` string

#### Returns

Task<(bool Success, string Error, bool PasswordRequired)>

### EnsureSystemChannelAsync(string, string?)

    Task<ChannelDto> EnsureSystemChannelAsync(string channelName, string? topic = null)

#### Parameters

`channelName` string
`topic` string

#### Returns

Task<ChannelDto>

### GetChannelByNameAsync(string)

    Task<ChannelDto?> GetChannelByNameAsync(string channelName)

#### Parameters

`channelName` string

#### Returns

Task<ChannelDto>

### GetChannelCryptoAsync(string)

    Task<ChannelCryptoDto?> GetChannelCryptoAsync(string channelName)

#### Parameters

`channelName` string

#### Returns

Task<ChannelCryptoDto>

### GetChannelKeyEnvelopeAsync(string)

    Task<(string? EncryptionSalt, string? WrappedRoomKey)> GetChannelKeyEnvelopeAsync(string channelName)

#### Parameters

`channelName` string

#### Returns

Task<(string EncryptionSalt, string WrappedRoomKey)>

### GetChannelListAsync()

    Task<List<ChannelListItem>> GetChannelListAsync()

#### Returns

Task<List<ChannelListItem>>

### GetChannelMetaAsync(string)

    Task<ChannelMetaDto?> GetChannelMetaAsync(string channelName)

#### Parameters

`channelName` string

#### Returns

Task<ChannelMetaDto>

### GetChannelTopicAsync(string)

    Task<(string? Topic, bool Exists)> GetChannelTopicAsync(string channelName)

#### Parameters

`channelName` string

#### Returns

Task<(string Topic, bool Exists)>

### GetChannelsAsync(Guid, int, int)

    Task<PaginatedResponse<ChannelDto>> GetChannelsAsync(Guid userId, int offset, int limit)

#### Parameters

`userId` Guid
`offset` int
`limit` int

#### Returns

Task<PaginatedResponse<ChannelDto>>

### RekeyChannelAsync(Guid, string, string, string, string, string)

    Task<ChannelOperationResult> RekeyChannelAsync(Guid callerUserId, string channelName, string oldPassword, string newPassword, string newEncryptionSalt, string newWrappedRoomKey)

#### Parameters

`callerUserId` Guid
`channelName` string
`oldPassword` string
`newPassword` string
`newEncryptionSalt` string
`newWrappedRoomKey` string

#### Returns

Task<ChannelOperationResult>

### SetChannelPasswordAsync(Guid, string, string?)

    Task<ChannelOperationResult> SetChannelPasswordAsync(Guid callerUserId, string channelName, string? password)

#### Parameters

`callerUserId` Guid
`channelName` string
`password` string

#### Returns

Task<ChannelOperationResult>

### UpdateTopicAsync(Guid, string, string?)

    Task<ChannelOperationResult> UpdateTopicAsync(Guid callerUserId, string channelName, string? topic)

#### Parameters

`callerUserId` Guid
`channelName` string
`topic` string

#### Returns

Task<ChannelOperationResult>