| 2112 | } |
| 2113 | |
| 2114 | func (c *unixSocketClient) NetworkDirect( |
| 2115 | ctx context.Context, |
| 2116 | workspaceRef string, |
| 2117 | channel string, |
| 2118 | directID string, |
| 2119 | ) (NetworkDirectRoomRecord, error) { |
| 2120 | path, err := networkDirectPath(workspaceRef, channel, directID) |
| 2121 | if err != nil { |
| 2122 | return NetworkDirectRoomRecord{}, err |
| 2123 | } |
| 2124 | var response struct { |
| 2125 | Direct NetworkDirectRoomRecord `json:"direct"` |
| 2126 | } |
| 2127 | if err := c.doJSON(ctx, http.MethodGet, path, nil, nil, &response); err != nil { |
| 2128 | return NetworkDirectRoomRecord{}, err |
| 2129 | } |
| 2130 | return response.Direct, nil |
| 2131 | } |
| 2132 | |
| 2133 | func (c *unixSocketClient) NetworkDirectMessages( |
| 2134 | ctx context.Context, |