package emailcli import ( "context" "fmt" ) func (c *Client) CreateChannel(ctx context.Context, req CreateChannelReq) (*Channel, error) { return post[*Channel](c, ctx, "/api/v1/channels", req) } func (c *Client) ListChannels(ctx context.Context, q ChannelListQuery) (*PaginationResult[Channel], error) { params := mergeParams(paginationParams(q.PaginationQuery), map[string]interface{}{ "status": q.Status, "keyword": q.Keyword, }) return get[*PaginationResult[Channel]](c, ctx, "/api/v1/channels", buildQuery(params)) } func (c *Client) UpdateChannel(ctx context.Context, id uint, req UpdateChannelReq) (*Channel, error) { return put[*Channel](c, ctx, fmt.Sprintf("/api/v1/channels/%d", id), req) } func (c *Client) DeleteChannel(ctx context.Context, id uint) error { _, err := del[any](c, ctx, fmt.Sprintf("/api/v1/channels/%d", id)) return err }